diff --git a/.github/workflows/basemap-data-hires.yml b/.github/workflows/basemap-data-hires.yml index a43562f10..f079cfbda 100644 --- a/.github/workflows/basemap-data-hires.yml +++ b/.github/workflows/basemap-data-hires.yml @@ -46,10 +46,11 @@ jobs: name: checkout path: . - - name: Build wheel + name: Build sdist and wheel run: | cd ${{ env.PKGDIR }} - python setup.py sdist bdist_wheel + python setup.py sdist + pip wheel -w dist --no-deps dist/*.zip - name: Upload build artifacts uses: actions/upload-artifact@v1 diff --git a/.github/workflows/basemap-data.yml b/.github/workflows/basemap-data.yml index cd82ae63f..a0fda0862 100644 --- a/.github/workflows/basemap-data.yml +++ b/.github/workflows/basemap-data.yml @@ -46,10 +46,11 @@ jobs: name: checkout path: . - - name: Build wheel + name: Build sdist and wheel run: | cd ${{ env.PKGDIR }} - python setup.py sdist bdist_wheel + python setup.py sdist + pip wheel -w dist --no-deps dist/*.zip - name: Upload build artifacts uses: actions/upload-artifact@v1 diff --git a/.github/workflows/basemap-for-manylinux.yml b/.github/workflows/basemap-for-manylinux.yml index 21c0a1e56..37b5e9c4b 100644 --- a/.github/workflows/basemap-for-manylinux.yml +++ b/.github/workflows/basemap-for-manylinux.yml @@ -137,10 +137,12 @@ jobs: name: Build wheel run: | cd ${{ env.PKGDIR }} - export GEOS_DIR=extern - export NUMPY_INCLUDE_PATH=extern/include + export GEOS_DIR="${GITHUB_WORKSPACE}/${{ env.PKGDIR }}/extern" + export NUMPY_INCLUDE_PATH="${GITHUB_WORKSPACE}/${{ env.PKGDIR }}/extern/include" + export CFLAGS="-std=c99" pip install -r requirements-setup.txt - python setup.py sdist bdist_wheel + python setup.py sdist + pip wheel -w dist --no-deps dist/*.zip - name: Upload build artifacts uses: actions/upload-artifact@v1 diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index 80b5e7d63..fae596591 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -164,10 +164,12 @@ jobs: name: Build wheel run: | cd ${{ env.PKGDIR }} - $env:GEOS_DIR = "extern" - $env:NUMPY_INCLUDE_PATH = "extern/include" + $env:GEOS_DIR = "$env:GITHUB_WORKSPACE/${{ env.PKGDIR }}/extern" + $env:NUMPY_INCLUDE_PATH = "$env:GITHUB_WORKSPACE/${{ env.PKGDIR }}/extern/include" + $env:SETUPTOOLS_USE_DISTUTILS = "stdlib" pip install -r requirements-setup.txt - python setup.py sdist bdist_wheel + python setup.py sdist + pip wheel -w dist --no-deps (Get-Item dist/*.zip) - name: Upload build artifacts uses: actions/upload-artifact@v1 diff --git a/packages/basemap/MANIFEST.in b/packages/basemap/MANIFEST.in new file mode 100644 index 000000000..0ea74f384 --- /dev/null +++ b/packages/basemap/MANIFEST.in @@ -0,0 +1,8 @@ +include requirements*.txt +recursive-include doc * +recursive-exclude doc/build * +recursive-include test * +recursive-include utils *.py +recursive-exclude **/__pycache__ * +exclude **/*.pyc +exclude **/.gitkeep diff --git a/packages/basemap/pyproject.toml b/packages/basemap/pyproject.toml new file mode 100644 index 000000000..cdf1ce414 --- /dev/null +++ b/packages/basemap/pyproject.toml @@ -0,0 +1,11 @@ +[build-system] +requires = [ + 'setuptools', + 'wheel', + 'oldest-supported-numpy; python_version >= "3.5"', + 'numpy == 1.16.6; python_version == "3.4" or python_version == "2.7"', + 'numpy == 1.11.3; python_version == "3.3" or python_version == "3.2" or python_version == "2.6"', + 'cython >= 0.29, < 3.1; python_version >= "3.3" or python_version <= "3.0"', + 'cython >= 0.26, < 0.27; python_version == "3.2"' +] +build-backend = "setuptools.build_meta" diff --git a/packages/basemap/setup.cfg b/packages/basemap/setup.cfg index f0d50b88d..3195b621d 100644 --- a/packages/basemap/setup.cfg +++ b/packages/basemap/setup.cfg @@ -3,6 +3,9 @@ license_files = LICENSE LICENSE.geos +[sdist] +formats = zip + [flake8] ignore = E301,E306,E402,E501,E731,W503,W504 diff --git a/packages/basemap/setup.py b/packages/basemap/setup.py index 7dd6887c6..05007318f 100644 --- a/packages/basemap/setup.py +++ b/packages/basemap/setup.py @@ -78,15 +78,6 @@ def run(self): finally: self.distribution.data_files = orig_data_files - def initialize_options(self): - """Call `initialize_options` and then set zip as default format.""" - - sdist.initialize_options(self) - self._default_to_zip() - - def _default_to_zip(self): - self.formats = ["zip"] - # Initialise include and library dirs. data_files = [] @@ -160,6 +151,10 @@ def _default_to_zip(self): item.replace(marker1, "").replace(marker2, "") for item in install_requires if item.endswith(marker1) or item.endswith(marker2) or "python_version" not in item] +else: + marker1 = '; python_version == "3.2"' + setup_requires = [item for item in setup_requires if not item.endswith(marker1)] + install_requires = [item for item in install_requires if not item.endswith(marker1)] setup(**{ "name": diff --git a/packages/basemap_data/setup.cfg b/packages/basemap_data/setup.cfg index 98f8f7925..46fc44d00 100644 --- a/packages/basemap_data/setup.cfg +++ b/packages/basemap_data/setup.cfg @@ -5,5 +5,8 @@ license_files = LICENSE.epsg LICENSE.mit +[sdist] +formats = zip + [bdist_wheel] universal = 1 diff --git a/packages/basemap_data/setup.py b/packages/basemap_data/setup.py index 641ac7346..3dc004c9f 100644 --- a/packages/basemap_data/setup.py +++ b/packages/basemap_data/setup.py @@ -8,7 +8,6 @@ import itertools from setuptools import setup from setuptools import find_packages -from setuptools.command.sdist import sdist def get_content(name, splitlines=False): @@ -23,19 +22,6 @@ def get_content(name, splitlines=False): return content -class sdist_zip(sdist): - """Custom `sdist` that saves source distributions in zip format.""" - - def initialize_options(self): - """Call `initialize_options` and then set zip as default format.""" - - sdist.initialize_options(self) - self._default_to_zip() - - def _default_to_zip(self): - self.formats = ["zip"] - - # Define some helper lists. basenames = [ "countries", @@ -140,9 +126,6 @@ def _default_to_zip(self): "!=3.1.*", "<4", ]), - "cmdclass": { - "sdist": sdist_zip, - }, "project_urls": { "Bug Tracker": "https://github.com/matplotlib/basemap/issues", diff --git a/packages/basemap_data_hires/setup.cfg b/packages/basemap_data_hires/setup.cfg index 365ae95ff..e408a4da9 100644 --- a/packages/basemap_data_hires/setup.cfg +++ b/packages/basemap_data_hires/setup.cfg @@ -3,5 +3,8 @@ license_files = COPYING COPYING.LESSER +[sdist] +formats = zip + [bdist_wheel] universal = 1 diff --git a/packages/basemap_data_hires/setup.py b/packages/basemap_data_hires/setup.py index 12b2e0a87..5455f7c25 100644 --- a/packages/basemap_data_hires/setup.py +++ b/packages/basemap_data_hires/setup.py @@ -8,7 +8,6 @@ import itertools from setuptools import setup from setuptools import find_packages -from setuptools.command.sdist import sdist def get_content(name, splitlines=False): @@ -23,19 +22,6 @@ def get_content(name, splitlines=False): return content -class sdist_zip(sdist): - """Custom `sdist` that saves source distributions in zip format.""" - - def initialize_options(self): - """Call `initialize_options` and then set zip as default format.""" - - sdist.initialize_options(self) - self._default_to_zip() - - def _default_to_zip(self): - self.formats = ["zip"] - - # Define some helper lists. basenames = [ "countries", @@ -118,9 +104,6 @@ def _default_to_zip(self): "!=3.1.*", "<4", ]), - "cmdclass": { - "sdist": sdist_zip, - }, "project_urls": { "Bug Tracker": "https://github.com/matplotlib/basemap/issues",