Skip to content

Use current working directory when searching for .env#336

Merged
laserb merged 1 commit into
projectsyn:masterfrom
haasad:fix/search-dotenv-in-cwd
Jun 25, 2021
Merged

Use current working directory when searching for .env#336
laserb merged 1 commit into
projectsyn:masterfrom
haasad:fix/search-dotenv-in-cwd

Conversation

@laserb

@laserb laserb commented Jun 25, 2021

Copy link
Copy Markdown
Contributor

The .env was only found if it is placed next to the virtualenv.
If the virtualenv is in another directory, then the .env was ignored and commodore failed.
Fix it by searching the .env in current directory.

Checklist

  • Keep pull requests small so they can be easily reviewed.
  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog

@laserb laserb added the bug Something isn't working label Jun 25, 2021
@laserb laserb requested a review from simu June 25, 2021 09:24

@simu simu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Just to clarify the issue description: from what I can tell, the issue doesn't stem from the relative location of the virtualenv in respect to the .env file but rather the relative location of the Commodore package compared to the .env file, since the old implementation works fine for me with .env in /home/simon/work/syn/commodore and the Poetry virtualenv in /home/simon/.cache/pypoetry/virtualenvs/commodore-mfZDsTMQ-py3.9.

@laserb

laserb commented Jun 25, 2021

Copy link
Copy Markdown
Contributor Author

Yes, the relative location of the .env and the commodore.cli is important. dotenv searches in the parent folders of commodore.cli. It fails if you do not run it with poetry run. I.e. install it with poetry install or pip.

@laserb laserb merged commit 421d5bc into projectsyn:master Jun 25, 2021
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

Successfully merging this pull request may close these issues.

3 participants