Skip to content

Commit 196a1c1

Browse files
WIP: Restructure: Split into setuptools-scm/ and vcs-versioning/ workspace
Major repository restructure to support monorepo workspace: Structure changes: - Move all setuptools-scm files to setuptools-scm/ subdirectory - Hoist vcs-versioning from nextgen/ to vcs-versioning/ at root - Rename test directories: testing/ → testing_scm/, testingB/ → testing_vcs/ - Keep docs/ and mkdocs.yml at root for shared documentation - Use hyphenated directory names to prevent Python imports Configuration updates: - Root pyproject.toml: workspace-only config with uv workspace members - Root pytest.ini: global test paths for both projects - Per-project pyproject.toml with updated testpaths and uv default-groups - Update mkdocs.yml paths for multi-project documentation - Update GitHub Actions workflows for new paths - Update MANIFEST.in for testing_scm directory - Simplify _own_version_helper.py to use entrypoints This commit is for uv workspace debugging - the workspace setup needs investigation as uv sync currently fails with metadata errors.
1 parent a265596 commit 196a1c1

File tree

104 files changed

+401
-376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+401
-376
lines changed

.github/workflows/api-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ jobs:
4646
run: |
4747
echo "Comparing current code against tag: ${{ steps.latest-tag.outputs.tag }}"
4848
# Use local check_api.py script which includes griffe-public-wildcard-imports extension
49-
uv run python check_api.py --against ${{ steps.latest-tag.outputs.tag }}
49+
uv run python setuptools-scm/check_api.py --against ${{ steps.latest-tag.outputs.tag }}

.github/workflows/python-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
matrix:
2727
include:
2828
- name: vcs-versioning
29-
path: nextgen/vcs-versioning
29+
path: vcs-versioning
3030
suffix: -vcs-versioning
3131
- name: setuptools-scm
32-
path: .
32+
path: setuptools-scm
3333
suffix: -setuptools-scm
3434
env:
3535
# Use no-local-version for package builds to ensure clean versions for PyPI uploads
@@ -132,7 +132,7 @@ jobs:
132132
# this hopefully helps with os caches, hg init sometimes gets 20s timeouts
133133
- run: hg version
134134
- name: Run tests for both packages
135-
run: uv run pytest testing/ nextgen/vcs-versioning/testingB/
135+
run: uv run pytest setuptools-scm/testing_scm/ vcs-versioning/testing_vcs/
136136
timeout-minutes: 25
137137

138138
dist_upload:

README.md

