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

Export Session in __init__ #343

Closed
layday opened this issue Sep 3, 2020 · 1 comment · Fixed by #344
Closed

Export Session in __init__ #343

layday opened this issue Sep 3, 2020 · 1 comment · Fixed by #344

Comments

@layday
Copy link
Contributor

layday commented Sep 3, 2020

How would this feature be useful?
Currently, if you'd like to annotate nox callbacks, for e.g. type checking, code completion or docstring lookup, you have to import Session from nox.sessions:

import nox
from nox.sessions import Session


@nox.session
def foo(session: Session):
    ...

Re-exporting Session in __init__ would 'jibe' with nox's global object approach and would perhaps make typing in nox more accessible.

Describe the solution you'd like
For the Session class to be imported/re-exported in nox.__init__ so as to not require a separate import.

Describe alternatives you've considered
Importing Session from nox.sessions, as above.

@theacodes
Copy link
Collaborator

theacodes commented Sep 3, 2020 via email

theacodes pushed a commit that referenced this issue Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants