Skip to content

Commit 411e933

Browse files
Merge branch 'main' into main
2 parents 1f49a81 + 45eb1b2 commit 411e933

Some content is hidden

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

59 files changed

+423
-227
lines changed

.github/workflows/python-tests.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ jobs:
2626
with:
2727
fetch-depth: 0
2828

29-
- uses: hynek/build-and-inspect-python-package@v1
29+
- uses: hynek/build-and-inspect-python-package@v2
3030

3131
test:
3232
needs: [package]
3333
runs-on: ${{ matrix.os }}
3434
strategy:
3535
fail-fast: false
3636
matrix:
37-
python_version: [ '3.8', '3.9', '3.10', '3.11', '3.12.0-beta - 3.12', 'pypy-3.8' ]
37+
python_version: [ '3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.10' ]
3838
os: [windows-latest, ubuntu-latest] #, macos-latest]
3939
include:
4040
- os: windows-latest
@@ -43,8 +43,10 @@ jobs:
4343
name: ${{ matrix.os }} - Python ${{ matrix.python_version }}
4444
steps:
4545
- uses: actions/checkout@v4
46+
with:
47+
fetch-depth: 0
4648
- name: Setup python
47-
uses: actions/setup-python@v4
49+
uses: actions/setup-python@v5
4850
if: matrix.python_version != 'msys2'
4951
with:
5052
python-version: ${{ matrix.python_version }}
@@ -80,7 +82,7 @@ jobs:
8082
git config --system gpg.program "C:\Program Files (x86)\gnupg\bin\gpg.exe"
8183
if: runner.os == 'Windows'
8284
- run: pip install -U 'setuptools>=61'
83-
- uses: actions/download-artifact@v3
85+
- uses: actions/download-artifact@v4
8486
with:
8587
name: Packages
8688
path: dist
@@ -89,7 +91,7 @@ jobs:
8991
- run: |
9092
$(hg debuginstall --template "{pythonexe}") -m pip install hg-git --user
9193
if: matrix.os == 'ubuntu-latest'
92-
# this hopefull helps with os caches, hg init sometimes gets 20s timeouts
94+
# this hopefully helps with os caches, hg init sometimes gets 20s timeouts
9395
- run: hg version
9496
- run: pytest
9597
timeout-minutes: 15
@@ -102,7 +104,7 @@ jobs:
102104
id-token: write
103105
needs: [test]
104106
steps:
105-
- uses: actions/download-artifact@v3
107+
- uses: actions/download-artifact@v4
106108
with:
107109
name: Packages
108110
path: dist
@@ -115,7 +117,7 @@ jobs:
115117
permissions:
116118
id-token: write
117119
steps:
118-
- uses: actions/download-artifact@v3
120+
- uses: actions/download-artifact@v4
119121
with:
120122
name: Packages
121123
path: dist

.pre-commit-config.yaml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,25 @@
1-
default_language_version:
2-
python: python3.9
31
repos:
4-
- repo: https://github.com/psf/black
5-
rev: 23.9.1
6-
hooks:
7-
- id: black
8-
args: [--safe, --quiet]
9-
exclude: docs/examples/
10-
- repo: https://github.com/asottile/reorder-python-imports
11-
rev: v3.11.0
12-
hooks:
13-
- id: reorder-python-imports
14-
args: [ "--application-directories=.:src" , --py38-plus, --add-import, 'from __future__ import annotations']
152
- repo: https://github.com/pre-commit/pre-commit-hooks
16-
rev: v4.4.0
3+
rev: v4.5.0
174
hooks:
185
- id: trailing-whitespace
196
- id: check-yaml
207
- id: debug-statements
21-
- repo: https://github.com/PyCQA/flake8
22-
rev: 6.1.0
23-
hooks:
24-
- id: flake8
25-
- repo: https://github.com/asottile/pyupgrade
26-
rev: v3.13.0
27-
hooks:
28-
- id: pyupgrade
29-
args: [--py38-plus]
308
- repo: https://github.com/astral-sh/ruff-pre-commit
31-
rev: v0.0.291
9+
rev: v0.3.0
3210
hooks:
3311
- id: ruff
3412
args: [--fix, --exit-non-zero-on-fix]
13+
- id: ruff-format
14+
3515
- repo: https://github.com/tox-dev/pyproject-fmt
36-
rev: "1.1.0"
16+
rev: "1.7.0"
3717
hooks:
3818
- id: pyproject-fmt
3919
exclude: docs/examples/
4020

4121
- repo: https://github.com/pre-commit/mirrors-mypy
42-
rev: 'v1.5.1'
22+
rev: 'v1.8.0'
4323
hooks:
4424
- id: mypy
4525
args: [--strict]

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100

101101
# v7.0.5
102102

103-
- fixes #742, #745: correctly hande accidentally released archival files
103+
- fixes #742, #745: correctly handle accidentally released archival files
104104

105105
# v7.0.4
106106

@@ -484,7 +484,7 @@ v3.0.3 (pulled from pypi due to a packaging issue) ======
484484

485485
v1.15.7 ======
486486

487-
- Fix #174 with #207: Re-use samefile backport as developed in
487+
- Fix #174 with #207: Reuse samefile backport as developed in
488488
jaraco.windows, and only use the backport where samefile is not
489489
available.
490490

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ Unwanted files must be excluded via `MANIFEST.in`.
2020
The preferred way to configure [setuptools-scm] is to author
2121
settings in a `tool.setuptools_scm` section of `pyproject.toml`.
2222

23-
This feature requires setuptools 60 or later.
23+
This feature requires setuptools 61 or later.
2424
First, ensure that [setuptools-scm] is present during the project's
2525
build step by specifying it as one of the build requirements.
2626

