diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2024-05-12 12:01:24 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-12 12:01:24 +0000 |
commit | 971c61f4d83889bcd3312bd4612dcbe51193da26 (patch) | |
tree | 67e9beec9965a651b3c1839c22e9d1ecdb4e0c67 /pkgs/development/python-modules | |
parent | 1d2dff45d3f3b8820f0f48d162813c128bc9e4df (diff) | |
parent | 17a5c56edb84a79db79679071b10cc8b7fe8388f (diff) |
Merge master into staging-next
Diffstat (limited to 'pkgs/development/python-modules')
12 files changed, 336 insertions, 174 deletions
diff --git a/pkgs/development/python-modules/adext/default.nix b/pkgs/development/python-modules/adext/default.nix index c5a05d19bee85..8a7345613de79 100644 --- a/pkgs/development/python-modules/adext/default.nix +++ b/pkgs/development/python-modules/adext/default.nix @@ -1,40 +1,39 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, setuptools-scm -, alarmdecoder -, pytestCheckHook +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools-scm, + alarmdecoder, + pytestCheckHook, + pythonOlder, }: buildPythonPackage rec { pname = "adext"; - version = "0.4.2"; - format = "setuptools"; + version = "0.4.3"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "ajschmidt8"; - repo = pname; - rev = "v${version}"; - sha256 = "0h5k9kzms2f0r48pdhsgv8pimk0vsxw8vs0k6880mank8ij914wr"; + repo = "adext"; + rev = "refs/tags/v${version}"; + hash = "sha256-y8BvcSc3vD0FEWiyzW2Oh6PBS2Itjs2sz+9Dzh5yqSg="; }; - nativeBuildInputs = [ - setuptools-scm - ]; + build-system = [ setuptools-scm ]; - propagatedBuildInputs = [ - alarmdecoder - ]; + dependencies = [ alarmdecoder ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; pythonImportsCheck = [ "adext" ]; meta = with lib; { description = "Python extension for AlarmDecoder"; homepage = "https://github.com/ajschmidt8/adext"; + changelog = "https://github.com/ajschmidt8/adext/releases/tag/v${version}"; license = with licenses; [ mit ]; maintainers = with maintainers; [ fab ]; }; diff --git a/pkgs/development/python-modules/apprise/default.nix b/pkgs/development/python-modules/apprise/default.nix index 8b7dcea1f3525..b29ddeedad7fe 100644 --- a/pkgs/development/python-modules/apprise/default.nix +++ b/pkgs/development/python-modules/apprise/default.nix @@ -1,38 +1,37 @@ -{ lib -, babel -, buildPythonPackage -, click -, cryptography -, fetchPypi -, gntp -, installShellFiles -, markdown -, paho-mqtt -, pytest-mock -, pytest-xdist -, pytestCheckHook -, pythonOlder -, pyyaml -, requests -, requests-oauthlib -, setuptools +{ + lib, + babel, + buildPythonPackage, + click, + cryptography, + fetchPypi, + gntp, + installShellFiles, + markdown, + paho-mqtt, + pytest-mock, + pytest-xdist, + pytestCheckHook, + pythonOlder, + pyyaml, + requests, + requests-oauthlib, + setuptools, }: buildPythonPackage rec { pname = "apprise"; - version = "1.7.6"; + version = "1.8.0"; pyproject = true; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-B38JMJzIpskGPb1hSzQ4B9Un1UZpO3/o/FpEM1Av6mw="; + hash = "sha256-6PWM6/6ho09WnLTGiAmjF1voDsBvCi7Ec1IrkgIyEsU="; }; - nativeBuildInputs = [ - installShellFiles - ]; + nativeBuildInputs = [ installShellFiles ]; build-system = [ babel @@ -70,9 +69,7 @@ buildPythonPackage rec { installManPage packaging/man/apprise.1 ''; - pythonImportsCheck = [ - "apprise" - ]; + pythonImportsCheck = [ "apprise" ]; meta = with lib; { description = "Push Notifications that work with just about every platform"; diff --git a/pkgs/development/python-modules/courlan/default.nix b/pkgs/development/python-modules/courlan/default.nix index bd73aad1977d8..fd2cfc01b6e8d 100644 --- a/pkgs/development/python-modules/courlan/default.nix +++ b/pkgs/development/python-modules/courlan/default.nix @@ -1,56 +1,58 @@ -{ lib -, buildPythonPackage -, fetchPypi -, langcodes -, pytestCheckHook -, tld -, urllib3 -, pythonOlder +{ + lib, + babel, + buildPythonPackage, + fetchPypi, + langcodes, + pytestCheckHook, + pythonOlder, + setuptools, + tld, + urllib3, }: buildPythonPackage rec { pname = "courlan"; - version = "1.0.0"; - format = "setuptools"; + version = "1.1.0"; + pyproject = true; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - hash = "sha256-PDVRHDZSXLL5Qc1nCbejp0LtlfC55WyX7sDBb9wDUYM="; + hash = "sha256-1wZoQzTxi+StofvVfyaArfADZkj22ECFL3pIItOt/Y0="; }; - propagatedBuildInputs = [ + # Tests try to write to /tmp directly. use $TMPDIR instead. + postPatch = '' + substituteInPlace tests/unit_tests.py \ + --replace-fail "\"courlan --help\"" "\"$out/bin/courlan --help\"" \ + --replace-fail "courlan_bin = \"courlan\"" "courlan_bin = \"$out/bin/courlan\"" \ + --replace-fail "/tmp" "$TMPDIR" + ''; + + build-system = [ setuptools ]; + + dependencies = [ + babel langcodes tld urllib3 ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; # disable tests that require an internet connection - disabledTests = [ - "test_urlcheck" - ]; - - # tests try to write to /tmp directly. use $TMPDIR instead. - postPatch = '' - substituteInPlace tests/unit_tests.py \ - --replace "\"courlan --help\"" "\"$out/bin/courlan --help\"" \ - --replace "courlan_bin = \"courlan\"" "courlan_bin = \"$out/bin/courlan\"" \ - --replace "/tmp" "$TMPDIR" - ''; + disabledTests = [ "test_urlcheck" ]; pythonImportsCheck = [ "courlan" ]; meta = with lib; { description = "Clean, filter and sample URLs to optimize data collection"; - mainProgram = "courlan"; homepage = "https://github.com/adbar/courlan"; changelog = "https://github.com/adbar/courlan/blob/v${version}/HISTORY.md"; license = licenses.asl20; maintainers = with maintainers; [ jokatzke ]; + mainProgram = "courlan"; }; } diff --git a/pkgs/development/python-modules/hawkauthlib/default.nix b/pkgs/development/python-modules/hawkauthlib/default.nix index 9df850b788297..b7c6c73820a25 100644 --- a/pkgs/development/python-modules/hawkauthlib/default.nix +++ b/pkgs/development/python-modules/hawkauthlib/default.nix @@ -1,28 +1,45 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, requests -, webob +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + requests, + webob, + unittestCheckHook, }: buildPythonPackage rec { pname = "hawkauthlib"; version = "0.1.1"; - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "mozilla-services"; - repo = pname; + repo = "hawkauthlib"; rev = "refs/tags/v${version}"; - sha256 = "0mr1mpx4j9q7sch9arwfvpysnpf2p7ijy7072wilxm8pnj0bwvsi"; + hash = "sha256-UW++gLQX1U4jFwccL+O5wl2r/d2OZ5Ug0wcnSfqtIVc="; }; - propagatedBuildInputs = [ requests webob ]; + postPatch = '' + substituteInPlace hawkauthlib/tests/* \ + --replace-warn 'assertEquals' 'assertEqual' + ''; + + build-system = [ setuptools ]; + + dependencies = [ + requests + webob + ]; + + pythonImportsCheck = [ "hawkauthlib" ]; + + nativeCheckInputs = [ unittestCheckHook ]; meta = with lib; { homepage = "https://github.com/mozilla-services/hawkauthlib"; description = "Hawk Access Authentication protocol"; license = licenses.mpl20; + maintainers = with maintainers; [ ]; }; - } diff --git a/pkgs/development/python-modules/html-text/default.nix b/pkgs/development/python-modules/html-text/default.nix index 00d2fb426d381..43d7ca228bb0e 100644 --- a/pkgs/development/python-modules/html-text/default.nix +++ b/pkgs/development/python-modules/html-text/default.nix @@ -1,37 +1,43 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, lxml -, six -, pytestCheckHook +{ + lib, + buildPythonPackage, + fetchFromGitHub, + lxml, + lxml-html-clean, + pytestCheckHook, + pythonOlder, + setuptools, }: buildPythonPackage rec { pname = "html-text"; - version = "0.5.2"; - format = "setuptools"; + version = "0.6.2"; + pyproject = true; + + disabled = pythonOlder "3.8"; src = fetchFromGitHub { - owner = "TeamHG-Memex"; + owner = "zytedata"; repo = "html-text"; - rev = version; - hash = "sha256-jw/hpz0QfcgP5OEJcmre0h1OzOfpPtaROxHm+YUqces="; + rev = "refs/tags/${version}"; + hash = "sha256-e9gkibQv8mn1Jbt77UmpauOeTqhJQhY9R5Sge/iYi+U="; }; - propagatedBuildInputs = [ + build-system = [ setuptools ]; + + dependencies = [ lxml + lxml-html-clean ]; - nativeCheckInputs = [ - pytestCheckHook - six - ]; + nativeCheckInputs = [ pytestCheckHook ]; pythonImportsCheck = [ "html_text" ]; meta = with lib; { description = "Extract text from HTML"; - homepage = "https://github.com/TeamHG-Memex/html-text"; + homepage = "https://github.com/zytedata/html-text"; + changelog = "https://github.com/zytedata/html-text/blob/${version}/CHANGES.rst"; license = licenses.mit; maintainers = with maintainers; [ ambroisie ]; }; diff --git a/pkgs/development/python-modules/pipdeptree/default.nix b/pkgs/development/python-modules/pipdeptree/default.nix index 8dad1316c1a7f..b312b78a2bfb2 100644 --- a/pkgs/development/python-modules/pipdeptree/default.nix +++ b/pkgs/development/python-modules/pipdeptree/default.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { pname = "pipdeptree"; - version = "2.19.1"; + version = "2.20.0"; pyproject = true; disabled = pythonOlder "3.8"; @@ -24,7 +24,7 @@ buildPythonPackage rec { owner = "tox-dev"; repo = "pipdeptree"; rev = "refs/tags/${version}"; - hash = "sha256-kXRz78UHQtVyHFFnURSjOOXX8Me2I5tG2bX+u2yGyzY="; + hash = "sha256-Mng5YUM2+T3OFrr4uGVvq5mP0aq10r21pp46tw6lLno="; }; build-system = [ diff --git a/pkgs/development/python-modules/private-gpt/default.nix b/pkgs/development/python-modules/private-gpt/default.nix new file mode 100644 index 0000000000000..226489d046cb4 --- /dev/null +++ b/pkgs/development/python-modules/private-gpt/default.nix @@ -0,0 +1,119 @@ +{ lib +, buildPythonPackage +, python +, fetchFromGitHub +, poetry-core +, fastapi +, injector +, llama-index-core +, llama-index-readers-file +, huggingface-hub +, python-multipart +, pyyaml +, transformers +, uvicorn +, watchdog +, gradio +, fetchurl +, fetchpatch +}: + +buildPythonPackage rec { + pname = "private-gpt"; + version = "0.5.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "zylon-ai"; + repo = "private-gpt"; + rev = "v${version}"; + hash = "sha256-bjydzJhOJjmbflcJbuMyNsmby7HtNPFW3MY2Tw12cHw="; + }; + + patches = [ + # Fix a vulnerability, to be removed in the next bump version + # See https://github.com/zylon-ai/private-gpt/pull/1890 + (fetchpatch { + url = "https://github.com/zylon-ai/private-gpt/commit/86368c61760c9cee5d977131d23ad2a3e063cbe9.patch"; + hash = "sha256-4ysRUuNaHW4bmNzg4fn++89b430LP6AzYDoX2HplVH0="; + }) + ]; + + build-system = [ + poetry-core + ]; + + dependencies = [ + fastapi + injector + llama-index-core + llama-index-readers-file + python-multipart + pyyaml + transformers + uvicorn + watchdog + ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); + + # This is needed for running the tests and the service in offline mode, + # See related issue at https://github.com/zylon-ai/private-gpt/issues/1870 + passthru.cl100k_base.tiktoken = fetchurl { + url = "https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken"; + hash = "sha256-Ijkht27pm96ZW3/3OFE+7xAPtR0YyTWXoRO8/+hlsqc="; + }; + + passthru.optional-dependencies = with python.pkgs; { + embeddings-huggingface = [ + huggingface-hub + llama-index-embeddings-huggingface + ]; + embeddings-ollama = [ + llama-index-embeddings-ollama + ]; + embeddings-openai = [ + llama-index-embeddings-openai + ]; + embeddings-sagemaker = [ + boto3 + ]; + llms-ollama = [ + llama-index-llms-ollama + ]; + llms-openai = [ + llama-index-llms-openai + ]; + llms-openai-like = [ + llama-index-llms-openai-like + ]; + llms-sagemaker = [ + boto3 + ]; + ui = [ + gradio + ]; + vector-stores-chroma = [ + llama-index-vector-stores-chroma + ]; + vector-stores-postgres = [ + llama-index-vector-stores-postgres + ]; + vector-stores-qdrant = [ + llama-index-vector-stores-qdrant + ]; + }; + + postInstall = '' + cp settings*.yaml $out/${python.sitePackages}/private_gpt/ + ''; + + pythonImportsCheck = [ "private_gpt" ]; + + meta = { + changelog = "https://github.com/zylon-ai/private-gpt/blob/${src.rev}/CHANGELOG.md"; + description = "Interact with your documents using the power of GPT, 100% privately, no data leaks"; + homepage = "https://github.com/zylon-ai/private-gpt"; + license = lib.licenses.asl20; + mainProgram = "private-gpt"; + maintainers = with lib.maintainers; [ drupol ]; + }; +} diff --git a/pkgs/development/python-modules/pybrowserid/default.nix b/pkgs/development/python-modules/pybrowserid/default.nix index 1a4cd7c43058c..10346ee04cc3d 100644 --- a/pkgs/development/python-modules/pybrowserid/default.nix +++ b/pkgs/development/python-modules/pybrowserid/default.nix @@ -1,24 +1,44 @@ -{ lib, buildPythonPackage, fetchPypi -, requests, mock }: +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, + requests, + unittestCheckHook, + mock, +}: buildPythonPackage rec { pname = "pybrowserid"; version = "0.14.0"; + pyproject = true; src = fetchPypi { pname = "PyBrowserID"; inherit version; - sha256 = "1qvi79kfb8x9kxkm5lw2mp42hm82cpps1xknmsb5ghkwx1lpc8kc"; + hash = "sha256-bCJ2aeh8wleWrnb2oO9lAlUoyK2C01Jnn6mj5WY6ceM="; }; - propagatedBuildInputs = [ requests ]; + postPatch = '' + substituteInPlace browserid/tests/* \ + --replace-warn 'assertEquals' 'assertEqual' + ''; - nativeCheckInputs = [ mock ]; + build-system = [ setuptools ]; + + dependencies = [ requests ]; + + pythonImportsCheck = [ "browserid" ]; + + nativeCheckInputs = [ + unittestCheckHook + mock + ]; meta = with lib; { description = "Python library for the BrowserID Protocol"; - homepage = "https://github.com/mozilla/PyBrowserID"; - license = licenses.mpl20; + homepage = "https://github.com/mozilla/PyBrowserID"; + license = licenses.mpl20; maintainers = with maintainers; [ ]; }; } diff --git a/pkgs/development/python-modules/pyfxa/default.nix b/pkgs/development/python-modules/pyfxa/default.nix index 39794d592103c..259370299db2e 100644 --- a/pkgs/development/python-modules/pyfxa/default.nix +++ b/pkgs/development/python-modules/pyfxa/default.nix @@ -18,7 +18,7 @@ buildPythonPackage rec { pname = "pyfxa"; version = "0.7.8"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.7"; @@ -28,7 +28,11 @@ buildPythonPackage rec { hash = "sha256-DMFZl1hbYNaScOTWkAbK2nKti6wD5SS5A30q7TW5vO4="; }; - propagatedBuildInputs = [ + build-system = [ + setuptools + ]; + + dependencies = [ cryptography hawkauthlib pybrowserid diff --git a/pkgs/development/python-modules/pyinsteon/default.nix b/pkgs/development/python-modules/pyinsteon/default.nix index 22242ee62bf49..0f52f3dbf45ce 100644 --- a/pkgs/development/python-modules/pyinsteon/default.nix +++ b/pkgs/development/python-modules/pyinsteon/default.nix @@ -1,23 +1,24 @@ -{ lib -, aiofiles -, aiohttp -, async-timeout -, async-generator -, buildPythonPackage -, fetchFromGitHub -, pypubsub -, pyserial -, pyserial-asyncio -, pytestCheckHook -, pythonAtLeast -, pythonOlder -, setuptools -, voluptuous +{ + lib, + aiofiles, + aiohttp, + async-timeout, + async-generator, + buildPythonPackage, + fetchFromGitHub, + pypubsub, + pyserial, + pyserial-asyncio, + pytestCheckHook, + pythonAtLeast, + pythonOlder, + setuptools, + voluptuous, }: buildPythonPackage rec { pname = "pyinsteon"; - version = "1.5.3"; + version = "1.6.1"; pyproject = true; disabled = pythonOlder "3.8"; @@ -26,12 +27,10 @@ buildPythonPackage rec { owner = "pyinsteon"; repo = "pyinsteon"; rev = "refs/tags/${version}"; - hash = "sha256-9d6QbekUv63sjKdK+ZogYOkGfFXVW+JB6ITHnehLwtM="; + hash = "sha256-s8YRDu+UpU1sisdscd87CpcLl3csOUDdIuKqx48GZsw="; }; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; dependencies = [ aiofiles @@ -48,14 +47,17 @@ buildPythonPackage rec { pytestCheckHook ]; + disabledTests = [ + # RuntimeError: BUG: Dead Listener called, still subscribed! + "test_linking_with_i1_device" + ]; + disabledTestPaths = lib.optionals (pythonAtLeast "3.12") [ # Tests are blocking or failing "tests/test_handlers/" ]; - pythonImportsCheck = [ - "pyinsteon" - ]; + pythonImportsCheck = [ "pyinsteon" ]; meta = with lib; { description = "Python library to support Insteon home automation projects"; diff --git a/pkgs/development/python-modules/python-roborock/default.nix b/pkgs/development/python-modules/python-roborock/default.nix index 31e730a0b9432..7d746131636e1 100644 --- a/pkgs/development/python-modules/python-roborock/default.nix +++ b/pkgs/development/python-modules/python-roborock/default.nix @@ -20,7 +20,7 @@ buildPythonPackage rec { pname = "python-roborock"; - version = "2.2.0"; + version = "2.2.1"; pyproject = true; disabled = pythonOlder "3.10"; @@ -29,7 +29,7 @@ buildPythonPackage rec { owner = "humbertogontijo"; repo = "python-roborock"; rev = "refs/tags/v${version}"; - hash = "sha256-/j7aJ34W7KP+O5ugl+xrA/X42SIjc+zfiBeSd1/4YZI="; + hash = "sha256-qyaERNaisfDWXW1IeyFMOV6nLqT+0O9QJ4U02LOyiuE="; }; postPatch = '' diff --git a/pkgs/development/python-modules/trafilatura/default.nix b/pkgs/development/python-modules/trafilatura/default.nix index 35212c3434438..a8183bf3f8411 100644 --- a/pkgs/development/python-modules/trafilatura/default.nix +++ b/pkgs/development/python-modules/trafilatura/default.nix @@ -1,35 +1,43 @@ -{ lib -, buildPythonPackage -, fetchPypi -, pytestCheckHook -, pythonOlder -, certifi -, charset-normalizer -, courlan -, htmldate -, justext -, lxml -, urllib3 -, setuptools +{ + lib, + buildPythonPackage, + certifi, + charset-normalizer, + courlan, + fetchPypi, + htmldate, + justext, + lxml, + pytestCheckHook, + pythonOlder, + setuptools, + urllib3, }: buildPythonPackage rec { pname = "trafilatura"; - version = "1.8.1"; + version = "1.9.0"; pyproject = true; disabled = pythonOlder "3.9"; src = fetchPypi { inherit pname version; - hash = "sha256-a4eN/b1cXftV0Pgwfyt9wVrDRYBU90hh/5ihcvXjhyA="; + hash = "sha256-5oM9KauKE+2FOTfXyR5oaLxi774QIUrCsQZDbdI9FBI="; }; - nativeBuildInputs = [ - setuptools - ]; + # Patch out gui cli because it is not supported in this packaging and + # nixify path to the trafilatura binary in the test suite + postPatch = '' + substituteInPlace setup.py \ + --replace-fail '"trafilatura_gui=trafilatura.gui:main",' "" + substituteInPlace tests/cli_tests.py \ + --replace-fail "trafilatura_bin = 'trafilatura'" "trafilatura_bin = '$out/bin/trafilatura'" + ''; + + build-system = [ setuptools ]; - propagatedBuildInputs = [ + dependencies = [ certifi charset-normalizer courlan @@ -39,34 +47,22 @@ buildPythonPackage rec { urllib3 ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; disabledTests = [ # Disable tests that require an internet connection + "test_cli_pipeline" + "test_crawl_page" "test_download" "test_fetch" - "test_redirection" "test_meta_redirections" - "test_crawl_page" - "test_whole" "test_probing" - "test_cli_pipeline" + "test_queue" + "test_redirection" + "test_whole" ]; - # patch out gui cli because it is not supported in this packaging - # nixify path to the trafilatura binary in the test suite - postPatch = '' - substituteInPlace setup.py \ - --replace-fail '"trafilatura_gui=trafilatura.gui:main",' "" - substituteInPlace tests/cli_tests.py \ - --replace-fail "trafilatura_bin = 'trafilatura'" "trafilatura_bin = '$out/bin/trafilatura'" - ''; - - pythonImportsCheck = [ - "trafilatura" - ]; + pythonImportsCheck = [ "trafilatura" ]; meta = with lib; { description = "Python package and command-line tool designed to gather text on the Web"; |