-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
mkPythonMetaPackage: init meta package function (and psycopg2-binary) #337621
Conversation
8635489
to
0c2bdf9
Compare
0c2bdf9
to
9382b96
Compare
pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix
Outdated
Show resolved
Hide resolved
9382b96
to
e2959d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This seems to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
I wonder if it would make sense to turn this into a function to produce such a package that could also be used for e.g. https://pypi.org/project/phonenumberslite/
e2959d2
to
472b732
Compare
Good idea! I've added a |
472b732
to
226544e
Compare
This function exists create a meta package containing [metadata files](https://packaging.python.org/en/latest/specifications/recording-installed-packages/) to satisfy a dependency on a package, without it actually having been installed into the environment.
226544e
to
f3aee82
Compare
Pscycopg2-binary is normally used in Python development to avoid having to build psycopg2 from source. In nixpkgs we always want ot build from source whenever possible, but it can still be useful to provide a psycopg2-binary package. This "fake" package exists to satisfy a dependency on psycopg2-binary, but still use the build from psycopg2. cc @misuzu nix-community/pyproject.nix#143
f3aee82
to
d3e7844
Compare
In NixOS#337621 I had initially created an empty, but importable package, meaning that initial tests worked just fine, because the top_level.txt file is always created when an importable package exists. Subsequent refactors removed the importable package, but didn't verify that the dependency satisfaction still works, only that the metadata output looked good. It was a bit tricky to express what I wanted to with hatchling, so I switched to setuptools.
In NixOS#337621 I had initially created an empty, but importable package, meaning that initial tests worked just fine. Subsequent refactors removed the importable package, but didn't verify that the dependency satisfaction still works, only that the metadata output looked good.
Description of changes
Adds a function
mkPythonMetaPackage
that exists to satisfy a dependency on a package, but don't actually build it.This is useful for packages that have a split binary/source dichotomy like psycopg2/psycopg2-binary, where we want to use the former, but some projects declare a dependency on the latter.
This PR:
mkPythonMetaPackage
functionpsycopg2-binary
that uses itOverride hacks could be dropped from:
cc @misuzu nix-community/pyproject.nix#143
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.