From e8aede8883f3056b93173f15b735487b87d53879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 12 Dec 2024 08:53:01 -0800 Subject: [PATCH 1/2] python312Packages.django-q: fix build --- .../python-modules/django-q/default.nix | 8 ++- .../python-modules/django-q/pep-621.patch | 50 ++++++++----------- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/pkgs/development/python-modules/django-q/default.nix b/pkgs/development/python-modules/django-q/default.nix index 51670368c577..fac1bfa327a8 100644 --- a/pkgs/development/python-modules/django-q/default.nix +++ b/pkgs/development/python-modules/django-q/default.nix @@ -17,6 +17,7 @@ pytestCheckHook, pythonOlder, redis, + setuptools, }: buildPythonPackage rec { @@ -33,20 +34,23 @@ buildPythonPackage rec { hash = "sha256-gFSrAl3QGoJEJfvTTvLQgViPPjeJ6BfvgEwgLLo+uAA="; }; - # fixes empty version string - # analog to https://github.com/NixOS/nixpkgs/pull/171200 patches = [ ./pep-621.patch ]; build-system = [ poetry-core ]; + pythonRelaxDeps = [ + "redis" + ]; + dependencies = [ django-picklefield arrow blessed django future + setuptools # for pkg_resources ]; nativeCheckInputs = [ diff --git a/pkgs/development/python-modules/django-q/pep-621.patch b/pkgs/development/python-modules/django-q/pep-621.patch index e0a1568f4825..5f89201e3511 100644 --- a/pkgs/development/python-modules/django-q/pep-621.patch +++ b/pkgs/development/python-modules/django-q/pep-621.patch @@ -1,32 +1,24 @@ diff --git a/pyproject.toml b/pyproject.toml -index 9a83e90..0cdffaf 100644 +index 9a83e90..07068ac 100644 --- a/pyproject.toml +++ b/pyproject.toml -@@ -1,16 +1,12 @@ --[tool.poetry] -+[project] - name = "django-q" - version = "1.3.9" - description = "A multiprocessing distributed task queue for Django" --authors = ["Ilan Steemers "] --maintainers = ["Ilan Steemers "] --license = "MIT" -+authors = [ { name = "Ilan Steemers", email = "koed00@gmail.com"} ] -+maintainers = [ { name = "Ilan Steemers", email = "koed00@gmail.com"} ] -+license.text = "MIT" - readme = 'README.rst' - --repository = "https://github.com/koed00/django-q" --homepage = "https://django-q.readthedocs.org" --documentation = "https://django-q.readthedocs.org" -- - keywords = ["django", "distributed", "multiprocessing", "queue", "scheduler"] - - classifiers = [ -@@ -31,7 +27,6 @@ classifiers = [ - 'Topic :: System :: Distributed Computing', - 'Topic :: Software Development :: Libraries :: Python Modules', - ] --include = ['CHANGELOG.md'] - - [tool.poetry.plugins] # Optional super table +@@ -67,13 +67,15 @@ pytest-cov = "^2.12.0" + black = { version = "^21.5b1", allow-prereleases = true } + isort = {extras = ["requirements_deprecated_finder"], version = "^5.8.0"} + +-[tool.poetry.extras] ++[build-system] + requires = ["poetry_core>=1.0.0"] +-build-backend = ["poetry.core.masonry.api"] ++build-backend = "poetry.core.masonry.api" ++ ++[tool.poetry.extras] + testing = ["django-redis", "croniter", "hiredis", "psutil", "iron-mq", "boto3", "pymongo"] + rollbar = ["django-q-rollbar"] + sentry = ["django-q-sentry"] + + [tool.isort] + profile = "black" +-multi_line_output = 3 +\ No newline at end of file ++multi_line_output = 3 From a3881c16952efbd1383fe0501b28f1b369d8f465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 12 Dec 2024 09:09:57 -0800 Subject: [PATCH 2/2] python312Packages.preprocess-cancellation: only use poetry-core --- .../preprocess-cancellation/default.nix | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/preprocess-cancellation/default.nix b/pkgs/development/python-modules/preprocess-cancellation/default.nix index 7294e7808e57..443c115b0201 100644 --- a/pkgs/development/python-modules/preprocess-cancellation/default.nix +++ b/pkgs/development/python-modules/preprocess-cancellation/default.nix @@ -4,7 +4,6 @@ pythonOlder, fetchFromGitHub, poetry-core, - setuptools, shapely, pytestCheckHook, }: @@ -13,7 +12,7 @@ buildPythonPackage rec { pname = "preprocess-cancellation"; version = "0.2.1"; disabled = pythonOlder "3.6"; # >= 3.6 - format = "pyproject"; + pyproject = true; # No tests in PyPI src = fetchFromGitHub { @@ -26,22 +25,20 @@ buildPythonPackage rec { postPatch = '' sed -i "/^addopts/d" pyproject.toml - # setuptools 61 compatibility - # error: Multiple top-level packages discovered in a flat-layout: ['STLs', 'GCode']. - mkdir tests - mv GCode STLs test_* tests - substituteInPlace tests/test_preprocessor.py \ - --replace "./GCode" "./tests/GCode" - substituteInPlace tests/test_preprocessor_with_shapely.py \ - --replace "./GCode" "./tests/GCode" + cat >> pyproject.toml << EOF + [build-system] + requires = ["poetry-core"] + build-backend = "poetry.core.masonry.api" + EOF ''; - nativeBuildInputs = [ + build-system = [ poetry-core - setuptools ]; - propagatedBuildInputs = [ shapely ]; + optional-dependencies = { + shapely = [ shapely ]; + }; nativeCheckInputs = [ pytestCheckHook ];