Skip to content

Commit 94c5e95

Browse files
committed
2 parents f2546e7 + 5ee458d commit 94c5e95

File tree

6 files changed

+55
-71
lines changed

6 files changed

+55
-71
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Dump GitHub context
14-
env:
15-
GITHUB_CONTEXT: ${{ toJson(github) }}
16-
run: echo "$GITHUB_CONTEXT"
1713
- name: Translate Repo Name For Build Tools filename_prefix
1814
id: repo-name
1915
run: |
@@ -47,6 +43,8 @@ jobs:
4743
pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit
4844
- name: Library version
4945
run: git describe --dirty --always --tags
46+
- name: Setup problem matchers
47+
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
5048
- name: Pre-commit hooks
5149
run: |
5250
pre-commit run --all-files
@@ -60,16 +58,14 @@ jobs:
6058
- name: Build docs
6159
working-directory: docs
6260
run: sphinx-build -E -W -b html . _build/html
63-
- name: Check For setup.py
61+
- name: Check For pyproject.toml
6462
id: need-pypi
6563
run: |
66-
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
64+
echo pyproject-toml=$( find . -wholename './pyproject.toml' ) >> $GITHUB_OUTPUT
6765
- name: Build Python package
68-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
66+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
6967
run: |
70-
pip install --upgrade setuptools wheel twine readme_renderer testresources
71-
python setup.py sdist
72-
python setup.py bdist_wheel --universal
68+
pip install --upgrade build setuptools wheel twine readme_renderer testresources
69+
find -type f -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) -exec sed -i -e "s/0.0.0+auto.0/1.2.3/" {} +
70+
python -m build
7371
twine check dist/*
74-
- name: Setup problem matchers
75-
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1

.github/workflows/release.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,26 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v1
16-
- name: Check For setup.py
16+
- name: Check For pyproject.toml
1717
id: need-pypi
1818
run: |
19-
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
19+
echo pyproject-toml=$( find . -wholename './pyproject.toml' ) >> $GITHUB_OUTPUT
2020
- name: Set up Python
21-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
21+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
2222
uses: actions/setup-python@v1
2323
with:
2424
python-version: '3.x'
2525
- name: Install dependencies
26-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
26+
if: contains(steps.need-pypi.outputs.pyproject.toml, 'pyproject.toml')
2727
run: |
2828
python -m pip install --upgrade pip
29-
pip install setuptools wheel twine
29+
pip install --upgrade build twine
3030
- name: Build and publish
31-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
31+
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
3232
env:
3333
TWINE_USERNAME: ${{ secrets.pypi_username }}
3434
TWINE_PASSWORD: ${{ secrets.pypi_password }}
3535
run: |
36-
python setup.py sdist
36+
find -type f -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) -exec sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" {} +
37+
python -m build
3738
twine upload dist/*

adafruit_platformdetect/board.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from adafruit_platformdetect.constants import boards, chips
3232

3333

34-
__version__ = "0.0.0-auto.0"
34+
__version__ = "0.0.0+auto.0"
3535
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PlatformDetect.git"
3636

3737

adafruit_platformdetect/chip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from adafruit_platformdetect.constants import chips
3232

3333

34-
__version__ = "0.0.0-auto.0"
34+
__version__ = "0.0.0+auto.0"
3535
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PlatformDetect.git"
3636

3737

pyproject.toml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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-PlatformDetect"
14+
description = "Platform detection for use by libraries like Adafruit-Blinka."
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_Python_PlatformDetect"}
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+
packages = ["adafruit_platformdetect", "adafruit_platformdetect.constants"]
35+
36+
[tool.setuptools.dynamic]
37+
dependencies = {file = ["requirements.txt"]}

setup.py

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

0 commit comments

Comments
 (0)