-
Notifications
You must be signed in to change notification settings - Fork 94
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
wrapper script: consider clearing PYTHONPATH #5124
Comments
(Tagged 8.1.0 but could go into 8.0.x if we can agree a solution in time) |
Note: Users might need |
Unfortunately not everyone uses the wrapper! E.g. single user installations. What about explicitly cleaning |
I'm not sure that would work? The Python CLI options are probably a better bet. Note that all Cylc users use a wrapper script, not necessarily the Cylc wrapper script, but the one generated for them by pypi or Conda so we might be able to change things there too. Unfortunately I think we might actually need to bodge |
Note, this impacts Rose worse than Cylc, however, with Rose we actually need the PYTHONPATH to be preserved because it will be required for the Rose "command". |
Perhaps we need to save the PYTHONPATH in another environment variable which Rose can use before running the "command". |
That's sounding like the best option, note the variable would have to be set in the wrapper-script and restored in the rose library code. |
Suggestion, in the Cylc wrapper script:
For context, here's a common practice:
|
I think that I've done the rose end, but the wrapper script is proving trickier. We don't really want to cache |
We advise that Cylc is installed into an isolated environment (e.g. conda / virtualenv). Unfortunately the
PYTHONPATH
environment variable can corrupt these.Illustrative example (less extreme cases can cause problems too):
This is very inconvenient for users who rely on
PYTHONPATH
(e.g. to load their own Python environment) as they have to unload this environment before they can run Cylc commands. If Cylc is installed in an isolated environment, then it should be isolated from stuff like this.We might be able to do something like this:
Otherwise, there is the nuclear [Python] option:
Probably a good idea? But it does have the unwelcome side-effect of disabling
PYTHONBREAKPOINT
.And also:
Could do with a bit of investigation to work out what the consequences of these approaches are.
Pull requests welcome!
The text was updated successfully, but these errors were encountered: