Skip to content

Commit 5788587

Browse files
authored
Merge pull request #972 from makermelissa/main
Convert Blinka to use pyproject.toml
2 parents 5ca7fdd + 7c6c572 commit 5788587

File tree

6 files changed

+92
-144
lines changed

6 files changed

+92
-144
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
- name: Translate Repo Name For Build Tools filename_prefix
1717
id: repo-name
1818
run: echo "repo-name=Adafruit-Blinka" >> $GITHUB_OUTPUT
19-
- name: Set up Python 3.8
19+
- name: Set up Python 3.11
2020
uses: actions/setup-python@v4
2121
with:
22-
python-version: 3.8
22+
python-version: 3.11
2323
- name: Versions
2424
run: |
2525
python3 --version
@@ -47,7 +47,12 @@ jobs:
4747
- name: Build docs
4848
working-directory: docs
4949
run: sphinx-build -E -W -b html . _build/html
50+
- name: Check For pyproject.toml
51+
id: need-pypi
52+
run: |
53+
echo "pyproject-toml=$( find . -wholename './pyproject.toml' )" >> $GITHUB_OUTPUT
5054
- name: Build Python package
55+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
5156
run: |
5257
pip install --upgrade build twine
5358
for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v3
15-
- name: Check For setup.py
15+
- name: Check For pyproject.toml
1616
id: need-pypi
1717
run: |
18-
echo "setup-py=$( find . -wholename './setup.py' )" >> $GITHUB_OUTPUT
18+
echo "pyproject-toml=$( find . -wholename './pyproject.toml' )" >> $GITHUB_OUTPUT
1919
- name: Set up Python
20-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
20+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
2121
uses: actions/setup-python@v4
2222
with:
23-
python-version: '3.x'
23+
python-version: '3.11'
2424
- name: Install dependencies
25-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
25+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
2626
run: |
2727
python -m pip install --upgrade pip
2828
pip install --upgrade build twine
2929
- name: Build and publish
30-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
30+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
3131
env:
3232
TWINE_USERNAME: ${{ secrets.pypi_username }}
3333
TWINE_PASSWORD: ${{ secrets.pypi_password }}

docs/conf.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,25 +97,21 @@
9797
#
9898
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
9999

100-
if not on_rtd: # only import and set the theme if we're building docs locally
101-
try:
102-
import sphinx_rtd_theme
103-
104-
html_theme = "sphinx_rtd_theme"
105-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
106-
except:
107-
html_theme = "default"
108-
html_theme_path = ["."]
109-
else:
110-
html_theme_path = ["."]
100+
html_theme = "sphinx_rtd_theme"
111101

112102
# Add any paths that contain custom static files (such as style sheets) here,
113103
# relative to this directory. They are copied after the builtin static files,
114104
# so a file named "default.css" will overwrite the builtin "default.css".
115105
html_static_path = ["_static"]
116106

107+
# The name of an image file (relative to this directory) to use as a favicon of
108+
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
109+
# pixels large.
110+
#
111+
html_favicon = "_static/favicon.ico"
112+
117113
# Output file base name for HTML help builder.
118-
htmlhelp_basename = "AdafruitBlinkaLibrarydoc"
114+
htmlhelp_basename = "Adafruit_blinkaDisplayioLibrarydoc"
119115

120116
# -- Options for LaTeX output ---------------------------------------------
121117

pyproject.toml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# SPDX-FileCopyrightText: 2022 Alec Delaney for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
[build-system]
6+
requires = [
7+
"setuptools",
8+
"wheel",
9+
"setuptools-scm",
10+
]
11+
12+
[project]
13+
name = "Adafruit-Blinka"
14+
description = "CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython."
15+
version = "0.0.0+auto.0"
16+
readme = "README.rst"
17+
authors = [
18+
{name = "Adafruit Industries", email = "[email protected]"}
19+
]
20+
urls = {Homepage = "https://github.com/adafruit/Adafruit_Blinka"}
21+
license = {text = "MIT"}
22+
classifiers=[
23+
"Development Status :: 5 - Production/Stable",
24+
"Intended Audience :: Developers",
25+
"Topic :: Software Development :: Libraries",
26+
"Topic :: System :: Hardware",
27+
"License :: OSI Approved :: MIT License",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3.7",
30+
]
31+
dynamic = ["dependencies"]
32+
33+
[tool.setuptools]
34+
py-modules = [
35+
"analogio",
36+
"bitbangio",
37+
"board",
38+
"busio",
39+
"digitalio",
40+
"keypad",
41+
"micropython",
42+
"neopixel_write",
43+
"onewireio",
44+
"pulseio",
45+
"pwmio",
46+
"rainbowio",
47+
"usb_hid",
48+
]
49+
50+
[tool.setuptools.packages.find]
51+
where = ["src"]
52+
include = [
53+
"adafruit_blinka.microcontroller.bcm283x.libgpiod_pulsein*",
54+
"adafruit_blinka.microcontroller.amlogic.meson_g12_common.pulseio.libgpiod_pulsein*",
55+
"*.pyi"
56+
]
57+
58+
[tool.setuptools.dynamic]
59+
dependencies = {file = ["requirements.txt"]}

requirements.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
# requirements.txt
2-
#
3-
# installs dependencies from ./setup.py, and the package itself,
4-
# in editable mode
5-
# -e .
6-
7-
# (the -e above is optional). you could also just install the package
8-
# normally with just the line below (after uncommenting)
9-
.
1+
Adafruit-PlatformDetect>=3.70.1
2+
Adafruit-PureIO>=1.1.7
3+
Jetson.GPIO; platform_machine=='aarch64'
4+
RPi.GPIO; platform_machine=='armv7l' or platform_machine=='armv6l' or platform_machine=='aarch64'
5+
rpi_ws281x>=4.0.0; platform_machine=='armv7l' or platform_machine=='armv6l' or platform_machine=='aarch64'
6+
sysv_ipc>=1.1.0; sys_platform == 'linux' and platform_machine!='mips'
7+
pyftdi>=0.40.0
8+
binho-host-adapter>=0.1.6
9+
adafruit-circuitpython-typing
10+
toml>=0.10.2; python_version<'3.11'
11+
lgpio>=0.2.2.0
12+
Adafruit-Blinka-Raspberry-Pi5-Neopixel; platform_machine=='aarch64'

setup.py

Lines changed: 0 additions & 115 deletions
This file was deleted.

0 commit comments

Comments
 (0)