Skip to content

Commit

Permalink
Merge pull request #36 from tekktrik/dev/build-wheels
Browse files Browse the repository at this point in the history
Switch to pyproject.toml, build wheels
  • Loading branch information
makermelissa authored May 25, 2023
2 parents 4c19247 + a9262c1 commit 117f1f1
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 64 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,14 @@ jobs:
- name: Build docs
working-directory: docs
run: sphinx-build -E -W -b html . _build/html
- name: Check For pyproject.toml
id: need-pypi
run: |
echo pyproject-toml=$( find . -wholename './pyproject.toml' ) >> $GITHUB_OUTPUT
- name: Build Python package
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
run: |
pip install --upgrade build twine
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/" {} +
python -m build
twine check dist/*
15 changes: 8 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check For setup.py
- name: Check For pyproject.toml
id: need-pypi
run: |
echo "setup-py=$( find . -wholename './setup.py' )" >> $GITHUB_OUTPUT
echo pyproject-toml=$( find . -wholename './pyproject.toml' ) >> $GITHUB_OUTPUT
- name: Set up Python
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install --upgrade build twine
- name: Build and publish
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
env:
TWINE_USERNAME: ${{ secrets.pypi_username }}
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
python setup.py sdist
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}}/" {} +
python -m build
twine upload dist/*
3 changes: 3 additions & 0 deletions optional_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: 2023 Alec Delaney, for Adafruit Industries
#
# SPDX-License-Identifier: MIT
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# SPDX-FileCopyrightText: 2023 Alec Delaney for Adafruit Industries
#
# SPDX-License-Identifier: MIT

[build-system]
requires = [
"setuptools",
"wheel",
"setuptools-scm",
]

[project]
name = "Adafruit_PureIO"
description = "Pure python (i.e. no native extensions) access to Linux IO including I2C and SPI. Drop in replacement for smbus and spidev modules."
version = "0.0.0+auto.0"
readme = "README.rst"
authors = [
{name = "Adafruit Industries", email = "circuitpython@adafruit.com"}
]
urls = {Homepage = "https://github.com/adafruit/Adafruit_Python_PureIO"}
keywords = [
"adafruit",
"blinka",
"micropython",
"pureio",
"ioctl",
"spi",
"i2c",
"python",
]
license = {text = "MIT"}
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries",
"Topic :: System :: Hardware",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: Implementation :: CPython",
]
requires-python = ">=3.5.0"
dynamic = ["dependencies", "optional-dependencies"]

[tool.setuptools]
packages = ["Adafruit_PureIO"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}
57 changes: 0 additions & 57 deletions setup.py

This file was deleted.

0 comments on commit 117f1f1

Please sign in to comment.