Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv-sort: init at 0.5.0 #388382

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

uv-sort: init at 0.5.0 #388382

wants to merge 2 commits into from

Conversation

aaronjheng
Copy link
Contributor

@aaronjheng aaronjheng commented Mar 9, 2025

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@bengsparks
Copy link

bengsparks commented Mar 9, 2025

@GaetanLepage this is the first package that makes use of uv-dynamic-versioning as part of the build process, so I assume this issue has remained undetected so far.

I tried to build this package using GitHub as a source, but it seems that uv-dynamic-versioning is not compatible with hatchling, due to not specifying its own version explicitly?

Here is the traceback
pypa build flags: --no-isolation --outdir dist/ --wheel
* Getting build dependencies for wheel...
* Building wheel...
Traceback (most recent call last):
  File "/nix/store/gxp46ny33gykgxsbkyas7b4d64rd27sy-python3.12-pyproject-hooks-1.2.0/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
    main()
  File "/nix/store/gxp46ny33gykgxsbkyas7b4d64rd27sy-python3.12-pyproject-hooks-1.2.0/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
    json_out["return_val"] = hook(**hook_input["kwargs"])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/gxp46ny33gykgxsbkyas7b4d64rd27sy-python3.12-pyproject-hooks-1.2.0/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
    return _build_backend().build_wheel(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/pcl9w887942hvk75rwgrbz5vnyqvvwqp-python3.12-hatchling-1.27.0/lib/python3.12/site-packages/hatchling/build.py", line 58, in build_wheel
    return os.path.basename(next(builder.build(directory=wheel_directory, versions=['standard'])))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/pcl9w887942hvk75rwgrbz5vnyqvvwqp-python3.12-hatchling-1.27.0/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 90, in build
    self.metadata.validate_fields()
  File "/nix/store/pcl9w887942hvk75rwgrbz5vnyqvvwqp-python3.12-hatchling-1.27.0/lib/python3.12/site-packages/hatchling/metadata/core.py", line 265, in validate_fields
    _ = self.version
        ^^^^^^^^^^^^
  File "/nix/store/pcl9w887942hvk75rwgrbz5vnyqvvwqp-python3.12-hatchling-1.27.0/lib/python3.12/site-packages/hatchling/metadata/core.py", line 149, in version
    self._version = self._get_version()
                    ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/pcl9w887942hvk75rwgrbz5vnyqvvwqp-python3.12-hatchling-1.27.0/lib/python3.12/site-packages/hatchling/metadata/core.py", line 248, in _get_version
    version = self.hatch.version.cached
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/pcl9w887942hvk75rwgrbz5vnyqvvwqp-python3.12-hatchling-1.27.0/lib/python3.12/site-packages/hatchling/metadata/core.py", line 1456, in cached
    raise type(e)(message) from None
RuntimeError: Error getting the version from source `uv-dynamic-versioning`: Unable to detect version control system. Checked: Git. Not installed: Mercurial, Darcs, Subversion, Bazaar, Fossil, Pijul.

ERROR Backend subprocess exited when trying to invoke build_wheel
error: builder for '/nix/store/wzhchk8rk8fkgb22h7wvyykbdw80dacn-uv-sort-0.5.0.drv' failed with exit code 1;
       last 25 log lines:
       >   File "/nix/store/gxp46ny33gykgxsbkyas7b4d64rd27sy-python3.12-pyproject-hooks-1.2.0/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
       >     json_out["return_val"] = hook(**hook_input["kwargs"])
       >                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/gxp46ny33gykgxsbkyas7b4d64rd27sy-python3.12-pyproject-hooks-1.2.0/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
       >     return _build_backend().build_wheel(
       >            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/pcl9w887942hvk75rwgrbz5vnyqvvwqp-python3.12-hatchling-1.27.0/lib/python3.12/site-packages/hatchling/build.py", line 58, in build_wheel
       >     return os.path.basename(next(builder.build(directory=wheel_directory, versions=['standard'])))
       >                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/pcl9w887942hvk75rwgrbz5vnyqvvwqp-python3.12-hatchling-1.27.0/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 90, in build
       >     self.metadata.validate_fields()
       >   File "/nix/store/pcl9w887942hvk75rwgrbz5vnyqvvwqp-python3.12-hatchling-1.27.0/lib/python3.12/site-packages/hatchling/metadata/core.py", line 265, in validate_fields
       >     _ = self.version
       >         ^^^^^^^^^^^^
       >   File "/nix/store/pcl9w887942hvk75rwgrbz5vnyqvvwqp-python3.12-hatchling-1.27.0/lib/python3.12/site-packages/hatchling/metadata/core.py", line 149, in version
       >     self._version = self._get_version()
       >                     ^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/pcl9w887942hvk75rwgrbz5vnyqvvwqp-python3.12-hatchling-1.27.0/lib/python3.12/site-packages/hatchling/metadata/core.py", line 248, in _get_version
       >     version = self.hatch.version.cached
       >               ^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/pcl9w887942hvk75rwgrbz5vnyqvvwqp-python3.12-hatchling-1.27.0/lib/python3.12/site-packages/hatchling/metadata/core.py", line 1456, in cached
       >     raise type(e)(message) from None
       > RuntimeError: Error getting the version from source `uv-dynamic-versioning`: Unable to detect version control system. Checked: Git. Not installed: Mercurial, Darcs, Subversion, Bazaar, Fossil, Pijul.
       >
       > ERROR Backend subprocess exited when trying to invoke build_wheel
       For full logs, run 'nix log /nix/store/wzhchk8rk8fkgb22h7wvyykbdw80dacn-uv-sort-0.5.0.drv'.

Perhaps this is what you are looking for?

Comment on lines +11 to +16

src = fetchPypi {
pname = "uv_sort";
inherit version;
hash = "sha256-qCShDuKBFS4omcsntZ1wzRtAKTbp8CfTw0IIAgxBvcE=";
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetchFromGitHub is preferred unless there is a compelling reason to not use it. If so, put in a comment

Copy link

@bengsparks bengsparks Mar 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment here shows that a build from GitHub does not work. I suppose @aaronjheng should document the error in a comment, unless Gaetan happens to fix it first.

Comment on lines +29 to +31
nativeCheckInputs = with python3Packages; [
pytestCheckHook
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit and not blocking, but for just one input here you probably don't need to use with and it'll increase eval times to remove it

typer
];

build-system = with python3Packages; [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, put build-system before dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants