mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-17 02:14:36 +00:00
Merge pull request #145801 from dotlambda/tzlocal-4.1
python3Packages.tzlocal: 2.1 -> 4.1
This commit is contained in:
commit
2aaf727771
|
@ -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
|
||||
];
|
||||
|
|
|
@ -29,6 +29,7 @@ python3.pkgs.buildPythonApplication rec {
|
|||
lxml
|
||||
typing-extensions
|
||||
python-dateutil
|
||||
pytz
|
||||
tzlocal
|
||||
];
|
||||
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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):
|
|
@ -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 ];
|
||||
};
|
||||
}
|
36
pkgs/development/python-modules/tzlocal/2.nix
Normal file
36
pkgs/development/python-modules/tzlocal/2.nix
Normal file
|
@ -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 ];
|
||||
};
|
||||
}
|
|
@ -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" ];
|
||||
|
||||
|
|
|
@ -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; {
|
||||
|
|
|
@ -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 { };
|
||||
|
|
|
@ -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 { };
|
||||
|
|
Loading…
Reference in a new issue