]> Repositories - Adafruit_Blinka-hackapet.git/blob - setup.py
add all files, untested
[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 if os.path.exists("/proc/device-tree/compatible"):
25     with open("/proc/device-tree/compatible", "rb") as f:
26         compat = f.read()
27     if b"nvidia,tegra" in compat:
28         board_reqs = ["Jetson.GPIO"]
29     # Pi 4 and Earlier
30     if (
31         b"brcm,bcm2835" in compat
32         or b"brcm,bcm2836" in compat
33         or b"brcm,bcm2837" in compat
34         or b"brcm,bcm2838" in compat
35         or b"brcm,bcm2711" in compat
36     ):
37         board_reqs = ["RPi.GPIO", "rpi_ws281x>=4.0.0", "sysv_ipc>=1.1.0"]
38     # Pi 5
39     if b"brcm,bcm2712" in compat:
40         board_reqs = ["rpi_ws281x>=4.0.0", "sysv_ipc>=1.1.0", "rpi-lgpio"]
41     if (
42         b"ti,am335x" in compat
43     ):  # BeagleBone Black, Green, PocketBeagle, BeagleBone AI, etc.
44         board_reqs = ["Adafruit_BBIO"]
45
46 setup(
47     name="Adafruit-Blinka",
48     use_scm_version={
49         # This is needed for the PyPI version munging in the Github Actions release.yml
50         "git_describe_command": "git describe --tags --long",
51         "local_scheme": "no-local-version",
52     },
53     setup_requires=["setuptools_scm"],
54     description="CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.",
55     long_description=long_description,
56     long_description_content_type="text/x-rst",
57     author="Adafruit Industries",
58     author_email="circuitpython@adafruit.com",
59     python_requires=">=3.7.0",
60     url="https://github.com/adafruit/Adafruit_Blinka",
61     package_dir={"": "src"},
62     packages=find_packages("src") + ["micropython-stubs"],
63     # py_modules lists top-level single file packages to include.
64     # find_packages only finds packages in directories with __init__.py files.
65     py_modules=[
66         "analogio",
67         "bitbangio",
68         "board",
69         "busio",
70         "digitalio",
71         "keypad",
72         "micropython",
73         "neopixel_write",
74         "onewireio",
75         "pulseio",
76         "pwmio",
77         "rainbowio",
78         "usb_hid",
79     ],
80     package_data={
81         "adafruit_blinka.microcontroller.bcm283x.pulseio": [
82             "libgpiod_pulsein",
83             "libgpiod_pulsein64",
84         ],
85         "adafruit_blinka.microcontroller.amlogic.meson_g12_common.pulseio": [
86             "libgpiod_pulsein",
87         ],
88         "micropython-stubs": ["*.pyi"],
89     },
90     include_package_data=True,
91     install_requires=[
92         "Adafruit-PlatformDetect>=3.62.0",
93         "Adafruit-PureIO>=1.1.7",
94         "pyftdi>=0.40.0",
95         "adafruit-circuitpython-typing",
96     ]
97     + board_reqs,
98     license="MIT",
99     classifiers=[
100         # Trove classifiers
101         # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
102         "License :: OSI Approved :: MIT License",
103         "Programming Language :: Python",
104         "Programming Language :: Python :: 3",
105         "Programming Language :: Python :: 3.7",
106         "Programming Language :: Python :: Implementation :: MicroPython",
107     ],
108 )