diff --git a/pkgs/development/python-modules/steam/default.nix b/pkgs/development/python-modules/steam/default.nix new file mode 100644 index 00000000000000..a8463f06016609 --- /dev/null +++ b/pkgs/development/python-modules/steam/default.nix @@ -0,0 +1,57 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + fetchpatch, + setuptools, + six, + pycryptodomex, + requests, + vdf, + gevent, + gevent-eventemitter, + protobuf, + cachetools, +}: + +buildPythonPackage rec { + pname = "steam"; + version = "1.4.4"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ValvePython"; + repo = "steam"; + rev = "refs/tags/v${version}"; + hash = "sha256-OY04GsX3KMPvpsQl8sUurzFyJu+JKpES8B0iD6Z5uyw="; + }; + + patches = [ + # https://github.com/ValvePython/steam/pull/466 + /* (fetchpatch { + url = "https://github.com/ValvePython/steam/commit/e313e05d03cfbb9413cfb279a4a14fa55d0b3c4e.patch"; + hash = "sha256-y1LMwsnMXTVI8RsH07gSNQyKJfubDR+KYAkC8aHIYKw="; + }) */ + # TypeError: int() argument must be a string, a bytes-like object or a real number, not 'dict' + ./whydoesthisneedfixing.patch + ]; + + build-system = [ setuptools ]; + dependencies = [ + six + pycryptodomex + requests + vdf + gevent + protobuf + gevent-eventemitter + cachetools + ]; + + meta = { + description = "Python package for interacting with Steam"; + homepage = "https://steam.readthedocs.io/en/stable/"; # setup.py links to GitHub, but GitHub links to ReadTheDocs + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ pandapip1 ]; + }; +} diff --git a/pkgs/development/python-modules/steam/whydoesthisneedfixing.patch b/pkgs/development/python-modules/steam/whydoesthisneedfixing.patch new file mode 100644 index 00000000000000..2beeebfa3ea2a0 --- /dev/null +++ b/pkgs/development/python-modules/steam/whydoesthisneedfixing.patch @@ -0,0 +1,14 @@ +diff --git a/steam/client/cdn.py b/steam/client/cdn.py +index dbd09ab..3762653 100644 +--- a/steam/client/cdn.py ++++ b/steam/client/cdn.py +@@ -836,6 +836,9 @@ class CDNClient(object): + else: + manifest_gid = depot_info.get('manifests', {}).get(branch) + ++ if type(manifest_gid) == dict: ++ manifest_gid = manifest_gid.get('gid') ++ + if manifest_gid is not None: + tasks.append( + self.gpool.spawn( diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 63ac05eb00e36b..a929fac2a22271 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14904,6 +14904,8 @@ self: super: with self; { stdlibs = callPackage ../development/python-modules/stdlibs { }; + steam = callPackage ../development/python-modules/steam { }; + steamodd = callPackage ../development/python-modules/steamodd { }; steamship = callPackage ../development/python-modules/steamship { };