]> Repositories - Adafruit_Blinka-hackapet.git/blob - setup.py
0effb9af5d8fb60f570c8126fca2a307f6155975
[Adafruit_Blinka-hackapet.git] / setup.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 # SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
5 #
6 # SPDX-License-Identifier: MIT
7
8 # Note: To use the 'upload' functionality of this file, you must:
9 #   $ pip install twine
10
11 import io
12 import os
13
14 from setuptools import setup, find_packages
15
16 here = os.path.abspath(os.path.dirname(__file__))
17
18 # Import the README and use it as the long-description.
19 # Note: this will only work if 'README.md' is present in your MANIFEST.in file!
20 with io.open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
21     long_description = "\n" + f.read()
22
23 board_reqs = []
24 platform_reqs = []
25 if os.path.exists("/proc/device-tree/compatible"):
26     with open("/proc/device-tree/compatible", "rb") as f:
27         compat = f.read()
28     if b"nvidia,tegra" in compat:
29         board_reqs = ["Jetson.GPIO"]
30     # Pi 4 and Earlier
31     if (
32         b"brcm,bcm2835" in compat
33         or b"brcm,bcm2836" in compat
34         or b"brcm,bcm2837" in compat
35         or b"brcm,bcm2838" in compat
36         or b"brcm,bcm2711" in compat
37     ):
38         board_reqs = ["RPi.GPIO", "rpi_ws281x>=4.0.0", "sysv_ipc>=1.1.0"]
39     # Pi 5
40     if b"brcm,bcm2712" in compat:
41         board_reqs = ["rpi_ws281x>=4.0.0", "rpi-lgpio", "sysv_ipc>=1.1.0"]
42     if b"amlogic,a311d" in compat:
43         board_reqs = ["sysv_ipc>=1.1.0"]
44     if (
45         b"ti,am335x" in compat
46     ):  # BeagleBone Black, Green, PocketBeagle, BeagleBone AI, etc.
47         board_reqs = ["Adafruit_BBIO"]
48
49 setup(
50     name="Adafruit-Blinka",
51     use_scm_version={
52         # This is needed for the PyPI version munging in the Github Actions release.yml
53         "git_describe_command": "git describe --tags --long",
54         "local_scheme": "no-local-version",
55     },
56     setup_requires=["setuptools_scm"],
57     description="CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.",
58     long_description=long_description,
59     long_description_content_type="text/x-rst",
60     author="Adafruit Industries",
61     author_email="circuitpython@adafruit.com",
62     python_requires=">=3.7.0",
63     url="https://github.com/adafruit/Adafruit_Blinka",
64     package_dir={"": "src"},
65     packages=find_packages("src") + ["micropython-stubs"],
66     # py_modules lists top-level single file packages to include.
67     # find_packages only finds packages in directories with __init__.py files.
68     py_modules=[
69         "analogio",
70         "bitbangio",
71         "board",
72         "busio",
73         "digitalio",
74         "keypad",
75         "micropython",
76         "neopixel_write",
77         "onewireio",
78         "pulseio",
79         "pwmio",
80         "rainbowio",
81         "usb_hid",
82     ],
83     package_data={
84         "adafruit_blinka.microcontroller.bcm283x.pulseio": [
85             "libgpiod_pulsein",
86             "libgpiod_pulsein64",
87         ],
88         "adafruit_blinka.microcontroller.amlogic.meson_g12_common.pulseio": [
89             "libgpiod_pulsein",
90         ],
91         "micropython-stubs": ["*.pyi"],
92     },
93     include_package_data=True,
94     install_requires=[
95         "Adafruit-PlatformDetect>=3.70.1",
96         "Adafruit-PureIO>=1.1.7",
97         "binho-host-adapter>=0.1.6",
98         "pyftdi>=0.40.0",
99         "numpy>=1.21.5",
100         "adafruit-circuitpython-typing",
101     ]
102     + board_reqs,
103     license="MIT",
104     classifiers=[
105         # Trove classifiers
106         # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
107         "License :: OSI Approved :: MIT License",
108         "Programming Language :: Python",
109         "Programming Language :: Python :: 3",
110         "Programming Language :: Python :: 3.7",
111         "Programming Language :: Python :: Implementation :: MicroPython",
112     ],
113 )