diff --git a/pkgs/development/python-modules/pluggy/default.nix b/pkgs/development/python-modules/pluggy/default.nix index 46aebb5195008..e6473e98a282d 100644 --- a/pkgs/development/python-modules/pluggy/default.nix +++ b/pkgs/development/python-modules/pluggy/default.nix @@ -1,31 +1,40 @@ { buildPythonPackage , lib -, fetchPypi +, fetchFromGitHub , setuptools-scm , pythonOlder , importlib-metadata +, callPackage }: buildPythonPackage rec { pname = "pluggy"; - version = "1.0.0"; + version = "1.2.0"; format = "pyproject"; - src = fetchPypi { - inherit pname version; - sha256 = "4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"; + src = fetchFromGitHub { + owner = "pytest-dev"; + repo = "pluggy"; + rev = "refs/tags/${version}"; + hash = "sha256-SzJu7ITdmUgusn8sz6fRBpxTMQncWIViP5NCAj4q4GM="; }; nativeBuildInputs = [ setuptools-scm ]; + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; # To prevent infinite recursion with pytest doCheck = false; + passthru.tests = { + pytest = callPackage ./tests.nix { }; + }; meta = { + changelog = "https://github.com/pytest-dev/pluggy/blob/${src.rev}/CHANGELOG.rst"; description = "Plugin and hook calling mechanisms for Python"; homepage = "https://github.com/pytest-dev/pluggy"; license = lib.licenses.mit; diff --git a/pkgs/development/python-modules/pluggy/tests.nix b/pkgs/development/python-modules/pluggy/tests.nix new file mode 100644 index 0000000000000..dc6e16e7b2d79 --- /dev/null +++ b/pkgs/development/python-modules/pluggy/tests.nix @@ -0,0 +1,20 @@ +{ buildPythonPackage +, pluggy +, pytestCheckHook +}: + +buildPythonPackage { + pname = "pluggy-tests"; + inherit (pluggy) version; + format = "other"; + + inherit (pluggy) src; + + dontBuild = true; + dontInstall = true; + + nativeCheckInputs = [ + pluggy + pytestCheckHook + ]; +} diff --git a/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch b/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch deleted file mode 100644 index 2b34da289e2db..0000000000000 --- a/pkgs/development/python-modules/virtualenv/0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 21563405d6e2348ee457187f7fb61beb102bb367 Mon Sep 17 00:00:00 2001 -From: Frederik Rietdijk -Date: Sun, 24 May 2020 09:33:13 +0200 -Subject: [PATCH] Check base_prefix and base_exec_prefix for Python 2 - -This is a Nixpkgs-specific change so it can support virtualenvs from Nix envs. ---- - src/virtualenv/discovery/py_info.py | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/virtualenv/discovery/py_info.py b/src/virtualenv/discovery/py_info.py -index 6f12128..74e9218 100644 ---- a/src/virtualenv/discovery/py_info.py -+++ b/src/virtualenv/discovery/py_info.py -@@ -51,13 +51,17 @@ class PythonInfo(object): - self.version = u(sys.version) - self.os = u(os.name) - -+ config_vars = {} if sys.version_info.major is not 2 else sysconfig._CONFIG_VARS -+ base_prefix = config_vars.get("prefix") -+ base_exec_prefix = config_vars.get("exec_prefix") -+ - # information about the prefix - determines python home - self.prefix = u(abs_path(getattr(sys, "prefix", None))) # prefix we think -- self.base_prefix = u(abs_path(getattr(sys, "base_prefix", None))) # venv -+ self.base_prefix = u(abs_path(getattr(sys, "base_prefix", base_prefix))) # venv - self.real_prefix = u(abs_path(getattr(sys, "real_prefix", None))) # old virtualenv - - # information about the exec prefix - dynamic stdlib modules -- self.base_exec_prefix = u(abs_path(getattr(sys, "base_exec_prefix", None))) -+ self.base_exec_prefix = u(abs_path(getattr(sys, "base_exec_prefix", base_exec_prefix))) - self.exec_prefix = u(abs_path(getattr(sys, "exec_prefix", None))) - - self.executable = u(abs_path(sys.executable)) # the executable we were invoked via --- -2.25.1 - diff --git a/pkgs/development/python-modules/virtualenv/default.nix b/pkgs/development/python-modules/virtualenv/default.nix index 28100b8c55e7a..10602bfd4f3af 100644 --- a/pkgs/development/python-modules/virtualenv/default.nix +++ b/pkgs/development/python-modules/virtualenv/default.nix @@ -11,24 +11,24 @@ , hatch-vcs , hatchling , importlib-metadata -, importlib-resources , platformdirs , pytest-freezegun , pytest-mock , pytest-timeout , pytestCheckHook +, time-machine }: buildPythonPackage rec { pname = "virtualenv"; - version = "20.19.0"; + version = "20.24.0"; format = "pyproject"; - disabled = pythonOlder "3.6"; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-N6ZAuoLtQLImWZxSLUEeS+XtszmgwN4DDA3HtkbWFZA="; + hash = "sha256-4qfO+dqIDWk7kz23ZUNndU8U4gZQ3GDo7nOFVx+Fk6M="; }; nativeBuildInputs = [ @@ -40,16 +40,10 @@ buildPythonPackage rec { distlib filelock platformdirs - ] ++ lib.optionals (pythonOlder "3.7") [ - importlib-resources ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; - patches = lib.optionals (isPy27) [ - ./0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch - ]; - nativeCheckInputs = [ cython flaky @@ -57,6 +51,8 @@ buildPythonPackage rec { pytest-mock pytest-timeout pytestCheckHook + ] ++ lib.optionals (!isPyPy) [ + time-machine ]; preCheck = '' @@ -91,7 +87,7 @@ buildPythonPackage rec { meta = with lib; { description = "A tool to create isolated Python environments"; homepage = "http://www.virtualenv.org"; - changelog = "https://github.com/pypa/virtualenv/releases/tag/${version}"; + changelog = "https://github.com/pypa/virtualenv/blob/${version}/docs/changelog.rst"; license = licenses.mit; maintainers = with maintainers; [ goibhniu ]; };