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

Support double-digit minor version in python keyword #367

Merged
merged 2 commits into from Nov 30, 2020

Conversation

cjolowicz
Copy link
Collaborator

@cjolowicz cjolowicz commented Nov 28, 2020

This fixes an issue where "3.10" is resolved as "python3", as demonstrated by the test case.

Test failure
==================================================================================== FAILURES ====================================================================================
_______________________________________________________ test__resolved_interpreter_numerical_non_windows[3.10-python3.10] ________________________________________________________

sysfind = <MagicMock name='sysfind' id='4339276912'>, make_one = <function make_one.<locals>.factory at 0x102a6e790>, input_ = '3.10', expected = 'python3.10'

    @pytest.mark.parametrize(
        ["input_", "expected"],
        [
            ("3", "python3"),
            ("3.6", "python3.6"),
            ("3.6.2", "python3.6"),
            ("3.10", "python3.10"),
            ("2.7.15", "python2.7"),
        ],
    )
    @mock.patch("nox.virtualenv._SYSTEM", new="Linux")
    @mock.patch.object(py.path.local, "sysfind", return_value=True)
    def test__resolved_interpreter_numerical_non_windows(
        sysfind, make_one, input_, expected
    ):
        venv, _ = make_one(interpreter=input_)

>       assert venv._resolved_interpreter == expected
E       AssertionError: assert 'python3' == 'python3.10'
E         - python3.10
E         ?        ---
E         + python3

.../nox/tests/test_virtualenv.py:344: AssertionError


============================================================================ short test summary info =============================================================================
FAILED tests/test_virtualenv.py::test__resolved_interpreter_numerical_non_windows[3.10-python3.10] - AssertionError: assert 'python3' == 'python3.10'
============================================================== 1 failed, 266 passed, 2 skipped, 1 xfailed in 20.22s ==============================================================

I'm keeping the scope of this PR deliberately restricted to the fix.

Some other things we'd likely want for Python 3.10 support:

  • Add 3.10 to Nox's own Nox sessions
  • Add trove classifier
  • Add Python 3.10 to Appveyor CI
  • Add Python 3.10 to Travis CI
  • Update Contributor Guide
  • Update documentation (config.rst)
  • More?

Copy link
Collaborator

@crwilcox crwilcox left a comment

Choose a reason for hiding this comment

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

LGTM. I thought maybe it makes sense to also make major allow multiple digits, but not sure that is actually a real problem ;)

@cjolowicz
Copy link
Collaborator Author

cjolowicz commented Nov 29, 2020

😀 With an annual release cadence, Python could conceivably switch to Calendar Versioning. But at this stage, it seems to be more loud thinking than a serious proposal.

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.

None yet

2 participants