Skip to content

Commit 3d7b440

Browse files
committed
Switched to pyproject.toml
1 parent 714104b commit 3d7b440

File tree

6 files changed

+77
-77
lines changed

6 files changed

+77
-77
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,31 @@ 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
5355
- name: Build assets
5456
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
57+
- name: Archive bundles
58+
uses: actions/upload-artifact@v2
59+
with:
60+
name: bundles
61+
path: ${{ github.workspace }}/bundles/
5562
- name: Build docs
5663
working-directory: docs
5764
run: sphinx-build -E -W -b html . _build/html
58-
- name: Setup problem matchers
59-
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
65+
- name: Check For pyproject.toml
66+
id: need-pypi
67+
run: |
68+
echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' )
69+
- name: Build Python package
70+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
71+
run: |
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
77+
twine check dist/*

.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/*

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: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,43 @@
1-
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
1+
# SPDX-FileCopyrightText: 2022 Alec Delaney for Adafruit Industries
22
#
3-
# SPDX-License-Identifier: Unlicense
3+
# SPDX-License-Identifier: MIT
44

5-
[tool.black]
6-
target-version = ['py35']
5+
[build-system]
6+
requires = [
7+
"setuptools",
8+
"wheel",
9+
]
10+
11+
[project]
12+
name = "adafruit-circuitpython-bh1750"
13+
description = "CircuitPython library for use with the Adafruit BH1750 breakout"
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_BH1750"}
20+
keywords = [
21+
"adafruit",
22+
"blinka",
23+
"circuitpython",
24+
"micropython",
25+
"bh1750",
26+
]
27+
license = {text = "MIT"}
28+
classifiers = [
29+
"Intended Audience :: Developers",
30+
"Topic :: Software Development :: Libraries",
31+
"Topic :: Software Development :: Embedded Systems",
32+
"Topic :: System :: Hardware",
33+
"License :: OSI Approved :: MIT License",
34+
"Programming Language :: Python :: 3",
35+
]
36+
dynamic = ["dependencies", "optional-dependencies"]
37+
38+
[tool.setuptools]
39+
py-modules = ["adafruit_bh1750"]
40+
41+
[tool.setuptools.dynamic]
42+
dependencies = {file = ["requirements.txt"]}
43+
optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}

requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2-
# SPDX-FileCopyrightText: Copyright (c) 2020 Bryan Siepert for Adafruit Industries
1+
# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries
32
#
4-
# SPDX-License-Identifier: MIT
3+
# SPDX-License-Identifier: Unlicense
54

65
Adafruit-Blinka
7-
adafruit-circuitpython-busdevice
86
adafruit-circuitpython-register
7+
adafruit-circuitpython-busdevice

setup.py

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

0 commit comments

Comments
 (0)