Merge pull request #209534 from dotlambda/poetry-no-poetry2nix

poetry: don't use poetry2nix
This commit is contained in:
Robert Schütz 2023-01-16 23:26:19 -08:00 committed by GitHub
commit 2e1c2b9d88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 63 deletions

View File

@ -1,11 +1,10 @@
{ lib { lib
, stdenv , python3
, fetchFromGitHub , fetchFromGitHub
, buildPythonApplication , fetchpatch
, poetry
}: }:
buildPythonApplication rec { python3.pkgs.buildPythonApplication rec {
pname = "beancount-ing-diba"; pname = "beancount-ing-diba";
version = "0.6.0"; version = "0.6.0";
@ -16,10 +15,18 @@ buildPythonApplication rec {
sha256 = "sha256-1cdXqdeTz38n0g13EXJ1/IF/gJJCe1uL/Z5NJz4DL+E="; sha256 = "sha256-1cdXqdeTz38n0g13EXJ1/IF/gJJCe1uL/Z5NJz4DL+E=";
}; };
patches = [
(fetchpatch {
name = "use-poetry-core.patch";
url = "https://github.com/siddhantgoel/beancount-ing/commit/2d030330eed313a32c3968a2c8ce9400c6d18a41.patch";
hash = "sha256-6v7eQhgj6d4x9uWSyuO3IxXrSWkJZRS/M4N3j0H3R/U=";
})
];
format = "pyproject"; format = "pyproject";
nativeBuildInputs = [ nativeBuildInputs = with python3.pkgs; [
poetry poetry-core
]; ];
meta = with lib; { meta = with lib; {

View File

@ -1,6 +1,5 @@
{ pkgs ? import <nixpkgs> { } { pkgs ? import <nixpkgs> { }
, lib ? pkgs.lib , lib ? pkgs.lib
, poetry ? null
, poetryLib ? import ./lib.nix { inherit lib pkgs; stdenv = pkgs.stdenv; } , poetryLib ? import ./lib.nix { inherit lib pkgs; stdenv = pkgs.stdenv; }
}: }:
let let
@ -143,7 +142,7 @@ lib.makeScope pkgs.newScope (self: {
}; };
getFunctorFn = fn: if builtins.typeOf fn == "set" then fn.__functor else fn; getFunctorFn = fn: if builtins.typeOf fn == "set" then fn.__functor else fn;
poetryPkg = poetry.override { inherit python; }; poetryPkg = pkgs.callPackage ./pkgs/poetry { inherit python; };
scripts = pyProject.tool.poetry.scripts or { }; scripts = pyProject.tool.poetry.scripts or { };
hasScripts = scripts != { }; hasScripts = scripts != { };

View File

@ -1,65 +1,31 @@
{ lib { lib
, backports-cached-property
, buildPythonPackage
, cachecontrol
, cachy
, cleo
, crashtest
, deepdiff
, dulwich
, fetchFromGitHub
, filelock
, flatdict
, html5lib
, httpretty
, importlib-metadata
, installShellFiles
, intreehooks
, jsonschema
, keyring
, lockfile
, packaging
, pexpect
, pkginfo
, platformdirs
, poetry-core
, poetry-plugin-export
, pytest-mock
, pytest-xdist
, pytestCheckHook
, pythonAtLeast
, pythonOlder
, requests
, requests-toolbelt
, shellingham
, stdenv , stdenv
, tomli , python3
, tomlkit , fetchFromGitHub
, trove-classifiers , installShellFiles
, urllib3
, virtualenv
, xattr
}: }:
buildPythonPackage rec { let
python = python3;
in python.pkgs.buildPythonApplication rec {
pname = "poetry"; pname = "poetry";
version = "1.3.1"; version = "1.3.2";
format = "pyproject"; format = "pyproject";
disabled = pythonOlder "3.7"; disabled = python.pkgs.pythonOlder "3.7";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "python-poetry"; owner = "python-poetry";
repo = pname; repo = pname;
rev = "refs/tags/${version}"; rev = "refs/tags/${version}";
hash = "sha256-yiV2Y0vBF0d7BFfT5wonzRUGHVH040PZrlAUpVTFCZc="; hash = "sha256-12EiEGI9Vkb6EUY/W2KWeLigxWra1Be4ozvi8njBpEU=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
installShellFiles installShellFiles
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = with python.pkgs; [
cachecontrol cachecontrol
cleo cleo
crashtest crashtest
@ -97,7 +63,13 @@ buildPythonPackage rec {
--zsh <($out/bin/poetry completions zsh) \ --zsh <($out/bin/poetry completions zsh) \
''; '';
checkInputs = [ # Propagating dependencies leaks them through $PYTHONPATH which causes issues
# when used in nix-shell.
postFixup = ''
rm $out/nix-support/propagated-build-inputs
'';
checkInputs = with python.pkgs; [
cachy cachy
deepdiff deepdiff
flatdict flatdict
@ -132,7 +104,7 @@ buildPythonPackage rec {
"lock" "lock"
# fs permission errors # fs permission errors
"test_builder_should_execute_build_scripts" "test_builder_should_execute_build_scripts"
] ++ lib.optionals (pythonAtLeast "3.10") [ ] ++ lib.optionals (python.pythonAtLeast "3.10") [
# RuntimeError: 'auto_spec' might be a typo; use unsafe=True if this is intended # RuntimeError: 'auto_spec' might be a typo; use unsafe=True if this is intended
"test_info_setup_complex_pep517_error" "test_info_setup_complex_pep517_error"
]; ];
@ -147,6 +119,6 @@ buildPythonPackage rec {
homepage = "https://python-poetry.org/"; homepage = "https://python-poetry.org/";
description = "Python dependency management and packaging made easy"; description = "Python dependency management and packaging made easy";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ jakewaksbaum ]; maintainers = with maintainers; [ jakewaksbaum dotlambda ];
}; };
} }

View File

@ -16381,9 +16381,8 @@ with pkgs;
pew = callPackage ../development/tools/pew {}; pew = callPackage ../development/tools/pew {};
poetry = callPackage ../development/tools/poetry2nix/poetry2nix/pkgs/poetry { poetry = callPackage ../tools/package-management/poetry { };
python = python3;
};
poetry2nix = callPackage ../development/tools/poetry2nix/poetry2nix { poetry2nix = callPackage ../development/tools/poetry2nix/poetry2nix {
inherit pkgs lib; inherit pkgs lib;
}; };
@ -34438,9 +34437,7 @@ with pkgs;
bastet = callPackage ../games/bastet { }; bastet = callPackage ../games/bastet { };
beancount-ing-diba = callPackage ../applications/office/beancount/beancount-ing-diba.nix { beancount-ing-diba = callPackage ../applications/office/beancount/beancount-ing-diba.nix { };
inherit (python3Packages) buildPythonApplication;
};
black-hole-solver = callPackage ../games/black-hole-solver { black-hole-solver = callPackage ../games/black-hole-solver {
inherit (perlPackages) PathTiny; inherit (perlPackages) PathTiny;

View File

@ -134,6 +134,7 @@ mapAliases ({
pathpy = path; # added 2022-04-12 pathpy = path; # added 2022-04-12
pdfminer = pdfminer-six; # added 2022-05-25 pdfminer = pdfminer-six; # added 2022-05-25
pep257 = pydocstyle; # added 2022-04-12 pep257 = pydocstyle; # added 2022-04-12
poetry = throw "poetry was promoted to a top-level attribute, use poetry-core to build Python packages"; # added 2023-01-09
poetry2conda = throw "poetry2conda was promoted to a top-level attribute"; # Added 2022-10-02 poetry2conda = throw "poetry2conda was promoted to a top-level attribute"; # Added 2022-10-02
poster3 = throw "poster3 is unmaintained and source is no longer available"; # added 2023-05-29 poster3 = throw "poster3 is unmaintained and source is no longer available"; # added 2023-05-29
postorius = throw "Please use pkgs.mailmanPackages.postorius"; # added 2022-04-29 postorius = throw "Please use pkgs.mailmanPackages.postorius"; # added 2022-04-29

View File

@ -7348,8 +7348,6 @@ self: super: with self; {
podcats = callPackage ../development/python-modules/podcats { }; podcats = callPackage ../development/python-modules/podcats { };
poetry = callPackage ../development/python-modules/poetry { };
poetry-core = callPackage ../development/python-modules/poetry-core { }; poetry-core = callPackage ../development/python-modules/poetry-core { };
poetry-dynamic-versioning = callPackage ../development/python-modules/poetry-dynamic-versioning { }; poetry-dynamic-versioning = callPackage ../development/python-modules/poetry-dynamic-versioning { };