import sys
from setuptools import setup
from distutils.version import LooseVersion
from setuptools import __version__ as setuptools_version
setuptools_scm = 'setuptools_scm'
if LooseVersion(setuptools_version).version[0] < 12:
setuptools_scm += '<2.0'
def pyusb_scm_version():
"""append '-editable' to version for editable installs"""
from setuptools_scm.version import get_local_node_and_date
def editable_local_scheme(version):
local_scheme = get_local_node_and_date(version)
if "develop" in sys.argv[1:]:
return local_scheme + "-editable"
return local_scheme
return {
"version_scheme": "post-release",
"local_scheme": editable_local_scheme,
"write_to": "usb/_version.py",
}
pyusb_scm_version.pop = lambda *_: None
setup(
name='pyusb',
use_scm_version=pyusb_scm_version,
setup_requires=setuptools_scm,
description='Python USB access module',
author='Jonas Malaco',
author_email='me@jonasmalaco.com',
url='https://pyusb.github.io/pyusb',
packages=['usb', 'usb.backend'],
long_description=
"""
PyUSB offers easy USB devices communication in Python.
It should work without additional code in any environment with
Python >= 3.6, ctypes and a pre-built USB backend library
(currently: libusb 1.x, libusb 0.1.x or OpenUSB).
""",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: Manufacturing',
'Intended Audience :: Science/Research',
'Intended Audience :: System Administrators',
'Intended Audience :: Telecommunications Industry',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows :: Windows Vista',
'Operating System :: Microsoft :: Windows :: Windows 7',
'Operating System :: Microsoft :: Windows :: Windows 10',
'Operating System :: POSIX :: BSD :: FreeBSD',
'Operating System :: POSIX :: BSD :: NetBSD',
'Operating System :: POSIX :: BSD :: OpenBSD',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX :: SunOS/Solaris',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: IronPython',
'Programming Language :: Python :: Implementation :: Jython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Scientific/Engineering :' \
': Interface Engine/Protocol Translator',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Hardware :: Hardware Drivers'
],
python_requires='>=3.6.0'
)