Skip to content
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

How to install default packages to all sessions ? #731

Open
12rambau opened this issue Jul 27, 2023 · 1 comment
Open

How to install default packages to all sessions ? #731

12rambau opened this issue Jul 27, 2023 · 1 comment

Comments

@12rambau
Copy link

12rambau commented Jul 27, 2023

How would this feature be useful?

I'm working in an Azure devOps company environment so we use a custom feed for our private Python packages. In my CI I set an environment variable PIP_EXTRA_INDEX_URL to have access to this feed.
As this is an env variable it will crash if I don't start by installing both keyring and artifacts-keyring for authentication.

At the moment I'm forced to run the following in each session definition:

@nox.session(reuse_venv=True)
def something(session):
    session.install("keyring", "artifacts-keyring") # need to be the first thing I do
    session.install("pre-commit")
    session.run("pre-commit", "run", "--a", *session.posargs)
@alberto-gomezcasado-AP
Copy link

I think what is missing is the inverse of session.notify("other_session") + share the venv. Right now you can construct a chain of things that are done after, but not what should be done before.

Something like session.require("common", share_venv=True), which would invoke the "common" session where you define whatever you need as preparation BEFORE the rest of this session, and it is executed on the venv of the invoking session. The notify alone does not cut it because from the point of view of common you have no idea of what should be done after.

The share_venv would also be useful for .notify, so you can pile up actions happening on the same environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants