diff options
Diffstat (limited to 'pkgs/development/python-modules')
49 files changed, 616 insertions, 331 deletions
diff --git a/pkgs/development/python-modules/Babel/default.nix b/pkgs/development/python-modules/Babel/default.nix index 1074d2eef48..183478396eb 100644 --- a/pkgs/development/python-modules/Babel/default.nix +++ b/pkgs/development/python-modules/Babel/default.nix @@ -1,38 +1,17 @@ -{ stdenv, lib, buildPythonPackage, fetchPypi, fetchpatch, pytz, pytest, freezegun, glibcLocales }: +{ stdenv, lib, buildPythonPackage, fetchPypi, pytz, pytestCheckHook, freezegun }: buildPythonPackage rec { pname = "Babel"; - version = "2.7.0"; + version = "2.9.0"; src = fetchPypi { inherit pname version; - sha256 = "e86135ae101e31e2c8ec20a4e0c5220f4eed12487d5cf3f78be7e98d3a57fc28"; + sha256 = "018yg7g2pa6vjixx1nx41cfispgfi0azzp0a1chlycbj8jsil0ys"; }; - patches = [ - # The following 2 patches fix the test suite failing on nix < 2.3 with - # Python < 3 because those nix versions do not run in a pseudoterminal, - # which makes Python 2 not set the default encoding to UTF-8, and the - # Babel code crashes when printing a warning in that case. - # See #75676 and https://github.com/python-babel/babel/pull/691. - # It is important to fix this because otherwise Babel is not buildable - # with older nix versions (e.g. on machines used as --builders). - # TODO: Remove at release > 2.8.0. - (fetchpatch { - name = "Babel-Introduce-invariant-that-invalid_pofile-takes-unicode-line.patch"; - url = "https://github.com/python-babel/babel/commit/f4f6653e6aa053724d2c6dc0ee71dcb928013352.patch"; - sha256 = "1kyknwn9blspcf9yxmgdiaxdii1dnkblyhcflqwhxyl1mss1dxv5"; - }) - (fetchpatch { - name = "Babel-Fix-unicode-printing-error-on-Python-2-without-TTY.patch"; - url = "https://github.com/python-babel/babel/commit/da7f31143847659b6b74d802618b03438aceb350.patch"; - sha256 = "09yny8614knr8ngrrddmqzkxk70am135rccv2ncc6dji4xbqbfln"; - }) - ]; - propagatedBuildInputs = [ pytz ]; - checkInputs = [ pytest freezegun ]; + checkInputs = [ pytestCheckHook freezegun ]; doCheck = !stdenv.isDarwin; diff --git a/pkgs/development/python-modules/autobahn/default.nix b/pkgs/development/python-modules/autobahn/default.nix index 19015a5729a..2585cd539d7 100644 --- a/pkgs/development/python-modules/autobahn/default.nix +++ b/pkgs/development/python-modules/autobahn/default.nix @@ -1,34 +1,78 @@ -{ lib, buildPythonPackage, fetchPypi, isPy3k, - six, txaio, twisted, zope_interface, cffi, - mock, pytest, cryptography, pynacl +{ lib +, argon2_cffi +, attrs +, buildPythonPackage +, cbor +, cbor2 +, cffi +, cryptography +, fetchPypi +, flatbuffers +, mock +, msgpack +, passlib +, pynacl +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, twisted +, py-ubjson +, txaio +, ujson +, zope_interface }: + buildPythonPackage rec { pname = "autobahn"; version = "21.3.1"; - disabled = !isPy3k; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "e126c1f583e872fb59e79d36977cfa1f2d0a8a79f90ae31f406faae7664b8e03"; + sha256 = "00wf9dkfgakg80gy62prg650lb8zz9y9fdlxwxcznwp8hgsw29p1"; }; - propagatedBuildInputs = [ six txaio twisted zope_interface cffi cryptography pynacl ]; + propagatedBuildInputs = [ + argon2_cffi + cbor + cbor2 + cffi + cryptography + flatbuffers + msgpack + passlib + py-ubjson + pynacl + twisted + txaio + ujson + zope_interface + ]; + + checkInputs = [ + mock + pytest-asyncio + pytestCheckHook + ]; - checkInputs = [ mock pytest ]; - checkPhase = '' - runHook preCheck - USE_TWISTED=true py.test $out - runHook postCheck + postPatch = '' + substituteInPlace setup.py \ + --replace "pytest>=2.8.6,<3.3.0" "pytest" ''; - # Tests do no seem to be compatible yet with pytest 5.1 - # https://github.com/crossbario/autobahn-python/issues/1235 - doCheck = false; + preCheck = '' + # Run asyncio tests (requires twisted) + export USE_ASYNCIO=1 + ''; + + pytestFlagsArray = [ "--pyargs autobahn" ]; + + pythonImportsCheck = [ "autobahn" ]; meta = with lib; { - description = "WebSocket and WAMP in Python for Twisted and asyncio."; - homepage = "https://crossbar.io/autobahn"; - license = licenses.mit; + description = "WebSocket and WAMP in Python for Twisted and asyncio"; + homepage = "https://crossbar.io/autobahn"; + license = licenses.mit; maintainers = with maintainers; [ nand0p ]; }; } diff --git a/pkgs/development/python-modules/cffi/default.nix b/pkgs/development/python-modules/cffi/default.nix index afd9cfdc295..92899ed85e5 100644 --- a/pkgs/development/python-modules/cffi/default.nix +++ b/pkgs/development/python-modules/cffi/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, buildPythonPackage, isPyPy, fetchPypi, libffi, pycparser, pytest }: +{ lib, stdenv, buildPythonPackage, isPyPy, fetchPypi, libffi, pycparser, pytestCheckHook }: if isPyPy then null else buildPythonPackage rec { pname = "cffi"; @@ -11,8 +11,9 @@ if isPyPy then null else buildPythonPackage rec { outputs = [ "out" "dev" ]; - propagatedBuildInputs = [ libffi pycparser ]; - checkInputs = [ pytest ]; + buildInputs = [ libffi ]; + + propagatedBuildInputs = [ pycparser ]; # On Darwin, the cffi tests want to hit libm a lot, and look for it in a global # impure search path. It's obnoxious how much repetition there is, and how difficult @@ -33,9 +34,8 @@ if isPyPy then null else buildPythonPackage rec { "-Wno-unused-command-line-argument -Wno-unreachable-code"; doCheck = !stdenv.hostPlatform.isMusl && !stdenv.isDarwin; # TODO: Investigate - checkPhase = '' - py.test -k "not test_char_pointer_conversion" - ''; + + checkInputs = [ pytestCheckHook ]; meta = with lib; { maintainers = with maintainers; [ domenkozar lnl7 ]; diff --git a/pkgs/development/python-modules/datatable/default.nix b/pkgs/development/python-modules/datatable/default.nix index c5271e473e3..60eb0df1d09 100644 --- a/pkgs/development/python-modules/datatable/default.nix +++ b/pkgs/development/python-modules/datatable/default.nix @@ -39,7 +39,7 @@ buildPythonPackage rec { checkInputs = [ docutils pytestCheckHook ]; LLVM = llvm; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${libcxx}/include/c++/v1"; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${lib.getDev libcxx}/include/c++/v1"; pytestFlagsArray = let # ini file (not included in tarball) required to change python_files setting, diff --git a/pkgs/development/python-modules/django/2.nix b/pkgs/development/python-modules/django/2.nix index 991c353df17..e0d3cd12f8f 100644 --- a/pkgs/development/python-modules/django/2.nix +++ b/pkgs/development/python-modules/django/2.nix @@ -6,13 +6,13 @@ buildPythonPackage rec { pname = "Django"; - version = "2.2.20"; + version = "2.2.22"; disabled = !isPy3k; src = fetchPypi { inherit pname version; - sha256 = "0r3a6gbhwngxl172yy6n0sq5knibl2vxc0wbk1g8licfbzfgjs95"; + sha256 = "db2214db1c99017cbd971e58824e6f424375154fe358afc30e976f5b99fc6060"; }; patches = lib.optional withGdal diff --git a/pkgs/development/python-modules/django/3.nix b/pkgs/development/python-modules/django/3.nix index 62ca390eac5..321582946b3 100644 --- a/pkgs/development/python-modules/django/3.nix +++ b/pkgs/development/python-modules/django/3.nix @@ -13,13 +13,13 @@ buildPythonPackage rec { pname = "Django"; - version = "3.2"; + version = "3.2.2"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "179qdxa438fnycnnf1j5z6359h1kbp2q7djf01v5jrr26xjgkw11"; + sha256 = "0a1d195ad65c52bf275b8277b3d49680bd1137a5f55039a806f25f6b9752ce3d"; }; patches = lib.optional withGdal diff --git a/pkgs/development/python-modules/dnspython/1.nix b/pkgs/development/python-modules/dnspython/1.nix index 30f280a5029..5ff02c04338 100644 --- a/pkgs/development/python-modules/dnspython/1.nix +++ b/pkgs/development/python-modules/dnspython/1.nix @@ -1,4 +1,8 @@ -{ buildPythonPackage, fetchPypi, lib, pythonOlder }: +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +}: buildPythonPackage rec { pname = "dnspython"; @@ -12,11 +16,11 @@ buildPythonPackage rec { # needs networking for some tests doCheck = false; + pythonImportsCheck = [ "dns" ]; - meta = { - description = "A DNS toolkit for Python 3.x"; + meta = with lib; { + description = "A DNS toolkit for Python"; homepage = "http://www.dnspython.org"; - # BSD-like, check https://www.dnspython.org/LICENSE for details - license = lib.licenses.free; + license = with licenses; [ isc ]; }; } diff --git a/pkgs/development/python-modules/dnspython/default.nix b/pkgs/development/python-modules/dnspython/default.nix index afb85fb61f5..56e69aac044 100644 --- a/pkgs/development/python-modules/dnspython/default.nix +++ b/pkgs/development/python-modules/dnspython/default.nix @@ -1,4 +1,8 @@ -{ buildPythonPackage, fetchPypi, lib, pythonOlder }: +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +}: buildPythonPackage rec { pname = "dnspython"; @@ -13,11 +17,11 @@ buildPythonPackage rec { # needs networking for some tests doCheck = false; + pythonImportsCheck = [ "dns" ]; - meta = { - description = "A DNS toolkit for Python 3.x"; + meta = with lib; { + description = "A DNS toolkit for Python"; homepage = "http://www.dnspython.org"; - # BSD-like, check https://www.dnspython.org/LICENSE for details - license = lib.licenses.free; + license = with licenses; [ isc ]; }; } diff --git a/pkgs/development/python-modules/dotmap/default.nix b/pkgs/development/python-modules/dotmap/default.nix new file mode 100644 index 00000000000..cb5f032a6f2 --- /dev/null +++ b/pkgs/development/python-modules/dotmap/default.nix @@ -0,0 +1,30 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "dotmap"; + version = "1.3.23"; + + src = fetchPypi { + inherit pname version; + sha256 = "0hy88kzzb7zhxfr7iyvl6rhmvz02538pbna7zypaard4a88bbbka"; + }; + + checkInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ "dotmap/test.py" ]; + + pythonImportsCheck = [ "dotmap" ]; + + meta = with lib; { + description = "Python for dot-access dictionaries"; + homepage = "https://github.com/drgrib/dotmap"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/enaml/default.nix b/pkgs/development/python-modules/enaml/default.nix index 1102443884f..8896c5c706a 100644 --- a/pkgs/development/python-modules/enaml/default.nix +++ b/pkgs/development/python-modules/enaml/default.nix @@ -5,7 +5,7 @@ , ply , kiwisolver , qtpy -, sip +, sip_4 , cppy , bytecode }: @@ -44,7 +44,7 @@ buildPythonPackage rec { ply kiwisolver qtpy - sip + sip_4 cppy bytecode ]; diff --git a/pkgs/development/python-modules/flask-appbuilder/default.nix b/pkgs/development/python-modules/flask-appbuilder/default.nix index 6e98f6e80ac..e2c077162b1 100644 --- a/pkgs/development/python-modules/flask-appbuilder/default.nix +++ b/pkgs/development/python-modules/flask-appbuilder/default.nix @@ -6,6 +6,7 @@ , colorama , click , email_validator +, fetchpatch , flask , flask-babel , flask_login @@ -20,21 +21,27 @@ , python-dateutil , prison , pyjwt +, pyyaml , sqlalchemy-utils }: buildPythonPackage rec { pname = "flask-appbuilder"; - version = "3.1.1"; + version = "3.2.3"; src = fetchPypi { pname = "Flask-AppBuilder"; inherit version; - sha256 = "076b020b0ba125339a2e710e74eab52648cde2b18599f7cb0fa1eada9bbb648c"; + sha256 = "sha256-+ZYrn2LnVORyYsnZtsH3JX+4XbGgAZZ/Eh6O5gUP+y4="; }; - checkInputs = [ - nose + patches = [ + (fetchpatch { + name = "flask_jwt_extended-and-pyjwt-patch"; + url = "https://github.com/dpgaspar/Flask-AppBuilder/commit/7097a7b133f27c78d2b54d2a46e4a4c24478a066.patch"; + sha256 = "sha256-ZpY8+2Hoz3z01GVtw2OIbQcsmAwa7iwilFWzgcGhY1w="; + includes = [ "flask_appbuilder/security/manager.py" "setup.py" ]; + }) ]; propagatedBuildInputs = [ @@ -56,22 +63,23 @@ buildPythonPackage rec { python-dateutil prison pyjwt + pyyaml sqlalchemy-utils ]; postPatch = '' substituteInPlace setup.py \ - --replace "apispec[yaml]>=3.3, <4" "apispec" \ - --replace "Flask-Login>=0.3, <0.5" "Flask-Login" \ - --replace "Flask-Babel>=1, <2" "Flask-Babel" \ - --replace "marshmallow-sqlalchemy>=0.22.0, <0.24.0" "marshmallow-sqlalchemy" \ - --replace "prison>=0.1.3, <1.0.0" "prison" + --replace "apispec[yaml]>=3.3, <4" "apispec[yaml] >=3.3, <5" \ + --replace "Flask-Login>=0.3, <0.5" "Flask-Login >=0.3, <0.6" \ + --replace "Flask-Babel>=1, <2" "Flask-Babel >=1, <3" \ + --replace "marshmallow-sqlalchemy>=0.22.0, <0.24.0" "marshmallow-sqlalchemy >=0.22.0, <0.25.0" ''; - # majority of tests require network access or mongo doCheck = false; + pythonImportsCheck = [ "flask_appbuilder" ]; + meta = with lib; { description = "Simple and rapid application development framework, built on top of Flask"; homepage = "https://github.com/dpgaspar/flask-appbuilder/"; diff --git a/pkgs/development/python-modules/gst-python/default.nix b/pkgs/development/python-modules/gst-python/default.nix index ea89f7214c6..a391d993cf0 100644 --- a/pkgs/development/python-modules/gst-python/default.nix +++ b/pkgs/development/python-modules/gst-python/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "gst-python"; - version = "1.18.0"; + version = "1.18.4"; format = "other"; @@ -22,7 +22,7 @@ buildPythonPackage rec { src = fetchurl { url = "${meta.homepage}/src/gst-python/${pname}-${version}.tar.xz"; - sha256 = "0ifx2s2j24sj2w5jm7cxyg1kinnhbxiz4x0qp3gnsjlwbawfigvn"; + sha256 = "13h9qzfz8s1gyj2ar9q2gf5346sgdv6jv8hj7aw0hpl2gs5f0s6b"; }; # Python 2.x is not supported. diff --git a/pkgs/development/python-modules/hyperlink/default.nix b/pkgs/development/python-modules/hyperlink/default.nix index ad56de86782..21927683b18 100644 --- a/pkgs/development/python-modules/hyperlink/default.nix +++ b/pkgs/development/python-modules/hyperlink/default.nix @@ -1,4 +1,10 @@ -{ lib, buildPythonPackage, fetchPypi, isPy27, idna, typing ? null }: +{ lib +, buildPythonPackage +, fetchPypi +, isPy27 +, idna +, typing ? null +}: buildPythonPackage rec { pname = "hyperlink"; @@ -6,7 +12,7 @@ buildPythonPackage rec { src = fetchPypi { inherit pname version; - sha256 = "427af957daa58bc909471c6c40f74c5450fa123dd093fc53efd2e91d2705a56b"; + sha256 = "0sx50lkivsfjxx9zr4yh7l9gll2l9kvl0v0w8w4wk2x5v9bzjyj2"; }; propagatedBuildInputs = [ idna ] @@ -14,6 +20,7 @@ buildPythonPackage rec { meta = with lib; { description = "A featureful, correct URL for Python"; + homepage = "https://github.com/python-hyper/hyperlink"; license = licenses.mit; platforms = platforms.all; maintainers = with maintainers; [ apeschar ]; diff --git a/pkgs/development/python-modules/iso8601/default.nix b/pkgs/development/python-modules/iso8601/default.nix index 783f6f1eb30..d0a74f400bb 100644 --- a/pkgs/development/python-modules/iso8601/default.nix +++ b/pkgs/development/python-modules/iso8601/default.nix @@ -1,7 +1,7 @@ { lib , buildPythonPackage , fetchPypi -, pytest +, pytestCheckHook }: buildPythonPackage rec { @@ -13,15 +13,18 @@ buildPythonPackage rec { sha256 = "8aafd56fa0290496c5edbb13c311f78fa3a241f0853540da09d9363eae3ebd79"; }; - checkInputs = [ pytest ]; + checkInputs = [ + pytestCheckHook + ]; - checkPhase = '' - py.test iso8601 - ''; + pytestFlagsArray = [ "iso8601" ]; - meta = { - homepage = "https://bitbucket.org/micktwomey/pyiso8601/"; + pythonImportsCheck = [ "iso8601" ]; + + meta = with lib; { description = "Simple module to parse ISO 8601 dates"; - maintainers = with lib.maintainers; [ phreedom ]; + homepage = "https://pyiso8601.readthedocs.io/"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; }; } diff --git a/pkgs/development/python-modules/johnnycanencrypt/default.nix b/pkgs/development/python-modules/johnnycanencrypt/default.nix index 460b0cddf61..d2d4719dab4 100644 --- a/pkgs/development/python-modules/johnnycanencrypt/default.nix +++ b/pkgs/development/python-modules/johnnycanencrypt/default.nix @@ -39,7 +39,7 @@ buildPythonPackage rec { cargoSha256 = "0ifvpdizcdp2c5x2x2j1bhhy5a75q0pk7a63dmh52mlpmh45fy6r"; - LIBCLANG_PATH = llvmPackages.libclang + "/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; propagatedBuildInputs = [ requests diff --git a/pkgs/development/python-modules/kiwisolver/1_1.nix b/pkgs/development/python-modules/kiwisolver/1_1.nix index 0702e3518e0..762b5bc0b7b 100644 --- a/pkgs/development/python-modules/kiwisolver/1_1.nix +++ b/pkgs/development/python-modules/kiwisolver/1_1.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { sha256 = "53eaed412477c836e1b9522c19858a8557d6e595077830146182225613b11a75"; }; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; # Does not include tests doCheck = false; diff --git a/pkgs/development/python-modules/kiwisolver/default.nix b/pkgs/development/python-modules/kiwisolver/default.nix index d4d62787092..2b157494f91 100644 --- a/pkgs/development/python-modules/kiwisolver/default.nix +++ b/pkgs/development/python-modules/kiwisolver/default.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { sha256 = "950a199911a8d94683a6b10321f9345d5a3a8433ec58b217ace979e18f16e248"; }; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; nativeBuildInputs = [ cppy diff --git a/pkgs/development/python-modules/libarcus/default.nix b/pkgs/development/python-modules/libarcus/default.nix index edea85876a8..a48d70c544c 100644 --- a/pkgs/development/python-modules/libarcus/default.nix +++ b/pkgs/development/python-modules/libarcus/default.nix @@ -1,5 +1,5 @@ { lib, buildPythonPackage, python, fetchFromGitHub -, cmake, sip, protobuf, pythonOlder }: +, cmake, sip_4, protobuf, pythonOlder }: buildPythonPackage rec { pname = "libarcus"; @@ -15,7 +15,7 @@ buildPythonPackage rec { disabled = pythonOlder "3.4.0"; - propagatedBuildInputs = [ sip ]; + propagatedBuildInputs = [ sip_4 ]; nativeBuildInputs = [ cmake ]; buildInputs = [ protobuf ]; diff --git a/pkgs/development/python-modules/libsavitar/default.nix b/pkgs/development/python-modules/libsavitar/default.nix index f6aa1b378f5..7ecd09160ff 100644 --- a/pkgs/development/python-modules/libsavitar/default.nix +++ b/pkgs/development/python-modules/libsavitar/default.nix @@ -1,4 +1,4 @@ -{ lib, buildPythonPackage, python, pythonOlder, fetchFromGitHub, cmake, sip }: +{ lib, buildPythonPackage, python, pythonOlder, fetchFromGitHub, cmake, sip_4 }: buildPythonPackage rec { pname = "libsavitar"; @@ -18,7 +18,7 @@ buildPythonPackage rec { nativeBuildInputs = [ cmake ]; - propagatedBuildInputs = [ sip ]; + propagatedBuildInputs = [ sip_4 ]; disabled = pythonOlder "3.4.0"; diff --git a/pkgs/development/python-modules/llvmlite/default.nix b/pkgs/development/python-modules/llvmlite/default.nix index b5e6847a9f0..c7d2221a22e 100644 --- a/pkgs/development/python-modules/llvmlite/default.nix +++ b/pkgs/development/python-modules/llvmlite/default.nix @@ -33,7 +33,7 @@ buildPythonPackage rec { ''; # Set directory containing llvm-config binary preConfigure = '' - export LLVM_CONFIG=${llvm}/bin/llvm-config + export LLVM_CONFIG=${llvm.dev}/bin/llvm-config ''; checkPhase = '' ${python.executable} runtests.py diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix index 2c929d9a694..a6ee1a3bade 100644 --- a/pkgs/development/python-modules/matplotlib/2.nix +++ b/pkgs/development/python-modules/matplotlib/2.nix @@ -1,24 +1,16 @@ -{ lib, stdenv, fetchPypi, python, buildPythonPackage, pycairo, backports_functools_lru_cache +{ lib, stdenv, fetchPypi, writeText, python, buildPythonPackage, pycairo, backports_functools_lru_cache , which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver , freetype, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection, functools32, subprocess32 , fetchpatch -, enableGhostscript ? false, ghostscript ? null, gtk3 +, enableGhostscript ? false, ghostscript, gtk3 , enableGtk3 ? false, cairo # darwin has its own "MacOSX" backend -, enableTk ? !stdenv.isDarwin, tcl ? null, tk ? null, tkinter ? null, libX11 ? null +, enableTk ? !stdenv.isDarwin, tcl, tk, tkinter, libX11 , enableQt ? false, pyqt4 , Cocoa , pythonOlder }: -assert enableGhostscript -> ghostscript != null; -assert enableTk -> (tcl != null) - && (tk != null) - && (tkinter != null) - && (libX11 != null) - ; -assert enableQt -> pyqt4 != null; - buildPythonPackage rec { version = "2.2.3"; pname = "matplotlib"; @@ -54,7 +46,10 @@ buildPythonPackage rec { ++ lib.optionals enableQt [ pyqt4 ] ++ lib.optionals python.isPy2 [ functools32 subprocess32 ]; - setup_cfg = ./setup.cfg; + passthru.config = { + directories = { basedirlist = "."; }; + }; + setup_cfg = writeText "setup.cfg" (lib.generators.toINI {} passthru.config); preBuild = '' cp "$setup_cfg" ./setup.cfg ''; diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index 4be4189f8c7..7364920cba2 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -1,33 +1,25 @@ -{ lib, stdenv, fetchPypi, python, buildPythonPackage, isPy3k, pycairo, backports_functools_lru_cache +{ lib, stdenv, fetchPypi, writeText, python, buildPythonPackage, isPy3k, pycairo, backports_functools_lru_cache , which, cycler, dateutil, nose, numpy, pyparsing, sphinx, tornado, kiwisolver -, freetype, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection +, freetype, qhull, libpng, pkg-config, mock, pytz, pygobject3, gobject-introspection , certifi, pillow -, enableGhostscript ? true, ghostscript ? null, gtk3 +, enableGhostscript ? true, ghostscript, gtk3 , enableGtk3 ? false, cairo # darwin has its own "MacOSX" backend -, enableTk ? !stdenv.isDarwin, tcl ? null, tk ? null, tkinter ? null, libX11 ? null -, enableQt ? false, pyqt5 ? null +, enableTk ? !stdenv.isDarwin, tcl, tk, tkinter, libX11 +, enableQt ? false, pyqt5 , Cocoa , pythonOlder }: -assert enableGhostscript -> ghostscript != null; -assert enableTk -> (tcl != null) - && (tk != null) - && (tkinter != null) - && (libX11 != null) - ; -assert enableQt -> pyqt5 != null; - buildPythonPackage rec { - version = "3.3.4"; + version = "3.4.1"; pname = "matplotlib"; disabled = !isPy3k; src = fetchPypi { inherit pname version; - sha256 = "3e477db76c22929e4c6876c44f88d790aacdf3c3f8f3a90cb1975c0bf37825b0"; + sha256 = "84d4c4f650f356678a5d658a43ca21a41fca13f9b8b00169c0b76e6a6a948908"; }; XDG_RUNTIME_DIR = "/tmp"; @@ -39,13 +31,23 @@ buildPythonPackage rec { ++ lib.optional stdenv.isDarwin [ Cocoa ]; propagatedBuildInputs = - [ cycler dateutil numpy pyparsing tornado freetype kiwisolver - certifi libpng mock pytz pillow ] + [ cycler dateutil numpy pyparsing tornado freetype qhull + kiwisolver certifi libpng mock pytz pillow ] ++ lib.optionals enableGtk3 [ cairo pycairo gtk3 gobject-introspection pygobject3 ] ++ lib.optionals enableTk [ tcl tk tkinter libX11 ] ++ lib.optionals enableQt [ pyqt5 ]; - setup_cfg = if stdenv.isDarwin then ./setup-darwin.cfg else ./setup.cfg; + passthru.config = { + directories = { basedirlist = "."; }; + libs = { + system_freetype = true; + system_qhull = true; + } // lib.optionalAttrs stdenv.isDarwin { + # LTO not working in darwin stdenv, see #19312 + enable_lto = false; + }; + }; + setup_cfg = writeText "setup.cfg" (lib.generators.toINI {} passthru.config); preBuild = '' cp "$setup_cfg" ./setup.cfg ''; diff --git a/pkgs/development/python-modules/matplotlib/setup-darwin.cfg b/pkgs/development/python-modules/matplotlib/setup-darwin.cfg deleted file mode 100644 index f6463d9c574..00000000000 --- a/pkgs/development/python-modules/matplotlib/setup-darwin.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[directories] -basedirlist = . - -[libs] -system_freetype = true -# LTO not working in darwin stdenv, see #19312 -enable_lto = false diff --git a/pkgs/development/python-modules/matplotlib/setup.cfg b/pkgs/development/python-modules/matplotlib/setup.cfg deleted file mode 100644 index 6a773862765..00000000000 --- a/pkgs/development/python-modules/matplotlib/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[directories] -basedirlist = . - -[libs] -system_freetype = true diff --git a/pkgs/development/python-modules/meshtastic/default.nix b/pkgs/development/python-modules/meshtastic/default.nix new file mode 100644 index 00000000000..c8a9d78e7c1 --- /dev/null +++ b/pkgs/development/python-modules/meshtastic/default.nix @@ -0,0 +1,57 @@ +{ lib +, buildPythonPackage +, dotmap +, fetchPypi +, pexpect +, protobuf +, pygatt +, pypubsub +, pyqrcode +, pyserial +, pythonOlder +, tabulate +, timeago +}: + +buildPythonPackage rec { + pname = "meshtastic"; + version = "1.2.30"; + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "1kjflc2jwnsgxyr2zx1gyykhak9fsgy6hxaxlggsz5sw9b8rdrby"; + }; + + propagatedBuildInputs = [ + dotmap + pexpect + protobuf + pygatt + pypubsub + pyqrcode + pyserial + tabulate + timeago + ]; + + postPatch = '' + # https://github.com/meshtastic/Meshtastic-python/pull/87 + substituteInPlace setup.py \ + --replace 'with open("README.md", "r") as fh:' "" \ + --replace "long_description = fh.read()" "" \ + --replace "long_description=long_description," 'long_description="",' + ''; + + # Project only provides PyPI releases which don't contain the tests + # https://github.com/meshtastic/Meshtastic-python/issues/86 + doCheck = false; + pythonImportsCheck = [ "meshtastic" ]; + + meta = with lib; { + description = "Python API for talking to Meshtastic devices"; + homepage = "https://meshtastic.github.io/Meshtastic-python/"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/numba/default.nix b/pkgs/development/python-modules/numba/default.nix index 211e9d6185f..c49a4105abe 100644 --- a/pkgs/development/python-modules/numba/default.nix +++ b/pkgs/development/python-modules/numba/default.nix @@ -22,7 +22,7 @@ buildPythonPackage rec { sha256 = "55c11d7edbba2ba715f2b56f5294cad55cfd87bff98e2627c3047c2d5cc52d16"; }; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; propagatedBuildInputs = [ numpy llvmlite setuptools ]; pythonImportsCheck = [ "numba" ]; diff --git a/pkgs/development/python-modules/pandas/2.nix b/pkgs/development/python-modules/pandas/2.nix index 936a3db296e..8af4094b0cf 100644 --- a/pkgs/development/python-modules/pandas/2.nix +++ b/pkgs/development/python-modules/pandas/2.nix @@ -59,7 +59,7 @@ buildPythonPackage rec { # For OSX, we need to add a dependency on libcxx, which provides # `complex.h` and other libraries that pandas depends on to build. postPatch = lib.optionalString stdenv.isDarwin '' - cpp_sdk="${libcxx}/include/c++/v1"; + cpp_sdk="${lib.getDev libcxx}/include/c++/v1"; echo "Adding $cpp_sdk to the setup.py common_include variable" substituteInPlace setup.py \ --replace "['pandas/src/klib', 'pandas/src']" \ diff --git a/pkgs/development/python-modules/pandas/default.nix b/pkgs/development/python-modules/pandas/default.nix index 7fd551e192c..f3505e3c9a6 100644 --- a/pkgs/development/python-modules/pandas/default.nix +++ b/pkgs/development/python-modules/pandas/default.nix @@ -77,7 +77,7 @@ buildPythonPackage rec { # For OSX, we need to add a dependency on libcxx, which provides # `complex.h` and other libraries that pandas depends on to build. postPatch = lib.optionalString stdenv.isDarwin '' - cpp_sdk="${libcxx}/include/c++/v1"; + cpp_sdk="${lib.getDev libcxx}/include/c++/v1"; echo "Adding $cpp_sdk to the setup.py common_include variable" substituteInPlace setup.py \ --replace "['pandas/src/klib', 'pandas/src']" \ diff --git a/pkgs/development/python-modules/poppler-qt5/default.nix b/pkgs/development/python-modules/poppler-qt5/default.nix index 94d86f7b713..4a9fdfa4262 100644 --- a/pkgs/development/python-modules/poppler-qt5/default.nix +++ b/pkgs/development/python-modules/poppler-qt5/default.nix @@ -4,7 +4,7 @@ , isPy3k , fetchPypi , pythonPackages -, sip_5 +, sip , qtbase , qmake , pyqt5 @@ -34,7 +34,7 @@ buildPythonPackage rec { ]; buildInputs = [ qtbase.dev poppler pyqt-builder ]; - nativeBuildInputs = [ pkg-config qmake sip_5 ]; + nativeBuildInputs = [ pkg-config qmake sip ]; propagatedBuildInputs = [ pyqt5.dev ]; format = "pyproject"; @@ -46,7 +46,7 @@ buildPythonPackage rec { [tool.sip.bindings.Poppler-Qt5] include-dirs = ["${poppler.dev}/include/poppler"] - tags = ["${sip_5.platform_tag}"] + tags = ["${sip.platform_tag}"] EOF ''; diff --git a/pkgs/development/python-modules/prison/default.nix b/pkgs/development/python-modules/prison/default.nix index 941da2bf9af..95a79ea1896 100644 --- a/pkgs/development/python-modules/prison/default.nix +++ b/pkgs/development/python-modules/prison/default.nix @@ -7,13 +7,13 @@ buildPythonPackage rec { pname = "prison"; - version = "0.1.2"; + version = "0.1.3"; src = fetchFromGitHub { owner = "betodealmeida"; repo = "python-rison"; rev = version; - sha256 = "14vb468iznf9416z993bbqihywp9ibyslw5vp67wfr200zyxjwak"; + sha256 = "sha256-qor40vUQeTdlO3vwug3GGNX5vkNaF0H7EWlRdsY4bvc="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/py-cpuinfo/default.nix b/pkgs/development/python-modules/py-cpuinfo/default.nix index f9e276b3bb5..12b9668f1ed 100644 --- a/pkgs/development/python-modules/py-cpuinfo/default.nix +++ b/pkgs/development/python-modules/py-cpuinfo/default.nix @@ -1,7 +1,6 @@ { lib , stdenv , fetchFromGitHub -, fetchpatch , buildPythonPackage , pytestCheckHook , sysctl @@ -9,28 +8,15 @@ buildPythonPackage rec { pname = "py-cpuinfo"; - version = "7.0.0"; + version = "8.0.0"; src = fetchFromGitHub { owner = "workhorsy"; repo = pname; rev = "v${version}"; - sha256 = "10qfaibyb2syiwiyv74l7d97vnmlk079qirgnw3ncklqjs0s3gbi"; + sha256 = "sha256-Mgzj1HTasUNHeHMVwV6d+TeyVqnBNUwCJ1EC3kfovf8="; }; - patches = [ - # Make it detect Apple Silicon, remove after https://github.com/workhorsy/py-cpuinfo/pull/161 is merged. - (fetchpatch { - url = "https://github.com/workhorsy/py-cpuinfo/commit/54c32da6678f9d75ec5acf4534056cdc85c2a04d.patch"; - sha256 = "sha256-3R46KrpACAQ1V0CQtz48V5mQXxvplUQrXnACtiE8WqY="; - }) - # Continuation of the patch above - (fetchpatch { - url = "https://github.com/workhorsy/py-cpuinfo/commit/0d00f4b99750f292c85ff23e1039ea9489cb7ec8.patch"; - sha256 = "sha256-mHoXoCAEG2v3xpQppRFWzSvhYCp5i9CZkbEgtiLVzMs="; - }) - ]; - checkInputs = [ pytestCheckHook ]; @@ -42,17 +28,19 @@ buildPythonPackage rec { --replace "_run_and_get_stdout(['sysctl'" "_run_and_get_stdout(['${sysctl}/bin/sysctl'" ''; - meta = { - description = "Get CPU info with pure Python 2 & 3"; + pythonImportsCheck = [ "cpuinfo" ]; + + meta = with lib; { + description = "Get CPU info with pure Python"; longDescription = '' Py-cpuinfo gets CPU info with pure Python and should work without any extra programs or libraries, beyond what your OS provides. It does not require any compilation (C/C++, assembly, etc.) to use and works with - Python 2 and 3. + Python. ''; - inherit (src.meta) homepage; + homepage = "https://github.com/workhorsy/py-cpuinfo"; changelog = "https://github.com/workhorsy/py-cpuinfo/blob/v${version}/ChangeLog"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ costrouc ]; + license = licenses.mit; + maintainers = with maintainers; [ costrouc ]; }; } diff --git a/pkgs/development/python-modules/py-ubjson/default.nix b/pkgs/development/python-modules/py-ubjson/default.nix new file mode 100644 index 00000000000..4efa2b8b6fd --- /dev/null +++ b/pkgs/development/python-modules/py-ubjson/default.nix @@ -0,0 +1,32 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "py-ubjson"; + version = "0.16.1"; + + src = fetchFromGitHub { + owner = "Iotic-Labs"; + repo = pname; + rev = "v${version}"; + sha256 = "1frn97xfa88zrfmpnvdk1pc03yihlchhph99bhjayvzlfcrhm5v3"; + }; + + checkInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ "test/test.py" ]; + + pythonImportsCheck = [ "ubjson" ]; + + meta = with lib; { + description = "Universal Binary JSON draft-12 serializer for Python"; + homepage = "https://github.com/Iotic-Labs/py-ubjson"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/py3exiv2/default.nix b/pkgs/development/python-modules/py3exiv2/default.nix index 236a38c7e69..59d0cdb7299 100644 --- a/pkgs/development/python-modules/py3exiv2/default.nix +++ b/pkgs/development/python-modules/py3exiv2/default.nix @@ -13,7 +13,7 @@ buildPythonPackage rec { buildInputs = [ exiv2 boost ]; # work around python distutils compiling C++ with $CC (see issue #26709) - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; meta = with lib; { homepage = "https://launchpad.net/py3exiv2"; diff --git a/pkgs/development/python-modules/pycurl/default.nix b/pkgs/development/python-modules/pycurl/default.nix index fe62d1be1ea..e202d1928f2 100644 --- a/pkgs/development/python-modules/pycurl/default.nix +++ b/pkgs/development/python-modules/pycurl/default.nix @@ -1,11 +1,12 @@ -{ buildPythonPackage +{ lib +, buildPythonPackage , isPyPy , fetchPypi , pythonOlder , curl , openssl , bottle -, pytest +, pytestCheckHook , nose , flaky }: @@ -20,6 +21,11 @@ buildPythonPackage rec { sha256 = "8301518689daefa53726b59ded6b48f33751c383cf987b0ccfbbc4ed40281325"; }; + preConfigure = '' + substituteInPlace setup.py --replace '--static-libs' '--libs' + export PYCURL_SSL_LIBRARY=openssl + ''; + buildInputs = [ curl openssl.out @@ -31,34 +37,48 @@ buildPythonPackage rec { checkInputs = [ bottle - pytest + pytestCheckHook nose flaky ]; - # skip impure or flakey tests - # See also: - # * https://github.com/NixOS/nixpkgs/issues/77304 - checkPhase = '' - HOME=$TMPDIR pytest tests -k "not test_ssl_in_static_libs \ - and not test_keyfunction \ - and not test_keyfunction_bogus_return \ - and not test_libcurl_ssl_gnutls \ - and not test_libcurl_ssl_nss \ - and not test_libcurl_ssl_openssl" \ - --ignore=tests/getinfo_test.py \ - --ignore=tests/memory_mgmt_test.py \ - --ignore=tests/multi_memory_mgmt_test.py \ - --ignore=tests/multi_timer_test.py - ''; + pytestFlagsArray = [ + # don't pick up the tests directory below examples/ + "tests" + ]; - preConfigure = '' - substituteInPlace setup.py --replace '--static-libs' '--libs' - export PYCURL_SSL_LIBRARY=openssl + preCheck = '' + export HOME=$TMPDIR ''; - meta = { + disabledTests = [ + # libcurl stopped passing the reason phrase from the HTTP status line + # https://github.com/pycurl/pycurl/issues/679 + "test_failonerror" + "test_failonerror_status_line_invalid_utf8_python3" + # bottle>=0.12.17 escapes utf8 properly, so these test don't work anymore + # https://github.com/pycurl/pycurl/issues/669 + "test_getinfo_content_type_invalid_utf8_python3" + "test_getinfo_cookie_invalid_utf8_python3" + "test_getinfo_raw_content_type_invalid_utf8" + "test_getinfo_raw_cookie_invalid_utf8" + # tests that require network access + "test_keyfunction" + "test_keyfunction_bogus_return" + # OSError: tests/fake-curl/libcurl/with_openssl.so: cannot open shared object file: No such file or directory + "test_libcurl_ssl_openssl" + # OSError: tests/fake-curl/libcurl/with_nss.so: cannot open shared object file: No such file or directory + "test_libcurl_ssl_nss" + # OSError: tests/fake-curl/libcurl/with_gnutls.so: cannot open shared object file: No such file or directory + "test_libcurl_ssl_gnutls" + # AssertionError: assert 'crypto' in ['curl'] + "test_ssl_in_static_libs" + ]; + + meta = with lib; { homepage = "http://pycurl.sourceforge.net/"; description = "Python wrapper for libcurl"; + license = licenses.lgpl2Only; + maintainers = with maintainers; []; }; } diff --git a/pkgs/development/python-modules/pygatt/default.nix b/pkgs/development/python-modules/pygatt/default.nix new file mode 100644 index 00000000000..9d596e17236 --- /dev/null +++ b/pkgs/development/python-modules/pygatt/default.nix @@ -0,0 +1,48 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, mock +, nose +, pexpect +, pyserial +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "pygatt"; + version = "4.0.5"; + disabled = pythonOlder "3.5"; + + src = fetchFromGitHub { + owner = "peplin"; + repo = pname; + rev = "v${version}"; + sha256 = "1zdfxidiw0l8n498sy0l33n90lz49n25x889cx6jamjr7frlcihd"; + }; + + propagatedBuildInputs = [ + pexpect + pyserial + ]; + + checkInputs = [ + mock + nose + pytestCheckHook + ]; + + postPatch = '' + # Not support for Python < 3.4 + substituteInPlace setup.py --replace "'enum-compat'" "" + ''; + + pythonImportsCheck = [ "pygatt" ]; + + meta = with lib; { + description = "Python wrapper the BGAPI for accessing Bluetooth LE Devices"; + homepage = "https://github.com/peplin/pygatt"; + license = with licenses; [ asl20 mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/pykdl/default.nix b/pkgs/development/python-modules/pykdl/default.nix index 674a43f5f3e..9a0431b2b85 100644 --- a/pkgs/development/python-modules/pykdl/default.nix +++ b/pkgs/development/python-modules/pykdl/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, toPythonModule, fetchpatch, cmake, orocos-kdl, python, sip }: +{ lib, stdenv, toPythonModule, fetchpatch, cmake, orocos-kdl, python, sip_4 }: toPythonModule (stdenv.mkDerivation { pname = "pykdl"; @@ -18,7 +18,7 @@ toPythonModule (stdenv.mkDerivation { nativeBuildInputs = [ cmake ]; buildInputs = [ orocos-kdl ]; - propagatedBuildInputs = [ python sip ]; + propagatedBuildInputs = [ python sip_4 ]; meta = with lib; { description = "Kinematics and Dynamics Library (Python bindings)"; diff --git a/pkgs/development/python-modules/pynest2d/default.nix b/pkgs/development/python-modules/pynest2d/default.nix index 7ca72293382..f3b5b9ba685 100644 --- a/pkgs/development/python-modules/pynest2d/default.nix +++ b/pkgs/development/python-modules/pynest2d/default.nix @@ -1,5 +1,5 @@ { lib, buildPythonPackage, fetchFromGitHub, python3, cmake -, pythonOlder, libnest2d, sip, clipper }: +, pythonOlder, libnest2d, sip_4, clipper }: buildPythonPackage rec { version = "4.8.0"; @@ -13,7 +13,7 @@ buildPythonPackage rec { sha256 = "18dn92vgr4gvf9scfh93yg9bwrhdjvq62di08rpi7pqjrrvq2nvp"; }; - propagatedBuildInputs = [ libnest2d sip clipper ]; + propagatedBuildInputs = [ libnest2d sip_4 clipper ]; nativeBuildInputs = [ cmake ]; CLIPPER_PATH = "${clipper.out}"; diff --git a/pkgs/development/python-modules/pyqt-builder/default.nix b/pkgs/development/python-modules/pyqt-builder/default.nix index d7f15d966b3..d371fd7bcee 100644 --- a/pkgs/development/python-modules/pyqt-builder/default.nix +++ b/pkgs/development/python-modules/pyqt-builder/default.nix @@ -1,4 +1,4 @@ -{ lib, fetchPypi, buildPythonPackage, packaging, sip_5 }: +{ lib, fetchPypi, buildPythonPackage, packaging, sip }: buildPythonPackage rec { pname = "pyqt-builder"; @@ -10,7 +10,7 @@ buildPythonPackage rec { sha256 = "0g51yak53zzjs4gpq65i01cmpz7w8cjny9wfyxlgr2vi0wag107v"; }; - propagatedBuildInputs = [ packaging sip_5 ]; + propagatedBuildInputs = [ packaging sip ]; pythonImportsCheck = [ "pyqtbuild" ]; diff --git a/pkgs/development/python-modules/pyqt/4.x.nix b/pkgs/development/python-modules/pyqt/4.x.nix index 3427438b8a2..2652b5eb00b 100644 --- a/pkgs/development/python-modules/pyqt/4.x.nix +++ b/pkgs/development/python-modules/pyqt/4.x.nix @@ -1,13 +1,13 @@ -{ lib, stdenv, fetchurl, buildPythonPackage, python, dbus-python, sip, qt4, pkg-config, lndir, dbus, makeWrapper }: +{ lib, stdenv, fetchurl, buildPythonPackage, python, dbus-python, sip_4, qt4, pkg-config, lndir, dbus, makeWrapper }: buildPythonPackage rec { pname = "PyQt-x11-gpl"; - version = "4.12"; + version = "4.12.3"; format = "other"; src = fetchurl { url = "mirror://sourceforge/pyqt/PyQt4_gpl_x11-${version}.tar.gz"; - sha256 = "1nw8r88a5g2d550yvklawlvns8gd5slw53yy688kxnsa65aln79w"; + sha256 = "0wnlasg62rm5d39nq1yw4namcx2ivxgzl93r5f2vb9s0yaz5l3x0"; }; postPatch = '' @@ -45,7 +45,7 @@ buildPythonPackage rec { nativeBuildInputs = [ pkg-config lndir makeWrapper qt4 ]; buildInputs = [ qt4 dbus ]; - propagatedBuildInputs = [ sip ]; + propagatedBuildInputs = [ sip_4 ]; postInstall = '' for i in $out/bin/*; do diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 6e4b4d37f28..2671b27a630 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -16,9 +16,9 @@ let inherit (pythonPackages) buildPythonPackage python isPy3k dbus-python enum34; sip = if isPy3k then - pythonPackages.sip_5 + pythonPackages.sip else - (pythonPackages.sip.override { sip-module = "PyQt5.sip"; }).overridePythonAttrs(oldAttrs: { + (pythonPackages.sip_4.override { sip-module = "PyQt5.sip"; }).overridePythonAttrs(oldAttrs: { # If we install sip in another folder, then we need to create a __init__.py as well # if we want to be able to import it with Python 2. # Python 3 could rely on it being an implicit namespace package, however, diff --git a/pkgs/development/python-modules/python-engineio/3.nix b/pkgs/development/python-modules/python-engineio/3.nix index e4c71782f99..5deeec0bb57 100644 --- a/pkgs/development/python-modules/python-engineio/3.nix +++ b/pkgs/development/python-modules/python-engineio/3.nix @@ -13,6 +13,7 @@ , websocket_client , websockets , pytestCheckHook +, pythonAtLeast }: buildPythonPackage rec { @@ -63,5 +64,6 @@ buildPythonPackage rec { homepage = "https://github.com/miguelgrinberg/python-engineio/"; license = with licenses; [ mit ]; maintainers = with maintainers; [ graham33 ]; + broken = stdenv.isDarwin && (pythonAtLeast "3.9"); # See https://github.com/miguelgrinberg/python-socketio/issues/567 }; } diff --git a/pkgs/development/python-modules/qscintilla-qt5/default.nix b/pkgs/development/python-modules/qscintilla-qt5/default.nix index dcbe213966f..05c12c1c62a 100644 --- a/pkgs/development/python-modules/qscintilla-qt5/default.nix +++ b/pkgs/development/python-modules/qscintilla-qt5/default.nix @@ -10,7 +10,7 @@ buildPythonPackage { src = qscintilla.src; format = "other"; - nativeBuildInputs = [ sip qtbase ]; + nativeBuildInputs = [ sip_4 qtbase ]; buildInputs = [ qscintilla ]; propagatedBuildInputs = [ pyqt5 ]; @@ -40,7 +40,7 @@ buildPythonPackage { --qsci-libdir=${qscintilla}/lib \ --pyqt-sipdir=${pyqt5}/share/sip/PyQt5 \ --qsci-sipdir=$out/share/sip/PyQt5 \ - --sip-incdir=${sip}/include + --sip-incdir=${sip_4}/include ''; meta = with lib; { diff --git a/pkgs/development/python-modules/random2/default.nix b/pkgs/development/python-modules/random2/default.nix index 6845a5707da..cb84d32ef41 100644 --- a/pkgs/development/python-modules/random2/default.nix +++ b/pkgs/development/python-modules/random2/default.nix @@ -2,6 +2,7 @@ , buildPythonPackage , fetchPypi , isPyPy +, fetchpatch }: buildPythonPackage rec { @@ -15,6 +16,14 @@ buildPythonPackage rec { sha256 = "34ad30aac341039872401595df9ab2c9dc36d0b7c077db1cea9ade430ed1c007"; }; + patches = [ + # Patch test suite for python >= 3.9 + (fetchpatch { + url = "https://github.com/strichter/random2/pull/3/commits/1bac6355d9c65de847cc445d782c466778b94fbd.patch"; + sha256 = "064137pg1ilv3f9r10123lqbqz45070jca8pjjyp6gpfd0yk74pi"; + }) + ]; + meta = with lib; { homepage = "http://pypi.python.org/pypi/random2"; description = "Python 3 compatible Python 2 `random` Module"; diff --git a/pkgs/development/python-modules/sip/4.x.nix b/pkgs/development/python-modules/sip/4.x.nix new file mode 100644 index 00000000000..5334d119634 --- /dev/null +++ b/pkgs/development/python-modules/sip/4.x.nix @@ -0,0 +1,44 @@ +{ lib, fetchurl, buildPythonPackage, python, isPyPy, sip-module ? "sip" }: + +buildPythonPackage rec { + pname = sip-module; + version = "4.19.25"; + format = "other"; + + disabled = isPyPy; + + src = fetchurl { + url = "https://www.riverbankcomputing.com/static/Downloads/sip/${version}/sip-${version}.tar.gz"; + sha256 = "04a23cgsnx150xq86w1z44b6vr2zyazysy9mqax0fy346zlr77dk"; + }; + + configurePhase = '' + ${python.executable} ./configure.py \ + --sip-module ${sip-module} \ + -d $out/${python.sitePackages} \ + -b $out/bin -e $out/include + ''; + + enableParallelBuilding = true; + + installCheckPhase = let + modules = [ + sip-module + "sipconfig" + ]; + imports = lib.concatMapStrings (module: "import ${module};") modules; + in '' + echo "Checking whether modules can be imported..." + PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH ${python.interpreter} -c "${imports}" + ''; + + doCheck = true; + + meta = with lib; { + description = "Creates C++ bindings for Python modules"; + homepage = "http://www.riverbankcomputing.co.uk/"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ lovek323 sander ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/development/python-modules/sip/5.x.nix b/pkgs/development/python-modules/sip/5.x.nix deleted file mode 100644 index c15589b77bc..00000000000 --- a/pkgs/development/python-modules/sip/5.x.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ lib, stdenv, fetchPypi, buildPythonPackage, packaging, toml }: - -buildPythonPackage rec { - pname = "sip"; - version = "5.5.0"; - - src = fetchPypi { - pname = "sip"; - inherit version; - sha256 = "1idaivamp1jvbbai9yzv471c62xbqxhaawccvskaizihkd0lq0jx"; - }; - - propagatedBuildInputs = [ packaging toml ]; - - # There aren't tests - doCheck = false; - - pythonImportsCheck = [ "sipbuild" ]; - - # FIXME: Why isn't this detected automatically? - # Needs to be specified in pyproject.toml, e.g.: - # [tool.sip.bindings.MODULE] - # tags = [PLATFORM_TAG] - platform_tag = - if stdenv.targetPlatform.isLinux then - "WS_X11" - else if stdenv.targetPlatform.isDarwin then - "WS_MACX" - else if stdenv.targetPlatform.isWindows then - "WS_WIN" - else - throw "unsupported platform"; - - meta = with lib; { - description = "Creates C++ bindings for Python modules"; - homepage = "http://www.riverbankcomputing.co.uk/"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ eduardosm ]; - }; -} diff --git a/pkgs/development/python-modules/sip/default.nix b/pkgs/development/python-modules/sip/default.nix index 0027c1c0ba5..c15589b77bc 100644 --- a/pkgs/development/python-modules/sip/default.nix +++ b/pkgs/development/python-modules/sip/default.nix @@ -1,44 +1,40 @@ -{ lib, fetchurl, buildPythonPackage, python, isPyPy, sip-module ? "sip" }: +{ lib, stdenv, fetchPypi, buildPythonPackage, packaging, toml }: buildPythonPackage rec { - pname = sip-module; - version = "4.19.24"; - format = "other"; + pname = "sip"; + version = "5.5.0"; - disabled = isPyPy; - - src = fetchurl { - url = "https://www.riverbankcomputing.com/static/Downloads/sip/${version}/sip-${version}.tar.gz"; - sha256 = "1ra15vb5i9gkg2vdvh16cq9x2mmzw1yi3xphxs8q34q1pf83gkgd"; + src = fetchPypi { + pname = "sip"; + inherit version; + sha256 = "1idaivamp1jvbbai9yzv471c62xbqxhaawccvskaizihkd0lq0jx"; }; - configurePhase = '' - ${python.executable} ./configure.py \ - --sip-module ${sip-module} \ - -d $out/${python.sitePackages} \ - -b $out/bin -e $out/include - ''; + propagatedBuildInputs = [ packaging toml ]; - enableParallelBuilding = true; + # There aren't tests + doCheck = false; - installCheckPhase = let - modules = [ - sip-module - "sipconfig" - ]; - imports = lib.concatMapStrings (module: "import ${module};") modules; - in '' - echo "Checking whether modules can be imported..." - PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH ${python.interpreter} -c "${imports}" - ''; + pythonImportsCheck = [ "sipbuild" ]; - doCheck = true; + # FIXME: Why isn't this detected automatically? + # Needs to be specified in pyproject.toml, e.g.: + # [tool.sip.bindings.MODULE] + # tags = [PLATFORM_TAG] + platform_tag = + if stdenv.targetPlatform.isLinux then + "WS_X11" + else if stdenv.targetPlatform.isDarwin then + "WS_MACX" + else if stdenv.targetPlatform.isWindows then + "WS_WIN" + else + throw "unsupported platform"; meta = with lib; { description = "Creates C++ bindings for Python modules"; homepage = "http://www.riverbankcomputing.co.uk/"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ lovek323 sander ]; - platforms = platforms.all; + license = licenses.gpl3Only; + maintainers = with maintainers; [ eduardosm ]; }; } diff --git a/pkgs/development/python-modules/sphinx/default.nix b/pkgs/development/python-modules/sphinx/default.nix index 1c5cc29f414..8d6567b3e91 100644 --- a/pkgs/development/python-modules/sphinx/default.nix +++ b/pkgs/development/python-modules/sphinx/default.nix @@ -1,24 +1,18 @@ { lib , buildPythonPackage -, fetchPypi -, pytest -, simplejson -, mock -, glibcLocales -, html5lib , pythonOlder -, enum34 -, python +, fetchFromGitHub +# propagatedBuildInputs +, Babel +, alabaster , docutils +, imagesize , jinja2 +, packaging , pygments -, alabaster -, Babel -, snowballstemmer -, six -, whoosh -, imagesize , requests +, setuptools +, snowballstemmer , sphinxcontrib-applehelp , sphinxcontrib-devhelp , sphinxcontrib-htmlhelp @@ -26,56 +20,70 @@ , sphinxcontrib-qthelp , sphinxcontrib-serializinghtml , sphinxcontrib-websupport -, typing ? null -, setuptools -, packaging +# check phase +, html5lib +, imagemagick +, pytestCheckHook +, typed-ast }: buildPythonPackage rec { pname = "sphinx"; - version = "3.3.1"; - src = fetchPypi { - pname = "Sphinx"; - inherit version; - sha256 = "1e8d592225447104d1172be415bc2972bd1357e3e12fdc76edf2261105db4300"; + version = "3.5.4"; + disabled = pythonOlder "3.5"; + + src = fetchFromGitHub { + owner = "sphinx-doc"; + repo = pname; + rev = "v${version}"; + sha256 = "1xjii3dl01rq8x2bsxc6zywiy1s7arfgxrg5l8ml54w1748shadd"; }; - LC_ALL = "en_US.UTF-8"; - checkInputs = [ pytest ]; - buildInputs = [ simplejson mock glibcLocales html5lib ] ++ lib.optional (pythonOlder "3.4") enum34; - # Disable two tests that require network access. - checkPhase = '' - cd tests; ${python.interpreter} run.py --ignore py35 -k 'not test_defaults and not test_anchors_ignored' - ''; propagatedBuildInputs = [ + Babel + alabaster docutils + imagesize jinja2 - pygments - alabaster - Babel packaging + pygments + requests setuptools snowballstemmer - six - whoosh - imagesize - requests sphinxcontrib-applehelp sphinxcontrib-devhelp sphinxcontrib-htmlhelp sphinxcontrib-jsmath sphinxcontrib-qthelp sphinxcontrib-serializinghtml + # extra[docs] sphinxcontrib-websupport - ] ++ lib.optional (pythonOlder "3.5") typing; + ]; + + checkInputs = [ + imagemagick + html5lib + pytestCheckHook + ] ++ lib.optionals (pythonOlder "3.8") [ + typed-ast + ]; - # Lots of tests. Needs network as well at some point. - doCheck = false; + disabledTests = [ + # requires network access + "test_anchors_ignored" + "test_defaults" + "test_defaults_json" + "test_latex_images" + ]; - meta = { - description = "A tool that makes it easy to create intelligent and beautiful documentation for Python projects"; - homepage = "http://sphinx.pocoo.org/"; - license = lib.licenses.bsd3; - maintainers = with lib.maintainers; [ nand0p ]; + meta = with lib; { + description = "Python documentation generator"; + longDescription = '' + A tool that makes it easy to create intelligent and beautiful + documentation for Python projects + ''; + homepage = "https://www.sphinx-doc.org"; + license = licenses.bsd3; + maintainers = with maintainers; [ nand0p ]; }; } diff --git a/pkgs/development/python-modules/timeago/default.nix b/pkgs/development/python-modules/timeago/default.nix new file mode 100644 index 00000000000..0c2a688f674 --- /dev/null +++ b/pkgs/development/python-modules/timeago/default.nix @@ -0,0 +1,32 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "timeago"; + version = "1.0.15"; + + src = fetchFromGitHub { + owner = "hustcc"; + repo = pname; + rev = version; + sha256 = "03vm7c02l4g2d1x33w382i1psk8i3an7xchk69yinha33fjj1cag"; + }; + + checkInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ "test/testcase.py" ]; + + pythonImportsCheck = [ "timeago" ]; + + meta = with lib; { + description = "Python module to format past datetime output"; + homepage = "https://github.com/hustcc/timeago"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/txaio/default.nix b/pkgs/development/python-modules/txaio/default.nix index c2f2c9451bd..fa219a94513 100644 --- a/pkgs/development/python-modules/txaio/default.nix +++ b/pkgs/development/python-modules/txaio/default.nix @@ -1,30 +1,55 @@ -{ lib, buildPythonPackage, fetchPypi, pytest, mock, six, twisted, isPy37, isPy27 }: +{ lib +, buildPythonPackage +, fetchPypi +, mock +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, six +, twisted +, zope_interface +}: buildPythonPackage rec { pname = "txaio"; version = "21.2.1"; - disabled = isPy27; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "7d6f89745680233f1c4db9ddb748df5e88d2a7a37962be174c0fd04c8dba1dc8"; + sha256 = "sha256-fW+JdFaAIz8cTbndt0jfXojSp6N5Yr4XTA/QTI26Hcg="; }; - checkInputs = [ pytest mock ]; + propagatedBuildInputs = [ + six + twisted + zope_interface + ]; - propagatedBuildInputs = [ six twisted ]; + checkInputs = [ + mock + pytest-asyncio + pytestCheckHook + ]; - checkPhase = '' - py.test -k "not test_sdist" - ''; + disabledTests = [ + # No real value + "test_sdist" + # Some tests seems out-dated and require additional data + "test_as_future" + "test_errback" + "test_create_future" + "test_callback" + "test_immediate_result" + "test_cancel" + ]; - # Needs some fixing - doCheck = false; + pythonImportsCheck = [ "txaio" ]; meta = with lib; { - description = "Utilities to support code that runs unmodified on Twisted and asyncio."; - homepage = "https://github.com/crossbario/txaio"; - license = licenses.mit; + description = "Utilities to support code that runs unmodified on Twisted and asyncio"; + homepage = "https://github.com/crossbario/txaio"; + license = licenses.mit; maintainers = with maintainers; [ nand0p ]; }; } |