-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
python313Packages.picologging: fix build; python313Packages.psycopg: 3.2.3 -> 3.2.4 ; litestar: build for all python version #374977
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,56 +1 @@ | ||
| { | ||
| python3Packages, | ||
| lib, | ||
| fetchFromGitHub, | ||
| }: | ||
|
|
||
| python3Packages.buildPythonApplication rec { | ||
| pname = "litestar"; | ||
| version = "2.13.0"; | ||
| pyproject = true; | ||
|
|
||
| build-system = with python3Packages; [ | ||
| hatchling | ||
| ]; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "litestar-org"; | ||
| repo = "litestar"; | ||
| tag = "v${version}"; | ||
| hash = "sha256-PR2DVNRtILHs7XwVi9/ZCVRJQFqfGLn1x2gpYtYjHDo="; | ||
| }; | ||
|
|
||
| dependencies = with python3Packages; [ | ||
| anyio | ||
| click | ||
| redis | ||
| httpx | ||
| msgspec | ||
| multidict | ||
| jinja2 | ||
| pyyaml | ||
| rich | ||
| rich-click | ||
| typing-extensions | ||
| psutil | ||
| polyfactory | ||
| litestar-htmx | ||
| trio | ||
| cryptography | ||
| psycopg | ||
| fsspec | ||
| mako | ||
| time-machine | ||
| asyncpg | ||
| picologging | ||
| ]; | ||
|
|
||
| meta = { | ||
| homepage = "https://litestar.dev/"; | ||
| platforms = lib.platforms.unix; | ||
| maintainers = with lib.maintainers; [ bot-wxt1221 ]; | ||
| changelog = "https://github.com/litestar-org/litestar/releases/tag/v${version}"; | ||
| description = "Production-ready, Light, Flexible and Extensible ASGI API framework"; | ||
| license = lib.licenses.mit; | ||
| }; | ||
| } | ||
| { python3Packages }: with python3Packages; toPythonApplication litestar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| { | ||
| lib, | ||
| buildPythonPackage, | ||
| fetchFromGitHub, | ||
|
|
||
| # build-system | ||
| hatchling, | ||
|
|
||
| # dependencies | ||
| anyio, | ||
| asyncpg, | ||
| click, | ||
| cryptography, | ||
| fsspec, | ||
| httpx, | ||
| jinja2, | ||
| litestar-htmx, | ||
| mako, | ||
| msgspec, | ||
| multidict, | ||
| picologging, | ||
| polyfactory, | ||
| psutil, | ||
| psycopg, | ||
| pyyaml, | ||
| redis, | ||
| rich, | ||
| rich-click, | ||
| time-machine, | ||
| trio, | ||
| typing-extensions, | ||
|
|
||
| # tests | ||
| pytestCheckHook, | ||
| pytest-lazy-fixtures, | ||
| pytest-xdist, | ||
| pytest-mock, | ||
| pytest-asyncio, | ||
| pytest-timeout, | ||
| pytest-rerunfailures, | ||
| versionCheckHook, | ||
| }: | ||
|
|
||
| buildPythonPackage rec { | ||
| pname = "litestar"; | ||
| version = "2.13.0"; | ||
| pyproject = true; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "litestar-org"; | ||
| repo = "litestar"; | ||
| tag = "v${version}"; | ||
| hash = "sha256-PR2DVNRtILHs7XwVi9/ZCVRJQFqfGLn1x2gpYtYjHDo="; | ||
| }; | ||
|
|
||
| build-system = [ | ||
| hatchling | ||
| ]; | ||
|
|
||
| dependencies = [ | ||
| anyio | ||
| asyncpg | ||
| click | ||
| cryptography | ||
| fsspec | ||
| httpx | ||
| jinja2 | ||
| litestar-htmx | ||
| mako | ||
| msgspec | ||
| multidict | ||
| picologging | ||
| polyfactory | ||
| psutil | ||
| psycopg | ||
| pyyaml | ||
| redis | ||
| rich | ||
| rich-click | ||
| time-machine | ||
| trio | ||
| typing-extensions | ||
| ]; | ||
|
|
||
| nativeCheckInputs = [ | ||
| pytestCheckHook | ||
| pytest-lazy-fixtures | ||
| pytest-xdist | ||
| pytest-mock | ||
| pytest-asyncio | ||
| pytest-timeout | ||
| pytest-rerunfailures | ||
| versionCheckHook | ||
| ]; | ||
| versionCheckProgramArg = [ "version" ]; | ||
|
|
||
| __darwinAllowLocalNetworking = true; | ||
|
|
||
| pytestFlagsArray = [ | ||
| # Follow github CI | ||
| "docs/examples/" | ||
| ]; | ||
|
|
||
| meta = { | ||
| homepage = "https://litestar.dev/"; | ||
| platforms = lib.platforms.unix; | ||
| maintainers = with lib.maintainers; [ bot-wxt1221 ]; | ||
| changelog = "https://github.com/litestar-org/litestar/releases/tag/v${version}"; | ||
| description = "Production-ready, Light, Flexible and Extensible ASGI API framework"; | ||
| license = lib.licenses.mit; | ||
| mainProgram = "litestar"; | ||
| }; | ||
| } | ||
|
Bot-wxt1221 marked this conversation as resolved.
Outdated
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| diff --git a/src/picologging/compat.hxx b/src/picologging/compat.hxx | ||
| index d3356da..be7a1fc 100644 | ||
| --- a/src/picologging/compat.hxx | ||
| +++ b/src/picologging/compat.hxx | ||
| @@ -88,4 +88,12 @@ static inline PyObject* _Py_XNewRef(PyObject *obj) | ||
| } | ||
| #endif | ||
|
|
||
| +// For Python 3.13 and above, PyTime_t is now part of the public API | ||
| +#if PY_VERSION_HEX >= 0x030d0000 | ||
| +#define _PyTime_t PyTime_t | ||
| +#define _PyTime_AsSecondsDouble PyTime_AsSecondsDouble | ||
| +#define _PyTime_AsMilliseconds PyTime_AsMilliseconds | ||
| +#define _PyTime_ROUND_CEILING PyTime_ROUND_CEILING | ||
| +#endif | ||
| + | ||
| #endif // COMPAT_H | ||
| \ No newline at end of file | ||
|
|
||
| From fe313d8b3dcf0115e1be781e03b20673d3f51c3f Mon Sep 17 00:00:00 2001 | ||
| From: Anthony Shaw <anthony.p.shaw@gmail.com> | ||
| Date: Sat, 14 Sep 2024 17:33:25 +1000 | ||
| Subject: [PATCH 2/2] Patch other changed APIs for pytime | ||
|
|
||
| --- | ||
| pyproject.toml | 2 +- | ||
| src/picologging/compat.hxx | 2 -- | ||
| src/picologging/logrecord.cxx | 13 +++++++++++++ | ||
| 3 files changed, 14 insertions(+), 3 deletions(-) | ||
|
|
||
| diff --git a/pyproject.toml b/pyproject.toml | ||
| index 33abe66..27628c9 100644 | ||
| --- a/pyproject.toml | ||
| +++ b/pyproject.toml | ||
| @@ -1,7 +1,7 @@ | ||
| [build-system] | ||
| requires = [ | ||
| "setuptools>=65.4.1", | ||
| - "scikit-build>=0.17.0", | ||
| + "scikit-build>=0.18.0", | ||
| "cmake>=3.18", | ||
| "ninja", | ||
| ] | ||
| diff --git a/src/picologging/compat.hxx b/src/picologging/compat.hxx | ||
| index be7a1fc..7c6970d 100644 | ||
| --- a/src/picologging/compat.hxx | ||
| +++ b/src/picologging/compat.hxx | ||
| @@ -92,8 +92,6 @@ static inline PyObject* _Py_XNewRef(PyObject *obj) | ||
| #if PY_VERSION_HEX >= 0x030d0000 | ||
| #define _PyTime_t PyTime_t | ||
| #define _PyTime_AsSecondsDouble PyTime_AsSecondsDouble | ||
| -#define _PyTime_AsMilliseconds PyTime_AsMilliseconds | ||
| -#define _PyTime_ROUND_CEILING PyTime_ROUND_CEILING | ||
| #endif | ||
|
|
||
| #endif // COMPAT_H | ||
| \ No newline at end of file | ||
| diff --git a/src/picologging/logrecord.cxx b/src/picologging/logrecord.cxx | ||
| index cec68c9..9f5cf86 100644 | ||
| --- a/src/picologging/logrecord.cxx | ||
| +++ b/src/picologging/logrecord.cxx | ||
| @@ -16,11 +16,19 @@ _PyFloat_FromPyTime(_PyTime_t t) | ||
|
|
||
| _PyTime_t current_time() | ||
| { | ||
| +#if PY_VERSION_HEX >= 0x030d0000 | ||
| + _PyTime_t t; | ||
| + if (PyTime_Time(&t) < 0) { | ||
| + return -1; | ||
| + } | ||
| + return t; | ||
| +#else | ||
| _PyTime_t t; | ||
| if (_PyTime_GetSystemClockWithInfo(&t, NULL) < 0) { | ||
| return -1; | ||
| } | ||
| return t; | ||
| +#endif | ||
| } | ||
|
|
||
| PyObject* LogRecord_new(PyTypeObject* type, PyObject *initargs, PyObject *kwds) | ||
| @@ -162,7 +170,12 @@ LogRecord* LogRecord_create(LogRecord* self, PyObject* name, PyObject* msg, PyOb | ||
| } | ||
|
|
||
| self->created = _PyTime_AsSecondsDouble(ctime); | ||
| +// msecs conversion isn't in 3.13 API | ||
| +#if PY_VERSION_HEX < 0x030d0000 | ||
| self->msecs = _PyTime_AsMilliseconds(ctime, _PyTime_ROUND_CEILING); | ||
| +#else | ||
| + self->msecs = 0; | ||
| +#endif | ||
| self->relativeCreated = _PyFloat_FromPyTime((ctime - startTime) * 1000); | ||
| self->thread = PyThread_get_thread_ident(); // Only supported in Python 3.7+, if big demand for 3.6 patch this out for the old API. | ||
| // TODO #2 : See if there is a performant way to get the thread name. |
|
Bot-wxt1221 marked this conversation as resolved.
Outdated
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.