Skip to content

Commit f6c8b42

Browse files
committed
Switched to pyproject.toml
1 parent 81702d6 commit f6c8b42

File tree

6 files changed

+79
-77
lines changed

6 files changed

+79
-77
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: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,18 @@ jobs:
3131
- name: Versions
3232
run: |
3333
python3 --version
34-
- uses: actions/checkout@v1
34+
- name: Checkout Current Repo
35+
uses: actions/checkout@v1
3536
with:
3637
submodules: true
38+
- name: Checkout tools repo
39+
uses: actions/checkout@v2
40+
with:
41+
repository: adafruit/actions-ci-circuitpython-libs
42+
path: actions-ci
3743
- name: Install deps
3844
run: |
39-
sudo apt-get install -y gettext
40-
pip install -r requirements.txt
41-
pip install circuitpython-build-tools
45+
source actions-ci/install.sh
4246
- name: Build assets
4347
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
4448
- name: Upload Release Assets
@@ -57,25 +61,28 @@ jobs:
5761
runs-on: ubuntu-latest
5862
steps:
5963
- uses: actions/checkout@v1
60-
- name: Check For setup.py
64+
- name: Check For pyproject.toml
6165
id: need-pypi
6266
run: |
63-
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
67+
echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' )
6468
- name: Set up Python
65-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
69+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
6670
uses: actions/setup-python@v2
6771
with:
6872
python-version: '3.x'
6973
- name: Install dependencies
70-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
74+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
7175
run: |
7276
python -m pip install --upgrade pip
73-
pip install setuptools wheel twine
77+
pip install --upgrade build twine
7478
- name: Build and publish
75-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
79+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
7680
env:
7781
TWINE_USERNAME: ${{ secrets.pypi_username }}
7882
TWINE_PASSWORD: ${{ secrets.pypi_password }}
7983
run: |
80-
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
8188
twine upload dist/*

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+
]
10+
11+
[project]
12+
name = "adafruit-circuitpython-display-notification"
13+
description = "Displayio Widgets for displaying notifications"
14+
version = "0.0.0-auto.0"
15+
readme = "README.rst"
16+
authors = [
17+
{name = "Adafruit Industries", email = "[email protected]"}
18+
]
19+
urls = {Homepage = "https://github.com/adafruit/Adafruit_CircuitPython_Display_Notification"}
20+
keywords = [
21+
"adafruit",
22+
"blinka",
23+
"circuitpython",
24+
"micropython",
25+
"display_notification",
26+
"displayio",
27+
"ble",
28+
"ancs",
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_display_notification"]
43+
44+
[tool.setuptools.dynamic]
45+
dependencies = {file = ["requirements.txt"]}
46+
optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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-circuitpython-display-text
65
Adafruit-Blinka
6+
adafruit-circuitpython-display-text

setup.py

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

0 commit comments

Comments
 (0)