[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-21 Thread Vinay Sajip
Vinay Sajip added the comment: > I'll take a stab at implementing this [custom_script_path] I'll certainly look at a PR for this functionality. -- ___ Python tracker ___

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Caleb Donovick
Caleb Donovick added the comment: I have another idea, instead of baking in the semantics of the environmental variables, we could simply add the hooks __VENV_ACTIVATE_EXTRAS__ and __VENV_DEACTIVATE_EXTRAS__ to activate. By default they would be replaced by '', but would allow subclasses to

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Caleb Donovick
Caleb Donovick added the comment: >PowerShell has a full programming language and all details can be found in >pyvenv.cfg now as of Python 3.8. So Activate.ps1 can read that file to get >what it needs to set paths and the prompt which is what gets substituted into >the generate

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Vinay Sajip
Vinay Sajip added the comment: > Is there an architecture that would be less objectionable? One thing I would consider is the ability to configure a custom_script_path in the same way as other parameters are now. It would be used as follows: If not None, it should specify a directory, and

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Brett Cannon
Brett Cannon added the comment: > I am curious how you plan to achieve this without reducing the functionality > of venv? PowerShell has a full programming language and all details can be found in pyvenv.cfg now as of Python 3.8. So Activate.ps1 can read that file to get what it needs to

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Caleb Donovick
Caleb Donovick added the comment: > I didn't say environment variables weren't commonly used. I'm talking about > the specific functionality this issue is about. This is likely true, to most people venv is black magic. That doesn't mean that people wouldn't use it if the functionality

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Brett Cannon
Brett Cannon added the comment: I mentioned on python-ideas and opened https://bugs.python.org/issue37354 to actually make the Activate.ps1 file static for security purposes. -- nosy: +brett.cannon ___ Python tracker

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Vinay Sajip
Vinay Sajip added the comment: > Common python libraries that make use of environmental variables I didn't say environment variables weren't commonly used. I'm talking about the specific functionality this issue is about. > Overriding setup scripts is hardly a trivial task. One has to

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Caleb Donovick
Caleb Donovick added the comment: In regards to the added complexity by needing to be implemented across all shells, the functionality I am requesting already exists across all shells (e.g. setting PYTHONPATH) just not in a extensible way. -- ___

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Caleb Donovick
Caleb Donovick added the comment: Common python libraries that make use of environmental variables: - django - flask - jupyter - TensorFlow This is just off the top my head. While most developers are probably fine just setting the required variables at a system level that doesn't mean they

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Vinay Sajip
Vinay Sajip added the comment: I'm not very keen on this approach, because it needs to be implemented across all shells and maintenance in this area can be a headache because not everyone has knowledge of multiple shells. There already are hooks for customising behaviour - you can subclass

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- components: +Library (Lib) -Interpreter Core nosy: +vinay.sajip versions: +Python 3.9 ___ Python tracker ___

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Caleb Donovick
Caleb Donovick added the comment: I have basic version working in POSIX. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Caleb Donovick
Change by Caleb Donovick : -- keywords: +patch pull_requests: +14096 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14272 ___ Python tracker ___

[issue37349] venv.EnvBuilder environmental variable hooks

2019-06-20 Thread Caleb Donovick
New submission from Caleb Donovick : Currently EnvBuilder allows for a number of customizations of virtual environments, however, it does not allow for any modifications of the activate script itself (unless one wants to rewrite it completely). Yet, it is fairly common requirement for