diff --git a/pkgs/development/python-modules/tox/default.nix b/pkgs/development/python-modules/tox/default.nix index 9c167a7614c8..c60691c0674b 100644 --- a/pkgs/development/python-modules/tox/default.nix +++ b/pkgs/development/python-modules/tox/default.nix @@ -1,6 +1,7 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub +, pythonOlder , packaging , pluggy , py @@ -10,27 +11,69 @@ , toml , tomli , filelock -, pythonOlder +, hatchling +, hatch-vcs +, platformdirs +, pyproject-api +, colorama +, chardet +, cachetools +, testers +, tox }: buildPythonPackage rec { pname = "tox"; - version = "3.27.1"; + version = "4.0.16"; + format = "pyproject"; - buildInputs = [ setuptools-scm ]; - propagatedBuildInputs = [ packaging pluggy py six virtualenv filelock ] - ++ lib.optional (pythonOlder "3.11") tomli; + src = fetchFromGitHub { + owner = "tox-dev"; + repo = "tox"; + rev = "refs/tags/${version}"; + hash = "sha256-D53koe8XJLhEmDqfFOs2quDNVsC0jvr3/VzNCH4h8DY="; + }; - doCheck = false; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "packaging>=22" "packaging" + ''; - src = fetchPypi { - inherit pname version; - hash = "sha256-sqkg41pmjMBpQv/RzzpPsiGk2QnKchkftthLCxinvgQ="; + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + hatchling + hatch-vcs + ]; + + propagatedBuildInputs = [ + cachetools + chardet + colorama + filelock + packaging + platformdirs + pluggy + py + pyproject-api + six + toml + virtualenv + ] ++ lib.optionals (pythonOlder "3.11") [ + tomli + ]; + + doCheck = false; # infinite recursion via devpi-client + + passthru.tests = { + version = testers.testVersion { package = tox; }; }; meta = with lib; { - description = "Virtualenv-based automation of test activities"; - homepage = "https://tox.readthedocs.io/"; + changelog = "https://github.com/tox-dev/tox/releases/tag/${version}"; + description = "A generic virtualenv management and test command line tool"; + homepage = "https://github.com/tox-dev/tox"; license = licenses.mit; + maintainers = with maintainers; [ ]; }; }