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

Add Session.run_always(). #331

Merged
merged 6 commits into from Jun 8, 2020
Merged

Add Session.run_always(). #331

merged 6 commits into from Jun 8, 2020

Conversation

dhermes
Copy link
Collaborator

@dhermes dhermes commented Jun 7, 2020

Fixes #330.

docs/index.rst Outdated Show resolved Hide resolved
external=True,
)
session.install(".")
...
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Rendered:
Screen Shot 2020-06-07 at 2 45 16 PM

@theacodes
Copy link
Collaborator

lint seems unhappy but otherwise this looks good. Feel free to merge once you've pleased the lint god.

@dhermes
Copy link
Collaborator Author

dhermes commented Jun 8, 2020

1 file would be reformatted, 35 files would be left unchanged.

I noticed this during local dev! Couldn't tell if it was an update to black or something to do with my local install of black.

Do you have a "only update formatting if file has been edited" policy?

Either way I'll make the updates.

@dhermes
Copy link
Collaborator Author

dhermes commented Jun 8, 2020

I just ran nox -s blacken and it touched 6 files, so I made it into #332. Will rebase this PR on top of master once that PR is merged and hopefully the changes will be smaller.

@theacodes
Copy link
Collaborator

theacodes commented Jun 8, 2020 via email

@dhermes
Copy link
Collaborator Author

dhermes commented Jun 8, 2020

@theacodes This has been rebased and a nox -s blacken commit was added at the end, will merge on green!

@theacodes
Copy link
Collaborator

theacodes commented Jun 8, 2020 via email

@dhermes dhermes merged commit e3d4696 into wntrblm:master Jun 8, 2020
@dhermes dhermes deleted the issue-330 branch June 8, 2020 18:10
"-B", build_dir,
external=True,
)
session.run_always(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this called run_always?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I feel like we nailed it with the docstring: https://nox.thea.codes/en/stable/config.html#nox.sessions.Session.run_always

Run a command always.

This is a variant of run() that runs in all cases, including in the presence of --install-only.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about session.custom_install_command(...) ?

Seems to be much closer to the intention.
I was now even aware of --install-only.

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 run_always() for "install-type" actions that don't use pip.
4 participants