about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2023-08-11 15:30:29 +0200
committerGitHub <noreply@github.com>2023-08-11 15:30:29 +0200
commit954b6397ae336ba8403f790bc4cd6d8d6916f34d (patch)
tree58b42e2ebd089a2c5bce673bc08f5375dc40a608 /pkgs/development
parent672af9303f2fcf63f5757a6e32dd2939d20ce8b3 (diff)
parentafb1afc55ef92f81c1b1a2f10fc3fe6bfa1b9129 (diff)
Merge pull request #246829 from tjni/d2to1-cleanup
python3.pkgs.d2to1: remove as it's archived and breaks with setuptools 68
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/colour/default.nix27
-rw-r--r--pkgs/development/python-modules/colour/remove-unmaintained-d2to1.diff65
-rw-r--r--pkgs/development/python-modules/d2to1/default.nix25
3 files changed, 89 insertions, 28 deletions
diff --git a/pkgs/development/python-modules/colour/default.nix b/pkgs/development/python-modules/colour/default.nix
index f7419666f5359..2dd31a02bbe77 100644
--- a/pkgs/development/python-modules/colour/default.nix
+++ b/pkgs/development/python-modules/colour/default.nix
@@ -1,15 +1,36 @@
-{ lib, buildPythonPackage, fetchPypi, d2to1 }:
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pytestCheckHook
+}:
 
 buildPythonPackage rec {
   pname = "colour";
   version = "0.1.5";
+  format = "setuptools";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "af20120fefd2afede8b001fbef2ea9da70ad7d49fafdb6489025dae8745c3aee";
+    hash = "sha256-ryASD+/Sr+3osAH77y6p2nCtfUn6/bZIkCXa6HRcOu4=";
   };
 
-  buildInputs = [ d2to1 ];
+  patches = [
+    # https://github.com/vaab/colour/pull/66 (but does not merge cleanly)
+    ./remove-unmaintained-d2to1.diff
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
+
+  pytestFlagsArray = [
+    "--doctest-glob=\"*.rst\""
+    "--doctest-modules"
+  ];
+
+  pythonImportsCheck = [
+    "colour"
+  ];
 
   meta = with lib; {
     description = "Converts and manipulates common color representation (RGB, HSV, web, ...)";
diff --git a/pkgs/development/python-modules/colour/remove-unmaintained-d2to1.diff b/pkgs/development/python-modules/colour/remove-unmaintained-d2to1.diff
new file mode 100644
index 0000000000000..2cac787bf501b
--- /dev/null
+++ b/pkgs/development/python-modules/colour/remove-unmaintained-d2to1.diff
@@ -0,0 +1,65 @@
+diff --git a/setup.cfg b/setup.cfg
+index 41de928..1c18182 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -1,18 +1,14 @@
+ [metadata]
+ name = colour
+ version = 0.1.5
+-summary = converts and manipulates various color representation (HSL, RVB, web, X11, ...)
+-description-file = 
+-	README.rst
+-	CHANGELOG.rst
+-	TODO.rst
+-license_file = LICENSE
+-requires-dist = 
++description = converts and manipulates various color representation (HSL, RVB, web, X11, ...)
++long_description = file: README.rst, CHANGELOG.rst, TODO.rst
++license_files = LICENSE
+ author = Valentin LAB
+ author_email = valentin.lab@kalysto.org
+-home_page = http://github.com/vaab/colour
++url = http://github.com/vaab/colour
+ license = BSD 3-Clause License
+-classifier = 
++classifiers = 
+ 	Programming Language :: Python
+ 	Topic :: Software Development :: Libraries :: Python Modules
+ 	Development Status :: 3 - Alpha
+@@ -26,16 +22,8 @@ classifier =
+ 	Programming Language :: Python :: 3.5
+ 	Programming Language :: Python :: 3.6
+ 
+-[files]
+-modules = colour
+-extra_files = 
+-	README.rst
+-	CHANGELOG.rst
+-	TODO.rst
+-	setup.py
+-
+-[backwards_compat]
+-zip-safe = False
++[options]
++zip_safe = False
+ 
+ [bdist_wheel]
+ universal = 1
+diff --git a/setup.py b/setup.py
+index 47038f9..11a8d3a 100644
+--- a/setup.py
++++ b/setup.py
+@@ -54,12 +54,4 @@ if "%%short-version%%".startswith("%%"):
+     sys.exit(errlvl)
+ 
+ 
+-##
+-## Normal d2to1 setup
+-##
+-
+-setup(
+-    setup_requires=['d2to1'],
+-    extras_require={'test': ['nose', ]},
+-    d2to1=True
+-)
++setup(extras_require={'test': ['nose', ]})
diff --git a/pkgs/development/python-modules/d2to1/default.nix b/pkgs/development/python-modules/d2to1/default.nix
deleted file mode 100644
index eaad9fc9095bd..0000000000000
--- a/pkgs/development/python-modules/d2to1/default.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-{ buildPythonPackage
-, lib
-, fetchFromGitHub
-, nose
-}:
-buildPythonPackage rec {
-  pname = "d2to1";
-  version = "0.2.12.post1";
-
-  nativeCheckInputs = [ nose ];
-
-  src = fetchFromGitHub {
-    owner = "embray";
-    repo = pname;
-    rev = version;
-    sha256 = "1hzq51qbzsc27yy8swp08kf42mamag7qcabbrigzj4m6ivb5chi2";
-  };
-
-  meta = with lib;{
-    description = "Support for distutils2-like setup.cfg files as package metadata";
-    homepage = "https://github.com/embray/d2to1";
-    license = licenses.bsd2;
-    maintainers = with maintainers; [ makefu ];
-  };
-}