Skip to content

Conversation

jugmac00
Copy link
Member

@jugmac00 jugmac00 commented Sep 8, 2021

fixes #2195

  • wrote descriptive pull request text
  • added/updated test(s)
  • updated/extended the documentation
  • added relevant issue keyword
    in message body
  • added news fragment in changelog folder

@codecov
Copy link

codecov bot commented Sep 8, 2021

Codecov Report

Merging #2206 (5ae9302) into rewrite (8cdcc06) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           rewrite    #2206   +/-   ##
========================================
  Coverage    99.85%   99.85%           
========================================
  Files          157      157           
  Lines         8997     8999    +2     
  Branches       942      942           
========================================
+ Hits          8984     8986    +2     
  Misses           3        3           
  Partials        10       10           
Flag Coverage Δ
tests 99.85% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/tox/session/cmd/run/common.py 100.00% <100.00%> (ø)
tests/session/cmd/test_sequential.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8cdcc06...5ae9302. Read the comment docs.

@jugmac00
Copy link
Member Author

jugmac00 commented Sep 9, 2021

@gaborbernat Thanks for the review!

@gaborbernat gaborbernat merged commit 6a4174e into tox-dev:rewrite Sep 10, 2021
@jugmac00 jugmac00 deleted the issue_2195 branch September 10, 2021 13:16
adamchainz added a commit to adamchainz/tox-py that referenced this pull request Jan 10, 2022
This never properly worked. After discussion, tox added support for my use case with --skip-missing-interpreters: tox-dev/tox#2206
stephenfin added a commit to stephenfin/tox that referenced this pull request Jan 6, 2023
We were correctly raising the Skip or NoInterpreter exceptions upon
first access of the 'base_python' property of the 'Python' class,
however, subsequent calls would simply return None. This meant we did
not trigger our exception flow as expected and resulted in a traceback
like so:

  ❯ tox --skip-missing-interpreter=true -e py33
  py33: internal error
  Traceback (most recent call last):
    File "/tox/src/tox/session/cmd/run/single.py", line 45, in _evaluate
      tox_env.setup()
    File "/tox/src/tox/tox_env/api.py", line 248, in setup
      self._setup_env()
    File "/tox/src/tox/tox_env/python/runner.py", line 106, in _setup_env
      super()._setup_env()
    File "/tox/src/tox/tox_env/python/api.py", line 186, in _setup_env
      self.ensure_python_env()
    File "/tox/src/tox/tox_env/python/api.py", line 190, in ensure_python_env
      conf = self.python_cache()
             ^^^^^^^^^^^^^^^^^^^
    File "/tox/src/tox/tox_env/python/virtual_env/api.py", line 77, in python_cache
      base = super().python_cache()
             ^^^^^^^^^^^^^^^^^^^^^^
    File "/tox/src/tox/tox_env/python/api.py", line 228, in python_cache
      "version_info": list(self.base_python.version_info),
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  AttributeError: 'NoneType' object has no attribute 'version_info'
    py33: FAIL code 2 (0.00 seconds)
    evaluation failed :( (0.06 seconds)

(from an environment without Python 3.3)

Correct this so that we also raise these exceptions on subsequent
accesses.

  ❯ tox --skip-missing-interpreter=true -e py33
  py33: skipped because could not find python interpreter with spec(s): py33
    py33: SKIP (0.00 seconds)
    evaluation failed :( (0.06 seconds)

Note that this fix emphasises a change in behavior in tox 4. With the
above configuration, tox 3 would have skipped the environment a reported
success. By comparison, tox 4 reports a failure. This behavior change
was introduced in tox-dev#2206. A future change will note this in the
documentation.

Also note that this is still not complete. Running the above command
with '--skip-missing-interpreters=false' instead will currently result
in an unhandled exception. This is an existing issue that will need to
be addressed separately.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: tox-dev#2826
stephenfin added a commit to stephenfin/tox that referenced this pull request Jan 6, 2023
This behavior change was introduced in tox-dev#2206 and fixed tox-dev#2195. Call it
out in the upgrade docs.

Signed-off-by: Stephen Finucane <stephen@that.guru>
stephenfin added a commit to stephenfin/tox that referenced this pull request Jan 6, 2023
In tox-dev#2206, we said that tox should fail if all envs are skipped. This is
broken when only a single env runs. We print an error message but return
0. Correct this behavior.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: tox-dev#2827
stephenfin added a commit to stephenfin/tox that referenced this pull request Jan 6, 2023
This behavior change was introduced in tox-dev#2206 and fixed tox-dev#2195. Call it
out in the upgrade docs.

Signed-off-by: Stephen Finucane <stephen@that.guru>
stephenfin added a commit to stephenfin/tox that referenced this pull request Jan 6, 2023
In tox-dev#2206, we said that tox should fail if all envs are skipped. This is
broken when only a single env runs. We print an error message but return
0. Correct this behavior.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: tox-dev#2827
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants