Skip to content

Commit 731ae4d

Browse files
Merge pull request #1207 from pypa/main
sync main to develop
2 parents 5413460 + 6bf6746 commit 731ae4d

28 files changed

+1168
-1252
lines changed

.github/workflows/api-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020

2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2323
with:
2424
fetch-depth: 0
2525

.github/workflows/python-tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
SETUPTOOLS_SCM_NO_LOCAL: "1"
2828

2929
steps:
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v5
3131
with:
3232
fetch-depth: 0
3333

@@ -50,7 +50,7 @@ jobs:
5050

5151
name: ${{ matrix.os }} - Python ${{ matrix.python_version }}
5252
steps:
53-
- uses: actions/checkout@v4
53+
- uses: actions/checkout@v5
5454
with:
5555
fetch-depth: 0
5656
- name: Setup python
@@ -92,7 +92,7 @@ jobs:
9292
git config --system gpg.program "C:\Program Files (x86)\gnupg\bin\gpg.exe"
9393
if: runner.os == 'Windows'
9494
- run: uv sync --group test --group docs --extra rich
95-
- uses: actions/download-artifact@v4
95+
- uses: actions/download-artifact@v5
9696
with:
9797
name: Packages
9898
path: dist
@@ -114,7 +114,7 @@ jobs:
114114
id-token: write
115115
needs: [test]
116116
steps:
117-
- uses: actions/download-artifact@v4
117+
- uses: actions/download-artifact@v5
118118
with:
119119
name: Packages
120120
path: dist
@@ -128,7 +128,7 @@ jobs:
128128
permissions:
129129
contents: write
130130
steps:
131-
- uses: actions/download-artifact@v4
131+
- uses: actions/download-artifact@v5
132132
with:
133133
name: Packages
134134
path: dist
@@ -145,7 +145,7 @@ jobs:
145145
permissions:
146146
id-token: write
147147
steps:
148-
- uses: actions/download-artifact@v4
148+
- uses: actions/download-artifact@v5
149149
with:
150150
name: Packages
151151
path: dist

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,5 @@ coverage.xml
5151

5252
# Sphinx documentation
5353
docs/_build/
54+
55+
.serena/cache/

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: trailing-whitespace
66
- id: check-yaml
77
- id: debug-statements
88

99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.12.7
10+
rev: v0.12.8
1111
hooks:
1212
- id: ruff-check
1313
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
@@ -33,7 +33,7 @@ repos:
3333
- id: sp-repo-review
3434

3535
- repo: https://github.com/codespell-project/codespell
36-
rev: v2.3.0
36+
rev: v2.4.1
3737
hooks:
3838
- id: codespell
3939
args: [-w, --ignore-words-list=hist,nd,te]

