Skip to content

Commit 7fca605

Browse files
mwtoewsJamesParrott
authored andcommitted
Change to hatchling build backend, and move to src layout
1 parent 5b08537 commit 7fca605

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

.github/actions/test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ runs:
8080
working-directory: ${{ inputs.pyshp_repo_directory }}
8181
env:
8282
REPLACE_REMOTE_URLS_WITH_LOCALHOST: ${{ inputs.replace_remote_urls_with_localhost }}
83-
run: python shapefile.py ${{ inputs.extra_args }}
83+
run: python src/shapefile.py ${{ inputs.extra_args }}
8484

8585
- name: Install test dependencies.
8686
shell: bash

.github/workflows/run_tests_hooks_and_tools.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
run: |
2727
python -m pip install --upgrade pip
2828
pip install pytest pylint pylint-per-file-ignores
29+
pip install -e .
2930
- name: run Pylint for errors and warnings only, on test_shapefile.py
3031
run: |
3132
pylint --disable=R,C test_shapefile.py

MANIFEST.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

pyproject.toml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
2-
requires = ["setuptools"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
44

55
[project]
66
name = "pyshp"
@@ -33,8 +33,15 @@ test = ["pytest"]
3333
[project.urls]
3434
Repository = "https://github.com/GeospatialPython/pyshp"
3535

36-
[tool.setuptools.dynamic]
37-
version = {attr = "shapefile.__version__"}
36+
[tool.hatch.build.targets.sdist]
37+
only-include = ["src", "shapefiles", "test_shapefile.py"]
38+
39+
[tool.hatch.build.targets.wheel]
40+
only-include = ["src"]
41+
sources = {"src" = ""} # move from "src" directory for wheel
42+
43+
[tool.hatch.version]
44+
path = "src/shapefile.py"
3845

3946
[tool.ruff]
4047
# Exclude a variety of commonly ignored directories.
File renamed without changes.

0 commit comments

Comments
 (0)