From 33f43c502df06dc4b6ef3a0d0ff57f8d18a900f3 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sat, 27 Jul 2024 23:11:10 +0200 Subject: [PATCH] python3Packages.sopel: fix --- .../python-modules/sopel/default.nix | 57 ++++++++++--------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/pkgs/development/python-modules/sopel/default.nix b/pkgs/development/python-modules/sopel/default.nix index 54943d0cb625..853c2ae32cac 100644 --- a/pkgs/development/python-modules/sopel/default.nix +++ b/pkgs/development/python-modules/sopel/default.nix @@ -6,20 +6,21 @@ geoip2, ipython, isPyPy, + setuptools, praw, pyenchant, - pygeoip, pytestCheckHook, pythonOlder, pytz, sqlalchemy, xmltodict, + importlib-metadata, }: buildPythonPackage rec { pname = "sopel"; version = "8.0.0"; - format = "setuptools"; + pyproject = true; disabled = isPyPy || pythonOlder "3.7"; @@ -28,43 +29,47 @@ buildPythonPackage rec { hash = "sha256-juLJp0Et5qMZwBZzw0e4tKg1cBYqAsH8KUzqNoIP70U="; }; - patches = [ - # https://github.com/sopel-irc/sopel/issues/2401 - # https://github.com/sopel-irc/sopel/commit/596adc44330939519784389cbb927435305ef758.patch - # rewrite the patch because there are too many patches needed to apply the above patch. - ./python311-support.patch - ]; + build-system = [ setuptools ]; - propagatedBuildInputs = [ + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "setuptools~=66.1" "setuptools" + ''; + + dependencies = [ dnspython geoip2 ipython praw pyenchant - pygeoip pytz sqlalchemy xmltodict + importlib-metadata ]; + pythonRemoveDeps = [ "sopel-help" ]; + + pythonRelaxDeps = [ "sqlalchemy" ]; + nativeCheckInputs = [ pytestCheckHook ]; - postPatch = '' - substituteInPlace requirements.txt \ - --replace "praw>=4.0.0,<6.0.0" "praw" \ - --replace "sqlalchemy<1.4" "sqlalchemy" \ - --replace "xmltodict==0.12" "xmltodict>=0.12" - ''; - - preCheck = '' - export TESTDIR=$(mktemp -d) - cp -R ./test $TESTDIR - pushd $TESTDIR - ''; - - postCheck = '' - popd - ''; + disabledTests = [ + # requires network access + "test_example_exchange_cmd_0" + "test_example_exchange_cmd_1" + "test_example_duck_0" + "test_example_duck_1" + "test_example_suggest_0" + "test_example_suggest_1" + "test_example_suggest_2" + "test_example_tr2_0" + "test_example_tr2_1" + "test_example_tr2_2" + "test_example_title_command_0" + "test_example_wiktionary_0" + "test_example_wiktionary_ety_0" + ]; pythonImportsCheck = [ "sopel" ];