Skip to content

fix: Use missing-argument sentinel for dump_version argument#1286

Merged
RonnyPfannschmidt merged 2 commits intopypa:mainfrom
effigies:scm_version_sentinel
Mar 27, 2026
Merged

fix: Use missing-argument sentinel for dump_version argument#1286
RonnyPfannschmidt merged 2 commits intopypa:mainfrom
effigies:scm_version_sentinel

Conversation

@effigies
Copy link
Copy Markdown
Contributor

@effigies effigies commented Mar 9, 2026

#1183 added a warning that it claimed could be silenced by passing scm_version=None, but it uses None as its missing value sentinel, meaning the warning can never be silenced. This uses a sentinel object as a default value, so that passing None does successfully silence the warning and opt in to default behavior.

@effigies effigies force-pushed the scm_version_sentinel branch 4 times, most recently from 5c3f4d5 to 7494a71 Compare March 9, 2026 18:49
@RonnyPfannschmidt
Copy link
Copy Markdown
Contributor

the warning intentionally happens at missing parameter - the parameter is required
allowing it to be missing is a curtsey for downstream users - anyone using it should fix the code

@effigies
Copy link
Copy Markdown
Contributor Author

The warning says to pass None to silence the warning, but None is the sentinel used, so the warning cannot be silenced.

@RonnyPfannschmidt
Copy link
Copy Markdown
Contributor

You are right thanks for calling out
out
Ill have to decide on a transition tineline

@RonnyPfannschmidt
Copy link
Copy Markdown
Contributor

I can merge/ release after a changelog fragment is added

@effigies effigies force-pushed the scm_version_sentinel branch from 7494a71 to 5f018e9 Compare March 26, 2026 13:32
@RonnyPfannschmidt RonnyPfannschmidt merged commit 8c23c5b into pypa:main Mar 27, 2026
27 checks passed
@effigies effigies deleted the scm_version_sentinel branch March 27, 2026 16:05
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Mar 29, 2026
## 10.0.5 (2026-03-27)

### Fixed

- Allow `dump_version()` deprecation warning to be silenced by passing `scm_version=None`. ([#1286](pypa/setuptools-scm#1286))
- Remove `[tool.uv.sources]` from `setuptools-scm/pyproject.toml` to fix sdist builds outside the workspace — the workspace root already declares the source mapping for development. ([#1330](pypa/setuptools-scm#1330))

## 10.0.4 (2026-03-27)

### Fixed

- Anchor ``get_version`` in ``setup.py`` with ``relative_to`` and ``fallback_root`` so SCM fallbacks (e.g. ``PKG-INFO``) do not resolve against the wrong directory when the build cwd is the workspace or repo root. ([#1302](pypa/setuptools-scm#1302))
- Enter ``GlobalOverrides`` for ``SETUPTOOLS_SCM`` when using ``setuptools_scm.get_version`` / ``_get_version``, avoiding implicit context warnings for direct API callers. ([#1314](pypa/setuptools-scm#1314))


### Miscellaneous

- Upgrade pre-commit hooks (Ruff, mypy, codespell), align locked Ruff with hooks, and add Ruff per-file configuration for setuptools_scm re-export modules. ([#1311](pypa/setuptools-scm#1311))

## 10.0.3 (2026-03-26)

### Fixed

- Remove monorepo-only ``../vcs-versioning/src`` from ``build-system.backend-path`` so sdists install under PEP 517 (paths must stay inside the source tree). ([#1306](pypa/setuptools-scm#1306))


### Miscellaneous

- Add `griffecli` to test dependencies so the API stability check keeps working after the Griffe CLI was split into a separate package. ([#1310](pypa/setuptools-scm#1310))

## 10.0.2 (2026-03-25)

### Fixed

- Fix version file not generated for editable installs. Version files are now written to the source tree by default during inference (restoring pre-10.x behavior), and also registered as ``build_py`` outputs so strict editable installs include them in the persistent auxiliary directory. Set ``SETUPTOOLS_SCM_WRITE_TO_SOURCE=0`` to disable source-tree writing (e.g., for read-only source directories). ([#1298](pypa/setuptools-scm#1298))

## 10.0.1 (2026-03-09)

### Miscellaneous

- Simplify release tag creation to use a single ``createRelease`` API call instead of separate ``createTag``/``createRef``/``createRelease`` calls, avoiding dangling tag objects on partial failures. ([#release-pipeline](https://github.com/pypa/setuptools-scm/issues/release-pipeline))

## 10.0.0 (2026-02-26)

### Removed

- Drop Python 3.8 and 3.9 support. Minimum Python version is now 3.10. ([#1228](pypa/setuptools-scm#1228))


### Added

- setuptools-scm now depends on vcs-versioning for core version inference logic. This enables other build backends to use the same version inference without setuptools dependency. ([#1228](pypa/setuptools-scm#1228))
- Version files (``write_to`` and ``version_file``) are now written to the build directory
  during ``build_py`` instead of the source tree during version inference.
  This enables installing packages from read-only source directories (e.g., Bazel builds).

  Path transformation is automatically applied for ``src/`` layouts - a configured path like
  ``src/mypackage/_version.py`` is correctly written to ``mypackage/_version.py`` in the
  build directory based on the ``package_dir`` configuration.

  To restore the old behavior of writing version files at inference time (useful for
  development workflows), set the environment variable ``SETUPTOOLS_SCM_WRITE_TO_SOURCE=1``. ([#1252](pypa/setuptools-scm#1252))


### Fixed

- Fix issue #1231: Don't warn about tool.setuptools.dynamic.version conflict when only using file finder without version inference. ([#1231](pypa/setuptools-scm#1231))


### Miscellaneous

- Refactored should_infer from method to standalone function for better code organization. ([#1228](pypa/setuptools-scm#1228))
- Updated mypy version template test to use uvx, ensuring generated version files remain compatible with Python 3.8+ consumers. ([#1228](pypa/setuptools-scm#1228))
- Refactored TestBuildPackageWithExtra into parametrized function with custom INI-based decorator for cleaner test data specification. ([#1228](pypa/setuptools-scm#1228))
- Internal refactoring: modernized type annotations, improved CLI type safety, and enhanced release automation infrastructure. ([#1228](pypa/setuptools-scm#1228))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants