Open sivogel opened 2 months ago
Could you please complete your error report?
However, I guess that we simply need to change this code:
with _clean_environment(session):
if numpy == "1":
session.run("pip", "install", "numpy<2")
elif numpy == "2":
session.run("pip", "install", "numpy>1,<3")
else:
assert_never(numpy)
session.run("python", "hydpy/tests/run_doctests.py", *session.posargs)
to that one:
if numpy == "1":
session.run("pip", "install", "numpy<2")
elif numpy == "2":
session.run("pip", "install", "numpy>1,<3")
else:
assert_never(numpy)
with _clean_environment(session):
session.run("python", "hydpy/tests/run_doctests.py", *session.posargs)
Could you please verify and, if it works, open a pull request?
Oh pardon. Somehow the second part got lost: The following part did not work due to a SSL connection error (no proxy set for pip install)
with _clean_environment(session):
if numpy == "1":
session.run("pip", "install", "numpy<2")
elif numpy == "2":
session.run("pip", "install", "numpy>1,<3")
Removing the with _clean_environment(session):
(from the whole statement) helped to run the session. Could you please explain why do you need the _clean_environment for the run_doctest session?
I added the _clean_environment
context manager to get the HydPy-Server doctests running, which were hanging in some cases when the environment variable HTTP_PROXY
or HTTPS_PROXY
was set. However, I don't know if it is still required after the change introduced in commit 7bb80bfd.
In my case (behind a proxy) it is not needed (I run it without last week). But I think it also was no problem before, because localhost is added to my NO_PROXY environment variable. I think we can completely remove it.
But removing _clean_environment
would mean some nox sessions would not run if HTTP_PROXY
is set without NO_PROXY
being defined as you explained. We would have to explain this somewhere in the documentation. Hence, I see no advantage in removing _clean_environment
compared to fixing the problem as suggested.
I think setting up a proxy that ignores all local addresses is pretty standard. I would like to discuss this with Holger. He is more familiar this topic.
I have problems running the nox doctest session behind a proxy. The command "session.run("pip", "install", "numpy<2")" needs the proxy to be set. If I remove "with _clean_environment(session):"