Lines changed: 29 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,53 @@
1-
# setuptools-scm
2-
[![github ci](https://github.com/pypa/setuptools-scm/actions/workflows/python-tests.yml/badge.svg)](https://github.com/pypa/setuptools-scm/actions/workflows/python-tests.yml)
3-
[![Documentation Status](https://readthedocs.org/projects/setuptools-scm/badge/?version=latest)](https://setuptools-scm.readthedocs.io/en/latest/?badge=latest)
4-
[![tidelift](https://tidelift.com/badges/package/pypi/setuptools-scm) ](https://tidelift.com/subscription/pkg/pypi-setuptools-scm?utm_source=pypi-setuptools-scm&utm_medium=readme)
1+
# setuptools-scm Monorepo
52

6-
## about
3+
This is the monorepo for the setuptools-scm ecosystem, containing two main projects:
74

8-
[setuptools-scm] extracts Python package versions from `git` or `hg` metadata
9-
instead of declaring them as the version argument
10-
or in a Source Code Managed (SCM) managed file.
5+
## Projects
116

12-
Additionally [setuptools-scm] provides `setuptools` with a list of
13-
files that are managed by the SCM
14-
<br/>
15-
(i.e. it automatically adds all the SCM-managed files to the sdist).
16-
<br/>
17-
Unwanted files must be excluded via `MANIFEST.in`
18-
or [configuring Git archive][git-archive-docs].
7+
### [setuptools-scm](./setuptools-scm/)
198

20-
> **⚠️ Important:** Installing setuptools-scm automatically enables a file finder that includes **all SCM-tracked files** in your source distributions. This can be surprising if you have development files tracked in Git/Mercurial that you don't want in your package. Use `MANIFEST.in` to exclude unwanted files. See the [documentation] for details.
9+
The main package that extracts Python package versions from Git or Mercurial metadata and provides setuptools integration.
2110

22-
## `pyproject.toml` usage
11+
**[Read setuptools-scm documentation →](./setuptools-scm/README.md)**
2312

24-
The preferred way to configure [setuptools-scm] is to author
25-
settings in a `tool.setuptools_scm` section of `pyproject.toml`.
13+
### [vcs-versioning](./vcs-versioning/)
2614

27-
This feature requires setuptools 61 or later (recommended: >=80 for best compatibility).
28-
First, ensure that [setuptools-scm] is present during the project's
29-
build step by specifying it as one of the build requirements.
15+
Core VCS versioning functionality extracted as a standalone library that can be used independently of setuptools.
3016

31-
```toml title="pyproject.toml"
32-
[build-system]
33-
requires = ["setuptools>=80", "setuptools-scm>=8"]
34-
build-backend = "setuptools.build_meta"
35-
```
36-
37-
That will be sufficient to require [setuptools-scm] for projects
38-
that support [PEP 518] like [pip] and [build].
39-
40-
[pip]: https://pypi.org/project/pip
41-
[build]: https://pypi.org/project/build
42-
[PEP 518]: https://peps.python.org/pep-0518/
43-
44-
45-
To enable version inference, you need to set the version
46-
dynamically in the `project` section of `pyproject.toml`:
17+
**[Read vcs-versioning documentation →](./vcs-versioning/README.md)**
4718

48-
```toml title="pyproject.toml"
49-
[project]
50-
# version = "0.0.1" # Remove any existing version parameter.
51-
dynamic = ["version"]
19+
## Development
5220

53-
[tool.setuptools_scm]
54-
```
55-
56-
!!! note "Simplified Configuration"
57-
58-
Starting with setuptools-scm 8.1+, if `setuptools_scm` (or `setuptools-scm`) is
59-
present in your `build-system.requires`, the `[tool.setuptools_scm]` section
60-
becomes optional! You can now enable setuptools-scm with just:
21+
This workspace uses [uv](https://github.com/astral-sh/uv) for dependency management.
6122

62-
```toml title="pyproject.toml"
63-
[build-system]
64-
requires = ["setuptools>=80", "setuptools-scm>=8"]
65-
build-backend = "setuptools.build_meta"
23+
### Running Tests
6624

67-
[project]
68-
dynamic = ["version"]
69-
```
25+
```bash
26+
# Run all tests
27+
uv run pytest -n12
7028

71-
The `[tool.setuptools_scm]` section is only needed if you want to customize
72-
configuration options.
29+
# Run tests for setuptools-scm only
30+
uv run pytest setuptools-scm/testing_scm -n12
7331

74-
Additionally, a version file can be written by specifying:
75-
76-
```toml title="pyproject.toml"
77-
[tool.setuptools_scm]
78-
version_file = "pkg/_version.py"
32+
# Run tests for vcs-versioning only
33+
uv run pytest vcs-versioning/testing_vcs -n12
7934
```
8035

81-
Where `pkg` is the name of your package.
36+
### Building Documentation
8237

83-
If you need to confirm which version string is being generated or debug the configuration,
84-
you can install [setuptools-scm] directly in your working environment and run:
38+
Documentation is shared across projects:
8539

86-
```console
87-
$ python -m setuptools_scm
88-
# To explore other options, try:
89-
$ python -m setuptools_scm --help
40+
```bash
41+
uv run mkdocs serve
9042
```
9143

92-
For further configuration see the [documentation].
93-
94-
[setuptools-scm]: https://github.com/pypa/setuptools-scm
95-
[documentation]: https://setuptools-scm.readthedocs.io/
96-
[git-archive-docs]: https://setuptools-scm.readthedocs.io/en/stable/usage/#builtin-mechanisms-for-obtaining-version-numbers
97-
98-
99-
## Interaction with Enterprise Distributions
100-
101-
Some enterprise distributions like RHEL7
102-
ship rather old setuptools versions.
103-
104-
In those cases its typically possible to build by using an sdist against `setuptools-scm<2.0`.
105-
As those old setuptools versions lack sensible types for versions,
106-
modern [setuptools-scm] is unable to support them sensibly.
107-
108-
It's strongly recommended to build a wheel artifact using modern Python and setuptools,
109-
then installing the artifact instead of trying to run against old setuptools versions.
110-
111-
!!! note "Legacy Setuptools Support"
112-
While setuptools-scm recommends setuptools >=80, it maintains compatibility with setuptools 61+
113-
to support legacy deployments that cannot easily upgrade. Support for setuptools <80 is deprecated
114-
and will be removed in a future release. This allows enterprise environments and older CI/CD systems
115-
to continue using setuptools-scm while still encouraging adoption of newer versions.
116-
117-
118-
## Code of Conduct
119-
120-
121-
Everyone interacting in the [setuptools-scm] project's codebases, issue
122-
trackers, chat rooms, and mailing lists is expected to follow the
123-
[PSF Code of Conduct].
44+
## Links
12445

125-
[PSF Code of Conduct]: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
46+
- **Documentation**: https://setuptools-scm.readthedocs.io/
47+
- **Repository**: https://github.com/pypa/setuptools-scm/
48+
- **Issues**: https://github.com/pypa/setuptools-scm/issues
12649

50+
## License
12751

128-
## Security Contact
52+
Both projects are distributed under the terms of the MIT license.
12953

130-
To report a security vulnerability, please use the
131-
[Tidelift security contact](https://tidelift.com/security).
132-
Tidelift will coordinate the fix and disclosure.

_own_version_helper.py

Lines changed: 0 additions & 85 deletions
This file was deleted.

mkdocs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ theme:
1313
name: material
1414

1515
watch:
16-
- src/setuptools_scm
16+
- setuptools-scm/src/setuptools_scm
17+
- vcs-versioning/src/vcs_versioning
1718
- docs
1819
markdown_extensions:
1920
- def_list
@@ -31,7 +32,7 @@ plugins:
3132
default_handler: python
3233
handlers:
3334
python:
34-
paths: [ src, nextgen/vcs-versioning/src ]
35+
paths: [ setuptools-scm/src, vcs-versioning/src ]
3536
import:
3637
- https://docs.python.org/3/objects.inv
3738
options:

nextgen/vcs-versioning/tests/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)