diff --git a/pkgs/development/python-modules/asyncpraw/default.nix b/pkgs/development/python-modules/asyncpraw/default.nix new file mode 100644 index 000000000000..5435eb099e46 --- /dev/null +++ b/pkgs/development/python-modules/asyncpraw/default.nix @@ -0,0 +1,77 @@ +{ + lib, + aiofiles, + aiohttp, + aiosqlite, + asyncprawcore, + buildPythonPackage, + fetchFromGitHub, + flit-core, + mock, + pytestCheckHook, + pytest-asyncio, + pytest-vcr, + pythonOlder, + requests-toolbelt, + update-checker, + vcrpy, +}: + +buildPythonPackage rec { + pname = "asyncpraw"; + version = "7.8.1"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "praw-dev"; + repo = "asyncpraw"; + tag = "v${version}"; + hash = "sha256-glWAQoUjMFbjU3C4+MGuRGSGJS9mun15+6udMPCf9nU="; + }; + + pythonRelaxDeps = [ "aiosqlite" ]; + + # 'aiosqlite' is also checked when building the wheel + pypaBuildFlags = [ "--skip-dependency-check" ]; + + build-system = [ flit-core ]; + + dependencies = [ + aiofiles + aiohttp + aiosqlite + asyncprawcore + mock + update-checker + ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-asyncio + pytest-vcr + vcrpy + requests-toolbelt + ]; + + disabledTestPaths = [ + # Ignored due to error with request cannot pickle 'BufferedReader' instances + # Upstream issue: https://github.com/kevin1024/vcrpy/issues/737 + "tests/integration/models/reddit/test_emoji.py" + "tests/integration/models/reddit/test_submission.py" + "tests/integration/models/reddit/test_subreddit.py" + "tests/integration/models/reddit/test_widgets.py" + "tests/integration/models/reddit/test_wikipage.py" + ]; + + pythonImportsCheck = [ "asyncpraw" ]; + + meta = { + description = "Asynchronous Python Reddit API Wrapper"; + homepage = "https://asyncpraw.readthedocs.io/"; + changelog = "https://github.com/praw-dev/asyncpraw/blob/v${version}/CHANGES.rst"; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.amadejkastelic ]; + }; +} diff --git a/pkgs/development/python-modules/asyncprawcore/default.nix b/pkgs/development/python-modules/asyncprawcore/default.nix new file mode 100644 index 000000000000..133d74aefb7c --- /dev/null +++ b/pkgs/development/python-modules/asyncprawcore/default.nix @@ -0,0 +1,66 @@ +{ + lib, + aiohttp, + buildPythonPackage, + fetchFromGitHub, + flit-core, + mock, + pytestCheckHook, + pytest-asyncio, + pytest-vcr, + pythonOlder, + requests, + requests-toolbelt, + testfixtures, + vcrpy, + yarl, +}: + +buildPythonPackage rec { + pname = "asyncprawcore"; + version = "2.4.0"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "praw-dev"; + repo = "asyncprawcore"; + tag = "v${version}"; + hash = "sha256-FDQdtnNjsbiEp9BUYdQFMC/hkyJDhCh2WHhQWSQwrFY="; + }; + + nativeBuildInputs = [ flit-core ]; + + propagatedBuildInputs = [ + requests + aiohttp + yarl + ]; + + nativeCheckInputs = [ + testfixtures + mock + requests-toolbelt + pytestCheckHook + pytest-asyncio + pytest-vcr + vcrpy + ]; + + disabledTestPaths = [ + # Ignored due to error with request cannot pickle 'BufferedReader' instances + # Upstream issue: https://github.com/kevin1024/vcrpy/issues/737 + "tests/integration/test_sessions.py" + ]; + + pythonImportsCheck = [ "asyncprawcore" ]; + + meta = { + description = "Low-level asynchronous communication layer for Async PRAW"; + homepage = "https://asyncpraw.readthedocs.io/"; + changelog = "https://github.com/praw-dev/asyncprawcore/blob/v${version}/CHANGES.rst"; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.amadejkastelic ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a4cf72864359..4351fb705a59 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1022,6 +1022,10 @@ self: super: with self; { asyncpg = callPackage ../development/python-modules/asyncpg { }; + asyncpraw = callPackage ../development/python-modules/asyncpraw { }; + + asyncprawcore = callPackage ../development/python-modules/asyncprawcore { }; + asyncserial = callPackage ../development/python-modules/asyncserial { }; asyncsleepiq = callPackage ../development/python-modules/asyncsleepiq { };