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

Using module as project dependecy #26

Open
enzofrnt opened this issue Oct 20, 2024 · 0 comments
Open

Using module as project dependecy #26

enzofrnt opened this issue Oct 20, 2024 · 0 comments

Comments

@enzofrnt
Copy link

Hi,

i'm trying to use the module as a project dependency. But i'm getting weird behavior.

Here outside the environment that not working and that normal :

Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ poetry run python -c 'import os; print(os.environ.get("COUCOU"))'
None
Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ cat .env
COUCOU=enzo%                                                                                                                                                                                                     
Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ poetry run python -c 'import os; print(os.environ.get("COUCOU"))'
None
Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ poetry self show plugins                                         

  - poetry-plugin-export (1.8.0) Poetry plugin to export the dependencies to various formats
      1 application plugin

      Dependencies
        - poetry (>=1.8.0,<3.0.0)
        - poetry-core (>=1.7.0,<3.0.0)
Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ 

And now inside the environment of the project :

Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ poetry shell            
Spawning shell within /Users/enzofournet/Library/Caches/pypoetry/virtualenvs/flopedt-quziCqDd-py3.12
Book • ➜  ~/Github Repo/flop-migration-docker/work/back/flopedt-django emulate bash -c '. /Users/enzofournet/Library/Caches/pypoetry/virtualenvs/flopedt-quziCqDd-py3.12/bin/activate'
(flopedt-py3.12) Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ cat .env
COUCOU=enzo%                                                                                                                                                                                                     
(flopedt-py3.12) Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ echo $COUCOU

(flopedt-py3.12) Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ python -c 'import os; print(os.environ.get("COUCOU"))'
None
(flopedt-py3.12) Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ poetry run python -c 'import os; print(os.environ.get("COUCOU"))'
enzo
(flopedt-py3.12) Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ 
(flopedt-py3.12) Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ which python 
/Users/enzofournet/Library/Caches/pypoetry/virtualenvs/flopedt-quziCqDd-py3.12/bin/python
(flopedt-py3.12) Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ poetry self show plugins                                         

  - poetry-dotenv-plugin (0.2.0) A Poetry plugin to automatically load environment variables from .env files
      1 application plugin

      Dependencies
        - poetry (>=1.2.0a1)
        - python-dotenv (>=0.10.0)

  - poetry-plugin-export (1.8.0) Poetry plugin to export the dependencies to various formats
      1 application plugin

      Dependencies
        - poetry (>=1.8.0,<3.0.0)
        - poetry-core (>=1.7.0,<3.0.0)
(flopedt-py3.12) Book • ➜  ~/somewhere:(118-solver-tests-2) ✗ 

That is strange because when I'm already inside the virtual environment I need to use the poetry command while I'm already inside the venv is it a normal behavior ?

Thank you.

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

1 participant