Unverified Commit 21f12f0d authored by Nick Cao's avatar Nick Cao
Browse files

python312Packages.telethon: 1.26.1 -> 1.37.0, modernize

parent 1f9d2cf6
Loading
Loading
Loading
Loading
+23 −11
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
  openssl,
  rsa,
  pyaes,
  cryptg,
  pythonOlder,
  setuptools,
  pytest-asyncio,
@@ -13,40 +14,51 @@

buildPythonPackage rec {
  pname = "telethon";
  version = "1.26.1";
  format = "pyproject";
  version = "1.37.0";
  pyproject = true;

  disabled = pythonOlder "3.5";

  src = fetchFromGitHub {
    owner = "LonamiWebs";
    repo = "Telethon";
    rev = "refs/tags/v${version}";
    hash = "sha256-RxnC+PVSnLeCZ1xap6n6CjpeA8Ig6oLGiB0LDxqUmsA=";
    hash = "sha256-P7FP+Wqi3dqbBCFpI9aCDvK4k3mWv8076RO6MXg+jFQ=";
  };

  patchPhase = ''
    substituteInPlace telethon/crypto/libssl.py --replace \
    substituteInPlace telethon/crypto/libssl.py --replace-fail \
      "ctypes.util.find_library('ssl')" "'${lib.getLib openssl}/lib/libssl.so'"
  '';

  nativeBuildInputs = [ setuptools ];
  build-system = [
    setuptools
  ];

  propagatedBuildInputs = [
    rsa
  dependencies = [
    pyaes
    rsa
  ];

  optional-dependencies = {
    cryptg = [ cryptg ];
  };

  nativeCheckInputs = [
    pytest-asyncio
    pytestCheckHook
  ];

  pytestFlagsArray = [ "tests/telethon" ];
  disabledTests = [
    # https://github.com/LonamiWebs/Telethon/issues/4254
    "test_all_methods_present"
    "test_private_get_extension"
  ];

  meta = with lib; {
  meta = {
    homepage = "https://github.com/LonamiWebs/Telethon";
    description = "Full-featured Telegram client library for Python 3";
    license = licenses.mit;
    maintainers = with maintainers; [ nyanloutre ];
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ nyanloutre ];
  };
}