Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python312Packages.pypass: Remove nose dependency; modernize #330222

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 21 additions & 24 deletions pkgs/development/python-modules/pypass/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
git,
gnugrep,
gnupg,
nose,
pbr,
pexpect,
pythonAtLeast,
pythonOlder,
pytestCheckHook,
setuptools,
substituteAll,
tree,
xclip,
Expand All @@ -23,11 +23,11 @@
buildPythonPackage rec {
pname = "pypass";
version = "0.2.1";
format = "setuptools";
pyproject = true;

src = fetchPypi {
inherit pname version;
sha256 = "1nm4mj7pd7gz4ghic6b3wrnd1b59hd1f0axavdabfl79wy511l7r";
hash = "sha256-+dAQiufpULdU26or4EKDqazQbOZjGRbhI/+ddo+spNo=";
};

# Set absolute nix store paths to the executables that pypass uses
Expand All @@ -47,42 +47,39 @@ buildPythonPackage rec {
substituteInPlace requirements.txt --replace "enum34" ""
'';

build-system = [ setuptools ];

nativeBuildInputs = [ pbr ];

propagatedBuildInputs = [
dependencies = [
click
colorama
pexpect
];

doCheck = pythonOlder "3.12";

nativeCheckInputs = [ nose ];
nativeCheckInputs = [ pytestCheckHook ];

# Configuration so that the tests work
preCheck = ''
HOME=$TEMP ${git}/bin/git config --global user.email "nix-builder@nixos.org"
HOME=$TEMP ${git}/bin/git config --global user.name "Nix Builder"
HOME=$TEMP ${git}/bin/git config --global pull.ff only
HOME=$TEMP make setup_gpg
export HOME=$(mktemp -d)
export GNUPGHOME=pypass/tests/gnupg
${git}/bin/git config --global user.email "nix-builder@nixos.org"
${git}/bin/git config --global user.name "Nix Builder"
${git}/bin/git config --global pull.ff only
make setup_gpg
'';

# Run tests but exclude the test that uses clipboard as I wasn't able to make
# it work - probably the X clipboard just doesn't work in the build
# environment..
checkPhase = ''
runHook preCheck
HOME=$TEMP GNUPGHOME=pypass/tests/gnupg nosetests -v --exclude=test_show_clip .
runHook postCheck
'';
# Presumably this test needs the X clipboard, which we don't have
# as the test environment is non-graphical.
disabledTests = [ "test_show_clip" ];
Comment on lines +72 to +74
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xvfb-run could come in handy here, but it’s not a big deal.


meta = with lib; {
meta = {
broken = stdenv.isDarwin;
description = "Password manager pass in Python";
mainProgram = "pypass";
homepage = "https://github.com/aviau/python-pass";
license = licenses.gpl3Plus;
platforms = platforms.all;
maintainers = with maintainers; [ jluttine ];
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ jluttine ];
};
}