Merge pull request #153131 from fabaff/bump-pytest-socket

python3Packages.pytest-socket: 0.4.0 -> 0.5.0
This commit is contained in:
Fabian Affolter 2022-01-04 22:50:48 +01:00 committed by GitHub
commit 825bc4f09a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 25 deletions

View file

@ -1,23 +1,24 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, poetry-core
, pytest
, pythonOlder
, setuptoolsBuildHook
}:
buildPythonPackage rec {
pname = "pytest-socket";
version = "0.4.0";
disabled = pythonOlder "3.6";
version = "0.5.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "miketheman";
repo = pname;
rev = version;
sha256 = "sha256-cFYtJqZ/RjFbn9XlEy6ffxZ2djisajQAwjV/YR2f59Q=";
hash = "sha256-HdGkpIHFsoAG2+8UyL9jSb3Dm8bWkYzREdY3i15ls/Q=";
};
nativeBuildInputs = [
@ -28,23 +29,12 @@ buildPythonPackage rec {
pytest
];
checkInputs = [
pytest
];
patches = [
# Switch to poetry-core, https://github.com/miketheman/pytest-socket/pull/74
(fetchpatch {
name = "switch-to-poetry-core.patch";
url = "https://github.com/miketheman/pytest-socket/commit/32519170e656e731d24b81770a170333d3efa6a8.patch";
sha256 = "19ksgx77rsa6ijcbml74alwc5052mdqr4rmvqhlzvfcvv3676ig2";
})
];
# pytest-socket require network for majority of tests
doCheck = false;
pythonImportsCheck = [ "pytest_socket" ];
pythonImportsCheck = [
"pytest_socket"
];
meta = with lib; {
description = "Pytest Plugin to disable socket calls during tests";

View file

@ -1,8 +1,8 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, poetry
, pytest-cov
, fetchpatch
, poetry-core
, pytest-flakes
, pytest-mock
, pytest-socket
@ -19,22 +19,41 @@ buildPythonPackage rec {
owner = "niksite";
repo = pname;
rev = version;
sha256 = "09nac5nh94x0n4bfazjfxk96b20mfsx6r1fnvqv85gkzs0rwqkaq";
hash = "sha256-WE3MM9B/voI23taFbLp2FYhl0uxOfuUWsaCTBG1hyiY=";
};
nativeBuildInputs = [ poetry ];
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [ six ];
propagatedBuildInputs = [
six
];
checkInputs = [
pytest-cov
pytest-flakes
pytest-mock
pytest-socket
pytestCheckHook
];
pythonImportsCheck = [ "url_normalize" ];
patches = [
# Switch to poetry-core, https://github.com/niksite/url-normalize/pull/28
(fetchpatch {
name = "switch-to-poetry-core.patch";
url = "https://github.com/niksite/url-normalize/commit/b8557b10c977b191cc9d37e6337afe874a24ad08.patch";
sha256 = "sha256-SVCQATV9V6HbLmjOHs7V7eBagO0PuqZLubIJghBYfQQ=";
})
];
postPatch = ''
sed -i "/--cov/d" tox.ini
sed -i "/--flakes/d" tox.ini
'';
pythonImportsCheck = [
"url_normalize"
];
meta = with lib; {
description = "URL normalization for Python";