Skip to content

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

@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

Co-authored-by: Tom Fleet <tomfleet2018@gmail.com>
- Name the functions something completely different from the tags to
  ensure only tags are being to filter.
- Confirm that tags are case-insensitive.
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