Skip to content

Commit dd96af2

Browse files
authored
Merge pull request #26 from tekktrik/main
Switch to pyproject.toml
2 parents 87196b3 + 59e3463 commit dd96af2

File tree

5 files changed

+77
-79
lines changed

5 files changed

+77
-79
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
awk -F '\/' '{ print tolower($2) }' |
2323
tr '_' '-'
2424
)
25-
- name: Set up Python 3.7
26-
uses: actions/setup-python@v1
25+
- name: Set up Python 3.x
26+
uses: actions/setup-python@v2
2727
with:
28-
python-version: 3.7
28+
python-version: "3.x"
2929
- name: Versions
3030
run: |
3131
python3 --version
@@ -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: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
awk -F '\/' '{ print tolower($2) }' |
2525
tr '_' '-'
2626
)
27-
- name: Set up Python 3.6
28-
uses: actions/setup-python@v1
27+
- name: Set up Python 3.x
28+
uses: actions/setup-python@v2
2929
with:
30-
python-version: 3.6
30+
python-version: "3.x"
3131
- name: Versions
3232
run: |
3333
python3 --version
@@ -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')
70-
uses: actions/setup-python@v1
69+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
70+
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/*

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: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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-gfx"
14+
description = "CircuitPython pixel graphics drawing library"
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_GFX"}
21+
keywords = [
22+
"adafruit",
23+
"gfx",
24+
"graphics",
25+
"display",
26+
"pixel",
27+
"drawing",
28+
"hardware",
29+
"micropython",
30+
]
31+
license = {text = "MIT"}
32+
classifiers = [
33+
"Intended Audience :: Developers",
34+
"Topic :: Software Development :: Libraries",
35+
"Topic :: Software Development :: Embedded Systems",
36+
"Topic :: System :: Hardware",
37+
"License :: OSI Approved :: MIT License",
38+
"Programming Language :: Python :: 3",
39+
]
40+
dynamic = ["dependencies", "optional-dependencies"]
41+
42+
[tool.setuptools]
43+
packages = ["adafruit_gfx"]
44+
45+
[tool.setuptools.dynamic]
46+
dependencies = {file = ["requirements.txt"]}
47+
optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}

setup.py

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

0 commit comments

Comments
 (0)