Skip to content

Conversation

@MattSturgeon
Copy link
Contributor

@MattSturgeon MattSturgeon commented Dec 1, 2025

Summary

Fixes a build failure with recent nixpkgs and makes the package versioning clearer.

cc @beh-10257 @LovingMelody


What changed

  1. Configure flake lock commits
    nix flake lock / nix flake update now use conventional commits when run with --commit-lock-file.

  2. Update nixpkgs input
    Pulls in the latest nixpkgs, as it hasn't been bumped in a while.

  3. Use date-based versioning
    Nix builds now use 1.3.0-unstable-YYYY-MM-DD instead of commit hashes.
    This aligns with nixpkgs' version style and enables the next commit fixing versionCheckHook...
    The first part is read from umu/__init__.py, which is the canonical project version.

  4. Fix versionCheckHook
    Patch ensures the hook passes even though the Python package uses a slightly different version format.

  5. PEP-440 runtime version
    Python package __version__ is now ${version}.devYYYYMMDD, making the --version output more meaningful.

Testing

The nix package can't be built when tests fail, so I initially based this PR on the commit before #293, due to the test suite currently being broken on main.

Sadly, that lead to conflicts, so this is now rebased on main and cannot easiliy be tested. One way to test is adding doCheck = false to the package. Another way is to rebase on #574 which aims to fix the testsuite.


For users

  • The version you see in Python (__version__) or via --version is now PEP-440 compatible and includes a date, e.g. 1.3.0.dev20251130.
  • The version you see when inspecting the nix package attributes now follows the Nixpkgs style, e.g. 1.3.0-unstable-2025-11-30.

Configure `nix flake lock` and `nix flake update` to use conventional
commits when run with `--commit-lock-file`.
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/3a05eebede89661660945da1f151959900903b6a?narHash=sha256-Ly2fBL1LscV%2BKyCqPRufUBuiw%2BzmWrlJzpWOWbahplg%3D' (2025-02-26)
  → 'github:NixOS/nixpkgs/4c7d90a136071eb8154d6b3fe63b0046de9d4712?narHash=sha256-clj4TsIVqiFfvyu%2Bmfm3s94Y7iOP%2BeRa62wxzLUV49M%3D' (2025-11-30)
Switches from using commit hashes for the package version to using
`1.3.0-unstable-YYYY-MM-DD` date-based formatting, as described in:
https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#versioning
Nixpkgs recently added versionCheckHook to the package we override.

versionCheckHook expects `--version` to print the entire package
version, and it doesn't provide any way to override the version string
it expects without manually setting `version` in `preVersionCheck`.

Since the package version uses a different format to the build version,
the check fails. Patch it to ignore the -unstable-YY-MM-DD suffix.
While the package uses Nixpkgs compliant `${version}-unstable-${date}`
formatting, the actual build should use PEP-440 compliant
`${version}.dev${date}` formatting.

This makes things like `--version` more useful at runtime.

TODO: consider using unstable versioning in non-nix builds too.
@MattSturgeon
Copy link
Contributor Author

MattSturgeon commented Dec 1, 2025

Another way [to test] is to rebase on #574 which aims to fix the testsuite.

I've done this locally. This PR builds fine when rebased on that PR. Frustratingly, I had the same conflicts rebasing onto that as I did rebasing onto latest main, because #574 reverts the changes that conflict 😁

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.

1 participant