From 35ce615953bdc42a983f9e87872ac9df51e09c77 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 10 Jan 2025 15:24:05 -0600 Subject: [PATCH 1/3] Fix version in circuitpython-stubs the configuration that tried to use setuptools_scm was broken. Instead, provides circuitpython-stubs' setup.py with the version determined by setuptools_scm running in the git source directory. --- Makefile | 2 +- setup.py-stubs | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 30966918c3651..bc8a9e05a53b6 100644 --- a/Makefile +++ b/Makefile @@ -268,7 +268,7 @@ stubs: @$(PYTHON) tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR) @$(PYTHON) tools/extract_pyi.py ports/espressif/bindings $(STUBDIR) @$(PYTHON) tools/extract_pyi.py ports/raspberrypi/bindings $(STUBDIR) - @cp setup.py-stubs circuitpython-stubs/setup.py + @sed -e "s,__version__,`python -msetuptools_scm`," < setup.py-stubs > circuitpython-stubs/setup.py @cp README.rst-stubs circuitpython-stubs/README.rst @cp MANIFEST.in-stubs circuitpython-stubs/MANIFEST.in @$(PYTHON) tools/board_stubs/build_board_specific_stubs/board_stub_builder.py diff --git a/setup.py-stubs b/setup.py-stubs index 9cea5f7eeffd3..68412fd18929f 100644 --- a/setup.py-stubs +++ b/setup.py-stubs @@ -45,12 +45,7 @@ setup( packages=list(package_data.keys()), package_data=package_data, package_dir = package_dir, - setup_requires=["setuptools_scm", "setuptools>=38.6.0"], - use_scm_version = { - "root": "..", - "relative_to": __file__, - "local_scheme": local_scheme, - "git_describe_command": "tools/describe --long", - }, + setup_requires=["setuptools>=38.6.0"], + version="__version__", zip_safe=False, ) From 91ed9fa1b3e6d70bd92bd35f2302d9fa355004e9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 10 Jan 2025 16:41:19 -0600 Subject: [PATCH 2/3] Ensure git version info is available when building docs in CI (also need to check on rtd!) --- .github/actions/deps/submodules/action.yml | 2 +- .github/workflows/build.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/deps/submodules/action.yml b/.github/actions/deps/submodules/action.yml index 6878c5e7e5da9..3a5b83bb06a0c 100644 --- a/.github/actions/deps/submodules/action.yml +++ b/.github/actions/deps/submodules/action.yml @@ -22,7 +22,7 @@ inputs: - restore version: - description: 'Whether to generate CP version' + description: 'Whether to fetch tags to identify CP version' required: false default: false type: boolean diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d37baebdc15d..28f24abe93dd8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -183,6 +183,8 @@ jobs: python-version: 3.x - name: Set up submodules uses: ./.github/actions/deps/submodules + with: + version: true - name: Install dependencies run: | sudo apt-get update From f914995660225fdb72f05d8651c90646b228cffa Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 11 Jan 2025 12:36:21 -0600 Subject: [PATCH 3/3] setuptools_scm now needed during 'make check-stubs' --- tools/test-stubs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test-stubs.sh b/tools/test-stubs.sh index 907604aee5d7f..2339960fd7c92 100755 --- a/tools/test-stubs.sh +++ b/tools/test-stubs.sh @@ -2,7 +2,7 @@ rm -rf test-stubs python3 -m venv test-stubs . test-stubs/bin/activate -pip install mypy isort black adafruit-circuitpython-typing wheel build +pip install mypy isort black adafruit-circuitpython-typing wheel build setuptools_scm rm -rf circuitpython-stubs .mypy_cache make stubs # Allow either dash or underscore as separator. setuptools v69.3.0 changed from "-" to "_".