Skip to content

Commit

Permalink
Merge pull request #310905 from TomaSajt/pytest-shutil
Browse files Browse the repository at this point in the history
python312Packages.pytest-{fixture-config,shutil,server-fixtures,virtualenv}: * -> 1.7.1-unstable-2022-10-03
  • Loading branch information
wegank committed May 12, 2024
2 parents a07fc87 + 143bc2f commit 27713bd
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 53 deletions.
29 changes: 21 additions & 8 deletions pkgs/development/python-modules/pytest-fixture-config/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
{ lib, buildPythonPackage, fetchPypi
, setuptools-git, pytest }:
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
setuptools-git,
pytest,
}:

buildPythonPackage rec {
pname = "pytest-fixture-config";
version = "1.7.0";
format = "setuptools";
version = "1.7.1-unstable-2022-10-03";
pyproject = true;

src = fetchPypi {
inherit pname version;
sha256 = "13i1qpz22w3x4dmw8vih5jdnbqfqvl7jiqs0dg764s0zf8bp98a1";
src = fetchFromGitHub {
owner = "man-group";
repo = "pytest-plugins";
rev = "5f9b88a65a8c1e506885352bbd9b2a47900f5014";
hash = "sha256-huN3RzwtfVf4iMJ96VRP/ldOxTUlUMF1wJIdbcGXHn4=";
};

nativeBuildInputs = [ setuptools-git ];
sourceRoot = "${src.name}/pytest-fixture-config";

nativeBuildInputs = [
setuptools
setuptools-git
];

buildInputs = [ pytest ];

Expand Down
43 changes: 31 additions & 12 deletions pkgs/development/python-modules/pytest-server-fixtures/default.nix
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
{ lib, buildPythonPackage, fetchPypi
, pytest, pytest-shutil, pytest-fixture-config, psutil
, requests, future, retry }:
{
lib,
buildPythonPackage,
fetchFromGitHub,
future,
psutil,
pytest,
pytest-shutil,
pytest-fixture-config,
requests,
retry,
six,
setuptools,
}:

buildPythonPackage rec {
pname = "pytest-server-fixtures";
version = "1.7.1";
format = "setuptools";
inherit (pytest-fixture-config) version src;
pyproject = true;

src = fetchPypi {
inherit pname version;
sha256 = "sha256-xecz0gqNDnc8pRPjYOS6JkeVLqlCj6K9BVFsYoHqPOc=";
};
sourceRoot = "${src.name}/pytest-server-fixtures";

build-system = [ setuptools ];

buildInputs = [ pytest ];
propagatedBuildInputs = [ pytest-shutil pytest-fixture-config psutil requests future retry ];

# RuntimeError: Unable to find a free server number to start Xvfb
dependencies = [
future
psutil
pytest-shutil
pytest-fixture-config
requests
retry
six
];

# Don't run intergration tests
doCheck = false;

meta = with lib; {
description = "Extensible server fixures for py.test";
homepage = "https://github.com/manahl/pytest-plugins";
homepage = "https://github.com/manahl/pytest-plugins";
license = licenses.mit;
maintainers = with maintainers; [ ];
};
Expand Down
45 changes: 24 additions & 21 deletions pkgs/development/python-modules/pytest-shutil/default.nix
Original file line number Diff line number Diff line change
@@ -1,46 +1,50 @@
{ lib
, isPyPy
, buildPythonPackage
, fetchPypi
, pytest-fixture-config
, fetchpatch

# build
, pytest
# build-time
, setuptools
, setuptools-git

# runtime
, setuptools-git
, pytest
, mock
, path
, execnet
, termcolor
, six

# tests
, cmdline
, pytestCheckHook
}:

buildPythonPackage rec {
pname = "pytest-shutil";
version = "1.7.0";
format = "setuptools";
inherit (pytest-fixture-config) version src;
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-2BZSYd5251CFBcNB2UwCsRPclj8nRUOrynTb+r0CEmE=";
};
sourceRoot = "${src.name}/pytest-shutil";

postPatch = ''
substituteInPlace setup.py \
--replace "contextlib2" 'contextlib2;python_version<"3"' \
--replace "path.py" "path"
'';

buildInputs = [
pytest
# imp was removed in Python 3.12
patches = [
(fetchpatch {
name = "stop-using-imp.patch";
url = "https://build.opensuse.org/public/source/openSUSE:Factory/python-pytest-shutil/stop-using-imp.patch?rev=10";
hash = "sha256-L8tXoQ9q8o6aP3TpJY/sUVVbUd/ebw0h6de6dBj1WNY=";
stripLen = 1;
})
];

propagatedBuildInputs = [
build-system = [
setuptools
setuptools-git
];

buildInputs = [ pytest ];

dependencies = [
mock
path
execnet
Expand All @@ -49,7 +53,6 @@ buildPythonPackage rec {
];

nativeCheckInputs = [
cmdline
pytestCheckHook
];

Expand Down
46 changes: 34 additions & 12 deletions pkgs/development/python-modules/pytest-virtualenv/default.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
{ lib, buildPythonPackage, fetchPypi
, pytest, pytest-cov, mock, cmdline, pytest-fixture-config, pytest-shutil, virtualenv }:
{
lib,
buildPythonPackage,
cmdline,
importlib-metadata,
mock,
pytestCheckHook,
pytest,
pytest-fixture-config,
pytest-shutil,
setuptools,
virtualenv,
}:

buildPythonPackage rec {
pname = "pytest-virtualenv";
version = "1.7.0";
format = "setuptools";
inherit (pytest-fixture-config) version src;
pyproject = true;

src = fetchPypi {
inherit pname version;
sha256 = "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12";
};
sourceRoot = "${src.name}/pytest-virtualenv";

build-system = [ setuptools ];

buildInputs = [ pytest ];

dependencies = [
importlib-metadata
pytest-fixture-config
pytest-shutil
virtualenv
];

nativeCheckInputs = [ pytest pytest-cov mock cmdline ];
propagatedBuildInputs = [ pytest-fixture-config pytest-shutil virtualenv ];
checkPhase = "py.test tests/unit ";
nativeCheckInputs = [
cmdline
mock
pytestCheckHook
];

nativeBuildInputs = [ pytest ];
# Don't run integration tests
disabledTestPaths = [ "tests/integration/*" ];

meta = with lib; {
description = "Create a Python virtual environment in your test that cleans up on teardown. The fixture has utility methods to install packages and list what’s installed.";
Expand Down

0 comments on commit 27713bd

Please sign in to comment.