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

Handling psycopg2-binary dependency #143

Closed
misuzu opened this issue Aug 26, 2024 · 2 comments
Closed

Handling psycopg2-binary dependency #143

misuzu opened this issue Aug 26, 2024 · 2 comments

Comments

@misuzu
Copy link

misuzu commented Aug 26, 2024

Suppose I have the psycopg2-binary package in a pyproject.toml, the nixpkgs doesn't have this package so this won't evaluate.
But nixpkgs has the equivalent psycopg2 package.
How do I tell pyproject.nix to use psycopg2 instead of psycopg2-binary without editing the pyproject.toml?
I've tried just making an alias (psycopg2-binary = psycopg2;), but it fails to build (psycopg2-binary not installed).

@misuzu misuzu changed the title Handling psycopg2-binary package Handling psycopg2-binary dependency Aug 26, 2024
@adisbladis
Copy link
Member

This is nixpkgs python-check-deps hook failing to find psycopg2-binary. The hook is using Python packaging metadata to ensure the environment that is present in the build outputs.

Normally I'd tell you that you need to package a wheel in your Python overlay, but in this instance I think we should fix it in nixpkgs by adding a fake psycopg2-binary package that can satisfy the runtime dependency, but still use the psycopg2 build.

See NixOS/nixpkgs#337621.

@adisbladis
Copy link
Member

Not an issue in pyproject.nix per se. Closing.

@adisbladis adisbladis closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2024
adisbladis added a commit to adisbladis/nixpkgs that referenced this issue Aug 29, 2024
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
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

No branches or pull requests

3 participants
@adisbladis @misuzu and others