.serena/memories/done_checklist.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Before considering a task done
2+
3+
- Code quality
4+
- Ruff clean: uv run ruff check .
5+
- Types clean: uv run mypy
6+
- Tests
7+
- All tests green: uv run pytest
8+
- New/changed behavior covered with tests (use project fixtures)
9+
- Docs
10+
- Update docs if user-facing behavior changed
11+
- Build docs cleanly: uv run mkdocs build --clean --strict
12+
- Packaging
13+
- If relevant: uv run python -m build && uv run twine check dist/*
14+
- Housekeeping
15+
- Follow existing naming and module structure; keep functions focused and typed
16+
- Update `CHANGELOG.md` when appropriate

.serena/memories/project_overview.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Project: setuptools-scm
2+
3+
Purpose
4+
- Extract and infer Python package versions from SCM metadata (Git/Mercurial) at build/runtime.
5+
- Provide setuptools integrations (dynamic version, file finders) and fallbacks for archival/PKG-INFO.
6+
7+
Tech Stack
8+
- Language: Python (3.8–3.13)
9+
- Packaging/build: setuptools (>=61), packaging; console scripts via entry points
10+
- Tooling: uv (dependency and run), pytest, mypy (strict), ruff (lint, isort), mkdocs (docs), tox (optional/matrix), wheel/build
11+
12+
Codebase Structure (high level)
13+
- src/setuptools_scm/: library code
14+
- _cli.py, __main__.py: CLI entry (`python -m setuptools_scm`, `setuptools-scm`)
15+
- git.py, hg.py, hg_git.py: VCS parsing
16+
- _file_finders/: discover files for sdist
17+
- _integration/: setuptools and pyproject integration
18+
- version.py and helpers: version schemes/local version logic
19+
- discover.py, fallbacks.py: inference and archival fallbacks
20+
- testing/: pytest suite and fixtures
21+
- docs/: mkdocs documentation
22+
- pyproject.toml: project metadata, pytest and ruff config
23+
- tox.ini: alternate CI/matrix, flake8 defaults
24+
- uv.lock: locked dependencies
25+
26+
Conventions
27+
- Use uv to run commands (`uv run ...`); tests live under `testing/` per pytest config.
28+
- Type hints throughout; strict mypy enforced; ruff governs lint rules and import layout (isort in ruff).
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Style and Conventions
2+
3+
- Typing
4+
- mypy strict is enabled; add precise type hints for public functions/classes.
5+
- Prefer explicit/clear types; avoid `Any` and unsafe casts.
6+
- Linting/Imports
7+
- Ruff is the canonical linter (config in pyproject). Respect its rules and isort settings (single-line imports, ordered, types grouped).
8+
- Flake8 config exists in tox.ini but ruff linting is primary.
9+
- Formatting
10+
- Follow ruff guidance; keep lines <= 88 where applicable (flake8 reference).
11+
- Testing
12+
- Pytest with `testing/` as testpath; default 5m timeout; warnings treated as errors.
13+
- Use existing fixtures; add `@pytest.mark` markers if needed (see pyproject markers).
14+
- Logging
15+
- Tests run with log level info/debug; avoid noisy logs in normal library code.
16+
- General
17+
- Small, focused functions; early returns; explicit errors. Keep APIs documented with concise docstrings.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Environment
2+
- Install deps (uses default groups test, docs):
3+
- uv sync
4+
5+
Core Dev
6+
- Run tests:
7+
- uv run pytest
8+
- Lint (ruff):
9+
- uv run ruff check .
10+
- uv run ruff check . --fix # optional autofix
11+
- Type check (mypy strict):
12+
- uv run mypy
13+
- Build docs:
14+
- uv run mkdocs serve --dev-addr localhost:8000
15+
- uv run mkdocs build --clean --strict
16+
17+
Entrypoints / Tooling
18+
- CLI version/debug:
19+
- uv run python -m setuptools_scm --help
20+
- uv run python -m setuptools_scm
21+
- uv run setuptools-scm --help
22+
- Build dist and verify:
23+
- uv run python -m build
24+
- uv run twine check dist/*
25+
- Optional matrix via tox:
26+
- uv run tox -q
27+
28+
Git/Linux Utilities (Linux host)
29+
- git status / git log --oneline --graph --decorate
30+
- ls -la; find . -name "pattern"; grep -R "text" .

.serena/project.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# language of the project (csharp, python, rust, java, typescript, go, cpp, or ruby)
2+
# * For C, use cpp
3+
# * For JavaScript, use typescript
4+
# Special requirements:
5+
# * csharp: Requires the presence of a .sln file in the project folder.
6+
language: python
7+
8+
# whether to use the project's gitignore file to ignore files
9+
# Added on 2025-04-07
10+
ignore_all_files_in_gitignore: true
11+
# list of additional paths to ignore
12+
# same syntax as gitignore, so you can use * and **
13+
# Was previously called `ignored_dirs`, please update your config if you are using that.
14+
# Added (renamed)on 2025-04-07
15+
ignored_paths: []
16+
17+
# whether the project is in read-only mode
18+
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
19+
# Added on 2025-04-18
20+
read_only: false
21+
22+
23+
# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
24+
# Below is the complete list of tools for convenience.
25+
# To make sure you have the latest list of tools, and to view their descriptions,
26+
# execute `uv run scripts/print_tool_overview.py`.
27+
#
28+
# * `activate_project`: Activates a project by name.
29+
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
30+
# * `create_text_file`: Creates/overwrites a file in the project directory.
31+
# * `delete_lines`: Deletes a range of lines within a file.
32+
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
33+
# * `execute_shell_command`: Executes a shell command.
34+
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
35+
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
36+
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
37+
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
38+
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file or directory.
39+
# * `initial_instructions`: Gets the initial instructions for the current project.
40+
# Should only be used in settings where the system prompt cannot be set,
41+
# e.g. in clients you have no control over, like Claude Desktop.
42+
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
43+
# * `insert_at_line`: Inserts content at a given line in a file.
44+
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
45+
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
46+
# * `list_memories`: Lists memories in Serena's project-specific memory store.
47+
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
48+
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
49+
# * `read_file`: Reads a file within the project directory.
50+
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
51+
# * `remove_project`: Removes a project from the Serena configuration.
52+
# * `replace_lines`: Replaces a range of lines within a file with new content.
53+
# * `replace_symbol_body`: Replaces the full definition of a symbol.
54+
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
55+
# * `search_for_pattern`: Performs a search for a pattern in the project.
56+
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
57+
# * `switch_modes`: Activates modes by providing a list of their names
58+
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
59+
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
60+
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
61+
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
62+
excluded_tools: []
63+
64+
# initial prompt for the project. It will always be given to the LLM upon activating the project
65+
# (contrary to the memories, which are loaded on demand).
66+
initial_prompt: ""
67+
68+
project_name: "setuptools_scm"

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## v9.2.0
4+
5+
### Added
6+
7+
- add simplified activation via `setuptools-scm[simple]` extra
8+
9+
A new streamlined way to enable version inference without requiring a `[tool.setuptools_scm]` section.
10+
When `setuptools-scm[simple]` is in `build-system.requires` and `version` is in `project.dynamic`,
11+
version inference is automatically enabled with default settings.
12+
13+
14+
### removed
15+
16+
- unchecked simplified activation - too many projects use setups where it would fail
17+
18+
### changed
19+
20+
- refine activation logic and add unittest for the relevant cases instead of trying to speedrun setuptools
21+
322
## v9.1.1
423

524
### fixed

0 commit comments

Comments
 (0)