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

Strange assumptions made about poetry virtualenvs #113

Open
rvodden opened this issue Oct 23, 2022 · 1 comment
Open

Strange assumptions made about poetry virtualenvs #113

rvodden opened this issue Oct 23, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@rvodden
Copy link

rvodden commented Oct 23, 2022

Describe the bug

Poetry build is making very strange assumptions about the nature of the virtualenv which poetry creates.

Current behavior

As far as I'm aware I have a completely normal poetry setup. I'm using pyenv to manage my virtual environments. When I run bi poetry install i get the following output:

[Error] failed extracting python site package form the following virtual env "/home/rvodden/.pyenv/versions/3.10.7/envs/library"

Reproduction steps

install pyenv
create a virtualenv using pyenv
create a poetry project in that virtualenv
run bi poetry install

Expected behavior

I'd expect bi to use correct semantics to establish the location of site-packages. For example, this command:

poetry run python -c 'import site; print(site.getsitepackages())'

will reliably report the location of site-packages. I don't really follow the logic which is employed to extract the site-packages location here:
https://github.com/jfrog/build-info-go/blob/main/utils/pythonutils/poetryutils.go#L211-L217

It looks to be making very specific assumptions about how virtualenvs are arranged which at first glance would appear to be more likely to be incorrect than correct in the majority of circumstances

Operating system type and version

ubuntu 20.04 i686

@rvodden rvodden added the bug Something isn't working label Oct 23, 2022
@rvodden rvodden changed the title (short issue description) Strange assumptions made about poetry virtualenvs Oct 23, 2022
@rvodden
Copy link
Author

rvodden commented Oct 24, 2022

I have raised the following pull request to address this issue. Note that my original suggestion of using the site package doesn't work when using the python virtualenv module, and so I've used the sysconfig package instead.

#114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant