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

feat: Add session tags #627

Merged
merged 7 commits into from
Jun 21, 2022

Conversation

edgarrmondragon
Copy link
Contributor

Closes #339

@DiddiLeija
Copy link
Collaborator

Looks like a nice start. I haven't verified the behavior yet, but I think it's what we want (any thoughts @wntrblm/nox?). Also, I approved the CI runs to discard any failure.

@FollowTheProcess
Copy link
Collaborator

This is looking good. Although I've checked out your PR and can't seem to get the desired behaviour:

# noxfile.py

@nox.session(tags=["hello"])
def hello(session: nox.Session) -> None:
    """
    Does something.
    """
    session.log("hello")

When I run nox -t hello I get the following:

image

So not sure what's going on there?

It would also be really good to incorporate the tags somehow into the output of nox --list, although I think that would be better in a fresh PR, let's get the functionality merged first then work on how we show it

nox/manifest.py Outdated Show resolved Hide resolved
@edgarrmondragon
Copy link
Contributor Author

# noxfile.py

@nox.session(tags=["hello"])
def hello(session: nox.Session) -> None:
    """
    Does something.
    """
    session.log("hello")

@FollowTheProcess Thanks for reviewing. I tried it with your example and it's working as expected:

$ nox -t hello
nox > Running session hello
nox > Creating virtual environment (virtualenv) using python3.9 in .nox/hello
nox > hello
nox > Session hello was successful.

$ nox -k "hello or other"
nox > Running session hello
nox > Creating virtual environment (virtualenv) using python3.9 in .nox/hello
nox > hello
nox > Session hello was successful.

$ noxpy -k "not hello"
nox > No sessions selected after filtering by keyword.

@edgarrmondragon edgarrmondragon marked this pull request as ready for review June 17, 2022 00:54
Copy link
Collaborator

@FollowTheProcess FollowTheProcess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weirdly it worked fine for me after I removed and re-cloned the repo 🤷🏻 so obviously something to do with my laptop and not the code so we're all good there.

Just a few minor changes, otherwise this is looking great

docs/tutorial.rst Outdated Show resolved Hide resolved
nox/manifest.py Outdated Show resolved Hide resolved
docs/usage.rst Show resolved Hide resolved
nox/manifest.py Outdated Show resolved Hide resolved
tests/test_tasks.py Show resolved Hide resolved
Co-authored-by: Tom Fleet <tomfleet2018@gmail.com>
nox/manifest.py Outdated Show resolved Hide resolved
nox/manifest.py Outdated Show resolved Hide resolved
- Name the functions something completely different from the tags to
  ensure only tags are being to filter.
- Confirm that tags are case-insensitive.
nox/manifest.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@FollowTheProcess FollowTheProcess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @edgarrmondragon 🎉

@FollowTheProcess FollowTheProcess merged commit 1bd7f96 into wntrblm:main Jun 21, 2022
@edgarrmondragon edgarrmondragon deleted the feat-session-markers branch June 21, 2022 17:43
@DiddiLeija
Copy link
Collaborator

Thanks @edgarrmondragon! 🎉

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

Successfully merging this pull request may close these issues.

Add functionality similar to pytest.mark
4 participants