27-
```toml
27+
```toml title="pyproject.toml"
2828
[build-system]
29-
requires = [
30-
"setuptools>=60",
31-
"setuptools-scm>=8.0"]
29+
requires = ["setuptools>=64", "setuptools_scm>=8"]
30+
build-backend = "setuptools.build_meta"
3231
```
3332

3433
That will be sufficient to require [setuptools-scm] for projects
@@ -46,6 +45,7 @@ dynamically in the `project` section of `pyproject.toml`:
4645
[project]
4746
# version = "0.0.1" # Remove any existing version parameter.
4847
dynamic = ["version"]
48+
4949
[tool.setuptools_scm]
5050
```
5151

_own_version_helper.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@
55
it works only if the backend-path of the build-system section
66
from pyproject.toml is respected
77
"""
8+
89
from __future__ import annotations
910

1011
import logging
11-
from typing import Callable
1212

13-
from setuptools import build_meta as build_meta # noqa
13+
from typing import Callable
1414

15-
from setuptools_scm import _types as _t
15+
from setuptools import build_meta as build_meta
1616
from setuptools_scm import Configuration
17+
from setuptools_scm import _types as _t
1718
from setuptools_scm import get_version
1819
from setuptools_scm import git
1920
from setuptools_scm import hg
2021
from setuptools_scm.fallbacks import parse_pkginfo
22+
from setuptools_scm.version import ScmVersion
2123
from setuptools_scm.version import get_local_node_and_date
2224
from setuptools_scm.version import guess_next_dev_version
23-
from setuptools_scm.version import ScmVersion
2425

2526
log = logging.getLogger("setuptools_scm")
2627
# todo: take fake entrypoints from pyproject.toml
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
### Changed
3+
4+
- fix #957 - add subprocess timeout control env var
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
### Added
3+
4+
- fix #960: add a ``--force-write-version-files`` flag for the cli
5+
6+
-->
7+
<!--
8+
### Changed
9+
10+
- A bullet item for the Changed category.
11+
12+
-->
13+
<!--
14+
### Deprecated
15+
16+
- A bullet item for the Deprecated category.
17+
18+
-->
19+
<!--
20+
### Fixed
21+
22+
- A bullet item for the Fixed category.
23+
24+
-->
25+
<!--
26+
### Security
27+
28+
- A bullet item for the Security category.
29+
30+
-->
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
### Fixed
3+
4+
- fix #1018: allow non-normalized versions for semver

docs/config.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ Callables or other Python objects have to be passed in `setup.py` (via the `use_
2727
!!! warning ""
2828

2929
Only files with `.py` and `.txt` extensions have builtin templates,
30-
for other file types it is necessary to provide `write_to_template`.
30+
for other file types it is necessary to provide `version_file_template`.
31+
32+
`version_file_template: str | None = None`
33+
: A new-style format string taking `version`, `scm_version` and `version_tuple` as parameters.
34+
`version` is the generated next_version as string,
35+
`version_tuple` is a tuple of split numbers/strings and
36+
`scm_version` is the `ScmVersion` instance the current `version` was rendered from
3137

32-
`version_file_template_template: str | None = None`
33-
: A new-style format string that is given the current version as
34-
the `version` keyword argument for formatting.
3538

3639
`write_to: Pathlike[str] | Path | None = None`
3740
: (deprecated) legacy option to create a version file relative to the scm root
@@ -108,17 +111,22 @@ Callables or other Python objects have to be passed in `setup.py` (via the `use_
108111
: used as the primary source for the version number
109112
in which case it will be an unparsed string
110113

111-
!!! warning "it is strongly recommended to use use distribution name specific pretend versions"
114+
!!! warning ""
112115

116+
it is strongly recommended to use distribution-specific pretend versions
117+
(see below).
113118

114119
`SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${NORMALIZED_DIST_NAME}`
115-
: used as the primary source for the version number
116-
in which case it will be an unparsed string
120+
: used as the primary source for the version number,
121+
in which case it will be an unparsed string.
122+
Specifying distribution-specific pretend versions will
123+
avoid possible collisions with third party distributions
124+
also using ``setuptools_scm``
117125

118126
the dist name normalization follows adapted PEP 503 semantics, with one or
119-
more of ".-_" being replaced by a single "_", and the name being upper-cased
127+
more of ".-\_" being replaced by a single "\_", and the name being upper-cased
120128

121-
it takes precedence over ``SETUPTOOLS_SCM_PRETEND_VERSION``
129+
this will take precedence over ``SETUPTOOLS_SCM_PRETEND_VERSION``
122130

123131
`SETUPTOOLS_SCM_DEBUG`
124132
: enable the debug logging

docs/customizing.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,10 @@ setup(use_scm_version={"version_scheme": myversion_func})
3131
```
3232

3333

34-
``` { .python title="pyproject.toml" file="docs/examples/version_scheme_code/pyproject.toml" }
34+
``` { .toml title="pyproject.toml" file="docs/examples/version_scheme_code/pyproject.toml" }
3535
[build-system]
36-
requires = [
37-
"setuptools>=64",
38-
"setuptools_scm>=8",
39-
"wheel",
40-
]
36+
requires = ["setuptools>=64", "setuptools_scm>=8"]
37+
build-backend = "setuptools.build_meta"
4138

4239
[project]
4340
name = "scm-example"
@@ -49,9 +46,6 @@ dynamic = [
4946
```
5047

5148
- [ ] add a build block that adds example output
52-
- [ ] correct config after [entangled mkdocs bug] is fixed
53-
54-
[entangled mkdocs bug]: https://github.com/entangled/mkdocs-plugin/issues/1
5549

5650

5751

0 commit comments

Comments
 (0)