Unverified Commit d43eaad6 authored by Martin Weinelt's avatar Martin Weinelt Committed by GitHub
Browse files

python312Packages: remove some old backport modules (#355418)

parents 40641d0a a45548f7
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -7,9 +7,6 @@
  # build
  poetry-core,

  # runtime
  backports-zoneinfo,

  # tests
  pytestCheckHook,
  freezegun,
@@ -29,8 +26,6 @@ buildPythonPackage rec {

  nativeBuildInputs = [ poetry-core ];

  propagatedBuildInputs = lib.optionals (pythonOlder "3.9") [ backports-zoneinfo ];

  nativeCheckInputs = [
    freezegun
    pytestCheckHook
+0 −45
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pythonOlder,
  setuptools-scm,
  wheel,
  pytestCheckHook,
  pytest-mock,
  pytest-sugar,
}:

buildPythonPackage rec {
  pname = "backports-cached-property";
  version = "1.0.2";
  format = "pyproject";

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "penguinolog";
    repo = "backports.cached_property";
    rev = version;
    hash = "sha256-rdgKbVQaELilPrN4ve8RbbaLiT14Xex0esy5vUX2ZBc=";
  };

  nativeBuildInputs = [ setuptools-scm ];

  propagatedBuildInputs = [ wheel ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-mock
    pytest-sugar
  ];

  pythonImportsCheck = [ "backports.cached_property" ];

  meta = with lib; {
    description = "Python 3.8 functools.cached_property backport to python 3.6";
    homepage = "https://github.com/penguinolog/backports.cached_property";
    license = with licenses; [ mit ];
    maintainers = with maintainers; [ izorkin ];
  };
}
+0 −37
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pytest,
  pythonOlder,
}:

if !(pythonOlder "3.3") then
  null
else
  buildPythonPackage {
    pname = "backports-shutil-get-terminal-size";
    version = "unstable-2016-02-21";

    # there have been numerous fixes committed since the initial release.
    # Most notably fixing a problem where the backport would always return
    # terminal size 0. See https://trac.sagemath.org/ticket/25320#comment:5.
    # Unfortunately the maintainer seems inactive and has not responded to
    # a request for a new release since 2016:
    # https://github.com/chrippa/backports.shutil_get_terminal_size/issues/7
    src = fetchFromGitHub {
      owner = "chrippa";
      repo = "backports.shutil_get_terminal_size";
      rev = "159e269450dbf37c3a837f6ea7e628d59acbb96a";
      sha256 = "17sgv8vg0xxfdnca45l1mmwwvj29gich5c8kqznnj51kfccch7sg";
    };

    nativeCheckInputs = [ pytest ];

    meta = with lib; {
      description = "Backport of the get_terminal_size function from Python 3.3’s shutil";
      homepage = "https://github.com/chrippa/backports.shutil_get_terminal_size";
      license = with licenses; [ mit ];
      maintainers = teams.sage.members;
    };
  }
+0 −30
Original line number Diff line number Diff line
{
  lib,
  fetchPypi,
  buildPythonPackage,
  pytest,
}:

buildPythonPackage rec {
  pname = "backports-shutil-which";
  version = "3.5.2";

  src = fetchPypi {
    pname = "backports.shutil_which";
    inherit version;
    sha256 = "fe39f567cbe4fad89e8ac4dbeb23f87ef80f7fe8e829669d0221ecdb0437c133";
  };

  nativeCheckInputs = [ pytest ];

  checkPhase = ''
    py.test test
  '';

  meta = with lib; {
    description = "Backport of shutil.which from Python 3.3";
    homepage = "https://github.com/minrk/backports.shutil_which";
    license = licenses.psfl;
    maintainers = with maintainers; [ jluttine ];
  };
}
+0 −80
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pythonAtLeast,
  pythonOlder,
  python,
  substituteAll,
  importlib-resources,
  tzdata,
  hypothesis,
  pytestCheckHook,
  fetchpatch,
}:

buildPythonPackage rec {
  pname = "backports-zoneinfo";
  version = "0.2.1";
  format = "setuptools";

  disabled = pythonAtLeast "3.9";

  src = fetchFromGitHub {
    owner = "pganssle";
    repo = "zoneinfo";
    rev = version;
    hash = "sha256-00xdDOVdDanfsjQTd3yjMN2RFGel4cWRrAA3CvSnl24=";
  };

  # Make sure test data update patch applies
  prePatch = ''
    substituteInPlace tests/data/zoneinfo_data.json --replace \"2020a\" \"2021a\"
  '';

  patches = [
    # Update test suite's test data to zoneinfo 2022a
    # https://github.com/pganssle/zoneinfo/pull/115
    (fetchpatch {
      name = "backports-zoneinfo-2022a-update-test-data1.patch";
      url = "https://github.com/pganssle/zoneinfo/pull/115/commits/837e2a0f9f1a1332e4233f83e3648fa564a9ec9e.patch";
      sha256 = "196knwa212mr0b7zsh8papzr3f5mii87gcjjjx1r9zzvmk3g3ri0";
    })
    (fetchpatch {
      name = "backports-zoneinfo-2022a-update-test-data2.patch";
      url = "https://github.com/pganssle/zoneinfo/pull/115/commits/9fd330265b177916d6182249439bb40d5691eb58.patch";
      sha256 = "1zxa5bkwi8hbnh4c0qv72wv6vdp5jlxqizfjsc05ymzvwa99cf75";
    })

    (substituteAll {
      name = "zoneinfo-path";
      src = ./zoneinfo.patch;
      zoneinfo = "${tzdata}/${python.sitePackages}/tzdata/zoneinfo";
    })
  ];

  propagatedBuildInputs = [ tzdata ] ++ lib.optionals (pythonOlder "3.7") [ importlib-resources ];

  pythonImportsCheck = [ "backports.zoneinfo" ];

  nativeCheckInputs = [
    hypothesis
    pytestCheckHook
  ];

  disabledTests = [
    # AssertionError: 'AEDT' != 'AEST'
    "test_folds_and_gaps"
    # AssertionError: 0 != 1 : (datetime.datetime(1917, 3, 25, 2, 0, 1, tzinfo=backports.zoneinfo.ZoneInfo(key='Australia/Sydney')), datetime.datetime(1917, 3, 24, 15, 0, tzinfo=datetime.timezone.utc))
    "test_folds_from_utc"
    # backports.zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key Eurasia/Badzone'
    "test_bad_keys"
  ];

  meta = with lib; {
    description = "Backport of the standard library module zoneinfo";
    homepage = "https://github.com/pganssle/zoneinfo";
    license = licenses.asl20;
    maintainers = [ ];
  };
}
Loading