Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e5735cd

Browse files
authored
Merge pull request #4517 from youknowone/cpython-3.11
trying to go with CPython 3.11
2 parents 3b8d670 + 75f3f3c commit e5735cd

File tree

6 files changed

+50
-43
lines changed

6 files changed

+50
-43
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ jobs:
250250
- uses: dtolnay/rust-toolchain@stable
251251
- uses: actions/setup-python@v2
252252
with:
253-
python-version: "3.10"
253+
python-version: "3.11"
254254
- name: Set up the Windows environment
255255
shell: bash
256256
run: |
@@ -266,7 +266,7 @@ jobs:
266266
run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }}
267267
- uses: actions/setup-python@v2
268268
with:
269-
python-version: "3.10"
269+
python-version: "3.11"
270270
- name: run snippets
271271
run: python -m pip install -r requirements.txt && pytest -v
272272
working-directory: ./extra_tests
@@ -351,7 +351,7 @@ jobs:
351351
run: cargo clippy --manifest-path=wasm/lib/Cargo.toml -- -Dwarnings
352352
- uses: actions/setup-python@v2
353353
with:
354-
python-version: "3.10"
354+
python-version: "3.11"
355355
- name: install flake8
356356
run: python -m pip install flake8
357357
- name: run lint
@@ -411,7 +411,7 @@ jobs:
411411
tar -xzf geckodriver-v0.30.0-linux64.tar.gz -C geckodriver
412412
- uses: actions/setup-python@v2
413413
with:
414-
python-version: "3.10"
414+
python-version: "3.11"
415415
- run: python -m pip install -r requirements.txt
416416
working-directory: ./wasm/tests
417417
- uses: actions/setup-node@v1

.github/workflows/cron-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
RUSTC_WRAPPER: './scripts/codecoverage-rustc-wrapper.sh'
3030
- uses: actions/setup-python@v2
3131
with:
32-
python-version: "3.10"
32+
python-version: "3.11"
3333
- run: python -m pip install pytest
3434
working-directory: ./extra_tests
3535
- name: run snippets

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RustPython requires the following:
2525
stable version: `rustup update stable`
2626
- If you do not have Rust installed, use [rustup](https://rustup.rs/) to
2727
do so.
28-
- CPython version 3.10 or higher
28+
- CPython version 3.11 or higher
2929
- CPython can be installed by your operating system's package manager,
3030
from the [Python website](https://www.python.org/downloads/), or
3131
using a third-party distribution, such as

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# [RustPython](https://rustpython.github.io/)
44

5-
A Python-3 (CPython >= 3.10.0) Interpreter written in Rust :snake: :scream:
5+
A Python-3 (CPython >= 3.11.0) Interpreter written in Rust :snake: :scream:
66
:metal:.
77

88
[![Build Status](https://github.com/RustPython/RustPython/workflows/CI/badge.svg)](https://github.com/RustPython/RustPython/actions?query=workflow%3ACI)

extra_tests/snippets/imp.py renamed to extra_tests/snippets/stdlib_imp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
assert _imp.is_builtin("not existing module") == False
77

88
assert _imp.is_frozen("__hello__") == True
9-
assert _imp.is_frozen("os") == False
9+
assert _imp.is_frozen("math") == False
1010

1111
class FakeSpec:
1212
def __init__(self, name):

extra_tests/snippets/syntax_async.py

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import sys
12
import asyncio
23
import unittest
34

5+
46
class ContextManager:
57
async def __aenter__(self):
68
print("Entrada")
@@ -41,15 +43,18 @@ async def a(s, m):
4143
async for i in AIterWrap(range(0, 2)):
4244
print(i)
4345
ls.append(m)
44-
await asyncio.sleep(1)
46+
await asyncio.sleep(0.1)
47+
48+
49+
async def main():
50+
tasks = [
51+
asyncio.create_task(c)
52+
for c in [a(0, "hello1"), a(0.1, "hello2"), a(0.2, "hello3"), a(0.3, "hello4")]
53+
]
54+
await asyncio.wait(tasks)
4555

4656

47-
loop = asyncio.get_event_loop()
48-
loop.run_until_complete(
49-
asyncio.wait(
50-
[a(0, "hello1"), a(0.75, "hello2"), a(1.5, "hello3"), a(2.25, "hello4")]
51-
)
52-
)
57+
asyncio.run(main(), debug=True)
5358

5459

5560
assert ls == [
@@ -72,41 +77,43 @@ async def a(s, m):
7277
]
7378

7479

75-
class TestAsyncWith(unittest.TestCase):
76-
def testAenterAttributeError1(self):
77-
class LacksAenter(object):
78-
async def __aexit__(self, *exc):
79-
pass
80+
if sys.version_info < (3, 11, 0):
8081

81-
async def foo():
82-
async with LacksAenter():
83-
pass
84-
85-
with self.assertRaisesRegex(AttributeError, '__aenter__'):
86-
foo().send(None)
82+
class TestAsyncWith(unittest.TestCase):
83+
def testAenterAttributeError1(self):
84+
class LacksAenter(object):
85+
async def __aexit__(self, *exc):
86+
pass
8787

88-
def testAenterAttributeError2(self):
89-
class LacksAenterAndAexit(object):
90-
pass
88+
async def foo():
89+
async with LacksAenter():
90+
pass
9191

92-
async def foo():
93-
async with LacksAenterAndAexit():
92+
with self.assertRaisesRegex(AttributeError, "__aenter__"):
93+
foo().send(None)
94+
95+
def testAenterAttributeError2(self):
96+
class LacksAenterAndAexit(object):
9497
pass
9598

96-
with self.assertRaisesRegex(AttributeError, '__aenter__'):
97-
foo().send(None)
99+
async def foo():
100+
async with LacksAenterAndAexit():
101+
pass
98102

99-
def testAexitAttributeError(self):
100-
class LacksAexit(object):
101-
async def __aenter__(self):
102-
pass
103+
with self.assertRaisesRegex(AttributeError, "__aenter__"):
104+
foo().send(None)
103105

104-
async def foo():
105-
async with LacksAexit():
106-
pass
107-
108-
with self.assertRaisesRegex(AttributeError, '__aexit__'):
109-
foo().send(None)
106+
def testAexitAttributeError(self):
107+
class LacksAexit(object):
108+
async def __aenter__(self):
109+
pass
110+
111+
async def foo():
112+
async with LacksAexit():
113+
pass
114+
115+
with self.assertRaisesRegex(AttributeError, "__aexit__"):
116+
foo().send(None)
110117

111118

112119
if __name__ == "__main__":

0 commit comments

Comments
 (0)