guix_mirror_bot pushed a commit to branch master
in repository guix.

commit e6be560b495c698a1f2a44ac22ac7d8978c2b1d8
Author: Nicolas Graves <[email protected]>
AuthorDate: Fri Oct 3 16:34:01 2025 +0200

    gnu: python-colour: Switch to pyproject.
    
    * gnu/local.mk (python-colour):
    [source]: Switch to git-fetch. Add patch to remove d2to1 dependency.
    [build-system]: Switch to pyproject-build-system.
    [arguments]<#:phases>: Add phase 'set-version.
    <#:tests?>: Disable them.
    [native-inputs]: Add python-setuptools.
    [description]: Improve style.
    
    Change-Id: Icf722a429f7bb70b08e81d0048624c5ba2e82a89
    Signed-off-by: Sharlatan Hellseher <[email protected]>
---
 gnu/local.mk                                       |  1 +
 .../patches/python-colour-remove-d2to1.patch       | 80 ++++++++++++++++++++++
 gnu/packages/python-xyz.scm                        | 40 ++++++++---
 3 files changed, 110 insertions(+), 11 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index afa5ab32b2..4bdfb4e860 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2161,6 +2161,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/python-angr-check-exec-deps.patch       \
   %D%/packages/patches/python-3-reproducible-build.patch       \
   %D%/packages/patches/python-cross-compile.patch              \
+  %D%/packages/patches/python-colour-remove-d2to1.patch                \
   %D%/packages/patches/python-configobj-setuptools.patch       \
   %D%/packages/patches/python-debugpy-unbundle-pydevd.patch    \
   %D%/packages/patches/python-docopt-pytest6-compat.patch      \
diff --git a/gnu/packages/patches/python-colour-remove-d2to1.patch 
b/gnu/packages/patches/python-colour-remove-d2to1.patch
new file mode 100644
index 0000000000..d887be9124
--- /dev/null
+++ b/gnu/packages/patches/python-colour-remove-d2to1.patch
@@ -0,0 +1,80 @@
+From bc2013b76df8ebf404565a831f77f325cb95df1a Mon Sep 17 00:00:00 2001
+From: Theodore Ni <[email protected]>
+Date: Sun, 30 Jul 2023 10:05:54 -0700
+Subject: [PATCH] Remove unmaintained d2to1 during setup.
+
+---
+ setup.cfg | 27 +++++++--------------------
+ setup.py  | 10 +---------
+ 2 files changed, 8 insertions(+), 29 deletions(-)
+
+diff --git a/setup.cfg b/setup.cfg
+index a6616d0..0bf46f4 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -1,20 +1,16 @@
+ [metadata]
+ name = %%name%%
+ version = %%version%%
+-summary = %%description%%
+-description-file =
+-    README.rst
+-    CHANGELOG.rst
+-    TODO.rst
+-license_file = LICENSE
+-requires-dist =
++description = %%description%%
++long_description = file: README.rst, CHANGELOG.rst, TODO.rst
++license_files = LICENSE
+ 
+ ## sdist info
+ author = %%author%%
+ author_email = %%email%%
+-home_page = http://github.com/vaab/%%name%%
++url = http://github.com/vaab/%%name%%
+ license = BSD 3-Clause License
+-classifier =
++classifiers =
+     Programming Language :: Python
+     Topic :: Software Development :: Libraries :: Python Modules
+     Development Status :: 3 - Alpha
+@@ -29,19 +25,10 @@ classifier =
+     Programming Language :: Python :: 3.6
+ 
+ 
+-[files]
+-modules = %%name%%
+-extra_files =
+-    README.rst
+-    CHANGELOG.rst
+-    TODO.rst
+-    setup.py
+-
+-
+-[backwards_compat]
++[options]
+ ## without this ``pip uninstall`` fails on recent version of setuptools
+ ## (tested failing with setuptools 34.3.3, working with setuptools 9.1)
+-zip-safe = False
++zip_safe = False
+ 
+ 
+ [bdist_wheel]
+diff --git a/setup.py b/setup.py
+index 47038f9..11a8d3a 100644
+--- a/setup.py
++++ b/setup.py
+@@ -54,12 +54,4 @@
+     sys.exit(errlvl)
+ 
+ 
+-##
+-## Normal d2to1 setup
+-##
+-
+-setup(
+-    setup_requires=['d2to1'],
+-    extras_require={'test': ['nose', ]},
+-    d2to1=True
+-)
++setup(extras_require={'test': ['nose', ]})
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5c9d7892a6..3574c9424e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3969,19 +3969,37 @@ automatically generate the interface code.")
   (package
     (name "python-colour")
     (version "0.1.5")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "colour" version))
-              (sha256
-               (base32
-                "1visbisfini5j14bdzgs95yssw6sm4pfzyq1n3lfvbyjxw7i485g"))))
-    (build-system python-build-system)
-    (native-inputs
-     (list python-d2to1))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/vaab/colour";)
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "01k2n3zp6j0bws78vdy7i9d6m4lz3bm8z7d7lv1czks1d4aamnr2"))
+       (patches (search-patches "python-colour-remove-d2to1.patch"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:tests? #f ; No tests.
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'set-version
+            (lambda _
+              (substitute* "autogen.sh"
+                (("if ! \"\\$git\".*")
+                 "if false ; then\n")
+                (("depends git grep")
+                 "depends grep")
+                (("version=\\$\\(\"\\$git\" describe --tags\\)")
+                 (format #f "version=~s" #$version))))))))
+    (native-inputs (list python-setuptools))
     (home-page "https://github.com/vaab/colour";)
     (synopsis "Convert and manipulate various color representations")
-    (description "Pythonic way to manipulate color representations (HSL, RVB,
-web, X11, ...).")
+    (description
+     "This package provides a pythonic way to manipulate color representations
+(HSL, RVB,web, X11, ...).")
     (license license:expat)))
 
 (define-public python-d2to1

Reply via email to