diff --git a/pkgs/applications/misc/jrnl/default.nix b/pkgs/applications/misc/jrnl/default.nix index 967d4931c31e..494329ecabe7 100644 --- a/pkgs/applications/misc/jrnl/default.nix +++ b/pkgs/applications/misc/jrnl/default.nix @@ -16,6 +16,11 @@ python3.pkgs.buildPythonApplication rec { sha256 = "sha256-+kPr7ndY6u1HMw6m0UZJ5jxVIPNjlTfQt7OYEdZkHBE="; }; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'tzlocal = ">2.0, <3.0"' 'tzlocal = ">2.0, !=3.0"' + ''; + nativeBuildInputs = with python3.pkgs; [ poetry-core ]; diff --git a/pkgs/applications/networking/instant-messengers/zulip-term/default.nix b/pkgs/applications/networking/instant-messengers/zulip-term/default.nix index b2f80c70d240..1775ce9a4817 100644 --- a/pkgs/applications/networking/instant-messengers/zulip-term/default.nix +++ b/pkgs/applications/networking/instant-messengers/zulip-term/default.nix @@ -29,6 +29,7 @@ python3.pkgs.buildPythonApplication rec { lxml typing-extensions python-dateutil + pytz tzlocal ]; diff --git a/pkgs/development/python-modules/clickhouse-driver/default.nix b/pkgs/development/python-modules/clickhouse-driver/default.nix index 9a4c0f0f92be..dd1698f9a3ae 100644 --- a/pkgs/development/python-modules/clickhouse-driver/default.nix +++ b/pkgs/development/python-modules/clickhouse-driver/default.nix @@ -16,14 +16,14 @@ buildPythonPackage rec { pname = "clickhouse-driver"; - version = "0.2.0"; + version = "0.2.2"; # pypi source doesn't contain tests src = fetchFromGitHub { owner = "mymarilyn"; repo = "clickhouse-driver"; - rev = "96b7ba448c63ca2670cc9aa70d4a0e08826fb650"; - sha256 = "sha256-HFKUxJOlBCVlu7Ia8heGpwX6+HdKuwSy92s3v+GKGwE="; + rev = version; + sha256 = "0sx4jbadx9frzhqnj8b9w9l508x1r7j7b9883h7xq93lf00rxkfz"; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/exchangelib/skip_failing_test.patch b/pkgs/development/python-modules/exchangelib/skip_failing_test.patch deleted file mode 100644 index 6c070acaf75a..000000000000 --- a/pkgs/development/python-modules/exchangelib/skip_failing_test.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ./tests/__init__.py 1980-01-02 00:00:00.000000000 +0000 -+++ ./tests/__init__.py 1980-01-02 00:00:00.000000000 +0000 -@@ -301,6 +301,7 @@ - self.assertEqual(id(base_p.thread_pool), id(p.thread_pool)) - self.assertEqual(id(base_p._session_pool), id(p._session_pool)) - -+ @unittest.skip("no network connection inside the Nix sandbox") - def test_close(self): - proc = psutil.Process() - ip_addresses = {info[4][0] for info in socket.getaddrinfo( -@@ -1257,6 +1258,7 @@ - ) - - -+@unittest.skip("no network connection inside the Nix sandbox") - class EWSTest(unittest.TestCase): - @classmethod - def setUpClass(cls): diff --git a/pkgs/development/python-modules/pytz-deprecation-shim/default.nix b/pkgs/development/python-modules/pytz-deprecation-shim/default.nix new file mode 100644 index 000000000000..eccf8399ee29 --- /dev/null +++ b/pkgs/development/python-modules/pytz-deprecation-shim/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonAtLeast +, pythonOlder +, backports-zoneinfo +, python-dateutil +, tzdata +, hypothesis +, pytestCheckHook +, pytz +}: + +buildPythonPackage rec { + pname = "pytz-deprecation-shim"; + version = "0.1.0.post0"; + + format = "pyproject"; + + src = fetchPypi { + pname = "pytz_deprecation_shim"; + inherit version; + sha256 = "af097bae1b616dde5c5744441e2ddc69e74dfdcb0c263129610d85b87445a59d"; + }; + + propagatedBuildInputs = (lib.optionals (pythonAtLeast "3.6" && pythonOlder "3.9") [ + backports-zoneinfo + ]) ++ (lib.optionals (pythonOlder "3.6") [ + python-dateutil + ]) ++ (lib.optionals (pythonAtLeast "3.6") [ + tzdata + ]); + + checkInputs = [ + hypothesis + pytestCheckHook + pytz + ]; + + # https://github.com/pganssle/pytz-deprecation-shim/issues/27 + doCheck = pythonAtLeast "3.9"; + + meta = with lib; { + description = "Shims to make deprecation of pytz easier"; + homepage = "https://github.com/pganssle/pytz-deprecation-shim"; + license = licenses.asl20; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/tzlocal/2.nix b/pkgs/development/python-modules/tzlocal/2.nix new file mode 100644 index 000000000000..ba96c63af850 --- /dev/null +++ b/pkgs/development/python-modules/tzlocal/2.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchPypi +, pytz +, mock +}: + +buildPythonPackage rec { + pname = "tzlocal"; + version = "2.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "643c97c5294aedc737780a49d9df30889321cbe1204eac2c2ec6134035a92e44"; + }; + + propagatedBuildInputs = [ + pytz + ]; + + checkInputs = [ + mock + ]; + + doCheck = false; + + pythonImportsCheck = [ "tzlocal" ]; + + meta = with lib; { + description = "Tzinfo object for the local timezone"; + homepage = "https://github.com/regebro/tzlocal"; + license = licenses.cddl; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/tzlocal/default.nix b/pkgs/development/python-modules/tzlocal/default.nix index 363e1d12a55e..c735ee38ea98 100644 --- a/pkgs/development/python-modules/tzlocal/default.nix +++ b/pkgs/development/python-modules/tzlocal/default.nix @@ -1,19 +1,37 @@ -{ lib, buildPythonPackage, fetchPypi -, pytz }: +{ lib +, buildPythonPackage +, pythonOlder +, fetchPypi +, pytz-deprecation-shim +, pytest-mock +, pytestCheckHook +}: buildPythonPackage rec { pname = "tzlocal"; - version = "2.1"; # version needs to be compatible with APScheduler + version = "4.1"; # version needs to be compatible with APScheduler - propagatedBuildInputs = [ pytz ]; + disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - sha256 = "643c97c5294aedc737780a49d9df30889321cbe1204eac2c2ec6134035a92e44"; + sha256 = "sha256-DygBWsaKXAZyEEAKkZf8XTa6m8P46vHaPL1ZrN/tngk="; }; - # test fail (timezone test fail) - doCheck = false; + propagatedBuildInputs = [ + pytz-deprecation-shim + ]; + + checkInputs = [ + pytest-mock + pytestCheckHook + ]; + + disabledTests = [ + "test_conflicting" + "test_noconflict" + "test_symlink_localtime" + ]; pythonImportsCheck = [ "tzlocal" ]; diff --git a/pkgs/development/tools/aws-sam-cli/default.nix b/pkgs/development/tools/aws-sam-cli/default.nix index 8f8f37a4e417..d38ac9ba88c9 100644 --- a/pkgs/development/tools/aws-sam-cli/default.nix +++ b/pkgs/development/tools/aws-sam-cli/default.nix @@ -51,7 +51,7 @@ python3.pkgs.buildPythonApplication rec { --replace "aws_lambda_builders==" "aws-lambda-builders #" \ --replace "typing_extensions==" "typing-extensions #" \ --replace "regex==" "regex #" \ - --replace "tzlocal==3.0" "tzlocal==2.*" + --replace "tzlocal==3.0" "tzlocal" ''; meta = with lib; { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e7825d77fea6..771fc6572bf1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7894,6 +7894,8 @@ in { pytz = callPackage ../development/python-modules/pytz { }; + pytz-deprecation-shim = callPackage ../development/python-modules/pytz-deprecation-shim { }; + pytzdata = callPackage ../development/python-modules/pytzdata { }; pyu2f = callPackage ../development/python-modules/pyu2f { }; diff --git a/pkgs/top-level/python2-packages.nix b/pkgs/top-level/python2-packages.nix index ace11ce495ff..59afe1064168 100644 --- a/pkgs/top-level/python2-packages.nix +++ b/pkgs/top-level/python2-packages.nix @@ -640,6 +640,8 @@ with self; with super; { typing = callPackage ../development/python-modules/typing { }; + tzlocal = callPackage ../development/python-modules/tzlocal/2.nix { }; + ujson = callPackage ../development/python-modules/ujson/2.nix { }; umemcache = callPackage ../development/python-modules/umemcache { };