Skip to content

Commit c0c4cf0

Browse files
committed
build: Use setuptools-scm to list files and generate sdist version
This partially reverts previous commit 16727ac "build: Restore documentation and test files in sdist" to finally implement the first solution (use `setuptools-scm`). Indeed, this solution allows fixing another one: generate unique tags on each push on GitHub [^1]. The downside is that we have to manually exclude files that aren't supposed to be embedded in the source distribution. [^1]: #721 (comment)
1 parent 16727ac commit c0c4cf0

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.github/workflows/publish.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ jobs:
1313
- uses: actions/checkout@v4
1414
with:
1515
persist-credentials: false
16+
- name: Fetch git tags
17+
run: |
18+
git fetch --prune --unshallow
19+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
1620
- name: Set up Python
1721
uses: actions/setup-python@v5
1822
with:

MANIFEST.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
include *.rst
2-
include docs/Makefile docs/*.py docs/*.rst docs/*.png
3-
include tests/*.py tests/rules/*.py tests/yaml-1.2-spec-examples/example-*
1+
exclude .* .github/**

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,12 @@ documentation = "https://yamllint.readthedocs.io"
4242

4343
[build-system]
4444
build-backend = "setuptools.build_meta"
45-
requires = ["setuptools >= 61"]
45+
requires = ["setuptools >= 61", "setuptools-scm >= 8"]
4646

4747
[tool.setuptools]
4848
packages = ["yamllint", "yamllint.conf", "yamllint.rules"]
4949

5050
[tool.setuptools.package-data]
5151
yamllint = ["conf/*.yaml"]
5252

53-
[tool.setuptools.dynamic]
54-
version = {attr = "yamllint.__version__"}
53+
[tool.setuptools_scm]

0 commit comments

Comments
 (0)