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

environment fails to find system-site-packages #1451

Open
jnikula opened this issue May 2, 2024 · 5 comments
Open

environment fails to find system-site-packages #1451

jnikula opened this issue May 2, 2024 · 5 comments

Comments

@jnikula
Copy link

jnikula commented May 2, 2024

My project uses libclang and its python bindings. These need to be installed via the distro's package manager; the clang bindings on pypi aren't official, nor are they guaranteed to be compatible with the libclang installed. So I rely on the system site packages. (On Debian, they all get installed via apt install python3-clang.)

I've used this, and it has worked fine:

python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install --requirement requirements.txt --upgrade
pip install --config-settings editable_mode=strict --editable .
pytest -n auto

However, my attempts at getting this to work with hatch environments have been unsuccesful.

[tool.hatch.envs.default]
system-site-packages = true
upgrade = true

[tool.hatch.envs.test]
dependencies = [
    "pytest",
    "pytest-cov",
    "pytest-xdist",
    "strictyaml",
]

[tool.hatch.envs.test.scripts]
run = "pytest -n auto"

The requirements.txt file contains pretty much the same stuff as [tool.hatch.envs.test], in particular clang isn't mentioned there. It's supposed to come from the system.

However, hatch run test:run fails to find the clang package.

Any clues on how to debug this or make it work?

@ofek
Copy link
Sponsor Collaborator

ofek commented May 2, 2024

How was Hatch installed?

@jnikula
Copy link
Author

jnikula commented May 2, 2024

How was Hatch installed?

pipx

@jnikula
Copy link
Author

jnikula commented May 8, 2024

@ofek Any further questions, things to try?

@ofek
Copy link
Sponsor Collaborator

ofek commented May 8, 2024

Does it work if you use the version of Hatch that your distribution provides?

@jnikula
Copy link
Author

jnikula commented May 8, 2024

Does it work if you use the version of Hatch that your distribution provides?

AFAICT Debian doesn't provide Hatch via apt.

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

2 participants