Skip to content

Commit d8a6f0b

Browse files
committed
Merge branch 'main' into sprite_button
# Conflicts: # setup.py
2 parents ddd7c13 + ed71bd1 commit d8a6f0b

File tree

8 files changed

+86
-27
lines changed

8 files changed

+86
-27
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ jobs:
4747
pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit
4848
- name: Library version
4949
run: git describe --dirty --always --tags
50+
- name: Setup problem matchers
51+
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
5052
- name: Pre-commit hooks
5153
run: |
5254
pre-commit run --all-files
@@ -60,16 +62,16 @@ jobs:
6062
- name: Build docs
6163
working-directory: docs
6264
run: sphinx-build -E -W -b html . _build/html
63-
- name: Check For setup.py
65+
- name: Check For pyproject.toml
6466
id: need-pypi
6567
run: |
66-
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
68+
echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' )
6769
- name: Build Python package
68-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
70+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
6971
run: |
70-
pip install --upgrade setuptools wheel twine readme_renderer testresources
71-
python setup.py sdist
72-
python setup.py bdist_wheel --universal
72+
pip install --upgrade build twine
73+
for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
74+
sed -i -e "s/0.0.0-auto.0/1.2.3/" $file;
75+
done;
76+
python -m build
7377
twine check dist/*
74-
- name: Setup problem matchers
75-
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1

.github/workflows/release.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,28 @@ jobs:
6161
runs-on: ubuntu-latest
6262
steps:
6363
- uses: actions/checkout@v1
64-
- name: Check For setup.py
64+
- name: Check For pyproject.toml
6565
id: need-pypi
6666
run: |
67-
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
67+
echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' )
6868
- name: Set up Python
69-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
69+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
7070
uses: actions/setup-python@v2
7171
with:
7272
python-version: '3.x'
7373
- name: Install dependencies
74-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
74+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
7575
run: |
7676
python -m pip install --upgrade pip
77-
pip install setuptools wheel twine
77+
pip install --upgrade build twine
7878
- name: Build and publish
79-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
79+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
8080
env:
8181
TWINE_USERNAME: ${{ secrets.pypi_username }}
8282
TWINE_PASSWORD: ${{ secrets.pypi_password }}
8383
run: |
84-
python setup.py sdist
84+
for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
85+
sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file;
86+
done;
87+
python -m build
8588
twine upload dist/*

README.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Introduction
1313
:target: https://github.com/adafruit/Adafruit_CircuitPython_Display_Button/actions
1414
:alt: Build Status
1515

16+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
17+
:target: https://github.com/psf/black
18+
:alt: Code Style: Black
19+
1620
UI Buttons for displayio
1721

1822

@@ -46,8 +50,8 @@ To install in a virtual environment in your current project:
4650
.. code-block:: shell
4751
4852
mkdir project-name && cd project-name
49-
python3 -m venv .env
50-
source .env/bin/activate
53+
python3 -m venv .venv
54+
source .venv/bin/activate
5155
pip3 install adafruit-circuitpython-display-button
5256
5357
Usage Example
@@ -80,15 +84,15 @@ To build this library locally you'll need to install the
8084

8185
.. code-block:: shell
8286
83-
python3 -m venv .env
84-
source .env/bin/activate
87+
python3 -m venv .venv
88+
source .venv/bin/activate
8589
pip install circuitpython-build-tools
8690
8791
Once installed, make sure you are in the virtual environment:
8892

8993
.. code-block:: shell
9094
91-
source .env/bin/activate
95+
source .venv/bin/activate
9296
9397
Then run the build:
9498

@@ -104,8 +108,8 @@ install dependencies (feel free to reuse the virtual environment from above):
104108

105109
.. code-block:: shell
106110
107-
python3 -m venv .env
108-
source .env/bin/activate
111+
python3 -m venv .venv
112+
source .venv/bin/activate
109113
pip install Sphinx sphinx-rtd-theme
110114
111115
Now, once you have the virtual environment activated:

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
#
6161
# This is also used if you do content translation via gettext catalogs.
6262
# Usually you set "language" from the command line for these cases.
63-
language = None
63+
language = "en"
6464

6565
# List of patterns, relative to source directory, that match files and
6666
# directories to ignore when looking for source files.

docs/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ Table of Contents
3131
.. toctree::
3232
:caption: Other Links
3333

34-
Download <https://github.com/adafruit/Adafruit_CircuitPython_Display_Button/releases/latest>
34+
Download from GitHub <https://github.com/adafruit/Adafruit_CircuitPython_Display_Button/releases/latest>
35+
Download Library Bundle <https://circuitpython.org/libraries>
3536
CircuitPython Reference Documentation <https://docs.circuitpython.org>
3637
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60>
3738
Discord Chat <https://adafru.it/discord>

optional_requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense

pyproject.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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-circuitpython-display_button"
14+
description = "UI Buttons for displayio"
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_CircuitPython_Display_Button"}
21+
keywords = [
22+
"adafruit",
23+
"blinka",
24+
"circuitpython",
25+
"micropython",
26+
"display_button",
27+
"buttons",
28+
"UI",
29+
]
30+
license = {text = "MIT"}
31+
classifiers = [
32+
"Intended Audience :: Developers",
33+
"Topic :: Software Development :: Libraries",
34+
"Topic :: Software Development :: Embedded Systems",
35+
"Topic :: System :: Hardware",
36+
"License :: OSI Approved :: MIT License",
37+
"Programming Language :: Python :: 3",
38+
]
39+
dynamic = ["dependencies", "optional-dependencies"]
40+
41+
[tool.setuptools]
42+
py-modules = ["adafruit_button"]
43+
44+
[tool.setuptools.dynamic]
45+
dependencies = {file = ["requirements.txt"]}
46+
optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
1+
# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries
22
#
33
# SPDX-License-Identifier: Unlicense
44

5+
Adafruit-Blinka-displayio
56
Adafruit-Blinka
6-
adafruit-blinka-displayio
7+
adafruit-circuitpython-bitmap-font
78
adafruit-circuitpython-display-text
89
adafruit-circuitpython-display-shapes
9-
adafruit-circuitpython-bitmap-font

0 commit comments

Comments
 (0)