From 4ce1122a3e8867bd26e583a25b2e2f996703a63b Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 16 Aug 2021 08:25:46 -0400 Subject: [PATCH 1/6] thrift: Move from Python 2 to Python 3 The Twisted dependency now requires Python 3. Also, Python 2 is long-since EOL. --- pkgs/development/libraries/thrift/0.10.nix | 6 +++--- pkgs/development/libraries/thrift/default.nix | 6 +++--- pkgs/top-level/all-packages.nix | 8 ++------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/thrift/0.10.nix b/pkgs/development/libraries/thrift/0.10.nix index d81912b07c61..001de25e9963 100644 --- a/pkgs/development/libraries/thrift/0.10.nix +++ b/pkgs/development/libraries/thrift/0.10.nix @@ -1,5 +1,5 @@ -{ lib, stdenv, fetchurl, boost, zlib, libevent, openssl, python, pkg-config, bison -, flex, twisted +{ lib, stdenv, fetchurl, boost, zlib, libevent, openssl, python3, pkg-config, bison +, flex }: stdenv.mkDerivation rec { @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; buildInputs = [ - boost zlib libevent openssl python bison flex twisted + boost zlib libevent openssl bison flex (python3.withPackages (ps: [ps.twisted])) ]; preConfigure = "export PY_PREFIX=$out"; diff --git a/pkgs/development/libraries/thrift/default.nix b/pkgs/development/libraries/thrift/default.nix index a34fc36484d9..6460be99fd47 100644 --- a/pkgs/development/libraries/thrift/default.nix +++ b/pkgs/development/libraries/thrift/default.nix @@ -1,5 +1,5 @@ -{ lib, stdenv, fetchurl, boost, zlib, libevent, openssl, python, cmake, pkg-config -, bison, flex, twisted +{ lib, stdenv, fetchurl, boost, zlib, libevent, openssl, python3, cmake, pkg-config +, bison, flex , static ? stdenv.hostPlatform.isStatic }: @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config bison flex ]; buildInputs = [ boost zlib libevent openssl ] - ++ lib.optionals (!static) [ python twisted ]; + ++ lib.optionals (!static) [ (python3.withPackages (ps: [ps.twisted])) ]; preConfigure = "export PY_PREFIX=$out"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9a32c15dcd42..e9e7ad540721 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18916,13 +18916,9 @@ with pkgs; theft = callPackage ../development/libraries/theft { }; - thrift = callPackage ../development/libraries/thrift { - inherit (pythonPackages) twisted; - }; + thrift = callPackage ../development/libraries/thrift { }; - thrift-0_10 = callPackage ../development/libraries/thrift/0.10.nix { - inherit (pythonPackages) twisted; - }; + thrift-0_10 = callPackage ../development/libraries/thrift/0.10.nix { }; tidyp = callPackage ../development/libraries/tidyp { }; From 1975b07db3700a7ca503eda9fa077205fc5a981a Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 16 Aug 2021 09:46:15 -0400 Subject: [PATCH 2/6] maintainers: add exarkun --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 568f00696f78..37711fe0fa1e 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -3419,6 +3419,12 @@ githubId = 454695; name = "Artur Taranchiev"; }; + exarkun = { + email = "exarkun@twistedmatrix.com"; + github = "exarkun"; + githubId = 254565; + name = "Jean-Paul Calderone"; + }; exfalso = { email = "0slemi0@gmail.com"; github = "exfalso"; From e41b0b50b0e507c21d226195a557f131f699e583 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 9 Aug 2021 08:50:08 -0400 Subject: [PATCH 3/6] pythonPackages.txtorcon: run tests with trial and disable for Date: Fri, 6 Aug 2021 18:47:46 -0400 Subject: [PATCH 4/6] pythonPackages.tubes: init at 0.2.0 --- .../python-modules/tubes/default.nix | 29 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 pkgs/development/python-modules/tubes/default.nix diff --git a/pkgs/development/python-modules/tubes/default.nix b/pkgs/development/python-modules/tubes/default.nix new file mode 100644 index 000000000000..0dbfe2206570 --- /dev/null +++ b/pkgs/development/python-modules/tubes/default.nix @@ -0,0 +1,29 @@ +{ lib, buildPythonPackage, fetchPypi, python +, characteristic, six, twisted +}: + +buildPythonPackage rec { + pname = "tubes"; + version = "0.2.0"; + + src = fetchPypi { + pname = "Tubes"; + inherit version; + sha256 = "0sg1gg2002h1xsgxigznr1zk1skwmhss72dzk6iysb9k9kdgymcd"; + }; + + propagatedBuildInputs = [ characteristic six twisted ]; + + checkPhase = '' + ${python.interpreter} -m twisted.trial -j $NIX_BUILD_CORES tubes + ''; + + pythonImportsCheck = [ "tubes" ]; + + meta = with lib; { + description = "a data-processing and flow-control engine for event-driven programs"; + homepage = "https://github.com/twisted/tubes"; + license = licenses.mit; + maintainers = with maintainers; [ exarkun ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 431d4a9959e3..76dcaca59d0c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8920,6 +8920,8 @@ in { ttp = callPackage ../development/python-modules/ttp { }; + tubes = callPackage ../development/python-modules/tubes { }; + tunigo = callPackage ../development/python-modules/tunigo { }; tubeup = callPackage ../development/python-modules/tubeup { }; From 804a2a35de5afea8100bb3f962cbf8b561f91e40 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 6 Aug 2021 19:10:10 -0400 Subject: [PATCH 5/6] pythonPackages.klein: 17.10.0 -> 21.8.0 --- .../python-modules/klein/default.nix | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/klein/default.nix b/pkgs/development/python-modules/klein/default.nix index f4c26edd0e4a..a2870f3ca70d 100644 --- a/pkgs/development/python-modules/klein/default.nix +++ b/pkgs/development/python-modules/klein/default.nix @@ -1,35 +1,29 @@ -{ lib, buildPythonPackage, fetchPypi, fetchpatch -, six, twisted, werkzeug, incremental -, mock }: +{ lib, buildPythonPackage, fetchPypi, python +, attrs, enum34, hyperlink, incremental, six, twisted, typing, tubes, werkzeug, zope_interface +, hypothesis, treq +}: buildPythonPackage rec { pname = "klein"; - version = "17.10.0"; + version = "21.8.0"; src = fetchPypi { inherit pname version; - sha256 = "30aaf0d78a987d5dbfe0968a07367ad0c73e02823cc8eef4c54f80ab848370d0"; + sha256 = "1mpydmz90d0n9dwa7mr6pgj5v0kczfs05ykssrasdq368dssw7ch"; }; - patches = [ - (fetchpatch { - name = "tests-expect-werkzeug-308.patch"; - url = "https://github.com/twisted/klein/commit/e2a5835b83e37a2bc5faefbfe1890c529b18b9c6.patch"; - sha256 = "03j0bj3l3hnf7f96rb27i4bzy1iih79ll5bcah7gybdi1wpznh8w"; - }) - ]; + propagatedBuildInputs = [ attrs enum34 hyperlink incremental six twisted typing tubes werkzeug zope_interface ]; - propagatedBuildInputs = [ six twisted werkzeug incremental ]; - - checkInputs = [ mock twisted ]; + checkInputs = [ hypothesis treq ]; checkPhase = '' - trial klein + ${python.interpreter} -m twisted.trial -j $NIX_BUILD_CORES klein ''; meta = with lib; { description = "Klein Web Micro-Framework"; homepage = "https://github.com/twisted/klein"; license = licenses.mit; + maintainers = with maintainers; [ exarkun ]; }; } From c06357825bd099f028d1ca3761929f1522f82b47 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 6 Aug 2021 09:44:45 -0400 Subject: [PATCH 6/6] pythonPackages.twisted: 20.3.0 -> 21.7.0 --- pkgs/development/python-modules/twisted/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/twisted/default.nix b/pkgs/development/python-modules/twisted/default.nix index 421565725b14..b09ccebde198 100644 --- a/pkgs/development/python-modules/twisted/default.nix +++ b/pkgs/development/python-modules/twisted/default.nix @@ -13,18 +13,19 @@ , service-identity , setuptools , idna +, typing-extensions }: buildPythonPackage rec { pname = "Twisted"; - version = "20.3.0"; + version = "21.7.0"; src = fetchPypi { inherit pname version; - extension = "tar.bz2"; - sha256 = "040yzha6cyshnn6ljgk2birgh6mh2cnra48xp5ina5vfsnsmab6p"; + extension = "tar.gz"; + sha256 = "01lh225d7lfnmfx4f4kxwl3963gjc9yg8jfkn1w769v34ia55mic"; }; - propagatedBuildInputs = [ zope_interface incremental automat constantly hyperlink pyhamcrest attrs setuptools ]; + propagatedBuildInputs = [ zope_interface incremental automat constantly hyperlink pyhamcrest attrs setuptools typing-extensions ]; passthru.extras.tls = [ pyopenssl service-identity idna ]; @@ -32,7 +33,7 @@ buildPythonPackage rec { # twisted.python.runtime.platform.supportsINotify() == False patchPhase = lib.optionalString stdenv.isLinux '' substituteInPlace src/twisted/python/_inotify.py --replace \ - "ctypes.util.find_library('c')" "'${stdenv.glibc.out}/lib/libc.so.6'" + "ctypes.util.find_library(\"c\")" "'${stdenv.glibc.out}/lib/libc.so.6'" ''; # Generate Twisted's plug-in cache. Twisted users must do it as well. See