Skip to content

Commit

Permalink
Merge pull request #214 from sjev/1-switch-from-setuppy-to-pyprojecttoml
Browse files Browse the repository at this point in the history
switch from setuppy to pyprojecttoml
  • Loading branch information
FoamyGuy committed Jun 3, 2024
2 parents 74b07be + 524e552 commit 0227af6
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 123 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
- 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/*
17 changes: 13 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"]
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
104 changes: 0 additions & 104 deletions setup.py

This file was deleted.

0 comments on commit 0227af6

Please sign in to comment.