2 # -*- coding: utf-8 -*-
4 # Note: To use the 'upload' functionality of this file, you must:
10 from shutil import rmtree
12 from setuptools import find_packages, setup, Command
15 NAME = 'Adafruit-Blinka'
16 DESCRIPTION = 'CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.'
17 URL = 'https://github.com/adafruit/Adafruit_Blinka'
18 EMAIL = 'python@adafruit.com'
19 AUTHOR = 'Adafruit Industries'
20 REQUIRES_PYTHON = '>=3.6.0'
23 # What packages are required for this module to be executed?
25 # 'requests', 'maya', 'records',
28 here = os.path.abspath(os.path.dirname(__file__))
30 # Import the README and use it as the long-description.
31 # Note: this will only work if 'README.md' is present in your MANIFEST.in file!
32 with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
33 long_description = '\n' + f.read()
35 # Load the package's __version__.py module as a dictionary.
38 # with open(os.path.join(here, NAME, '__version__.py')) as f:
39 with open(os.path.join(here, 'src', '__version__.py')) as f:
42 about['__version__'] = VERSION
45 class UploadCommand(Command):
46 """Support setup.py upload."""
48 description = 'Build and publish the package.'
53 """Prints things in bold."""
54 print('\033[1m{0}\033[0m'.format(s))
56 def initialize_options(self):
59 def finalize_options(self):
64 self.status('Removing previous builds…')
65 rmtree(os.path.join(here, 'dist'))
69 self.status('Building Source and Wheel (universal) distribution…')
70 os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))
72 self.status('Uploading the package to PyPi via Twine…')
73 os.system('twine upload dist/*')
75 self.status('Pushing git tags…')
76 os.system('git tag v{0}'.format(about['__version__']))
77 os.system('git push --tags')
82 # Where the magic happens:
85 version=about['__version__'],
86 description=DESCRIPTION,
87 long_description=long_description,
88 long_description_content_type='text/x-rst',
91 python_requires=REQUIRES_PYTHON,
93 package_dir={'': 'src'},
94 #packages=find_packages(exclude=('tests',)),
97 'adafruit_blinka.agnostic',
98 'adafruit_blinka.board',
99 'adafruit_blinka.microcontroller',
100 'adafruit_blinka.microcontroller.esp8266',
101 'adafruit_blinka.microcontroller.stm32',
104 # If your package is a single module, use this instead of 'packages':
105 py_modules=['bitbangio', 'board', 'busio', 'digitalio'],
107 # 'console_scripts': ['mycli=mymodule:cli'],
109 install_requires=REQUIRED,
110 include_package_data=True,
114 # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
115 'License :: OSI Approved :: MIT License',
116 'Programming Language :: Python',
117 'Programming Language :: Python :: 3',
118 'Programming Language :: Python :: 3.6',
119 'Programming Language :: Python :: Implementation :: MicroPython',
121 # $ setup.py publish support.
123 'upload': UploadCommand,