-
Notifications
You must be signed in to change notification settings - Fork 120
Build script improvements #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
108d445
f0d6ea1
d7820d2
241cf33
fe609db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,14 @@ | ||
| import os | ||
| import shutil | ||
|
|
||
| architectures = dict(darwin=['64bit'], | ||
| win32=['32bit', '64bit'], | ||
| noplatform='noarch') | ||
|
|
||
| def cleanup(): | ||
| shutil.rmtree('build', ignore_errors=True) | ||
| try: | ||
| os.remove('_soundfile.py') | ||
| except: | ||
| pass | ||
|
|
||
| for platform, archs in architectures.items(): | ||
| def make_wheel(platform, arch, dist): | ||
|
||
| os.system('python setup.py clean --all') | ||
|
||
| os.environ['PYSOUNDFILE_PLATFORM'] = platform | ||
| for arch in archs: | ||
| os.environ['PYSOUNDFILE_ARCHITECTURE'] = arch | ||
| cleanup() | ||
| os.system('python setup.py bdist_wheel') | ||
|
|
||
| cleanup() | ||
| os.system('python setup.py sdist') | ||
| os.environ['PYSOUNDFILE_ARCHITECTURE'] = arch | ||
| os.system(f'python setup.py {dist}') | ||
|
|
||
| if __name__ == '__main__': | ||
| make_wheel('darwin', '64bit', 'bdist_wheel') | ||
| make_wheel('win32', '32bit', 'bdist_wheel') | ||
| make_wheel('win32', '64bit', 'bdist_wheel') | ||
| make_wheel('', '', 'bdist_wheel') | ||
|
||
| make_wheel('', '', 'sdist') | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,13 @@ | |
| from setuptools.command.test import test as TestCommand | ||
| import sys | ||
|
|
||
| for line in open('soundfile.py'): | ||
| if line.startswith('__version__'): | ||
| exec(line) | ||
| break | ||
| else: | ||
| raise RuntimeException('No version number found') | ||
|
||
|
|
||
| PYTHON_INTERPRETERS = '.'.join([ | ||
| 'cp26', 'cp27', | ||
| 'cp32', 'cp33', 'cp34', 'cp35', 'cp36', | ||
|
|
@@ -87,7 +94,7 @@ def get_tag(self): | |
|
|
||
| setup( | ||
| name='SoundFile', | ||
| version='0.10.1', | ||
| version=__version__, | ||
| description='An audio library based on libsndfile, CFFI and NumPy', | ||
| author='Bastian Bechtold', | ||
| author_email='[email protected]', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a script, it should probably be executable and have a shebang?