Skip to content

Commit d8e120d

Browse files
authored
Merge pull request #323 from mwtoews/hatchling-src-layout
Change to hatchling build backend, and move to src layout
2 parents 6e1a2a0 + f983462 commit d8e120d

File tree

6 files changed

+13
-40
lines changed

6 files changed

+13
-40
lines changed

.github/actions/test/action.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,7 @@ runs:
9797
working-directory: ${{ inputs.pyshp_repo_directory }}
9898
env:
9999
REPLACE_REMOTE_URLS_WITH_LOCALHOST: ${{ inputs.replace_remote_urls_with_localhost }}
100-
run: |
101-
echo "Ensure the tests import the installed wheel"
102-
mv shapefile.py __tmp.py
103-
pytest -rA --tb=short ${{ inputs.extra_args }}
104-
mv __tmp.py shapefile.py
100+
run: pytest -rA --tb=short ${{ inputs.extra_args }}
105101

106102

107103

.github/workflows/run_checks_build_and_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
run: |
2626
python -m pip install --upgrade pip
2727
pip install pytest pylint pylint-per-file-ignores
28+
pip install -e .
2829
- name: run Pylint for errors and warnings only, on test_shapefile.py
2930
run: |
3031
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.

setup.cfg

Lines changed: 0 additions & 29 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)