From 5962fe0782dc36ae4a8fa34f96262c0ff5893dbb Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 5 Jun 2022 23:30:32 +0200 Subject: [PATCH 1/5] python310Packages.wheel-filename: 1.3.0 -> 1.4.1 - use GitHub as source - enable tests - add pythonImportsCheck --- .../python-modules/wheel-filename/default.nix | 35 ++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/wheel-filename/default.nix b/pkgs/development/python-modules/wheel-filename/default.nix index 351bc86686a3..3140870289d8 100644 --- a/pkgs/development/python-modules/wheel-filename/default.nix +++ b/pkgs/development/python-modules/wheel-filename/default.nix @@ -1,26 +1,45 @@ { lib -, buildPythonPackage -, fetchurl , attrs +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder }: buildPythonPackage rec { pname = "wheel-filename"; - version = "1.3.0"; - format = "wheel"; + version = "1.4.1"; + format = "pyproject"; - src = fetchurl { - url = "https://github.com/jwodder/wheel-filename/releases/download/v1.1.0/wheel_filename-1.1.0-py3-none-any.whl"; - sha256 = "0aee45553f34e3a1b8a5db64aa832326f13c138b7f925a53daf96f984f9e6a38"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "jwodder"; + repo = pname; + rev = "v${version}"; + hash = "sha256-M3XGHG733X5qKuMS6mvFSFHYOwWPaBMXw+w0eYo6ByE="; }; buildInputs = [ attrs ]; + checkInputs = [ + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace tox.ini \ + --replace " --cov=wheel_filename --no-cov-on-fail" "" + ''; + + pythonImportsCheck = [ + "wheel_filename" + ]; + meta = with lib; { - homepage = "https://github.com/jwodder/wheel-filename"; description = "Parse wheel filenames"; + homepage = "https://github.com/jwodder/wheel-filename"; license = with licenses; [ mit ]; maintainers = with lib.maintainers; [ ayazhafiz ]; }; From 5f4fe18c16eab71e2ebdd35b536c22d30d579106 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 5 Jun 2022 23:40:27 +0200 Subject: [PATCH 2/5] python310Packages.wheel-inspect: 1.7.0 -> 1.7.1 - use source from GitHub - enable tests - add pythonImportsCheck --- .../python-modules/wheel-inspect/default.nix | 81 +++++++++---------- 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/pkgs/development/python-modules/wheel-inspect/default.nix b/pkgs/development/python-modules/wheel-inspect/default.nix index 88fd592da8fb..9c55dce7a353 100644 --- a/pkgs/development/python-modules/wheel-inspect/default.nix +++ b/pkgs/development/python-modules/wheel-inspect/default.nix @@ -1,65 +1,58 @@ { lib +, attrs , buildPythonPackage -, fetchurl -, bleach, docutils, pygments, six -, attrs, entry-points-txt, headerparser, packaging, wheel-filename +, entry-points-txt +, fetchFromGitHub +, headerparser +, jsonschema +, packaging +, pytestCheckHook +, pythonOlder +, readme_renderer +, wheel-filename }: -# wheel-filename is stuck on readme_renderer~=24.0.0, but the upstream is at a -# future version. -let readme_renderer_24 = buildPythonPackage rec { - pname = "readme_renderer"; - version = "24.0.0"; - format = "wheel"; - - src = fetchurl { - url = "https://files.pythonhosted.org/packages/c3/7e/d1aae793900f36b097cbfcc5e70eef82b5b56423a6c52a36dce51fedd8f0/readme_renderer-24.0-py2.py3-none-any.whl"; - sha256 = "c8532b79afc0375a85f10433eca157d6b50f7d6990f337fa498c96cd4bfc203d"; - }; - - doCheck = false; - - buildInputs = [ - bleach - docutils - pygments - six - ]; - - meta = with lib; { - description = "Python library for rendering readme descriptions"; - homepage = "https://github.com/pypa/readme_renderer"; - license = with licenses; [ asl20 ]; - maintainers = with lib.maintainers; [ ayazhafiz ]; - }; -}; - -in buildPythonPackage rec { - version = "1.7.0"; +buildPythonPackage rec { pname = "wheel-inspect"; - format = "wheel"; + version = "1.7.1"; + format = "pyproject"; - src = fetchurl { - url = "https://github.com/jwodder/wheel-inspect/releases/download/v1.7.0/wheel_inspect-1.7.0-py3-none-any.whl"; - sha256 = "69b34de1f4464ddfc76280c4563e4afc644de2c88e3ae6882f030afdad3d73e4"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "jwodder"; + repo = pname; + rev = "v${version}"; + hash = "sha256-pB9Rh+A7GlxnYuka2mTSBoxpoyYCzoaMPVgsHDlpos0="; }; propagatedBuildInputs = [ attrs - bleach - docutils entry-points-txt headerparser packaging - pygments - readme_renderer_24 + readme_renderer wheel-filename ]; + checkInputs = [ + jsonschema + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace tox.ini \ + --replace " --cov=wheel_inspect --no-cov-on-fail" "" + ''; + + pythonImportsCheck = [ + "wheel_inspect" + ]; + meta = with lib; { - homepage = "https://github.com/jwodder/wheel-inspect"; description = "Extract information from wheels"; + homepage = "https://github.com/jwodder/wheel-inspect"; license = with licenses; [ mit ]; - maintainers = with lib.maintainers; [ ayazhafiz ]; + maintainers = with maintainers; [ ayazhafiz ]; }; } From 834eeb35e46f3009ca95954941bf35f73af4ed9d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 5 Jun 2022 23:55:12 +0200 Subject: [PATCH 3/5] python310Packages.entry-points-txt: 0.1.0 -> 0.2.0 --- .../entry-points-txt/default.nix | 35 ++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/entry-points-txt/default.nix b/pkgs/development/python-modules/entry-points-txt/default.nix index d52e9ea0d3be..0e73f9768115 100644 --- a/pkgs/development/python-modules/entry-points-txt/default.nix +++ b/pkgs/development/python-modules/entry-points-txt/default.nix @@ -1,22 +1,41 @@ { lib , buildPythonPackage -, fetchurl +, fetchFromGitHub +, pytestCheckHook +, pythonOlder }: buildPythonPackage rec { pname = "entry-points-txt"; - version = "0.1.0"; - format = "wheel"; + version = "0.2.0"; + format = "pyproject"; - src = fetchurl { - url = "https://github.com/jwodder/entry-points-txt/releases/download/v0.1.0/entry_points_txt-0.1.0-py3-none-any.whl"; - sha256 = "29773bed3d9d337766a394e19d6f7ab0be3ed7d6f3ebb753ff0f7f48f056aa8e"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "jwodder"; + repo = pname; + rev = "v${version}"; + hash = "sha256-klFSt3Od7xYgenpMP4DBFoZeQanGrmtJxDm5qeZ1Psc="; }; + checkInputs = [ + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace tox.ini \ + --replace " --cov=entry_points_txt --no-cov-on-fail" "" + ''; + + pythonImportsCheck = [ + "entry_points_txt" + ]; + meta = with lib; { - homepage = "https://github.com/jwodder/entry-points-txt"; description = "Read & write entry_points.txt files"; + homepage = "https://github.com/jwodder/entry-points-txt"; license = with licenses; [ mit ]; - maintainers = with lib.maintainers; [ ayazhafiz ]; + maintainers = with maintainers; [ ayazhafiz ]; }; } From 1c61372d39caded68a1913d9c3e6250d9512ff92 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 6 Jun 2022 00:03:40 +0200 Subject: [PATCH 4/5] python310Packages.headerparser: enable tests --- .../python-modules/headerparser/default.nix | 39 +++++++++++++++---- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/headerparser/default.nix b/pkgs/development/python-modules/headerparser/default.nix index b1a38170162b..6a07f1f07ca7 100644 --- a/pkgs/development/python-modules/headerparser/default.nix +++ b/pkgs/development/python-modules/headerparser/default.nix @@ -1,27 +1,50 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub +, pytest-mock +, pytestCheckHook +, pythonOlder , six }: buildPythonPackage rec { pname = "headerparser"; version = "0.4.0"; + format = "pyproject"; - src = fetchPypi{ - inherit pname; - inherit version; - sha256 = "b8ceae4c5e6133fda666d022684e93f9b3d45815c2c7881018123c71ff28c5cc"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "jwodder"; + repo = pname; + rev = "v${version}"; + hash = "sha256-KJJt85iC/4oBoIelB2zUJVyHSppFem/22v6F30P5nYM="; }; - buildInputs = [ + propagatedBuildInputs = [ six ]; + checkInputs = [ + pytest-mock + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace tox.ini \ + --replace "--cov=headerparser" "" \ + --replace "--no-cov-on-fail" "" \ + --replace "--flakes" "" + ''; + + pythonImportsCheck = [ + "headerparser" + ]; + meta = with lib; { + description = "Module to parse key-value pairs in the style of RFC 822 (e-mail) headers"; homepage = "https://github.com/jwodder/headerparser"; - description = "argparse for mail-style headers"; license = with licenses; [ mit ]; - maintainers = with lib.maintainers; [ ayazhafiz ]; + maintainers = with maintainers; [ ayazhafiz ]; }; } From f74ef9f98a726b718259c51396c0cde796dd0e44 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 6 Jun 2022 00:20:46 +0200 Subject: [PATCH 5/5] python310Packages.wheel-inspect: relax entry-points-txt constraint --- pkgs/development/python-modules/wheel-inspect/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/wheel-inspect/default.nix b/pkgs/development/python-modules/wheel-inspect/default.nix index 9c55dce7a353..438084e6c058 100644 --- a/pkgs/development/python-modules/wheel-inspect/default.nix +++ b/pkgs/development/python-modules/wheel-inspect/default.nix @@ -43,12 +43,19 @@ buildPythonPackage rec { postPatch = '' substituteInPlace tox.ini \ --replace " --cov=wheel_inspect --no-cov-on-fail" "" + substituteInPlace setup.cfg \ + --replace "entry-points-txt ~= 0.1.0" "entry-points-txt >= 0.1.0" ''; pythonImportsCheck = [ "wheel_inspect" ]; + pytestFlagsArray = [ + "-W" + "ignore::DeprecationWarning" + ]; + meta = with lib; { description = "Extract information from wheels"; homepage = "https://github.com/jwodder/wheel-inspect";