#πŸ”’ pip-tools environment variable expansion in containers not working as expected

5 messages Β· Page 1 of 1 (latest)

jovial abyss
#

I have a tilt environment spinning up a docker container that has a private repository as a dependency that looks something like
some_dep @ git+https://${USER}:${SECRET}@github.com/user/[email protected] in my requirements.in.

I have a cmd_button to run a script that sets up an environment within tilt & runs pip-compile --allow-unsafe requirements.in . (I would like to use --generate-hashes, but tags are apparently unhashable, planning on referencing a tar.gz as I believe that's hashable, but niether here nor there. A later me problem)
I have confirmed USER & SECRET are properly loaded into the script's environment, but when pip-compile is ran ${VARS} never expands, so the generation of requirements.txt fails. Hard coding the values works, but that's not a solution here. This issue https://github.com/jazzband/pip-tools/issues/966 is my intended behavior.

GitHub

Environment variables get expanded by pip-compile. This is especially unwanted when the variable describes a password or local path. Environment Versions Ubuntu 18.04 Python version: 3.7.4 pip vers...

dim perchBOT
#

@jovial abyss

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

jovial abyss
#

The environment variables are loaded into the script via the dotenv tilt extension. There's this https://stackoverflow.com/questions/75162964/pip-install-r-requirements-txt-doesnt-expand-my-environment-variables on the issue, but as far as I can tell the environment variables are correctly set in the context.

dim perchBOT
#

@jovial abyss

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.