-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
needs_nox
in noxfile
#210
needs_nox
in noxfile
#210
Conversation
@crwilcox @dhermes @stsewd do any of you have a moment to look at this? I don't have the bandwidth right now. @Paulius-Maruska thank you for submitting this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice approach!
6c6d27f
to
bda165d
Compare
I have updated the PR, and also rebased it on the latest master branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR. I left a couple of comments that I would like follow up on, but overall this looks good.
|
||
import nox | ||
|
||
needs_nox = '2019.5.30' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echoing a comment from @dhermes on the issue. This noxfile.py
would result in pylint
throwing lint_test.py:3:0: C0103: Constant name "needs_nox" doesn't conform to UPPER_CASE naming style (invalid-name)
Any objections to changing this to a constant?
# limitations under the License. | ||
|
||
# future version, to make sure error is logged and returned | ||
needs_nox = "3001.1.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a bit 'heavy' to have multiple resources files to validate this. Could these be generated at test time? How are these unique to the tests in test_version
?
assert tasks.load_nox_module(config) == 2 | ||
|
||
|
||
def test_load_nox_module_returns_2_when_noxfile_does_not_even_import(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't clear to me what this validates. Is this validating the ordering of errors? That we will mention that we have an invalid arg to the decorator before the version?
assert needed is None | ||
|
||
|
||
def test_is_version_sufficient_returns_true_for_lower_version(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be a case for exact match?
Minimum required nox version | ||
---------------------------- | ||
|
||
Minimum required Nox version can be specified in your ``noxfile.py`` file by simply defining |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: may make sense to drop the word 'simply' as there can be negative feelings about that verbiage in prose.
Minimum required Nox version can be specified in your ``noxfile.py`` file by simply defining | |
Minimum required Nox version can be specified in your ``noxfile.py`` file by defining |
In terms of placating linters and continuing to be somewhat idiomatic, what do y'all think of making import nox
nox.needs_version = ">=2018.7.8"
nox.options.sessions = ["lint", "tests-3.6"]
@nox.session
def lint(s):
...
... |
I think adding this to the module would make sense. It also may be more discoverable via language intelligence services in IDEs. Though my big sticking point is matching PyLint, just to avoid the bug that will follow if this doesn't :D |
if needed_version and needed_version > nox_version(): | ||
logger.error( | ||
"Noxfile {} needs at least Nox {} and therefore it cannot be used " | ||
"with this version.".format(noxfile, str(needed_version)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message could include the current nox version too
return needs_version | ||
|
||
|
||
def needs_nox(noxfile, noxfile_module=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Np: this function is doing two things. And only using one arg. If noxfile and noxfile module are given, noxfile module is only used
I'm sorry for the silence this past week - I was attending the EuroPython2019 conference and was quite busy with the various activities here. :) I will try to address the issues / respond next week as early as I can. |
Take your time, and thanks for keeping us updated. 🙂
…On Sun, Jul 14, 2019, 1:03 AM Paulius Maruška ***@***.***> wrote:
I'm sorry for the silence this past week - I was attending the
EuroPython2019 conference and was quite busy with the various activities
here. :)
I will try to address the issues / respond next week as early as I can.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#210>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB5I46QCZA6KUTDVRSXEATP7LMVDANCNFSM4H6KLOJQ>
.
|
I'm going to close this PR due to inactivity. That's not to say I'm not interested in merging it! If you're still up for it just reply and I'll re-open the PR. :) |
Hello, in an attempt to familiarize myself with nox code, I managed to implement #99