Skip to content

Commit

Permalink
update setup.py for universal wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
cs01 committed Nov 26, 2017
1 parent b4b4fc9 commit 5f14dbb
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Changes that are in master but have not yet been pushed to PyPI.

* Lazily load files (issue #131)
* Update setup.py to build wheels

## 0.9.0.0
* Compress responses from server (massive bandwidth improvement)
Expand Down
6 changes: 4 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ test:
python setup.py checkdocs

publish: test
python setup.py sdist upload
python setup.py upload

testpublish: test
python setup.py sdist upload -r pypitest
rm -rf dist
python setup.py sdist bdist_wheel --universal
twine upload dist/* -r pypitest
80 changes: 64 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
import sys
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Note: To use the 'upload' functionality of this file, you must:
# pip install twine

import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command

CURDIR = os.path.abspath(os.path.dirname(__file__))

EXCLUDE_FROM_PACKAGES = []
REQUIRED = [
'Flask>=0.12.2', # to run server
'pygdbmi>=0.7.4.4', # to parse gdb output
'pypugjs>=4.2.2', # to use .pug instead of .html
'Flask-SocketIO>=2.9.2', # for websockets
'gevent>=1.2.2', # for websockets (preferred)
'eventlet>=0.21.0', # for websockets (backup to gevent)
'Pygments>=2.2.0', # for syntax highlighting
'Flask-Compress>=1.4.0', # to compress flask responses
]

readme = io.open('README.rst', 'r', encoding="utf-8").read()
README = io.open('README.rst', 'r', encoding="utf-8").read()


class TestCommand (Command):
Expand All @@ -25,13 +44,46 @@ def run(self):
sys.exit(test_app.main())


class UploadCommand(Command):
"""Support setup.py upload."""

description = 'Build and publish the package.'
user_options = []

@staticmethod
def status(s):
"""Prints things in bold."""
print('\033[1m{0}\033[0m'.format(s))

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
try:
self.status('Removing previous builds…')
rmtree(os.path.join(CURDIR, 'dist'))
except OSError:
pass

self.status('Building Source and Wheel (universal) distribution…')
os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))

self.status('Uploading the package to PyPi via Twine…')
os.system('twine upload dist/*')

sys.exit()


setup(
name='gdbgui',
version='0.9.0.1',
author='Chad Smith',
author_email='[email protected]',
description=('browser-based gdb frontend using Flask and JavaScript to visually debug C, C++, Go, or Rust'),
long_description=readme,
description='browser-based gdb frontend using Flask and JavaScript to visually debug C, C++, Go, or Rust',
long_description=README,
url='https://github.com/cs01/gdbgui',
license='License :: GNU GPLv3',
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
Expand All @@ -46,27 +98,23 @@ def run(self):
},
extras_require={},
zip_safe=False,
cmdclass={'test': TestCommand},
install_requires=[
'Flask>=0.12.2', # to run server
'pygdbmi>=0.7.4.4', # to parse gdb output
'pypugjs>=4.2.2', # to use .pug instead of .html
'Flask-SocketIO>=2.9.2', # for websockets
'gevent>=1.2.2', # for websockets (preferred)
'eventlet>=0.21.0', # for websockets (backup to gevent)
'Pygments>=2.2.0', # for syntax highlighting
'Flask-Compress>=1.4.0', # to compress flask responses
],
cmdclass={
'test': TestCommand,
'upload': UploadCommand
},
install_requires=REQUIRED,
classifiers=[
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'License :: OSI Approved :: GNU GPLv3',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: PyPy'
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
],
)

0 comments on commit 5f14dbb

Please sign in to comment.