Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Feature/environment propagate #8534
Feature/environment propagate #8534
Changes from 2 commits
75ff512
3a585e5
5f323b1
16863a1
3fd4633
de6787e
7f86beb
a96287c
004ab8b
3d318e3
247f98c
997936b
fa0ca3d
e63890e
1a0abdf
1f66a6c
f78169a
b6dcb07
e3a3cf0
1482923
1d42450
935b3d0
15dbf07
4221d32
3798c78
4dbe0c0
e1bf328
c43ed63
3198d92
add3b79
9bfe52b
ac00b00
64f427d
ac44190
5247a74
d1be0f6
dca53ca
d89fe97
e8d5515
41bd889
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another point about Jinja: if you have those templates then you can just go through the list of templates and generate each one. This will be customizeable and easily extensible. For example add setting:
virtualenv.templates=buildenv.sh.j2,runenv.sh.j2,buildenv.fish.j2
(Also modules / blocks can be loaded from config file location).
I rewrote my generator in Jinja. The template is arguably easier to read but python code is significantly simpler without all if'ed logic.
Another benefit of such user-extensibility is that it would be easier to write plain
.env
files as @solvingj asked and which could be used in IDE (at least many VS Code plugins start supporting.env
files: python, C++ debugger).Also doing this as a template doesn't mean immediate decision to publish as a user-facing contract, but still (I believe) will reduce complexity of python code.
The only trick is to carefully handle this for pyinstaller / zip-friendlyness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree it would be great to provide templates for this, and provide user extensibility. At this point my priority is to define the new paradigm:
Still the problem of .env files is not fully clear. In Conan we clearly have the user demand for those different operations: append, prepend, define, unset, and those .env files cannot do that. Also, in Conan users might need to concatenate more than one environment definition (for example the definition coming from profiles and build-requires, and another definition coming from a toolchain), that both will need to perform different operations like appending. Those .env files cannot do this either, up to my knowledge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least in VS Code many plugins can use
.env
files instead of having settings. For example, python extension appendsPYTHONPATH
from it to its internal search path, C++ extension has similar option in debug configuration (for example to run program with modifiedLD_LIBRARY_PATH
).It may not even be possible to run IDE in such an activated environment, because, for example for workspace each folder (repo / project) has own settings / environment.
I'm not suggesting adding this by default, but some users may find it useful to customize and produce own files, even if they for example capture complete variables at the install time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may ctor receive arguments as loads? I see usage pattern is
x = ProfileEnvironment(); x.load(something)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, lets change it to
ProfileEnvirionment.loads(something)
staticmethod, as it will be more aligned with the rest of the codebase.