2 # -*- coding: utf-8 -*-
4 # SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
6 # SPDX-License-Identifier: MIT
8 # Note: To use the 'upload' functionality of this file, you must:
15 from setuptools import setup, find_packages
17 here = os.path.abspath(os.path.dirname(__file__))
20 def yellow_text(text: str) -> str:
21 return f"\033[33m{text}\033[0m"
24 # Import the README and use it as the long-description.
25 # Note: this will only work if 'README.md' is present in your MANIFEST.in file!
26 with io.open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
27 long_description = "\n" + f.read()
29 if not glob.glob("//usr//include//python3.*//Python.h"):
31 "This package requires a Python development environment. "
32 "Please install the python3-dev package for your distribution."
37 if os.path.exists("/proc/device-tree/compatible"):
38 with open("/proc/device-tree/compatible", "rb") as f:
40 # Jetson Nano, TX2, Xavier, etc
41 if b"nvidia,tegra" in compat:
42 board_reqs = ["Jetson.GPIO"]
45 b"brcm,bcm2835" in compat
46 or b"brcm,bcm2836" in compat
47 or b"brcm,bcm2837" in compat
48 or b"brcm,bcm2838" in compat
49 or b"brcm,bcm2711" in compat
50 or b"brcm,bcm2712" in compat
54 "lgpio;python_version<'3.13'",
56 "Adafruit-Blinka-Raspberry-Pi5-Neopixel",
59 # BeagleBone Black, Green, PocketBeagle, BeagleBone AI, etc.
60 elif b"ti,am335x" in compat:
61 board_reqs = ["Adafruit_BBIO"]
64 name="Adafruit-Blinka",
66 # This is needed for the PyPI version munging in the Github Actions release.yml
67 "git_describe_command": "git describe --tags --long",
68 "local_scheme": "no-local-version",
70 setup_requires=["setuptools_scm"],
71 description="CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.",
72 long_description=long_description,
73 long_description_content_type="text/x-rst",
74 author="Adafruit Industries",
75 author_email="circuitpython@adafruit.com",
76 python_requires=">=3.7.0",
77 url="https://github.com/adafruit/Adafruit_Blinka",
78 package_dir={"": "src"},
79 packages=find_packages("src") + ["micropython-stubs"],
80 # py_modules lists top-level single file packages to include.
81 # find_packages only finds packages in directories with __init__.py files.
98 "adafruit_blinka.microcontroller.bcm283x.pulseio": [
100 "libgpiod_pulsein64",
102 "adafruit_blinka.microcontroller.amlogic.meson_g12_common.pulseio": [
105 "micropython-stubs": ["*.pyi"],
107 include_package_data=True,
109 "Adafruit-PlatformDetect>=3.70.1",
110 "Adafruit-PureIO>=1.1.7",
111 "binho-host-adapter>=0.1.6",
113 "adafruit-circuitpython-typing",
114 "sysv_ipc>=1.1.0;sys_platform=='linux' and platform_machine!='mips'",
115 "toml>=0.10.2;python_version<'3.11'",
121 # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
122 "License :: OSI Approved :: MIT License",
123 "Programming Language :: Python",
124 "Programming Language :: Python :: 3",
125 "Programming Language :: Python :: 3.7",
126 "Programming Language :: Python :: Implementation :: MicroPython",
130 if raspberry_pi and os.sys.version_info >= (3, 13):
133 "\n*** Raspberry Pi 5 and later: lgpio will need to be installed manually. See the lgpio homepage for more details: http://abyz.me.uk/lg/download.html ***"