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__))
19 # Import the README and use it as the long-description.
20 # Note: this will only work if 'README.md' is present in your MANIFEST.in file!
21 with io.open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
22 long_description = "\n" + f.read()
24 if not glob.glob("//usr//include//python3.*//Python.h"):
26 "This package requires a Python development environment. "
27 "Please install the python3-dev package for your distribution."
31 if os.path.exists("/proc/device-tree/compatible"):
32 with open("/proc/device-tree/compatible", "rb") as f:
34 # Jetson Nano, TX2, Xavier, etc
35 if b"nvidia,tegra" in compat:
36 board_reqs = ["Jetson.GPIO"]
38 elif b"brcm,bcm2712" in compat:
41 "lgpio;python_version<'3.11'",
42 "Adafruit-Blinka-Raspberry-Pi5-Neopixel",
46 b"brcm,bcm2835" in compat
47 or b"brcm,bcm2836" in compat
48 or b"brcm,bcm2837" in compat
49 or b"brcm,bcm2838" in compat
50 or b"brcm,bcm2711" in compat
52 board_reqs = ["RPi.GPIO", "rpi_ws281x>=4.0.0"]
53 # BeagleBone Black, Green, PocketBeagle, BeagleBone AI, etc.
54 elif b"ti,am335x" in compat:
55 board_reqs = ["Adafruit_BBIO"]
58 name="Adafruit-Blinka",
60 # This is needed for the PyPI version munging in the Github Actions release.yml
61 "git_describe_command": "git describe --tags --long",
62 "local_scheme": "no-local-version",
64 setup_requires=["setuptools_scm"],
65 description="CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.",
66 long_description=long_description,
67 long_description_content_type="text/x-rst",
68 author="Adafruit Industries",
69 author_email="circuitpython@adafruit.com",
70 python_requires=">=3.7.0",
71 url="https://github.com/adafruit/Adafruit_Blinka",
72 package_dir={"": "src"},
73 packages=find_packages("src") + ["micropython-stubs"],
74 # py_modules lists top-level single file packages to include.
75 # find_packages only finds packages in directories with __init__.py files.
92 "adafruit_blinka.microcontroller.bcm283x.pulseio": [
96 "adafruit_blinka.microcontroller.amlogic.meson_g12_common.pulseio": [
99 "micropython-stubs": ["*.pyi"],
101 include_package_data=True,
103 "Adafruit-PlatformDetect>=3.70.1",
104 "Adafruit-PureIO>=1.1.7",
105 "binho-host-adapter>=0.1.6",
107 "adafruit-circuitpython-typing",
108 "sysv_ipc>=1.1.0;sys_platform=='linux' and platform_machine!='mips'",
109 "toml>=0.10.2;python_version<'3.11'",
115 # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
116 "License :: OSI Approved :: MIT License",
117 "Programming Language :: Python",
118 "Programming Language :: Python :: 3",
119 "Programming Language :: Python :: 3.7",
120 "Programming Language :: Python :: Implementation :: MicroPython",