Skip to main content

lsst_versions

This package is used to calculate a version dynamically from a Git repository when it is being built by pip. It is not needed for EUPS-only packages, and the calculated package version will be pip-compatible and thus differ from that produced by EUPS’s pkgautoversion. It avoids the need to hard-code and continually update a version string. It assumes the use of LSST DM release and tagging practices.

Development

This package uses uv to manage the library versions used for local development and CI. The versions are recorded in uv.lock and the tests are run in that locked environment:

uv run pytest
uv run mypy

Documentation is built from the doc dependency group, which requires Python 3.12 or later:

uv run --group doc sphinx-build -b html doc doc/_build/html

Run the following to refresh uv.lock with the latest available versions of all libraries:

uv lock --upgrade

lsst_versions 1.7.0 2026-09-09

New Features

  • The version calculation can now be run with python -m lsst_versions as well as through the lsst-version command. (DM-55986)

API Changes

  • lsst_versions.__version__ is now read from the installed package metadata using importlib.metadata rather than from a generated __version__.py file. It reports 0.0.0 if the package has not been installed.

    GitPython is now an unconditional requirement of this package rather than an optional import. The RuntimeError that was raised when it was missing has been removed.

    The public functions now accept any os.PathLike for the directory or repository they are given, rather than only a str. (DM-55986)

Bug Fixes

  • A version of 0+unknown is now reported when no version can be determined from Git or from package metadata, instead of raising an error. This allows a package to be built from a checkout with no Git history, such as a shallow clone. (DM-55985)

  • The Hatch version source plugin now calculates the version from the project root supplied by Hatch rather than from the current working directory. Previously a Hatch build started from a different directory could report the wrong version.

    The build system plugins no longer emit their own debug logging into the output of the package being built. A debug message was previously issued for every tag in the repository, which buried the output of tools that enable debug logging during a build, such as uv pip install -v. The informational message reporting the chosen version is retained. Set the LSST_VERSIONS_LOG_LEVEL environment variable to restore the debug messages.

    Repositories that do not use the LSST w.YYYY.WW weekly tagging convention are now versioned by semantic versioning. A tree built 22 commits after the 1.6.0 tag is therefore 1.6.1.dev22, which sorts above 1.6.0 and below 1.6.1. Previously such a repository combined the major version of its newest release with a commit count measured from the root of the repository, reporting 1.0.28 for that tree. (DM-55986)

Miscellaneous Changes of Minor Interest

  • All build configuration has been consolidated into pyproject.toml. The package is now built with an in-tree PEP 517 build backend. Library versions for development and CI are now managed with uv and recorded in uv.lock. The minimum supported setuptools version is now 77, matching the build requirements. (DM-55986)

An API Removal or Deprecation

  • The minimum supported Python version is now 3.11. This allows the standard library tomllib module to be used and the tomli dependency has been dropped. The dev and typing extras have been replaced by the dev dependency group, and doc/requirements.txt by the doc dependency group. (DM-55986)

lsst-versions 1.6.0 2025-01-21

New Features

Miscellaneous Changes of Minor Interest

  • Refreshes development and build environment specifications.

  • Removes retired pytest-openfiles testing dependency.

  • Uses secure tarfile data filter when supported by Python.

lsst-versions 1.5.0 2023-11-29

Package has been verified to work with python 3.12.

lsst-versions 1.4.0 2023-02-08

New Features

  • The calculation of the developer version has been modified. Previously alpha releases were constructed from weekly release tags. This approach, 26.0.0a20230500, resulted in confusion in PyPI installs once a formal release was made. To simplify installations with pip weekly developer release versions are now of the form 25.2023.500 – the weekly is encoded in the minor and patchlevel parts of the version and these are now releases derived from the release currently being worked (and not alphas towards the next release).

lsst-versions 1.3.0 2022-07-10

API Changes

  • Added a new function get_lsst_version. This allows to get a version string of a GitHub or metadata directory.

lsst-versions 1.2.0 2022-06-27

New Features

  • Now falls back to looking at PKG-INFO file if no git version can be determined. This allows a source distribution to be built.

  • The find_lsst_version API can now run without any parameters.

lsst-versions 1.1.0 2022-06-14

New Features

  • Added a new lsst-version command line that can be used to determine the version of a package. This command can also be used to create a version file in the package using the configuration found in a pyproject.toml file. (DM-35064)

API Changes

  • Renamed the find_dev_lsst_version function to find_lsst_version to reflect the fact that it does more than finding developer versions. (DM-35064)

Miscellaneous Changes of Minor Interest

    • Replaced some debug prints with logging.

    • Significantly improved the test coverage. (DM-35064)

lsst-versions 1.0.0 2022-04-18

New Features

  • Initial release of lsst-versions package. This package can be used as a setuptools entry point to determine the version of a package from the Git repository. (DM-32408)

Metadata

Release files for lsst-versions 1.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lsst-versions 1.7.0
File Size Uploaded
lsst_versions-1.7.0.tar.gz 22.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lsst-versions 1.7.0
File Interpreter ABI Platform
lsst_versions-1.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.0 kB

Release files / lsst_versions-1.7.0.tar.gz

Download URL lsst_versions-1.7.0.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d013d919e2474438ccf73d3f6ec38401a4ad942f7c91ed1b5664c22ba0b67dec
BLAKE2b-256 checksum
How to use checksums
49daa936d5feb355779498e43d1ebcb674be4e1849614d808bc1f208e5421532
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsst_versions-1.7.0-py3-none-any.whl

Download URL lsst_versions-1.7.0-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
335fe15279ae49d4dd5f022676b00e81325962b3424e39d33a1e9d6b623ddb7b
BLAKE2b-256 checksum
How to use checksums
c3cd3c4871c3dc0167bf88a221da9fc87548ece53487518ec101517c1a82062e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.7.0 This release

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page