Skip to content
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

Support Python3.13 #42

Merged
merged 10 commits into from
Nov 9, 2024
Merged

Support Python3.13 #42

merged 10 commits into from
Nov 9, 2024

Conversation

fullerzz
Copy link
Owner

@fullerzz fullerzz commented Sep 17, 2024

Changes

  • Project now supports Python3.13
  • Replaced msgspec with pydantic
  • Replaced test server with quart - was previously blacksheep
  • Upgraded dependencies

@fullerzz fullerzz linked an issue Sep 17, 2024 that may be closed by this pull request
@fullerzz fullerzz self-assigned this Nov 9, 2024
@fullerzz
Copy link
Owner Author

fullerzz commented Nov 9, 2024

Looks like blacksheep is having install issues with python3.13. It's just being used for the test server, so can probably just migrate to Flask or FastAPI.

@fullerzz
Copy link
Owner Author

fullerzz commented Nov 9, 2024

msgspec is also failing to build/install with python3.13. jcrist/msgspec#764

error: Failed to prepare distributions
  Caused by: Failed to download and build `msgspec==0.18.6`
  Caused by: Build backend failed to build wheel through `build_wheel` (exit status: 1)

[stdout]
running bdist_wheel
running build
running build_py
copying msgspec/toml.py -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/yaml.py -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/structs.py -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/inspect.py -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/json.py -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/_utils.py -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/_json_schema.py -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/__init__.py -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/msgpack.py -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/__init__.pyi -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/json.pyi -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/msgpack.pyi -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/structs.pyi -> build/lib.linux-x86_64-cpython-313/msgspec
copying msgspec/py.typed -> build/lib.linux-x86_64-cpython-313/msgspec
UPDATING build/lib.linux-x86_64-cpython-313/msgspec/_version.py
set build/lib.linux-x86_64-cpython-313/msgspec/_version.py to '0.18.6'
running build_ext
building 'msgspec._core' extension
gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/home/zach/.cache/uv/builds-v0/.tmp3RAeGo/include -I/home/zach/.pyenv/versions/3.13.0/include/python3.13 -c msgspec/_core.c -o build/temp.linux-x86_64-cpython-313/msgspec/_core.o

[stderr]
msgspec/_core.c: In function ‘find_keyword’:
msgspec/_core.c:500:13: warning: implicit declaration of function ‘_PyUnicode_EQ’; did you mean ‘PyUnicode_New’? [-Wimplicit-function-declaration]
  500 |         if (_PyUnicode_EQ(kwname, key)) {
      |             ^~~~~~~~~~~~~
      |             PyUnicode_New
msgspec/_core.c: In function ‘typenode_collect_convert_structs’:
msgspec/_core.c:4452:12: warning: implicit declaration of function ‘_PySet_NextEntry’ [-Wimplicit-function-declaration]
 4452 |     while (_PySet_NextEntry(state->structs_set, &set_pos, &set_item, &set_hash)) {
      |            ^~~~~~~~~~~~~~~~
msgspec/_core.c: In function ‘ms_uuid_to_16_bytes’:
msgspec/_core.c:11254:15: error: too few arguments to function ‘_PyLong_AsByteArray’
11254 |     int out = _PyLong_AsByteArray((PyLongObject *)int128, buf, 16, 0, 0);
      |               ^~~~~~~~~~~~~~~~~~~
In file included from /home/zach/.pyenv/versions/3.13.0/include/python3.13/longobject.h:107,
                 from /home/zach/.pyenv/versions/3.13.0/include/python3.13/Python.h:81,
                 from msgspec/_core.c:9:
/home/zach/.pyenv/versions/3.13.0/include/python3.13/cpython/longobject.h:111:17: note: declared here
  111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
      |                 ^~~~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1

* replaced msgspec with pydantic and blacksheep with quart

* updated type from BaseException -> Exception

* Revert "updated type from BaseException -> Exception"

This reverts commit d97c1b6.

* added arbitrary_types_allowed=True to pydantic model config

* updated test server response

* removed arg
@fullerzz fullerzz added enhancement New feature or request dependencies Pull requests that update a dependency file labels Nov 9, 2024
@fullerzz fullerzz changed the title test against 3.13 Support Python3.13 Nov 9, 2024
@fullerzz fullerzz merged commit 8779f03 into main Nov 9, 2024
10 checks passed
@fullerzz fullerzz deleted the 41-support-python313 branch November 9, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Python3.13
1 participant