Skip to content

Commit 9b97740

Browse files
committed
Add wheel support to the release script
This still needs to be tested, so there may be bugs with it.
1 parent 98607f7 commit 9b97740

File tree

1 file changed

+63
-4
lines changed

1 file changed

+63
-4
lines changed

release/rever.xsh

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ $ACTIVITIES = [
3333
'mailmap_update',
3434
'test_sympy',
3535
'source_tarball',
36+
'wheel',
3637
'build_docs',
3738
'copy_release_files',
3839
'compare_tar_against_git',
@@ -41,6 +42,11 @@ $ACTIVITIES = [
4142
'test_tarball35',
4243
'test_tarball36',
4344
'test_tarball37',
45+
'test_wheel27',
46+
'test_wheel34',
47+
'test_wheel35',
48+
'test_wheel36',
49+
'test_wheel37',
4450
'print_authors',
4551
'sha256',
4652
# 'tag',
@@ -83,6 +89,13 @@ def source_tarball():
8389
# Assumes this is run in Docker and git is already clean
8490
./setup.py sdist --keep-temp
8591

92+
93+
@activity(deps={'_version', 'mailmap_update', 'test_sympy'})
94+
def wheel():
95+
with run_in_conda_env(['mpmath', 'python=3.6', 'setuptools', 'pip'], 'sympy-release'):
96+
# Assumes this is run in Docker and git is already clean
97+
./setup.py bdist_wheel --universal --keep-temp
98+
8699
@activity(deps={'_version'})
87100
def build_docs():
88101
with run_in_conda_env(['sphinx', 'docutils', 'numpy', 'mpmath', 'matplotlib'],
@@ -108,7 +121,7 @@ def build_docs():
108121
cd ../../../
109122

110123

111-
@activity(deps={'source_tarball', 'build_docs'})
124+
@activity(deps={'source_tarball', 'wheel', 'build_docs'})
112125
def copy_release_files():
113126
ls dist
114127
cp dist/* /root/release/
@@ -133,6 +146,26 @@ def test_tarball36():
133146
def test_tarball37():
134147
test_tarball('3.7')
135148

149+
@activity(deps={'wheel'})
150+
def test_wheel27():
151+
test_wheel('2.7')
152+
153+
@activity(deps={'wheel'})
154+
def test_wheel34():
155+
test_wheel('3.4')
156+
157+
@activity(deps={'wheel'})
158+
def test_wheel35():
159+
test_wheel('3.5')
160+
161+
@activity(deps={'wheel'})
162+
def test_wheel36():
163+
test_wheel('3.6')
164+
165+
@activity(deps={'wheel'})
166+
def test_wheel37():
167+
test_wheel('3.7')
168+
136169
@activity(deps={'source_tarball'})
137170
def compare_tar_against_git():
138171
"""
@@ -176,7 +209,7 @@ def compare_tar_against_git():
176209
if fail:
177210
sys.exit(red("Non-whitelisted files found or not found in the tarball"))
178211

179-
@activity(deps={'source_tarball'})
212+
@activity(deps={'source_tarball', 'wheel'})
180213
def print_authors():
181214
"""
182215
Print authors text to put at the bottom of the release notes
@@ -200,7 +233,7 @@ Thanks to everyone who contributed to this release!
200233
print("- " + name)
201234
print()
202235

203-
@activity(deps={'source_tarball', 'build_docs'})
236+
@activity(deps={'source_tarball', 'wheel', 'build_docs'})
204237
def sha256():
205238
"""
206239
Print the sha256 sums of the release files
@@ -220,7 +253,12 @@ def _sha256(print_=True, local=False):
220253
print(out)
221254
return out
222255

223-
@activity(deps={'mailmap_update', 'sha256', 'print_authors', 'source_tarball', 'build_docs', 'compare_tar_against_git', 'test_tarball27', 'test_tarball34', 'test_tarball35', 'test_tarball36', 'test_sympy'})
256+
@activity(deps={'mailmap_update', 'sha256', 'print_authors',
257+
'source_tarball', 'wheel', 'build_docs',
258+
'compare_tar_against_git', 'test_tarball27', 'test_tarball34',
259+
'test_tarball35', 'test_tarball36', 'test_wheel27',
260+
'test_wheel34', 'test_wheel35', 'test_wheel36',
261+
'test_wheel37', 'test_sympy'})
224262
def release():
225263
pass
226264

@@ -268,6 +306,22 @@ def test_tarball(py_version):
268306
python -m isympy --help
269307
isympy --help
270308

309+
def test_wheel(py_version):
310+
"""
311+
Test that the wheel can be installed, and that sympy imports in the install.
312+
"""
313+
if py_version not in {'2.7', '3.4', '3.5', '3.6', '3.7'}: # TODO: Add win32
314+
raise ValueError("release must be one of 2.7, 3.4, 3.5, 3.6, or 3.7 not %s" % py_version)
315+
316+
317+
with run_in_conda_env(['python=%s' % py_version], 'test-install-%s' % py_version):
318+
cp @('/root/release/{wheel}'.format(**tarball_format)) @("{wheel}".format(**tarball_format))
319+
pip install @("{wheel}".format(**tarball_format)
320+
321+
python -c "import sympy; print(sympy.__version__); print('sympy installed successfully')"
322+
python -m isympy --help
323+
isympy --help
324+
271325
def get_tarball_name(file):
272326
"""
273327
Get the name of a tarball
@@ -277,6 +331,7 @@ def get_tarball_name(file):
277331
source-orig: The original name of the source tarball
278332
source-orig-notar: The name of the untarred directory
279333
source: The source tarball (after renaming)
334+
wheel: The wheel
280335
html: The name of the html zip
281336
html-nozip: The name of the html, without ".zip"
282337
pdf-orig: The original name of the pdf file
@@ -298,6 +353,8 @@ def get_tarball_name(file):
298353
name += ".{extension}"
299354
elif file == 'pdf-orig':
300355
name = "sympy-{version}.pdf"
356+
elif file == 'wheel':
357+
name = 'sympy-{version}-py2.py3-none-any.whl'
301358
else:
302359
raise ValueError(file + " is not a recognized argument")
303360

@@ -309,6 +366,7 @@ tarball_name_types = {
309366
'source-orig',
310367
'source-orig-notar',
311368
'source',
369+
'wheel',
312370
'html',
313371
'html-nozip',
314372
'pdf-orig',
@@ -829,6 +887,7 @@ def check_tag_exists():
829887

830888
descriptions = OrderedDict([
831889
('source', "The SymPy source installer.",),
890+
('wheel', "A wheel of the package.",),
832891
('html', '''Html documentation. This is the same as
833892
the <a href="https://docs.sympy.org/latest/index.html">online documentation</a>.''',),
834893
('pdf', '''Pdf version of the <a href="https://docs.sympy.org/latest/index.html"> html documentation</a>.''',),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy