File tree Expand file tree Collapse file tree 4 files changed +34
-14
lines changed Expand file tree Collapse file tree 4 files changed +34
-14
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ jobs:
147
147
$env:GEOS_DIR = "extern"
148
148
$env:NUMPY_INCLUDE_PATH = "extern/include"
149
149
pip install -r requirements-setup.txt
150
- python setup.py bdist_wheel
150
+ python setup.py sdist bdist_wheel
151
151
-
152
152
name : Upload build artifacts
153
153
uses : actions/upload-artifact@v1
@@ -205,6 +205,7 @@ jobs:
205
205
TWINE_REPOSITORY_URL : " ${{ secrets.PYPI_REPOSITORY_URL }}"
206
206
run : |
207
207
python -m twine check `
208
+ ${{ env.PKGDIR }}/dist/*.zip `
208
209
${{ env.PKGDIR }}/dist/*-win*.whl
209
210
python -m twine upload --skip-existing `
210
211
${{ env.PKGDIR }}/dist/*-win*.whl
Original file line number Diff line number Diff line change @@ -64,15 +64,28 @@ def get_geos_install_prefix():
64
64
class basemap_sdist (sdist ):
65
65
"""Custom `sdist` so that it will not pack DLLs on Windows if present."""
66
66
67
- def finalize_options (self ):
68
- """Call `finalize_options` after cleaning `data_files` and reset."""
69
-
70
- self .formats = ["zip" ]
67
+ def run (self ):
68
+ """Custom `run` command."""
71
69
70
+ # Replace DLL data files and add GEOS build script.
72
71
orig_data_files = self .distribution .data_files
73
- self .distribution .data_files = []
74
- sdist .finalize_options (self )
75
- self .distribution .data_files = orig_data_files
72
+ self .distribution .data_files = [
73
+ ("." , glob .glob (os .path .join ("utils" , "*.py" )))]
74
+
75
+ # Run the original `run` method and leave `data_files` as it was found.
76
+ try :
77
+ sdist .run (self )
78
+ finally :
79
+ self .distribution .data_files = orig_data_files
80
+
81
+ def initialize_options (self ):
82
+ """Call `initialize_options` and then set zip as default format."""
83
+
84
+ sdist .initialize_options (self )
85
+ self ._default_to_zip ()
86
+
87
+ def _default_to_zip (self ):
88
+ self .formats = ["zip" ]
76
89
77
90
78
91
# Initialise include and library dirs.
Original file line number Diff line number Diff line change @@ -26,11 +26,14 @@ def get_content(name, splitlines=False):
26
26
class basemap_data_sdist (sdist ):
27
27
"""Custom `sdist` so that it will force to save in zip format."""
28
28
29
- def finalize_options (self ):
30
- """Enforce zip format before calling `finalize_options` ."""
29
+ def initialize_options (self ):
30
+ """Call `initialize_options` and then set zip as default format ."""
31
31
32
+ sdist .initialize_options (self )
33
+ self ._default_to_zip ()
34
+
35
+ def _default_to_zip (self ):
32
36
self .formats = ["zip" ]
33
- sdist .finalize_options (self )
34
37
35
38
36
39
# Define some helper lists.
Original file line number Diff line number Diff line change @@ -26,11 +26,14 @@ def get_content(name, splitlines=False):
26
26
class basemap_data_hires_sdist (sdist ):
27
27
"""Custom `sdist` so that it will force to save in zip format."""
28
28
29
- def finalize_options (self ):
30
- """Enforce zip format before calling `finalize_options` ."""
29
+ def initialize_options (self ):
30
+ """Call `initialize_options` and then set zip as default format ."""
31
31
32
+ sdist .initialize_options (self )
33
+ self ._default_to_zip ()
34
+
35
+ def _default_to_zip (self ):
32
36
self .formats = ["zip" ]
33
- sdist .finalize_options (self )
34
37
35
38
36
39
# Define some helper lists.
You can’t perform that action at this time.
0 commit comments