From d7550058e0276613b3a2cdddd9cdd4f2f30d9e7f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 7 May 2023 22:32:03 +0200 Subject: [PATCH 01/11] python310Packages.defusedcsv: init at 2.0.0 --- .../python-modules/defusedcsv/default.nix | 35 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/development/python-modules/defusedcsv/default.nix diff --git a/pkgs/development/python-modules/defusedcsv/default.nix b/pkgs/development/python-modules/defusedcsv/default.nix new file mode 100644 index 000000000000..5e44ce731748 --- /dev/null +++ b/pkgs/development/python-modules/defusedcsv/default.nix @@ -0,0 +1,35 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub + +# tests +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "defusedcsv"; + version = "2.0.0"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "raphaelm"; + repo = "defusedcsv"; + rev = "refs/tags/v${version}"; + hash = "sha256-y8qLVfdkxRrDjtrTOLK5Zvi/1Vyv8eOnCueUkaRp4sQ="; + }; + + pythonImportsCheck = [ + "defusedcsv.csv" + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + meta = with lib; { + description = "Python library to protect your users from Excel injections in CSV-format exports, drop-in replacement for standard library's csv module"; + homepage = "https://github.com/raphaelm/defusedcsv"; + license = licenses.asl20; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 06e00fe5b650..11dd3ffd0346 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2408,6 +2408,8 @@ self: super: with self; { deform = callPackage ../development/python-modules/deform { }; + defusedcsv = callPackage ../development/python-modules/defusedcsv { }; + defusedxml = callPackage ../development/python-modules/defusedxml { }; deid = callPackage ../development/python-modules/deid { }; From 3a6716ccb9c18ca2b8b9abad0775fe9bcc9498b7 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 7 May 2023 22:42:28 +0200 Subject: [PATCH 02/11] python310Packages.django-i18nfield: init at 1.9.4 --- .../django-i18nfield/default.nix | 43 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/django-i18nfield/default.nix diff --git a/pkgs/development/python-modules/django-i18nfield/default.nix b/pkgs/development/python-modules/django-i18nfield/default.nix new file mode 100644 index 000000000000..62d0770a693a --- /dev/null +++ b/pkgs/development/python-modules/django-i18nfield/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub + +# tests +, djangorestframework +, html5lib +, lxml +, pytest-django +, pytestCheckHook +, pyyaml +}: + +buildPythonPackage { + pname = "django-i18nfield"; + version = "1.9.4"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "raphaelm"; + repo = "django-i18nfield"; + rev = "10488eb6c673be50e50387c76085a7c8d84e9157"; + hash = "sha256-FF980LTw7RFuG9QgxA96yJsSczCNNMq9WsbacQqIReE="; + }; + + env.DJANGO_SETTINGS_MODULE = "tests.settings"; + + nativeCheckInputs = [ + djangorestframework + html5lib + lxml + pytest-django + pytestCheckHook + pyyaml + ]; + + meta = with lib; { + description = "Store internationalized strings in Django models"; + homepage = "https://github.com/raphaelm/django-i18nfield"; + license = licenses.asl20; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 11dd3ffd0346..c08bfb75af49 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2671,6 +2671,8 @@ self: super: with self; { django_hijack = callPackage ../development/python-modules/django-hijack { }; # This package may need an older version of Django. Override the package set and set e.g. `django = super.django_1_9`. See the Nixpkgs manual for examples on how to override the package set. + django-i18nfield = callPackage ../development/python-modules/django-i18nfield { }; + django-import-export = callPackage ../development/python-modules/django-import-export { }; django-ipware = callPackage ../development/python-modules/django-ipware { }; From 38e83e44040757950e69a358ec82c65bedad03c9 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 7 May 2023 22:53:10 +0200 Subject: [PATCH 03/11] python310Packages.drf-ujson2: init at 1.7.2 --- .../python-modules/drf-ujson2/default.nix | 55 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/python-modules/drf-ujson2/default.nix diff --git a/pkgs/development/python-modules/drf-ujson2/default.nix b/pkgs/development/python-modules/drf-ujson2/default.nix new file mode 100644 index 000000000000..58277fca7ed6 --- /dev/null +++ b/pkgs/development/python-modules/drf-ujson2/default.nix @@ -0,0 +1,55 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub + +# dependencies +, django +, djangorestframework +, ujson + +# tests +, pytest-django +, pytest-mock +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "drf-ujson2"; + version = "1.7.2"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "Amertz08"; + repo = "drf_ujson2"; + rev = "refs/tags/v${version}"; + hash = "sha256-kbpZN1zOXHvRPcn+Sjbelq74cWgvCUeMXZy1eFSa6rA="; + }; + + postPatch = '' + sed -i '/--cov/d' setup.cfg + ''; + + buildInputs = [ + django + ]; + + propagatedBuildInputs = [ + djangorestframework + ujson + ]; + + env.DJANGO_SETTINGS_MODULE = "tests.settings"; + + nativeCheckInputs = [ + pytest-django + pytest-mock + pytestCheckHook + ]; + + meta = with lib; { + changelog = "https://github.com/Amertz08/drf_ujson2/releases/tag/v${version}"; + description = "JSON parser and renderer using ujson for Django Rest Framework"; + homepage = "https://github.com/Amertz08/drf_ujson2"; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c08bfb75af49..c6bb28dcb8c2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2949,6 +2949,8 @@ self: super: with self; { drf-spectacular-sidecar = callPackage ../development/python-modules/drf-spectacular-sidecar { }; + drf-ujson2 = callPackage ../development/python-modules/drf-ujson2 { }; + drf-writable-nested = callPackage ../development/python-modules/drf-writable-nested { }; drf-yasg = callPackage ../development/python-modules/drf-yasg { }; From 07de4d29146fc6e37bdc72174551facc770f2885 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 7 May 2023 23:21:52 +0200 Subject: [PATCH 04/11] python310Packages.paypalhttp: init at 1.0.0 --- .../python-modules/paypalhttp/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/paypalhttp/default.nix diff --git a/pkgs/development/python-modules/paypalhttp/default.nix b/pkgs/development/python-modules/paypalhttp/default.nix new file mode 100644 index 000000000000..25c6aa1ba878 --- /dev/null +++ b/pkgs/development/python-modules/paypalhttp/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub + +# propagates +, pyopenssl +, requests +, six + +# tests +, pytestCheckHook +, responses +}: + +buildPythonPackage rec { + pname = "paypalhttp"; + version = "1.0.0"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "paypal"; + repo = "paypalhttp_python"; + rev = "refs/tags/${version}"; + hash = "sha256-3ihcpYtpcejPkiyf4g4jveyNU6flQB2sv9EZ5Pd7tUc="; + }; + + propagatedBuildInputs = [ + requests + six + pyopenssl + ]; + + nativeCheckInputs = [ + pytestCheckHook + responses + ]; + + meta = with lib; { + changelog = "https://github.com/paypal/paypalhttp_python/releases/tag/${version}"; + description = "PayPalHttp is a generic HTTP Client"; + homepage = "https://github.com/paypal/paypalhttp_python"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c6bb28dcb8c2..2d5345d57bb6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7234,6 +7234,8 @@ self: super: with self; { paver = callPackage ../development/python-modules/paver { }; + paypalhttp = callPackage ../development/python-modules/paypalhttp { }; + paypalrestsdk = callPackage ../development/python-modules/paypalrestsdk { }; pbkdf2 = callPackage ../development/python-modules/pbkdf2 { }; From 5e524c5150e4f93f690488af52a8c9babdd48a99 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 7 May 2023 23:22:10 +0200 Subject: [PATCH 05/11] python310Packages.paypal-checkout-serversdk: init at 1.0. --- .../paypal-checkout-serversdk/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/paypal-checkout-serversdk/default.nix diff --git a/pkgs/development/python-modules/paypal-checkout-serversdk/default.nix b/pkgs/development/python-modules/paypal-checkout-serversdk/default.nix new file mode 100644 index 000000000000..711056008c9b --- /dev/null +++ b/pkgs/development/python-modules/paypal-checkout-serversdk/default.nix @@ -0,0 +1,52 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub + +# propagates +, paypalhttp + +# tersts +, pytestCheckHook +, responses +}: + +buildPythonPackage rec { + pname = "paypal-checkout-serversdk"; + version = "1.0.1"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "paypal"; + repo = "Checkout-Python-SDK"; + rev = "refs/tags/${version}"; + hash = "sha256-04ojNJeqVMdhnGpeCD+wzgKGLI22tVvrMW3gF/SH7KU="; + }; + + postPatch = '' + # outdated python2 samples + rm -rf sample + ''; + + propagatedBuildInputs = [ + paypalhttp + ]; + + nativeCheckInputs = [ + pytestCheckHook + responses + ]; + + disabledTests = [ + # network tests + "testOrdersPatchTest" + "testOrdersCreateTest" + "testOrderGetRequestTest" + ]; + + meta = with lib; { + changelog = "https://github.com/paypal/Checkout-Python-SDK/releases/tag/${version}"; + description = "Python SDK for Checkout RESTful APIs"; + license = licenses.asl20; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2d5345d57bb6..7c83a3f8cb8b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7234,6 +7234,8 @@ self: super: with self; { paver = callPackage ../development/python-modules/paver { }; + paypal-checkout-serversdk = callPackage ../development/python-modules/paypal-checkout-serversdk { }; + paypalhttp = callPackage ../development/python-modules/paypalhttp { }; paypalrestsdk = callPackage ../development/python-modules/paypalrestsdk { }; From 2a2e8b663c0969de611c9bf0823c3423725124ac Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 8 May 2023 00:16:52 +0200 Subject: [PATCH 06/11] python310Packages.django-mysql: init at 4.9.0 --- .../python-modules/django-mysql/default.nix | 54 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 56 insertions(+) create mode 100644 pkgs/development/python-modules/django-mysql/default.nix diff --git a/pkgs/development/python-modules/django-mysql/default.nix b/pkgs/development/python-modules/django-mysql/default.nix new file mode 100644 index 000000000000..0a53c6489fe0 --- /dev/null +++ b/pkgs/development/python-modules/django-mysql/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub + +# build-system +, setuptools + +# dependencies +, django +, mysqlclient + +# tests +, pytest-django +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "django-mysql"; + version = "4.9.0"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "adamchainz"; + repo = "django-mysql"; + rev = "refs/tags/${version}"; + hash = "sha256-mXAdwNqSIrWMh+YcCjksiqmkLSXGAd+ofyzJmiG+gNo="; + }; + + nativeBuildInputs = [ + setuptools + ]; + + buildInputs = [ + django + mysqlclient + ]; + + doCheck = false; # requires mysql/mariadb server + + env.DJANGO_SETTINGS_MODULE = "tests.settings"; + + nativeCheckInputs = [ + pytest-django + pytestCheckHook + ]; + + meta = with lib; { + changelog = "https://django-mysql.readthedocs.io/en/latest/changelog.html"; + description = "Extensions to Django for use with MySQL/MariaD"; + homepage = "https://github.com/adamchainz/django-mysql"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7c83a3f8cb8b..759ca9719c55 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2703,6 +2703,8 @@ self: super: with self; { django-mptt = callPackage ../development/python-modules/django-mptt { }; + django-mysql = callPackage ../development/python-modules/django-mysql { }; + django_nose = callPackage ../development/python-modules/django_nose { }; django-oauth-toolkit = callPackage ../development/python-modules/django-oauth-toolkit { }; From 7be2ba708efe0db4ae10120ec952c1f39d1797f6 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 8 May 2023 18:42:23 +0200 Subject: [PATCH 07/11] python310Packages.python-u2flib-server: init at 5.0.1 --- .../cryptography-37-compat.patch | 112 ++++++++++++++++++ .../python-u2flib-server/default.nix | 60 ++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 174 insertions(+) create mode 100644 pkgs/development/python-modules/python-u2flib-server/cryptography-37-compat.patch create mode 100644 pkgs/development/python-modules/python-u2flib-server/default.nix diff --git a/pkgs/development/python-modules/python-u2flib-server/cryptography-37-compat.patch b/pkgs/development/python-modules/python-u2flib-server/cryptography-37-compat.patch new file mode 100644 index 000000000000..beed33ab2a35 --- /dev/null +++ b/pkgs/development/python-modules/python-u2flib-server/cryptography-37-compat.patch @@ -0,0 +1,112 @@ +diff --git a/test/soft_u2f_v2.py b/test/soft_u2f_v2.py +index d011b1f..9a24bb9 100644 +--- a/test/soft_u2f_v2.py ++++ b/test/soft_u2f_v2.py +@@ -112,9 +112,7 @@ class SoftU2FDevice(object): + CERT_PRIV, password=None, backend=default_backend()) + cert = CERT + data = b'\x00' + app_param + client_param + key_handle + pub_key +- signer = cert_priv.signer(ec.ECDSA(hashes.SHA256())) +- signer.update(data) +- signature = signer.finalize() ++ signature = cert_priv.sign(data, ec.ECDSA(hashes.SHA256())) + + raw_response = (b'\x05' + pub_key + six.int2byte(len(key_handle)) + + key_handle + cert + signature) +@@ -163,9 +161,7 @@ class SoftU2FDevice(object): + counter = struct.pack('>I', self.counter) + + data = app_param + touch + counter + client_param +- signer = priv_key.signer(ec.ECDSA(hashes.SHA256())) +- signer.update(data) +- signature = signer.finalize() ++ signature = priv_key.sign(data, ec.ECDSA(hashes.SHA256())) + raw_response = touch + counter + signature + + return SignResponse( +diff --git a/u2flib_server/attestation/resolvers.py b/u2flib_server/attestation/resolvers.py +index 034549f..cd59b10 100644 +--- a/u2flib_server/attestation/resolvers.py ++++ b/u2flib_server/attestation/resolvers.py +@@ -86,27 +86,29 @@ class MetadataResolver(object): + cert_bytes = cert.tbs_certificate_bytes + + if isinstance(pubkey, rsa.RSAPublicKey): +- verifier = pubkey.verifier( +- cert_signature, +- padding.PKCS1v15(), +- cert.signature_hash_algorithm +- ) ++ try: ++ pubkey.verify( ++ cert_signature, ++ cert_bytes, ++ padding.PKCS1v15(), ++ cert.signature_hash_algorithm ++ ) ++ return True ++ except InvalidSignature: ++ return False + elif isinstance(pubkey, ec.EllipticCurvePublicKey): +- verifier = pubkey.verifier( +- cert_signature, +- ec.ECDSA(cert.signature_hash_algorithm) +- ) ++ try: ++ pubkey.verify( ++ cert_signature, ++ cert_bytes, ++ ec.ECDSA(cert.signature_hash_algorithm) ++ ) ++ return True ++ except InvalidSignature: ++ return False + else: + raise ValueError("Unsupported public key value") + +- verifier.update(cert_bytes) +- +- try: +- verifier.verify() +- return True +- except InvalidSignature: +- return False +- + def resolve(self, cert): + if isinstance(cert, bytes): + cert = x509.load_der_x509_certificate(cert, default_backend()) +diff --git a/u2flib_server/model.py b/u2flib_server/model.py +index 481be51..6ec01bb 100644 +--- a/u2flib_server/model.py ++++ b/u2flib_server/model.py +@@ -175,12 +175,9 @@ class RegistrationData(object): + cert = x509.load_der_x509_certificate(self.certificate, + default_backend()) + pubkey = cert.public_key() +- verifier = pubkey.verifier(self.signature, ec.ECDSA(hashes.SHA256())) +- +- verifier.update(b'\0' + app_param + chal_param + self.key_handle + +- self.pub_key) ++ msg = (b'\0' + app_param + chal_param + self.key_handle + self.pub_key) + try: +- verifier.verify() ++ pubkey.verify(self.signature, msg, ec.ECDSA(hashes.SHA256())) + except InvalidSignature: + raise ValueError('Attestation signature is invalid') + +@@ -207,13 +204,9 @@ class SignatureData(object): + def verify(self, app_param, chal_param, der_pubkey): + pubkey = load_der_public_key(PUB_KEY_DER_PREFIX + der_pubkey, + default_backend()) +- verifier = pubkey.verifier(self.signature, ec.ECDSA(hashes.SHA256())) +- verifier.update(app_param + +- six.int2byte(self.user_presence) + +- struct.pack('>I', self.counter) + +- chal_param) ++ msg = app_param + six.int2byte(self.user_presence) + struct.pack('>I', self.counter) + chal_param + try: +- verifier.verify() ++ pubkey.verify(self.signature, msg, ec.ECDSA(hashes.SHA256())) + except InvalidSignature: + raise ValueError('U2F signature is invalid') + diff --git a/pkgs/development/python-modules/python-u2flib-server/default.nix b/pkgs/development/python-modules/python-u2flib-server/default.nix new file mode 100644 index 000000000000..08a62d41363a --- /dev/null +++ b/pkgs/development/python-modules/python-u2flib-server/default.nix @@ -0,0 +1,60 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, fetchpatch + +# propagates +, cryptography +, six + +# optional +, webob + +# tests +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "python-u2flib-server"; + version = "5.0.1"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "Yubico"; + repo = "python-u2flib-server"; + rev = version; + hash = "sha256-ginP9u+aHcdaWpwcFYJWu0Ghf7+nDZq9i3TVAacIPhg="; + }; + + patches = [ + ./cryptography-37-compat.patch + ]; + + propagatedBuildInputs = [ + cryptography + six + ]; + + passthru.optional-dependencies = { + u2f_server = [ + webob + ]; + }; + + pythonImportsCheck = [ + "u2flib_server" + "u2flib_server.u2f" + ]; + + nativeCheckInputs = [ + pytestCheckHook + ] ++ passthru.optional-dependencies.u2f_server; + + meta = with lib; { + description = "Python based U2F server library"; + homepage = "https://github.com/Yubico/python-u2flib-server"; + changelog = "https://github.com/Yubico/python-u2flib-server/blob/${src.rev}/NEWS"; + license = licenses.bsd2; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 759ca9719c55..ca6a4ed5e426 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9837,6 +9837,8 @@ self: super: with self; { python-u2flib-host = callPackage ../development/python-modules/python-u2flib-host { }; + python-u2flib-server = callPackage ../development/python-modules/python-u2flib-server { }; + python-uinput = callPackage ../development/python-modules/python-uinput { }; python-unshare = callPackage ../development/python-modules/python-unshare { }; From 2e546199d3aaa361a37c9dc64f083a3072b6a97b Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 8 May 2023 18:48:14 +0200 Subject: [PATCH 08/11] python310packages.pyuca: init at 1.2 --- .../python-modules/pyuca/default.nix | 33 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/development/python-modules/pyuca/default.nix diff --git a/pkgs/development/python-modules/pyuca/default.nix b/pkgs/development/python-modules/pyuca/default.nix new file mode 100644 index 000000000000..94b29dc80f9b --- /dev/null +++ b/pkgs/development/python-modules/pyuca/default.nix @@ -0,0 +1,33 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, unittestCheckHook +}: + +buildPythonPackage rec { + pname = "pyuca"; + version = "1.2"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "jtauber"; + repo = "pyuca"; + rev = "v${version}"; + hash = "sha256-KIWk+/o1MX5J9cO7xITvjHrYg0NdgdTetOzfGVwAI/4="; + }; + + pythonImportsCheck = [ + "pyuca" + ]; + + nativeCheckInputs = [ + unittestCheckHook + ]; + + meta = with lib; { + description = "A Python implementation of the Unicode Collation Algorithm"; + homepage = "https://github.com/jtauber/pyuca"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ca6a4ed5e426..b2be05678147 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7665,6 +7665,8 @@ self: super: with self; { pytomorrowio = callPackage ../development/python-modules/pytomorrowio { }; + pyuca = callPackage ../development/python-modules/pyuca { }; + pyutil = callPackage ../development/python-modules/pyutil { }; pyzbar = callPackage ../development/python-modules/pyzbar { }; From 7857ee842e0ac32e494311a12f250722731eeb35 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 8 May 2023 19:05:46 +0200 Subject: [PATCH 09/11] python310Packages.slimit: init at unstable-2018-08-08 --- .../python-modules/slimit/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/slimit/default.nix diff --git a/pkgs/development/python-modules/slimit/default.nix b/pkgs/development/python-modules/slimit/default.nix new file mode 100644 index 000000000000..1166db2639c4 --- /dev/null +++ b/pkgs/development/python-modules/slimit/default.nix @@ -0,0 +1,39 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, ply +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "slimit"; + version = "unstable-2018-08-08"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "rspivak"; + repo = "slimit"; + rev = "3533eba9ad5b39f3a015ae6269670022ab310847"; + hash = "sha256-J+8RGENM/+eaTNvoC54XXPP+aWmazlssjnZAY88J/F0="; + }; + + propagatedBuildInputs = [ + ply + ]; + + pythonImportsCheck = [ + "slimit" + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + meta = with lib; { + description = "SlimIt - a JavaScript minifier/parser in Python"; + homepage = "https://github.com/rspivak/slimit"; + changelog = "https://github.com/rspivak/slimit/blob/${src.rev}/CHANGES"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b2be05678147..ca2bbddd4519 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11061,6 +11061,8 @@ self: super: with self; { slither-analyzer = callPackage ../development/python-modules/slither-analyzer { }; + slimit = callPackage ../development/python-modules/slimit { }; + slixmpp = callPackage ../development/python-modules/slixmpp { inherit (pkgs) gnupg; }; From 35f4603c864c2e16b9ea24a8e724eda65f973b5e Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 8 May 2023 19:14:36 +0200 Subject: [PATCH 10/11] python310Packages.static3: init at 0.7.0 --- .../python-modules/static3/default.nix | 55 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/python-modules/static3/default.nix diff --git a/pkgs/development/python-modules/static3/default.nix b/pkgs/development/python-modules/static3/default.nix new file mode 100644 index 000000000000..9156ea6d6089 --- /dev/null +++ b/pkgs/development/python-modules/static3/default.nix @@ -0,0 +1,55 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub + +# optionals +, genshi + +# tests +, pytestCheckHook +, webtest +}: + +buildPythonPackage rec { + pname = "static3"; + version = "0.7.0"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "rmohr"; + repo = "static3"; + rev = "v${version}"; + hash = "sha256-uFgv+57/UZs4KoOdkFxbvTEDQrJbb0iYJ5JoWWN4yFY="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace ", 'pytest-cov'" "" + ''; + + passthru.optional-dependencies = { + KidMagic = [ + # TODO: kid + ]; + Genshimagic = [ + genshi + ]; + }; + + pythonImportsCheck = [ + "static" + ]; + + nativeCheckInputs = [ + pytestCheckHook + webtest + ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); + + meta = with lib; { + changelog = "https://github.com/rmohr/static3/releases/tag/v${version}"; + description = "A really simple WSGI way to serve static (or mixed) content"; + homepage = "https://github.com/rmohr/static3"; + license = licenses.lgpl21Only; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ca2bbddd4519..057280146377 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11485,6 +11485,8 @@ self: super: with self; { stashy = callPackage ../development/python-modules/stashy { }; + static3 = callPackage ../development/python-modules/static3 { }; + staticjinja = callPackage ../development/python-modules/staticjinja { }; statistics = callPackage ../development/python-modules/statistics { }; From cd9a466b20c597bc8ab2c3aed5ea61579afb7483 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 8 May 2023 23:07:16 +0200 Subject: [PATCH 11/11] python310Packages.vat-moss: init at 0.11.0 And apply a patch that updates the EU API endpoint to use HTTPS. --- .../python-modules/vat-moss/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/vat-moss/default.nix diff --git a/pkgs/development/python-modules/vat-moss/default.nix b/pkgs/development/python-modules/vat-moss/default.nix new file mode 100644 index 000000000000..1bf0879d3427 --- /dev/null +++ b/pkgs/development/python-modules/vat-moss/default.nix @@ -0,0 +1,52 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, fetchpatch +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "vat-moss"; + version = "0.11.0"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "raphaelm"; + repo = "vat_moss-python"; + rev = version; + hash = "sha256-c0lcyeW8IUhWKcfn3BmsbNmHyAzm8T0sdYp0Zp0FbFw="; + }; + + patches = [ + (fetchpatch { + # Update API URL to HTTPS + url = "https://github.com/raphaelm/vat_moss-python/commit/ed32b7d893da101332d3bb202d17b1bf89e5d9ed.patch"; + hash = "sha256-GpxaQ6/1LdFdxzXT/p4HS7FHU0WeM0i3LbdRFeqnFdw="; + }) + ]; + + pythonImportsCheck = [ + "vat_moss" + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + "test_fetch" + ]; + + disabledTestPaths = [ + # network access + "tests/test_id.py" + ]; + + meta = with lib; { + description = "A Python library for dealing with VAT MOSS and Norway VAT on digital services. Includes VAT ID validation, rate calculation based on place of supply, exchange rate and currency tools for invoices"; + homepage = "https://github.com/raphaelm/vat_moss-python"; + changelog = "https://github.com/raphaelm/vat_moss-python/blob/${src.rev}/changelog.md"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 057280146377..46759a821780 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12542,6 +12542,8 @@ self: super: with self; { varint = callPackage ../development/python-modules/varint { }; + vat-moss = callPackage ../development/python-modules/vat-moss { }; + vcrpy = callPackage ../development/python-modules/vcrpy { }; vcver = callPackage ../development/python-modules/vcver { };