diff --git a/pkgs/development/python-modules/pdm-pep517/default.nix b/pkgs/development/python-modules/pdm-pep517/default.nix index 9cfe5a5e9244..4c05afe0fbd2 100644 --- a/pkgs/development/python-modules/pdm-pep517/default.nix +++ b/pkgs/development/python-modules/pdm-pep517/default.nix @@ -8,13 +8,13 @@ buildPythonPackage rec { pname = "pdm-pep517"; - version = "1.0.2"; + version = "1.0.4"; format = "pyproject"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-nVoqpYlvNzN1UJeUXsKnUc0Z7jOZMG4JlRQBSx5JrfE="; + sha256 = "sha256-OS+MK0fG7CBVDLjhniS529Jzc0E/BntW7Ndfl2f5MBU="; }; preCheck = '' diff --git a/pkgs/development/python-modules/requests-wsgi-adapter/default.nix b/pkgs/development/python-modules/requests-wsgi-adapter/default.nix new file mode 100644 index 000000000000..77386c21a869 --- /dev/null +++ b/pkgs/development/python-modules/requests-wsgi-adapter/default.nix @@ -0,0 +1,29 @@ +{ lib +, buildPythonPackage +, fetchPypi +, requests +}: + +buildPythonPackage rec { + pname = "requests-wsgi-adapter"; + version = "0.4.1"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-WncJ6Qq/SdGB9sMqo3eUU39yXeD23UI2K8jIyQgSyHg="; + }; + + propagatedBuildInputs = [ + requests + ]; + + # tests are not contained in pypi-release + doCheck = false; + + meta = with lib; { + description = "WSGI Transport Adapter for Requests"; + homepage = "https://github.com/seanbrant/requests-wsgi-adapter"; + license = licenses.bsd3; + maintainers = with maintainers; [ betaboon ]; + }; +} diff --git a/pkgs/development/python-modules/unearth/default.nix b/pkgs/development/python-modules/unearth/default.nix new file mode 100644 index 000000000000..c12074136930 --- /dev/null +++ b/pkgs/development/python-modules/unearth/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder + +, cached-property +, packaging +, pdm-pep517 +, requests + +, flask +, pytest-httpserver +, pytestCheckHook +, requests-wsgi-adapter +, trustme +}: + +buildPythonPackage rec { + pname = "unearth"; + version = "0.6.1"; + format = "pyproject"; + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-S3v719NKEWc9gN+uf6u/khwTmqx4OD+wyhapDTtTpm4="; + }; + + nativeBuildInputs = [ + pdm-pep517 + ]; + + propagatedBuildInputs = [ + packaging + requests + ] ++ lib.optionals (pythonOlder "3.8") [ + cached-property + ]; + + checkInputs = [ + flask + pytest-httpserver + pytestCheckHook + requests-wsgi-adapter + trustme + ]; + + meta = with lib; { + homepage = "https://github.com/frostming/unearth"; + description = "A utility to fetch and download python packages"; + license = licenses.mit; + maintainers = with maintainers; [ betaboon ]; + }; +} diff --git a/pkgs/tools/package-management/pdm/check-update.patch b/pkgs/tools/package-management/pdm/check-update.patch deleted file mode 100644 index 9bc216177e5b..000000000000 --- a/pkgs/tools/package-management/pdm/check-update.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/tests/conftest.py b/tests/conftest.py -index d310d36..e15d398 100644 ---- a/tests/conftest.py -+++ b/tests/conftest.py -@@ -252,6 +252,7 @@ def project_no_init(tmp_path, mocker): - old_config_map = Config._config_map.copy() - tmp_path.joinpath("caches").mkdir(parents=True) - p.global_config["cache_dir"] = tmp_path.joinpath("caches").as_posix() -+ p.global_config["check_update"] = False - do_use(p, getattr(sys, "_base_executable", sys.executable)) - with temp_environ(): - os.environ.pop("VIRTUAL_ENV", None) diff --git a/pkgs/tools/package-management/pdm/default.nix b/pkgs/tools/package-management/pdm/default.nix index 7458262b168a..29a39cf96614 100644 --- a/pkgs/tools/package-management/pdm/default.nix +++ b/pkgs/tools/package-management/pdm/default.nix @@ -24,28 +24,19 @@ in with python.pkgs; buildPythonApplication rec { pname = "pdm"; - version = "1.14.0"; + version = "2.1.2"; format = "pyproject"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-ZUbcuIRutSoHW5egCpwCKca2IZCgQsRAd72ueDzGySI="; + hash = "sha256-U8aXskq3PdIVXNhUTZ7TVRza4dexZoheHO1GO0aGneo="; }; - # this patch allows us to run additional tests that invoke pdm, which checks - # itself for an update on every invocation by default, drammatically slowing - # down test runs inside the sandbox - # - # the patch is necessary because the fixture is creating a project and - # doesn't appear to respect the settings in `$HOME`; possibly a bug upstream - patches = [ - ./check-update.patch - ]; - propagatedBuildInputs = [ blinker - click + cachecontrol + certifi findpython installer packaging @@ -54,12 +45,17 @@ buildPythonApplication rec { pip platformdirs python-dotenv - pythonfinder + requests-toolbelt resolvelib + rich shellingham tomli tomlkit - ] ++ lib.optionals (pythonOlder "3.8") [ + unearth + virtualenv + ] + ++ cachecontrol.optional-dependencies.filecache + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata typing-extensions ]; @@ -79,14 +75,11 @@ buildPythonApplication rec { ''; disabledTests = [ - # sys.executable and expected executable are different - "test_set_non_exist_python_path" + # fails to locate setuptools (maybe upstream bug) + "test_convert_setup_py_project" # pythonfinder isn't aware of nix's python infrastructure - "test_auto_isolate_site_packages" "test_use_wrapper_python" - "test_find_python_in_path" - # calls pip install and exits != 0 - "test_pre_and_post_hooks" + "test_use_invalid_wrapper_python" ]; meta = with lib; { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1b918a14b184..e0117f946f73 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9489,6 +9489,8 @@ in { requests-unixsocket = callPackage ../development/python-modules/requests-unixsocket { }; + requests-wsgi-adapter = callPackage ../development/python-modules/requests-wsgi-adapter { }; + requirements-detector = callPackage ../development/python-modules/requirements-detector { }; requirements-parser = callPackage ../development/python-modules/requirements-parser { }; @@ -11248,6 +11250,8 @@ in { uncompyle6 = callPackage ../development/python-modules/uncompyle6 { }; + unearth = callPackage ../development/python-modules/unearth { }; + unicodecsv = callPackage ../development/python-modules/unicodecsv { }; unicodedata2 = callPackage ../development/python-modules/unicodedata2 { };