diff options
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pytest-asyncio')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/pytest-asyncio/default.nix | 61 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/pytest-asyncio/tests.nix | 28 |
2 files changed, 89 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pytest-asyncio/default.nix b/nixpkgs/pkgs/development/python-modules/pytest-asyncio/default.nix new file mode 100644 index 000000000000..6eac9bf333be --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/pytest-asyncio/default.nix @@ -0,0 +1,61 @@ +{ lib +, buildPythonPackage +, callPackage +, fetchFromGitHub +, flaky +, hypothesis +, pytest +, pytestCheckHook +, pythonOlder +, setuptools-scm +}: + +buildPythonPackage rec { + pname = "pytest-asyncio"; + version = "0.19.0"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "pytest-dev"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-A8ngASbSRwY4RjanalnWBGgskZMDO50ffOf6wMNqOvA="; + }; + + outputs = [ + "out" + "testout" + ]; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + setuptools-scm + ]; + + buildInputs = [ + pytest + ]; + + postInstall = '' + mkdir $testout + cp -R tests $testout/tests + ''; + + doCheck = false; + passthru.tests.pytest = callPackage ./tests.nix {}; + + pythonImportsCheck = [ + "pytest_asyncio" + ]; + + meta = with lib; { + description = "Library for testing asyncio code with pytest"; + homepage = "https://github.com/pytest-dev/pytest-asyncio"; + changelog = "https://github.com/pytest-dev/pytest-asyncio/blob/${src.rev}/CHANGELOG.rst"; + license = licenses.asl20; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/nixpkgs/pkgs/development/python-modules/pytest-asyncio/tests.nix b/nixpkgs/pkgs/development/python-modules/pytest-asyncio/tests.nix new file mode 100644 index 000000000000..17e60e4369bd --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/pytest-asyncio/tests.nix @@ -0,0 +1,28 @@ +{ buildPythonPackage +, flaky +, hypothesis +, pytest-asyncio +, pytest-trio +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pytest-asyncio-tests"; + inherit (pytest-asyncio) version; + + src = pytest-asyncio.testout; + + dontBuild = true; + dontInstall = true; + + propagatedBuildInputs = [ + pytest-asyncio + ]; + + checkInputs = [ + flaky + hypothesis + pytest-trio + pytestCheckHook + ]; +} |