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 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, ) 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 "_".