From a084f3fcda24a35a0c80ecedbed115897cf85a33 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Thu, 21 Jul 2022 19:11:38 -0400 Subject: [PATCH 1/2] Allow __version__ population, fix problem matchers --- .github/workflows/build.yml | 7 +++++-- .github/workflows/release.yml | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2957d4e..22f6582 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,6 +47,8 @@ jobs: pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit - name: Library version run: git describe --dirty --always --tags + - name: Setup problem matchers + uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1 - name: Pre-commit hooks run: | pre-commit run --all-files @@ -68,7 +70,8 @@ jobs: if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') run: | 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/* - - name: Setup problem matchers - uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d8218f..d1b4f8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,5 +81,8 @@ jobs: TWINE_USERNAME: ${{ secrets.pypi_username }} TWINE_PASSWORD: ${{ secrets.pypi_password }} run: | + 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 -m build twine upload dist/* From 86223ba6ce2fa81c13b22f0709f40f0b4dad18ef Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Fri, 22 Jul 2022 19:08:44 -0400 Subject: [PATCH 2/2] Fix pyproject.toml for dynamic __version population --- pyproject.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c966152..37cc915 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ requires = [ [project] name = "adafruit-circuitpython-veml7700" description = "CircuitPython driver for VEML7700 high precision I2C ambient light sensor." +version = "0.0.0-auto.0" readme = "README.rst" authors = [ {name = "Adafruit Industries", email = "circuitpython@adafruit.com"} @@ -38,12 +39,10 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", ] -dynamic = ["version", "dependencies"] +dynamic = ["dependencies"] [tool.setuptools] py-modules = ["adafruit_veml7700"] [tool.setuptools.dynamic] dependencies = {file = ["requirements.txt"]} - -[tool.setuptools_scm]