]> Repositories - Adafruit_Blinka-hackapet.git/blob - setup.py
Update __init__.py
[Adafruit_Blinka-hackapet.git] / setup.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 # Note: To use the 'upload' functionality of this file, you must:
5 #   $ pip install twine
6
7 import io
8 import os
9 import sys
10
11 from setuptools import setup, find_packages
12
13 here = os.path.abspath(os.path.dirname(__file__))
14
15 # Import the README and use it as the long-description.
16 # Note: this will only work if 'README.md' is present in your MANIFEST.in file!
17 with io.open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
18     long_description = "\n" + f.read()
19
20 board_reqs = []
21 if os.path.exists("/proc/device-tree/compatible"):
22     with open("/proc/device-tree/compatible", "rb") as f:
23         compat = f.read()
24     if b"nvidia,tegra" in compat:
25         board_reqs = ["Jetson.GPIO"]
26     if (
27         b"brcm,bcm2835" in compat
28         or b"brcm,bcm2836" in compat
29         or b"brcm,bcm2837" in compat
30         or b"brcm,bcm2838" in compat
31         or b"brcm,bcm2711" in compat
32     ):
33         board_reqs = ["RPi.GPIO", "rpi_ws281x>=4.0.0", "sysv_ipc>=1.1.0"]
34
35 setup(
36     name="Adafruit-Blinka",
37     use_scm_version={
38         # This is needed for the PyPI version munging in the Github Actions release.yml
39         "git_describe_command": "git describe --tags --long",
40         "local_scheme": "no-local-version",
41     },
42     setup_requires=["setuptools_scm"],
43     description="CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.",
44     long_description=long_description,
45     long_description_content_type="text/x-rst",
46     author="Adafruit Industries",
47     author_email="circuitpython@adafruit.com",
48     python_requires=">=3.6.0",
49     url="https://github.com/adafruit/Adafruit_Blinka",
50     package_dir={"": "src"},
51     packages=find_packages("src"),
52     # py_modules lists top-level single file packages to include.
53     # find_packages only finds packages in directories with __init__.py files.
54     py_modules=[
55         "analogio",
56         "bitbangio",
57         "board",
58         "busio",
59         "digitalio",
60         "keypad",
61         "micropython",
62         "neopixel_write",
63         "pulseio",
64         "pwmio",
65         "rainbowio",
66     ],
67     package_data={
68         "adafruit_blinka.microcontroller.bcm283x.pulseio": ["libgpiod_pulsein"]
69     },
70     install_requires=[
71         "Adafruit-PlatformDetect>=3.13.0",
72         "Adafruit-PureIO>=1.1.7",
73         "pyftdi>=0.40.0",
74     ]
75     + board_reqs,
76     license="MIT",
77     classifiers=[
78         # Trove classifiers
79         # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
80         "License :: OSI Approved :: MIT License",
81         "Programming Language :: Python",
82         "Programming Language :: Python :: 3",
83         "Programming Language :: Python :: 3.6",
84         "Programming Language :: Python :: Implementation :: MicroPython",
85     ],
86 )