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
, stdenv
, python3
, fetchFromGitHub
, buildPythonApplication
, poetry
, fetchpatch
}:
buildPythonApplication rec {
python3.pkgs.buildPythonApplication rec {
pname = "beancount-ing-diba";
version = "0.6.0";
@ -16,10 +15,18 @@ buildPythonApplication rec {
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";
nativeBuildInputs = [
poetry
nativeBuildInputs = with python3.pkgs; [
poetry-core
];
meta = with lib; {

View File

@ -1,6 +1,5 @@
{ pkgs ? import <nixpkgs> { }
, lib ? pkgs.lib
, poetry ? null
, poetryLib ? import ./lib.nix { inherit lib pkgs; stdenv = pkgs.stdenv; }
}:
let
@ -143,7 +142,7 @@ lib.makeScope pkgs.newScope (self: {
};
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 { };
hasScripts = scripts != { };

View File

@ -1,65 +1,31 @@
{ 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
, tomli
, tomlkit
, trove-classifiers
, urllib3
, virtualenv
, xattr
, python3
, fetchFromGitHub
, installShellFiles
}:
buildPythonPackage rec {
let
python = python3;
in python.pkgs.buildPythonApplication rec {
pname = "poetry";
version = "1.3.1";
version = "1.3.2";
format = "pyproject";
disabled = pythonOlder "3.7";
disabled = python.pkgs.pythonOlder "3.7";
src = fetchFromGitHub {
owner = "python-poetry";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-yiV2Y0vBF0d7BFfT5wonzRUGHVH040PZrlAUpVTFCZc=";
hash = "sha256-12EiEGI9Vkb6EUY/W2KWeLigxWra1Be4ozvi8njBpEU=";
};
nativeBuildInputs = [
installShellFiles
];
propagatedBuildInputs = [
propagatedBuildInputs = with python.pkgs; [
cachecontrol
cleo
crashtest
@ -97,7 +63,13 @@ buildPythonPackage rec {
--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
deepdiff
flatdict
@ -132,7 +104,7 @@ buildPythonPackage rec {
"lock"
# fs permission errors
"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
"test_info_setup_complex_pep517_error"
];
@ -147,6 +119,6 @@ buildPythonPackage rec {
homepage = "https://python-poetry.org/";
description = "Python dependency management and packaging made easy";
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 {};
poetry = callPackage ../development/tools/poetry2nix/poetry2nix/pkgs/poetry {
python = python3;
};
poetry = callPackage ../tools/package-management/poetry { };
poetry2nix = callPackage ../development/tools/poetry2nix/poetry2nix {
inherit pkgs lib;
};
@ -34438,9 +34437,7 @@ with pkgs;
bastet = callPackage ../games/bastet { };
beancount-ing-diba = callPackage ../applications/office/beancount/beancount-ing-diba.nix {
inherit (python3Packages) buildPythonApplication;
};
beancount-ing-diba = callPackage ../applications/office/beancount/beancount-ing-diba.nix { };
black-hole-solver = callPackage ../games/black-hole-solver {
inherit (perlPackages) PathTiny;

View File

@ -134,6 +134,7 @@ mapAliases ({
pathpy = path; # added 2022-04-12
pdfminer = pdfminer-six; # added 2022-05-25
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
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

View File

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