Switched to pyproject.toml
This commit is contained in:
parent
3772f60ce6
commit
c009680cd7
6 changed files with 64 additions and 84 deletions
19
.github/workflows/build.yml
vendored
19
.github/workflows/build.yml
vendored
|
|
@ -59,22 +59,19 @@ jobs:
|
|||
with:
|
||||
name: bundles
|
||||
path: ${{ github.workspace }}/bundles/
|
||||
- name: Check For docs folder
|
||||
id: need-docs
|
||||
run: |
|
||||
echo ::set-output name=docs::$( find . -wholename './docs' )
|
||||
- name: Build docs
|
||||
if: contains(steps.need-docs.outputs.docs, 'docs')
|
||||
working-directory: docs
|
||||
run: sphinx-build -E -W -b html . _build/html
|
||||
- name: Check For setup.py
|
||||
- name: Check For pyproject.toml
|
||||
id: need-pypi
|
||||
run: |
|
||||
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
|
||||
echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' )
|
||||
- name: Build Python package
|
||||
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
|
||||
run: |
|
||||
pip install --upgrade setuptools wheel twine readme_renderer testresources
|
||||
python setup.py sdist
|
||||
python setup.py bdist_wheel --universal
|
||||
pip install --upgrade build twine
|
||||
for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
|
||||
sed -i -e "s/0.0.0-auto.0/1.2.3/" $file;
|
||||
done;
|
||||
python -m build
|
||||
twine check dist/*
|
||||
|
|
|
|||
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
|
|
@ -61,28 +61,28 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Check For setup.py
|
||||
- name: Check For pyproject.toml
|
||||
id: need-pypi
|
||||
run: |
|
||||
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
|
||||
echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' )
|
||||
- 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@v2
|
||||
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: |
|
||||
for file in $(find -not -path './.*' -not -path './docs*' -name '*.py'); do
|
||||
sed -i -e 's/0.0.0-auto.0/${{github.event.release.tag_name}}/' $file;
|
||||
for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
|
||||
sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file;
|
||||
done;
|
||||
python setup.py sdist
|
||||
python -m build
|
||||
twine upload dist/*
|
||||
|
|
|
|||
3
optional_requirements.txt
Normal file
3
optional_requirements.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
|
|
@ -1,6 +1,44 @@
|
|||
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
|
||||
# SPDX-FileCopyrightText: 2022 Alec Delaney for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
[tool.black]
|
||||
target-version = ['py35']
|
||||
[build-system]
|
||||
requires = [
|
||||
"setuptools",
|
||||
"wheel",
|
||||
]
|
||||
|
||||
[project]
|
||||
name = "adafruit-circuitpython-ov5640"
|
||||
description = "CircuitPython driver for OV5640 Camera"
|
||||
version = "0.0.0-auto.0"
|
||||
readme = "README.rst"
|
||||
authors = [
|
||||
{name = "Adafruit Industries", email = "circuitpython@adafruit.com"}
|
||||
]
|
||||
urls = {Homepage = "https://github.com/adafruit/Adafruit_CircuitPython_OV5640"}
|
||||
keywords = [
|
||||
"adafruit",
|
||||
"ov5640",
|
||||
"camera",
|
||||
"breakout",
|
||||
"hardware",
|
||||
"micropythoncircuitpython",
|
||||
]
|
||||
license = {text = "MIT"}
|
||||
classifiers = [
|
||||
"Intended Audience :: Developers",
|
||||
"Topic :: Software Development :: Libraries",
|
||||
"Topic :: Software Development :: Embedded Systems",
|
||||
"Topic :: System :: Hardware",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3",
|
||||
]
|
||||
dynamic = ["dependencies", "optional-dependencies"]
|
||||
|
||||
[tool.setuptools]
|
||||
py-modules = ["adafruit_ov5640"]
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
dependencies = {file = ["requirements.txt"]}
|
||||
optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
|
||||
# SPDX-FileCopyrightText: Copyright (c) 2021 Jeff Epler for Adafruit Industries
|
||||
# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
Adafruit-Blinka
|
||||
adafruit-circuitpython-busdevice
|
||||
|
|
|
|||
57
setup.py
57
setup.py
|
|
@ -1,57 +0,0 @@
|
|||
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""A setuptools based setup module.
|
||||
|
||||
See:
|
||||
https://packaging.python.org/en/latest/distributing.html
|
||||
https://github.com/pypa/sampleproject
|
||||
"""
|
||||
|
||||
# Always prefer setuptools over distutils
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
# To use a consistent encoding
|
||||
from codecs import open
|
||||
from os import path
|
||||
|
||||
here = path.abspath(path.dirname(__file__))
|
||||
|
||||
# Get the long description from the README file
|
||||
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
|
||||
long_description = f.read()
|
||||
|
||||
setup(
|
||||
name="adafruit-circuitpython-ov5640",
|
||||
use_scm_version=True,
|
||||
setup_requires=["setuptools_scm"],
|
||||
description="CircuitPython driver for OV5640 Camera",
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/x-rst",
|
||||
# The project's main homepage.
|
||||
url="https://github.com/adafruit/Adafruit_CircuitPython_OV5640",
|
||||
# Author details
|
||||
author="Adafruit Industries",
|
||||
author_email="circuitpython@adafruit.com",
|
||||
install_requires=[
|
||||
"Adafruit-Blinka",
|
||||
"adafruit-circuitpython-busdevice",
|
||||
],
|
||||
# Choose your license
|
||||
license="MIT",
|
||||
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
classifiers=[
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Intended Audience :: Developers",
|
||||
"Topic :: Software Development :: Libraries",
|
||||
"Topic :: System :: Hardware",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3",
|
||||
],
|
||||
# What does your project relate to?
|
||||
keywords="adafruit ov5640 camera breakout hardware micropython" "circuitpython",
|
||||
# You can just specify the packages manually here if your project is
|
||||
# simple. Or you can use find_packages().
|
||||
py_modules=["adafruit_ov5640"],
|
||||
)
|
||||
Loading…
Reference in a new issue