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

test_markers.MarkersTestCase.test_interpret fails on py310 #154

Closed
vsajip opened this issue Sep 23, 2021 · 9 comments
Closed

test_markers.MarkersTestCase.test_interpret fails on py310 #154

vsajip opened this issue Sep 23, 2021 · 9 comments
Labels
bug Something isn't working major

Comments

@vsajip
Copy link
Collaborator

vsajip commented Sep 23, 2021

Original report by Michał Górny (Bitbucket: mgorny, GitHub: mgorny).


Not sure if this is a known problem:

$ python3.10 --version
Python 3.10.0rc2
$ tox -e py310
GLOB sdist-make: /tmp/distlib/setup.py
py310 inst-nodeps: /tmp/distlib/.tox/.tmp/package/1/distlib-0.3.4.dev0.zip
py310 installed: distlib @ file:///tmp/distlib/.tox/.tmp/package/1/distlib-0.3.4.dev0.zip
py310 run-test-pre: PYTHONHASHSEED='0'
py310 run-test: commands[0] | python setup.py test
/tmp/distlib/setup.py:8: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.core
running test
............................s......................................................s.......s..................F.......sss.ss..........sss......ss.........................s..........s.........................ssss.........ss.............
======================================================================
FAIL: test_interpret (test_markers.MarkersTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/distlib/tests/test_markers.py", line 73, in test_interpret
    self.assertFalse(interpret('python_version < "3.10"'))
AssertionError: True is not false

----------------------------------------------------------------------
Ran 235 tests in 19.500s

FAILED (failures=1, skipped=21)
ERROR: InvocationError for command /tmp/distlib/.tox/py310/bin/python setup.py test (exited with code 1)
_______________________________________________________________ summary _______________________________________________________________
ERROR:   py310: commands failed

@vsajip
Copy link
Collaborator Author

vsajip commented Sep 23, 2021

Are you using a repo version of tox? I can’t even get it to make a venv:

~/projects/distlib [default!] $ tox -epy310
GLOB sdist-make: /disk2/vinay/projects/distlib/setup.py
py310 create: /disk2/vinay/projects/distlib/.tox/py310
ERROR: invocation failed (exit code 1), logfile: /disk2/vinay/projects/distlib/.tox/py310/log/py310-0.log
======================================================================================================== log start =========================================================================================================
/home/vinay/.local/share/virtualenvs/tox/lib/python3.6/site-packages/virtualenv.py:22: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.spawn
/home/vinay/.local/share/virtualenvs/tox/lib/python3.6/site-packages/virtualenv.py:23: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
Using base prefix '/home/vinay/.local'
New python executable in /disk2/vinay/projects/distlib/.tox/py310/bin/python3.10
Also creating executable in /disk2/vinay/projects/distlib/.tox/py310/bin/python
Traceback (most recent call last):
  File "/home/vinay/.local/share/virtualenvs/tox/lib/python3.6/site-packages/virtualenv.py", line 2610, in <module>
    main()
  File "/home/vinay/.local/share/virtualenvs/tox/lib/python3.6/site-packages/virtualenv.py", line 824, in main
    create_environment(
  File "/home/vinay/.local/share/virtualenvs/tox/lib/python3.6/site-packages/virtualenv.py", line 1112, in create_environment
    install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
  File "/home/vinay/.local/share/virtualenvs/tox/lib/python3.6/site-packages/virtualenv.py", line 1691, in install_python
    fix_local_scheme(home_dir, symlink)
  File "/home/vinay/.local/share/virtualenvs/tox/lib/python3.6/site-packages/virtualenv.py", line 1777, in fix_local_scheme
    if sysconfig._get_default_scheme() == "posix_local":
AttributeError: module 'sysconfig' has no attribute '_get_default_scheme'. Did you mean: 'get_default_scheme'?
Running virtualenv with interpreter /home/vinay/.local/bin/python3.10

========================================================================================================= log end ==========================================================================================================
ERROR: InvocationError for command /home/vinay/.local/share/virtualenvs/tox/bin/python3 -m virtualenv --no-download --python /home/vinay/.local/bin/python3.10 py310 (exited with code 1)
_________________________________________________________________________________________________________ summary __________________________________________________________________________________________________________
ERROR:   py310: InvocationError for command /home/vinay/.local/share/virtualenvs/tox/bin/python3 -m virtualenv --no-download --python /home/vinay/.local/bin/python3.10 py310 (exited with code 1)

@vsajip
Copy link
Collaborator Author

vsajip commented Sep 23, 2021

AFAIK this is only failing because the 3.10 interpreter is a release candidate … I should check for the candidate status in the test, but that’s just a shortcoming in the test, I think.

@vsajip
Copy link
Collaborator Author

vsajip commented Sep 23, 2021

Fix #154: Update test to check the release level of the running Python interpreter.

@vsajip
Copy link
Collaborator Author

vsajip commented Sep 23, 2021

Original changes by Vinay Sajip (Bitbucket: vinay.sajip, GitHub: vsajip).


changed state from "new" to "resolved"

@vsajip vsajip closed this as completed Sep 23, 2021
@vsajip
Copy link
Collaborator Author

vsajip commented Sep 23, 2021

Original comment by Michał Górny (Bitbucket: mgorny, GitHub: mgorny).


Are you using a repo version of tox? I can’t even get it to make a venv:

Yes. However, if I create a fresh venv and install tox there, I don’t seem to have a problem either. Maybe something’s pinning to old virtualenv on your system?

@vsajip
Copy link
Collaborator Author

vsajip commented Sep 23, 2021

Original comment by Michał Górny (Bitbucket: mgorny, GitHub: mgorny).


Fix #154: Update test to check the release level of the running Python interpreter.

→ <<cset 55b4b174b703>>

Are you sure this is the correct behavior, though? If I use

    install_requires=[
        "foo; python_version < '3.10'"
    ],

setuptools installs it only for Python 3.9 but not 3.10 alphas or RCs. Conversely, ‘>= 3.10’ also matches on alphas and RCs.

@vsajip
Copy link
Collaborator Author

vsajip commented Sep 23, 2021

OK, let me look into it further …

@vsajip
Copy link
Collaborator Author

vsajip commented Sep 23, 2021

Fix #154: Determine Python versions correctly for Python >= 3.10.

@vsajip
Copy link
Collaborator Author

vsajip commented Sep 23, 2021

Thanks for the nudge - it was an errant [:3] getting python_version from python_full_version 😳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working major
Projects
None yet
Development

No branches or pull requests

1 participant