Skip to content

Fix tests on 3.12 #799

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

Merged
merged 2 commits into from
Jun 2, 2023
Merged

Fix tests on 3.12 #799

merged 2 commits into from
Jun 2, 2023

Conversation

whitequark
Copy link
Member

No description provided.

@whitequark whitequark force-pushed the fix-3.12 branch 3 times, most recently from 8be405c to adf8fbe Compare June 1, 2023 18:47
@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

Merging #799 (1c5c1cb) into main (c343e87) will decrease coverage by 0.11%.
The diff coverage is 100.00%.

❗ Current head 1c5c1cb differs from pull request most recent head 2c0f844. Consider uploading reports for the commit 2c0f844 to get more accurate results

@@            Coverage Diff             @@
##             main     #799      +/-   ##
==========================================
- Coverage   82.15%   82.04%   -0.11%     
==========================================
  Files          51       50       -1     
  Lines        6908     6867      -41     
  Branches     1677     1670       -7     
==========================================
- Hits         5675     5634      -41     
+ Misses       1037     1036       -1     
- Partials      196      197       +1     
Impacted Files Coverage Δ
amaranth/hdl/dsl.py 99.73% <100.00%> (+<0.01%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@whitequark
Copy link
Member Author

It looks like (according to @mwkmwkmwk) the following test failure is a Python regression and not an Amaranth issue:

======================================================================
ERROR: test_command_wrong (tests.test_sim.SimulatorIntegrationTestCase.test_command_wrong)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/amaranth/amaranth/tests/test_sim.py", line 673, in test_command_wrong
    with self.assertSimulation(Module()) as sim:
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/home/runner/work/amaranth/amaranth/tests/test_sim.py", line 416, in assertSimulation
    sim.run()
  File "/home/runner/work/amaranth/amaranth/amaranth/sim/core.py", line 172, in run
    while self.advance():
          ^^^^^^^^^^^^^^
  File "/home/runner/work/amaranth/amaranth/amaranth/sim/core.py", line 163, in advance
    return self._engine.advance()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/amaranth/amaranth/amaranth/sim/pysim.py", line 3[19](https://github.com/amaranth-lang/amaranth/actions/runs/5155193634/jobs/9284561793?pr=799#step:6:20), in advance
    self._step()
  File "/home/runner/work/amaranth/amaranth/amaranth/sim/pysim.py", line 308, in _step
    process.run()
  File "/home/runner/work/amaranth/amaranth/amaranth/sim/_pycoro.py", line 1[25](https://github.com/amaranth-lang/amaranth/actions/runs/5155193634/jobs/9284561793?pr=799#step:6:26), in run
    self.coroutine.throw(exn)
  File "/home/runner/work/amaranth/amaranth/amaranth/sim/core.py", line 82, in wrapper
    yield from process()
  File "/home/runner/work/amaranth/amaranth/amaranth/sim/_pycoro.py", line 116, in run
    raise TypeError("Received unsupported command {!r} from process {!r}"
TypeError: Received unsupported command 1 from process '/home/runner/work/amaranth/amaranth/amaranth/sim/core.py:82'

I think I'll merge this PR since it's a clear improvement over status quo, and we can handle the coroutine issue later.

@whitequark whitequark enabled auto-merge (rebase) June 2, 2023 12:40
This is causing issues on Python 3.12 and in any case should be
based on the Python `ziglang` package instead of this cursed
setuptools hack.
There is now an upstream deprecation warning for the same.
We don't have to duplicate it.
@whitequark whitequark merged commit a4402b5 into amaranth-lang:main Jun 2, 2023
@mwkmwkmwk
Copy link

It looks like (according to @mwkmwkmwk) the following test failure is a Python regression and not an Amaranth issue:

(to be clear, I think it's a coverage.py issue on new Python version, not a Python regression)

@whitequark whitequark deleted the fix-3.12 branch June 2, 2023 14:34
@whitequark
Copy link
Member Author

Ah sorry, I was distracted and missed that part!

@mwkmwkmwk
Copy link

For reference, the remaining test failure is caused by python/cpython#105162 , which has just been fixed in git main; the fix will presumably be included in the next 3.12 beta.

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.

2 participants