Skip to content
Draft
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
16 changes: 10 additions & 6 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ jobs:
run: |
tar zxvf *.tar.gz --strip-components=1
- name: Build wheels
uses: pypa/cibuildwheel@v3.4.1
uses: pypa/cibuildwheel@54327ab9d35de03b359ac25c97de9417d94639c0 # v4.0.0rc1
env:
CIBW_BUILD: "cp3{9..14}{t,}-${{ matrix.wheel_type }}"
CIBW_BUILD: "cp3{9..15}{t,}-${{ matrix.wheel_type }}"
CIBW_ARCHS_LINUX: auto
CIBW_ENABLE: cpython-prerelease cpython-freethreading
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks Wheels / test_wheels (3.13t) (pull_request) as cpython-freethreading is experimental in 3.13t.
As experimental cpython-freethreading is uninstalled, removing the flag breaks python3.13t test

CIBW_ENABLE: cpython-prerelease
- uses: actions/upload-artifact@v7
with:
name: ${{ matrix.wheel_type }}-wheels
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13t", "3.14", "3.14t"]
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13t", "3.14", "3.14t", "3.15", "3.15t"]
steps:
- uses: actions/checkout@v6
- name: Set up Python
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python_version: ["3.9", "3.13", "3.14"]
python_version: ["3.9", "3.13", "3.14", "3.15"]
steps:
- uses: actions/checkout@v6
- name: Set up Python
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python_version: ["3.13", "3.14"]
python_version: ["3.13", "3.14", "3.15"]
steps:
- uses: actions/checkout@v6
- name: Set up Python
Expand Down Expand Up @@ -425,6 +425,10 @@ jobs:
mv dist/*-wheels/*.whl dist/
rmdir dist/{sdist,*-wheels}
ls -R dist
- name: Avoid publishing Python 3.15 wheels
run: |
rm -f dist/*cp315*
ls -R dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
1 change: 1 addition & 0 deletions news/289.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Python 3.15 is now supported. The wheels are not yet published because the ABI is not yet frozen.
39 changes: 39 additions & 0 deletions src/pystack/_pystack/cpython/code.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,43 @@ typedef struct
} PyCodeObject;
} // namespace Python3_14

namespace Python3_15 {
typedef uint16_t _Py_CODEUNIT;

typedef struct
{
PyObject_VAR_HEAD PyObject* co_consts;
PyObject* co_names;
PyObject* co_exceptiontable;
int co_flags;
int co_argcount;
int co_posonlyargcount;
int co_kwonlyargcount;
int co_stacksize;
int co_firstlineno;
int co_nlocalsplus;
int co_framesize;
int co_nlocals;
int co_ncellvars;
int co_nfreevars;
uint32_t co_version;
PyObject* co_localsplusnames;
PyObject* co_localspluskinds;
PyObject* co_filename;
PyObject* co_name;
PyObject* co_qualname;
PyObject* co_linetable;
PyObject* co_weakreflist;
void* co_executors;
void* _co_cached;
uintptr_t _co_instrumentation_version;
void* _co_monitoring;
Py_ssize_t _co_unique_id;
int _co_firsttraceable;
void* co_extra;
/* deal with co_tlbc somehow */
char co_code_adaptive[1];
} PyCodeObject;
} // namespace Python3_15

} // namespace pystack
21 changes: 21 additions & 0 deletions src/pystack/_pystack/cpython/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,25 @@ struct _gc_runtime_state

} // namespace Python3_14

namespace Python3_15 {

struct _gc_runtime_state
{
int enabled;
int debug;
struct Python3_8::gc_generation young;
struct Python3_8::gc_generation old[2];
struct Python3_8::gc_generation permanent_generation;
struct gc_generation_stats generation_stats[NUM_GENERATIONS];
int collecting;
struct _PyInterpreterFrame* frame;
PyObject* garbage;
PyObject* callbacks;
Py_ssize_t heap_size;
Py_ssize_t long_lived_total;
Py_ssize_t long_lived_pending;
};

} // namespace Python3_15

} // namespace pystack
76 changes: 76 additions & 0 deletions src/pystack/_pystack/cpython/interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,80 @@ typedef struct _is

} // namespace Python3_14

namespace Python3_15 {

struct _pythreadstate;

typedef struct
{
Python3_13::PyMutex mutex;
unsigned long long thread;
size_t level;
} _PyRecursiveMutex;

struct _import_state
{
PyObject* modules;
PyObject* modules_by_index;
PyObject* importlib;
int override_frozen_modules;
int override_multi_interp_extensions_check;
PyObject* import_func;
_PyRecursiveMutex lock;
/* diagnostic info in PyImport_ImportModuleLevelObject() */
struct
{
int import_level;
int64_t accumulated;
int header;
} find_and_load;
};

struct _gil_runtime_state
{
unsigned long interval;
struct _pythreadstate* last_holder;
int locked;
unsigned long switch_number;
pthread_cond_t cond;
pthread_cond_t mutex;
#ifdef FORCE_SWITCHING
pthread_cond_t switch_cond;
pthread_cond_t switch_mutex;
#endif
};

typedef struct _is
{
struct _ceval_state ceval;
struct _is* next;
int64_t id;
Py_ssize_t id_refcount;
int requires_idref;
long _whence;
int _initialized;
int _ready;
int finalizing;
uintptr_t last_restart_version;
struct pythreads
{
uint64_t next_unique_id;
struct _pythreadstate* head;
struct _pythreadstate* preallocated;
struct _pythreadstate* main;
Py_ssize_t count;
size_t stacksize;
} threads;
void* runtime;
struct _pythreadstate* _finalizing;
unsigned long _finalizing_id;
struct _gc_runtime_state gc;
PyObject* sysdict;
PyObject* builtins;
struct _import_state imports;
struct _gil_runtime_state _gil;
} PyInterpreterState;

} // namespace Python3_15

} // namespace pystack
Loading
Loading