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

Skip to content

trying to go with CPython 3.11 #4517

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 4 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.11"
- name: Set up the Windows environment
shell: bash
run: |
Expand All @@ -266,7 +266,7 @@ jobs:
run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }}
- uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.11"
- name: run snippets
run: python -m pip install -r requirements.txt && pytest -v
working-directory: ./extra_tests
Expand Down Expand Up @@ -349,7 +349,7 @@ jobs:
run: cargo clippy --manifest-path=wasm/lib/Cargo.toml -- -Dwarnings
- uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.11"
- name: install flake8
run: python -m pip install flake8
- name: run lint
Expand Down Expand Up @@ -411,7 +411,7 @@ jobs:
tar -xzf geckodriver-v0.30.0-linux64.tar.gz -C geckodriver
- uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.11"
- run: python -m pip install -r requirements.txt
working-directory: ./wasm/tests
- uses: actions/setup-node@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cron-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
RUSTC_WRAPPER: './scripts/codecoverage-rustc-wrapper.sh'
- uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.11"
- run: python -m pip install pytest
working-directory: ./extra_tests
- name: run snippets
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RustPython requires the following:
stable version: `rustup update stable`
- If you do not have Rust installed, use [rustup](https://rustup.rs/) to
do so.
- CPython version 3.10 or higher
- CPython version 3.11 or higher
- CPython can be installed by your operating system's package manager,
from the [Python website](https://www.python.org/downloads/), or
using a third-party distribution, such as
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

[![Build Status](https://github.com/RustPython/RustPython/workflows/CI/badge.svg)](https://github.com/RustPython/RustPython/actions?query=workflow%3ACI)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
assert _imp.is_builtin("not existing module") == False

assert _imp.is_frozen("__hello__") == True
assert _imp.is_frozen("os") == False
assert _imp.is_frozen("math") == False

class FakeSpec:
def __init__(self, name):
Expand Down
77 changes: 42 additions & 35 deletions extra_tests/snippets/syntax_async.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import sys
import asyncio
import unittest


class ContextManager:
async def __aenter__(self):
print("Entrada")
Expand Down Expand Up @@ -41,15 +43,18 @@ async def a(s, m):
async for i in AIterWrap(range(0, 2)):
print(i)
ls.append(m)
await asyncio.sleep(1)
await asyncio.sleep(0.1)


async def main():
tasks = [
asyncio.create_task(c)
for c in [a(0, "hello1"), a(0.1, "hello2"), a(0.2, "hello3"), a(0.3, "hello4")]
]
await asyncio.wait(tasks)


loop = asyncio.get_event_loop()
loop.run_until_complete(
asyncio.wait(
[a(0, "hello1"), a(0.75, "hello2"), a(1.5, "hello3"), a(2.25, "hello4")]
)
)
asyncio.run(main(), debug=True)


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


class TestAsyncWith(unittest.TestCase):
def testAenterAttributeError1(self):
class LacksAenter(object):
async def __aexit__(self, *exc):
pass
if sys.version_info < (3, 11, 0):

async def foo():
async with LacksAenter():
pass

with self.assertRaisesRegex(AttributeError, '__aenter__'):
foo().send(None)
class TestAsyncWith(unittest.TestCase):
def testAenterAttributeError1(self):
class LacksAenter(object):
async def __aexit__(self, *exc):
pass

def testAenterAttributeError2(self):
class LacksAenterAndAexit(object):
pass
async def foo():
async with LacksAenter():
pass

async def foo():
async with LacksAenterAndAexit():
with self.assertRaisesRegex(AttributeError, "__aenter__"):
foo().send(None)

def testAenterAttributeError2(self):
class LacksAenterAndAexit(object):
pass

with self.assertRaisesRegex(AttributeError, '__aenter__'):
foo().send(None)
async def foo():
async with LacksAenterAndAexit():
pass

def testAexitAttributeError(self):
class LacksAexit(object):
async def __aenter__(self):
pass
with self.assertRaisesRegex(AttributeError, "__aenter__"):
foo().send(None)

async def foo():
async with LacksAexit():
pass

with self.assertRaisesRegex(AttributeError, '__aexit__'):
foo().send(None)
def testAexitAttributeError(self):
class LacksAexit(object):
async def __aenter__(self):
pass

async def foo():
async with LacksAexit():
pass

with self.assertRaisesRegex(AttributeError, "__aexit__"):
foo().send(None)


if __name__ == "__main__":
Expand Down