diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 61dfe13..4a2fd99 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -97,11 +97,7 @@ runs: working-directory: ${{ inputs.pyshp_repo_directory }} env: REPLACE_REMOTE_URLS_WITH_LOCALHOST: ${{ inputs.replace_remote_urls_with_localhost }} - run: | - echo "Ensure the tests import the installed wheel" - mv shapefile.py __tmp.py - pytest -rA --tb=short ${{ inputs.extra_args }} - mv __tmp.py shapefile.py + run: pytest -rA --tb=short ${{ inputs.extra_args }} diff --git a/.github/workflows/run_checks_build_and_test.yml b/.github/workflows/run_checks_build_and_test.yml index 3e9cadb..bbafa08 100644 --- a/.github/workflows/run_checks_build_and_test.yml +++ b/.github/workflows/run_checks_build_and_test.yml @@ -25,6 +25,7 @@ jobs: run: | python -m pip install --upgrade pip pip install pytest pylint pylint-per-file-ignores + pip install -e . - name: run Pylint for errors and warnings only, on test_shapefile.py run: | pylint --disable=R,C test_shapefile.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 19d54f2..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include *.md *.txt *.TXT -recursive-include shapefiles *.dbf *.sbn *.sbx *.shp *.shx diff --git a/pyproject.toml b/pyproject.toml index 945c86c..af799f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["setuptools"] -build-backend = "setuptools.build_meta" +requires = ["hatchling"] +build-backend = "hatchling.build" [project] name = "pyshp" @@ -33,8 +33,15 @@ test = ["pytest"] [project.urls] Repository = "https://github.com/GeospatialPython/pyshp" -[tool.setuptools.dynamic] -version = {attr = "shapefile.__version__"} +[tool.hatch.build.targets.sdist] +only-include = ["src", "shapefiles", "test_shapefile.py"] + +[tool.hatch.build.targets.wheel] +only-include = ["src"] +sources = {"src" = ""} # move from "src" directory for wheel + +[tool.hatch.version] +path = "src/shapefile.py" [tool.ruff] # Exclude a variety of commonly ignored directories. diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 1a2d80c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,29 +0,0 @@ -[metadata] -name = pyshp -version = attr: shapefile.__version__ -description = Pure Python read/write support for ESRI Shapefile format -long_description = file: README.md -long_description_content_type = text/markdown -author = Joel Lawhead -author_email = jlawhead@geospatialpython.com -maintainer = Karim Bahgat -maintainer_email = karim.bahgat.norway@gmail.com -url = https://github.com/GeospatialPython/pyshp -download_url = https://pypi.org/project/pyshp/ -license = MIT -license_files = LICENSE.TXT -keywords = gis, geospatial, geographic, shapefile, shapefiles -classifiers = - Development Status :: 5 - Production/Stable - Programming Language :: Python - Programming Language :: Python :: 3.9 - Topic :: Scientific/Engineering :: GIS - Topic :: Software Development :: Libraries - Topic :: Software Development :: Libraries :: Python Modules - -[options] -py_modules = shapefile -python_requires = >=3.9 - -[bdist_wheel] -universal=1 diff --git a/shapefile.py b/src/shapefile.py similarity index 100% rename from shapefile.py rename to src/shapefile.py