Merge branch 'main' into wwshell_merge_main

# Conflicts:
#	setup.py
This commit is contained in:
foamyguy 2024-06-17 11:32:02 -05:00
commit a6985550e1
5 changed files with 75 additions and 126 deletions

View file

@ -17,10 +17,10 @@ jobs:
- name: Translate Repo Name For Build Tools filename_prefix
id: repo-name
run: echo ::set-output name=repo-name::circup
- name: Set up Python 3.7
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.11
- name: Pip install Sphinx & pre-commit
run: |
pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit

View file

@ -1,5 +1,6 @@
# SPDX-FileCopyrightText: 2019 Nicholas Tollervey, written for Adafruit Industries
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: 2021 James Carr
#
# SPDX-License-Identifier: MIT
name: Release Actions
@ -14,26 +15,20 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Check For setup.py
id: need-pypi
run: |
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
filter: 'blob:none'
depth: 0
- name: Set up Python
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.11'
- name: Install dependencies
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install build setuptools wheel twine
- name: Build and publish
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
env:
TWINE_USERNAME: ${{ secrets.pypi_username }}
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
python setup.py sdist
python -m build
twine upload dist/*

View file

@ -25,15 +25,24 @@ Developer Setup
.. note::
Please try to use Python 3.6+ while developing CircUp. This is so we can
Please try to use Python 3.9+ while developing CircUp. This is so we can
use the
`Black code formatter <https://black.readthedocs.io/en/stable/index.html>`_
(which only works with Python 3.6+).
and so that we're supporting versions which still receive security updates.
Clone the repository and from the root of the project,
install the requirements::
pip install -e ".[dev]"
If you'd like you can setup a virtual environment and activate it.::
python3 -m venv .env
source .env/bin/activate
install the development requirements::
pip install -r optional_requirements.txt
Run the test suite::

51
pyproject.toml Normal file
View file

@ -0,0 +1,51 @@
# SPDX-FileCopyrightText: 2024 Jev Kuznetsov, ROX Automation
#
# SPDX-License-Identifier: MIT
[build-system]
requires = ["setuptools>=61.0", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "circup"
dynamic = ["version", "dependencies", "optional-dependencies"]
description = "A tool to manage/update libraries on CircuitPython devices."
readme = "README.rst"
authors = [{ name = "Adafruit Industries", email = "circuitpython@adafruit.com" }]
license = { file = "LICENSE" }
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Education",
"Topic :: Software Development :: Embedded Systems",
"Topic :: System :: Software Distribution"
]
keywords = ["adafruit", "blinka", "circuitpython", "micropython", "libraries"]
requires-python = ">=3.9"
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}
[tool.setuptools_scm]
[project.scripts]
circup = "circup:main"
[project.urls]
homepage = "https://github.com/adafruit/circup"
[tool.setuptools.packages.find]
where = ["."] # This tells setuptools to look in the project root directory
include = ["circup"] # This pattern includes your main package and any sub-packages within it

106
setup.py
View file

@ -1,106 +0,0 @@
# SPDX-FileCopyrightText: 2019 Nicholas Tollervey, written for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""A setuptools based setup module.
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
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()
install_requires = [
"semver~=3.0",
"Click>=8.0",
"appdirs>=1.4.3",
"requests>=2.22.0",
"findimports>=2.1.0",
"toml>=0.10.2",
# importlib_metadata is only available for 3.7, and is not needed for 3.8 and up.
"importlib_metadata; python_version == '3.7'",
"update_checker",
]
extras_require = {
"tests": [
"pytest",
"pylint",
"pytest-cov",
"pytest-random-order>=1.0.0",
"pytest-faulthandler",
"coverage",
"black",
],
"docs": ["sphinx"],
"package": [
# Wheel building and PyPI uploading
"wheel",
"twine",
],
}
extras_require["dev"] = (
extras_require["tests"] + extras_require["docs"] + extras_require["package"]
)
extras_require["all"] = list(
{req for extra, reqs in extras_require.items() for req in reqs}
)
setup(
name="circup",
use_scm_version=True,
setup_requires=["setuptools_scm"],
description="A tool to manage/update libraries on CircuitPython devices.",
long_description=long_description,
long_description_content_type="text/x-rst",
# The project's main homepage.
url="https://github.com/adafruit/circup",
# Author details
author="Adafruit Industries",
author_email="circuitpython@adafruit.com",
install_requires=install_requires,
extras_require=extras_require,
# Choose your license
license="MIT",
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Education",
"Topic :: Software Development :: Embedded Systems",
"Topic :: System :: Software Distribution",
],
entry_points={
"console_scripts": ["circup=circup:main", "wwshell=circup.wwshell:main"]
},
# What does your project relate to?
keywords="adafruit, blinka, circuitpython, micropython, libraries",
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
packages=["circup"],
package_data={"circup": ["config/bundle_config.json"]},
)