Skip to content

Commit 49aea44

Browse files
committed
Enforce sdist zip format in basemap-data/basemap-data-hires
1 parent 832266a commit 49aea44

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

.github/workflows/basemap-data-hires.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ jobs:
119119
set -e
120120
. /etc/profile
121121
python -m twine check \
122-
${{ env.PKGDIR }}/dist/*.tar.gz \
122+
${{ env.PKGDIR }}/dist/*.zip \
123123
${{ env.PKGDIR }}/dist/*.whl
124124
python -m twine upload --skip-existing \
125-
${{ env.PKGDIR }}/dist/*.tar.gz \
125+
${{ env.PKGDIR }}/dist/*.zip \
126126
${{ env.PKGDIR }}/dist/*.whl

.github/workflows/basemap-data.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ jobs:
119119
set -e
120120
. /etc/profile
121121
python -m twine check \
122-
${{ env.PKGDIR }}/dist/*.tar.gz \
122+
${{ env.PKGDIR }}/dist/*.zip \
123123
${{ env.PKGDIR }}/dist/*.whl
124124
python -m twine upload --skip-existing \
125-
${{ env.PKGDIR }}/dist/*.tar.gz \
125+
${{ env.PKGDIR }}/dist/*.zip \
126126
${{ env.PKGDIR }}/dist/*.whl

packages/basemap_data/setup.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import itertools
99
from setuptools import setup
1010
from setuptools import find_packages
11+
from setuptools.command.sdist import sdist
1112

1213

1314
def get_content(name, splitlines=False):
@@ -22,6 +23,16 @@ def get_content(name, splitlines=False):
2223
return content
2324

2425

26+
class basemap_data_sdist(sdist):
27+
"""Custom `sdist` so that it will force to save in zip format."""
28+
29+
def finalize_options(self):
30+
"""Enforce zip format before calling `finalize_options`."""
31+
32+
self.formats = ["zip"]
33+
sdist.finalize_options(self)
34+
35+
2536
# Define some helper lists.
2637
basenames = [
2738
"countries",
@@ -128,6 +139,9 @@ def get_content(name, splitlines=False):
128139
"!=3.1.*",
129140
"<4",
130141
]),
142+
"cmdclass": {
143+
"sdist": basemap_data_sdist,
144+
},
131145
"project_urls": {
132146
"Bug Tracker":
133147
"https://github.com/matplotlib/basemap/issues",

packages/basemap_data_hires/setup.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import itertools
99
from setuptools import setup
1010
from setuptools import find_packages
11+
from setuptools.command.sdist import sdist
1112

1213

1314
def get_content(name, splitlines=False):
@@ -22,6 +23,16 @@ def get_content(name, splitlines=False):
2223
return content
2324

2425

26+
class basemap_data_hires_sdist(sdist):
27+
"""Custom `sdist` so that it will force to save in zip format."""
28+
29+
def finalize_options(self):
30+
"""Enforce zip format before calling `finalize_options`."""
31+
32+
self.formats = ["zip"]
33+
sdist.finalize_options(self)
34+
35+
2536
# Define some helper lists.
2637
basenames = [
2738
"countries",
@@ -106,6 +117,9 @@ def get_content(name, splitlines=False):
106117
"!=3.1.*",
107118
"<4",
108119
]),
120+
"cmdclass": {
121+
"sdist": basemap_data_hires_sdist,
122+
},
109123
"project_urls": {
110124
"Bug Tracker":
111125
"https://github.com/matplotlib/basemap/issues",

0 commit comments

Comments
 (0)