From 9d709b63e1e2873de7a153dffa71f1fdf328fcb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 6 Dec 2024 16:35:55 +0100 Subject: [PATCH 1/3] reno: move to python3Packages, fetch from source, misc cleanup (cherry picked from commit b8836cf44a9fe485619f67b5cfe541c5ff2d6290) Fixup formatting conflict caused by the recent treewide formatting. --- .../reno/default.nix | 51 ++++++++++--------- pkgs/top-level/all-packages.nix | 4 +- pkgs/top-level/python-packages.nix | 2 + 3 files changed, 29 insertions(+), 28 deletions(-) rename pkgs/development/{tools => python-modules}/reno/default.nix (65%) diff --git a/pkgs/development/tools/reno/default.nix b/pkgs/development/python-modules/reno/default.nix similarity index 65% rename from pkgs/development/tools/reno/default.nix rename to pkgs/development/python-modules/reno/default.nix index 04990e6d71e93..556374be32516 100644 --- a/pkgs/development/tools/reno/default.nix +++ b/pkgs/development/python-modules/reno/default.nix @@ -1,42 +1,48 @@ { + buildPythonApplication, + dulwich, + docutils, lib, - fetchPypi, + fetchFromGitHub, git, - gnupg1, - python3Packages, + gnupg, + pbr, + pyyaml, + setuptools, + sphinx, + stestr, + testtools, + testscenarios, }: -python3Packages.buildPythonApplication rec { +buildPythonApplication rec { pname = "reno"; version = "4.1.0"; pyproject = true; - # Must be built from python sdist because of versioning quirks - src = fetchPypi { - inherit pname version; - hash = "sha256-+ZLx/b0WIV7J3kevCBMdU6KDDJ54Q561Y86Nan9iU3A="; + src = fetchFromGitHub { + owner = "openstack"; + repo = "reno"; + rev = "refs/tags/${version}"; + hash = "sha256-le9JtE0XODlYhTFsrjxFXG/Weshr+FyN4M4S3BMBLUE="; }; - # remove b/c doesn't list all dependencies, and requires a few packages not in nixpkgs - postPatch = '' - rm test-requirements.txt - ''; + env.PBR_VERSION = version; - build-system = with python3Packages; [ + build-system = [ setuptools ]; - dependencies = with python3Packages; [ + dependencies = [ dulwich pbr pyyaml - setuptools # required for finding pkg_resources at runtime + setuptools ]; - nativeCheckInputs = with python3Packages; [ + nativeCheckInputs = [ # Python packages docutils - fixtures sphinx stestr testtools @@ -44,12 +50,12 @@ python3Packages.buildPythonApplication rec { # Required programs to run all tests git - gnupg1 + gnupg ]; checkPhase = '' runHook preCheck - export HOME=$TMPDIR + export HOME=$(mktemp -d) stestr run -e <(echo " # Expects to be run from a git repository reno.tests.test_cache.TestCache.test_build_cache_db @@ -79,11 +85,6 @@ python3Packages.buildPythonApplication rec { mainProgram = "reno"; homepage = "https://docs.openstack.org/reno/latest"; license = licenses.asl20; - maintainers = - teams.openstack.members - ++ (with maintainers; [ - drewrisinger - guillaumekoenig - ]); + maintainers = teams.openstack.members; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d7c8e8cc58fa1..a9ee8976850c7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8571,9 +8571,7 @@ with pkgs; inherit (regclient) regbot regctl regsync; - reno = callPackage ../development/tools/reno { - python3Packages = python311Packages; - }; + reno = with python311Packages; toPythonApplication reno; replace-secret = callPackage ../build-support/replace-secret/replace-secret.nix { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3c173f7745f23..dc694326869bc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13738,6 +13738,8 @@ self: super: with self; { rencode = callPackage ../development/python-modules/rencode { }; + reno = callPackage ../development/python-modules/reno { }; + renson-endura-delta = callPackage ../development/python-modules/renson-endura-delta { }; reorder-python-imports = callPackage ../development/python-modules/reorder-python-imports { }; From 959ba1e98668aea27854996789f557093a4400e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 6 Dec 2024 16:36:37 +0100 Subject: [PATCH 2/3] python312Packages.pbr: fix python 3.12 compatibility for packaging module (cherry picked from commit d73c12eb29238e1959c210de9fd7dc302ae20319) --- pkgs/development/python-modules/pbr/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/pbr/default.nix b/pkgs/development/python-modules/pbr/default.nix index bd45d03af8928..d500a215be114 100644 --- a/pkgs/development/python-modules/pbr/default.nix +++ b/pkgs/development/python-modules/pbr/default.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, callPackage, + distutils, fetchPypi, setuptools, six, @@ -20,6 +21,7 @@ buildPythonPackage rec { build-system = [ setuptools ]; dependencies = [ + distutils # for distutils.command in pbr/packaging.py setuptools # for pkg_resources six ]; From 6bb937045e1c0ccd6a47ec00f69f944de60b302a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 6 Dec 2024 16:36:52 +0100 Subject: [PATCH 3/3] python312Packages.openstackdocstheme: allow for python 3.12 (cherry picked from commit 55a30bdb016497a7ced7a4cdc7affe1539f9459a) --- pkgs/development/python-modules/openstackdocstheme/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/openstackdocstheme/default.nix b/pkgs/development/python-modules/openstackdocstheme/default.nix index 7391fb37ba7a8..c0e75fcab9b93 100644 --- a/pkgs/development/python-modules/openstackdocstheme/default.nix +++ b/pkgs/development/python-modules/openstackdocstheme/default.nix @@ -14,8 +14,7 @@ buildPythonPackage rec { version = "3.4.0"; pyproject = true; - # breaks on import due to distutils import through pbr.packaging - disabled = pythonAtLeast "3.12"; + disabled = pythonAtLeast "3.13"; src = fetchPypi { inherit pname version;