mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
Target Python 3.15 using the final upstream reference
Update active version and comparison configuration to Python 3.15.0. Preserve the alpha implementation status, actual bytecode format, and existing libraries pending separate migration. Align generated library-upgrade workflow pins without changing permissions or actions. Assisted-by: OpenAI Codex:model identifier unavailable
This commit is contained in:
1 parent
f5b6526c49
commit
6c2529800a
15 files changed
+32
-24
No files matched your search
@@ -16,7 +16,7 @@ if [ "$(printf '%s\n' "3.13" "$CURRENT_PY" | sort -V | head -1)" != "3.13" ]; th
|
||||
echo "Upgrading python3 default to 3.13..."
|
||||
# Find best available Python >= 3.13
|
||||
TARGET=""
|
||||
for ver in python3.14 python3.13; do
|
||||
for ver in python3.15 python3.14 python3.13; do
|
||||
if command -v "$ver" &>/dev/null; then
|
||||
TARGET=$(command -v "$ver")
|
||||
break
|
||||
@@ -40,8 +40,8 @@ fi
|
||||
|
||||
# 2. Clone CPython source if not present (needed for scripts/update_lib)
|
||||
if [ ! -d "cpython" ]; then
|
||||
echo "Cloning CPython v3.14.3 (shallow)..."
|
||||
git clone --depth 1 --branch v3.14.3 https://github.com/python/cpython.git cpython
|
||||
echo "Cloning CPython v3.15.0 (shallow)..."
|
||||
git clone --depth 1 --branch v3.15.0 https://github.com/python/cpython.git cpython
|
||||
echo "CPython source ready."
|
||||
else
|
||||
echo "CPython source already present."
|
||||
|
||||
@@ -63,7 +63,7 @@ jobs:
|
||||
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
||||
id: cpython
|
||||
with:
|
||||
python-version: "3.14"
|
||||
python-version: "3.15"
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
|
||||
@@ -8,7 +8,7 @@ on:
|
||||
python-version:
|
||||
description: Target python version to generate doc db for
|
||||
type: string
|
||||
default: "3.14.7"
|
||||
default: "3.15.0"
|
||||
base-ref:
|
||||
description: Base branch to create the update branch from
|
||||
type: string
|
||||
|
||||
Generated
+3
-3
@@ -24,7 +24,7 @@
|
||||
# Pick an out-of-sync Python library from the todo list and upgrade it
|
||||
# by running `scripts/update_lib quick`, then open a pull request.
|
||||
#
|
||||
# frontmatter-hash: 3129480d6628afe028911bb8b31b6bb3b5eb251e395f00ed0677922cd21727cb
|
||||
# frontmatter-hash: 4c8478ae37e731fb9e34ca116a5fcbdd4f23b00f6f4d148df40f4db52b3bea6e
|
||||
|
||||
name: "Upgrade Python Library"
|
||||
"on":
|
||||
@@ -44,7 +44,7 @@ run-name: "Upgrade Python Library"
|
||||
|
||||
env:
|
||||
ISSUE_ID: "6839"
|
||||
PYTHON_VERSION: v3.14.3
|
||||
PYTHON_VERSION: v3.15.0
|
||||
|
||||
# Cache configuration from frontmatter was processed and added to the main job steps
|
||||
|
||||
@@ -109,7 +109,7 @@ jobs:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
||||
with:
|
||||
python-version: '3.14'
|
||||
python-version: '3.15'
|
||||
- name: Create gh-aw temp directory
|
||||
run: bash /opt/gh-aw/actions/create_gh_aw_tmp_dir.sh
|
||||
# Cache configuration from frontmatter processed below
|
||||
|
||||
@@ -28,7 +28,7 @@ engine: copilot
|
||||
|
||||
runtimes:
|
||||
python:
|
||||
version: "3.14"
|
||||
version: "3.15"
|
||||
|
||||
tools:
|
||||
bash:
|
||||
@@ -52,7 +52,7 @@ cache:
|
||||
- cpython-lib-
|
||||
|
||||
env:
|
||||
PYTHON_VERSION: "v3.14.7"
|
||||
PYTHON_VERSION: "v3.15.0"
|
||||
ISSUE_ID: "6839"
|
||||
---
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
3.14.7
|
||||
3.15.0
|
||||
@@ -4,7 +4,7 @@ This document provides guidelines for AI coding agents (GitHub Copilot, Claude C
|
||||
|
||||
## Project Overview
|
||||
|
||||
RustPython is a Python 3 interpreter written in Rust, implementing Python 3.14.0+ compatibility. The project aims to provide:
|
||||
RustPython is a Python 3 interpreter written in Rust, targeting Python 3.15 with compatibility work in progress. The project aims to provide:
|
||||
|
||||
- A complete Python-3 environment entirely in Rust (not CPython bindings)
|
||||
- A clean implementation without compatibility hacks
|
||||
|
||||
+1
-1
@@ -49,7 +49,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.14 or higher
|
||||
- CPython version 3.15 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
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
|
||||
# [RustPython](https://rustpython.github.io/)
|
||||
|
||||
A Python-3 (CPython >= 3.14.0) Interpreter written in Rust :snake: :scream:
|
||||
A Python-3 interpreter written in Rust, targeting CPython 3.15 :snake: :scream:
|
||||
:metal:.
|
||||
|
||||
Python 3.15 compatibility is a work in progress.
|
||||
|
||||
[](https://github.com/RustPython/RustPython/actions?query=workflow%3ACI)
|
||||
[](https://codecov.io/gh/RustPython/RustPython)
|
||||
[](https://app.codspeed.io/RustPython/RustPython?utm_source=badge)
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ fn main() {
|
||||
}
|
||||
println!("cargo:rerun-if-changed=../../Lib/importlib/_bootstrap.py");
|
||||
|
||||
// = 3.14.0alpha
|
||||
python_version(3, 14, 0, "alpha", 0);
|
||||
// = 3.15.0alpha
|
||||
python_version(3, 15, 0, "alpha", 0);
|
||||
|
||||
println!("cargo:rustc-env=RUSTPYTHON_GIT_HASH={}", git_hash());
|
||||
println!(
|
||||
|
||||
@@ -1804,7 +1804,7 @@ pub(crate) fn parse<E: From<CompileError>>(
|
||||
) -> Result<PyObjectRef, E> {
|
||||
let source_file = SourceFileBuilder::new(filename.to_owned(), source.to_owned()).finish();
|
||||
let mut options = parser::ParseOptions::from(mode);
|
||||
let target_version = target_version.unwrap_or(ast::PythonVersion::PY314);
|
||||
let target_version = target_version.unwrap_or(ast::PythonVersion::PY315);
|
||||
if let Some(error) = feature_version_syntax_error(source, &source_file, target_version) {
|
||||
return Err(error.into());
|
||||
}
|
||||
@@ -2045,7 +2045,7 @@ pub(crate) fn parse_func_type<E: From<CompileError>>(
|
||||
let parse_expr = |expr_src: &str| -> Result<ast::Expr, CompileError> {
|
||||
let source_file = SourceFileBuilder::new(filename.to_owned(), expr_src.to_owned()).finish();
|
||||
let options = parser::ParseOptions::from(parser::Mode::Expression)
|
||||
.with_target_version(target_version.unwrap_or(ast::PythonVersion::PY314));
|
||||
.with_target_version(target_version.unwrap_or(ast::PythonVersion::PY315));
|
||||
let parsed = parser::parse(expr_src, options).map_err(|parse_error| {
|
||||
let range = text_range_to_source_range(&source_file, parse_error.location);
|
||||
CompileError::from(ParseError {
|
||||
@@ -2080,7 +2080,7 @@ pub(crate) fn parse_func_type<E: From<CompileError>>(
|
||||
let call_source = format!("{ARG_PREFIX}{inner})");
|
||||
let source_file = SourceFileBuilder::new(filename.to_owned(), call_source.clone()).finish();
|
||||
let options = parser::ParseOptions::from(parser::Mode::Expression)
|
||||
.with_target_version(target_version.unwrap_or(ast::PythonVersion::PY314));
|
||||
.with_target_version(target_version.unwrap_or(ast::PythonVersion::PY315));
|
||||
let parsed = parser::parse(&call_source, options).map_err(|parse_error| {
|
||||
let range = text_range_to_source_range(&source_file, parse_error.location);
|
||||
CompileError::from(ParseError {
|
||||
|
||||
@@ -1607,7 +1607,7 @@ impl VirtualMachine {
|
||||
/// ```no_run
|
||||
/// use rustpython_vm::Interpreter;
|
||||
/// Interpreter::without_stdlib(Default::default()).enter(|vm| {
|
||||
/// let bytes = std::fs::read("__pycache__/<input>.rustpython-314.pyc").unwrap();
|
||||
/// let bytes = std::fs::read("__pycache__/<input>.rustpython-315.pyc").unwrap();
|
||||
/// let main_scope = vm.new_scope_with_main().unwrap();
|
||||
/// vm.run_pyc_bytes(&bytes, main_scope);
|
||||
/// });
|
||||
|
||||
@@ -25,6 +25,12 @@ assert "sys" in sys.builtin_module_names
|
||||
assert isinstance(sys.implementation.name, str)
|
||||
assert isinstance(sys.implementation.cache_tag, str)
|
||||
|
||||
if sys.implementation.name == "rustpython":
|
||||
assert sys.version_info == (3, 15, 0, "alpha", 0)
|
||||
assert sys.hexversion == 0x030F00A0
|
||||
assert sys.version.startswith("3.15.0.alpha (")
|
||||
assert sys.implementation.cache_tag == "rustpython-315"
|
||||
|
||||
assert sys.getfilesystemencoding() == "utf-8"
|
||||
assert sys.getfilesystemencodeerrors().startswith("surrogate")
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import urllib.request
|
||||
|
||||
import tomllib
|
||||
|
||||
CPYTHON_VERSION = "3.14"
|
||||
CPYTHON_VERSION = "3.15"
|
||||
|
||||
CONSTS_PATTERN = re.compile(r"\b_*[A-Z]+(?:_+[A-Z]+)*_*\b")
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env -S python3 -I
|
||||
# /// script
|
||||
# requires-python = ">=3.14"
|
||||
# requires-python = ">=3.15.0"
|
||||
# ///
|
||||
|
||||
# This script generates Lib/snippets/whats_left_data.py with these variables defined:
|
||||
@@ -39,9 +39,9 @@ GENERATED_FILE = "extra_tests/not_impl.py"
|
||||
implementation = platform.python_implementation()
|
||||
if implementation != "CPython":
|
||||
sys.exit(f"whats_left.py must be run under CPython, got {implementation} instead")
|
||||
if sys.version_info[:2] < (3, 14):
|
||||
if sys.version_info[:2] < (3, 15):
|
||||
sys.exit(
|
||||
f"whats_left.py must be run under CPython 3.14 or newer, got {implementation} {sys.version} instead. If you have uv, try `uv run python -I scripts/whats_left.py` to select a proper Python interpreter easier."
|
||||
f"whats_left.py must be run under CPython 3.15 or newer, got {implementation} {sys.version} instead. If you have uv, try `uv run python -I scripts/whats_left.py` to select a proper Python interpreter easier."
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user