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

python3Packages.nose3: drop #330741

Merged
merged 9 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
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
42 changes: 0 additions & 42 deletions pkgs/development/python-modules/nose3/default.nix

This file was deleted.

45 changes: 0 additions & 45 deletions pkgs/development/python-modules/pkutils/default.nix

This file was deleted.

53 changes: 34 additions & 19 deletions pkgs/tools/admin/gixy/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{ lib, fetchFromGitHub, python311 }:
{
lib,
fetchFromGitHub,
fetchpatch2,
python3,
nginx,
}:

let
python = python311.override {
python = python3.override {
packageOverrides = self: super: {
pyparsing = super.pyparsing.overridePythonAttrs rec {
version = "2.4.7";
Expand All @@ -11,20 +17,15 @@ let
rev = "pyparsing_${version}";
sha256 = "14pfy80q2flgzjcx8jkracvnxxnr59kjzp3kdm5nh232gk1v6g6h";
};
nativeBuildInputs = [
super.setuptools
];
nativeBuildInputs = [ super.setuptools ];
};
};
};
in
python.pkgs.buildPythonApplication rec {
pname = "gixy";
version = "0.1.20";
format = "setuptools";

# package is only compatible with python 2.7 and 3.5+
disabled = with python.pkgs; !(pythonAtLeast "3.5" || isPy27);
pyproject = true;

# fetching from GitHub because the PyPi source is missing the tests
src = fetchFromGitHub {
Expand All @@ -34,30 +35,44 @@ python.pkgs.buildPythonApplication rec {
sha256 = "14arz3fjidb8z37m08xcpih1391varj8s0v3gri79z3qb4zq5k6b";
};

postPatch = ''
sed -ie '/argparse/d' setup.py
'';
patches = [
# Migrate tests to pytest
# https://github.com/yandex/gixy/pull/146
(fetchpatch2 {
url = "https://github.com/yandex/gixy/compare/6f68624a7540ee51316651bda656894dc14c9a3e...b1c6899b3733b619c244368f0121a01be028e8c2.patch";
hash = "sha256-6VUF2eQ2Haat/yk8I5qIXhHdG9zLQgEXJMLfe25OKEo=";
})
];

build-system = [ python.pkgs.setuptools ];

propagatedBuildInputs = with python.pkgs; [
dependencies = with python.pkgs; [
cached-property
configargparse
pyparsing
jinja2
nose3
setuptools
six
];

meta = with lib; {
nativeCheckInputs = [ python.pkgs.pytestCheckHook ];

pythonRemoveDeps = [ "argparse" ];

passthru = {
inherit (nginx.passthru) tests;
};

meta = {
description = "Nginx configuration static analyzer";
mainProgram = "gixy";
longDescription = ''
Gixy is a tool to analyze Nginx configuration.
The main goal of Gixy is to prevent security misconfiguration and automate flaw detection.
'';
homepage = "https://github.com/yandex/gixy";
license = licenses.mpl20;
maintainers = [ maintainers.willibutz ];
platforms = platforms.unix;
sourceProvenance = [ lib.sourceTypes.fromSource ];
Copy link
Member

Choose a reason for hiding this comment

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

source should be not set as otherwise we had a lot of code deduplication

Copy link
Member Author

Choose a reason for hiding this comment

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

See #329470 (comment) for my (and others’) thoughts on that. (If sourceProvenance = [ lib.sourceTypes.fromSource ]; is redundant, so is sourceProvenance = [ lib.sourceTypes.fromSource lib.sourceTypes.binaryNativeCode ]; and arguably even sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];, not to mention license = lib.licenses.free; which nobody would argue for dropping.)

license = lib.licenses.mpl20;
maintainers = [ lib.maintainers.willibutz ];
platforms = lib.platforms.unix;
};
}
95 changes: 52 additions & 43 deletions pkgs/tools/misc/svtplay-dl/default.nix
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
{ lib
, stdenv
, fetchFromGitHub
, makeWrapper
, python3Packages
, perl
, zip
, gitMinimal
, ffmpeg
{
lib,
fetchFromGitHub,
installShellFiles,
python3Packages,
perl,
ffmpeg,
}:

let

inherit (python3Packages)
python pytest nose3 cryptography pyyaml requests mock requests-mock
python-dateutil setuptools;
buildPythonApplication
setuptools
requests
pysocks
cryptography
pyyaml
pytestCheckHook
mock
requests-mock
;

version = "4.97.1";

in

stdenv.mkDerivation rec {
buildPythonApplication {
pname = "svtplay-dl";
inherit version;
pyproject = true;

src = fetchFromGitHub {
owner = "spaam";
Expand All @@ -30,47 +37,49 @@ stdenv.mkDerivation rec {
hash = "sha256-9h3hHRRL7DKeCpEXL5w72hYi1nTS+a+x5e9ArMmVgYQ=";
};

pythonPaths = [ cryptography pyyaml requests ];
buildInputs = [ python perl python-dateutil setuptools ] ++ pythonPaths;
nativeBuildInputs = [ gitMinimal zip makeWrapper ];
nativeCheckInputs = [ nose3 pytest mock requests-mock ];

postPatch = ''
substituteInPlace scripts/run-tests.sh \
--replace 'PYTHONPATH=lib' 'PYTHONPATH=lib:$PYTHONPATH'

sed -i '/def test_sublang2\?(/ i\ @unittest.skip("accesses network")' \
lib/svtplay_dl/tests/test_postprocess.py
build-system = [ setuptools ];

dependencies = [
requests
pysocks
cryptography
pyyaml
];

nativeBuildInputs = [
# For `pod2man(1)`.
perl
installShellFiles
];

nativeCheckInputs = [
pytestCheckHook
mock
requests-mock
];

pytestFlagsArray = [
"--doctest-modules"
"lib"
];

postBuild = ''
make svtplay-dl.1
'';

makeFlags = [ "PREFIX=$(out)" "SYSCONFDIR=$(out)/etc" "PYTHON=${python.interpreter}" ];

postInstall = ''
wrapProgram "$out/bin/svtplay-dl" \
--prefix PATH : "${ffmpeg}" \
--prefix PYTHONPATH : "$PYTHONPATH"
'';

doCheck = python3Packages.pythonOlder "3.12";
checkPhase = ''
runHook preCheck

sh scripts/run-tests.sh -2

runHook postCheck
installManPage svtplay-dl.1
makeWrapperArgs+=(--prefix PATH : "${lib.makeBinPath [ ffmpeg ]}")
'';

doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
postInstallCheck = ''
$out/bin/svtplay-dl --help > /dev/null
runHook postInstallCheck
'';

meta = with lib; {
meta = {
homepage = "https://github.com/spaam/svtplay-dl";
description = "Command-line tool to download videos from svtplay.se and other sites";
license = licenses.mit;
license = lib.licenses.mit;
platforms = lib.platforms.unix;
mainProgram = "svtplay-dl";
};
Expand Down
30 changes: 13 additions & 17 deletions pkgs/tools/text/grin/default.nix
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
{ lib, fetchFromGitHub, fetchpatch, python3Packages }:
{
lib,
fetchFromGitHub,
python3Packages,
}:

python3Packages.buildPythonApplication rec {
python3Packages.buildPythonApplication {
pname = "grin";
version = "1.3.0";
version = "1.3.0-unstable-2023-08-30";
namePrefix = "";
pyproject = true;

src = fetchFromGitHub {
owner = "matthew-brett";
repo = pname;
rev = "1.3.0";
hash = "sha256-exKUy7LaDtpq0rJLSuNYsIcynpB4QLtLIE6T/ncB7RQ=";
repo = "grin";
rev = "00e11ebf17bbb37dc33d282eac1282c0bcc07e82";
hash = "sha256-0lrCOXFb2v0hCxWd9O7ysbn8CjPd8NHOJhARYzJJcYg=";
};

patches = [
# https://github.com/matthew-brett/grin/pull/4
(fetchpatch {
name = "replace-nose-with-nose3.patch";
url = "https://github.com/matthew-brett/grin/commit/ba473fa4f5da1b337ee80d7d31772a4e41ffa62d.patch";
hash = "sha256-CnWHynKSsXYjSsTLdPuwpcIndrCdq3cQYS8teg5EM0A=";
})
];
build-system = [ python3Packages.setuptools ];

nativeCheckInputs = with python3Packages; [
nose3
];
nativeCheckInputs = [ python3Packages.pytestCheckHook ];

meta = {
homepage = "https://github.com/matthew-brett/grin";
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/python-aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ mapAliases ({
net2grid = gridnet; # add 2022-04-22
nghttp2 = throw "in 1.52.0 removed deprecated python bindings."; # added 2023-06-08
ninja-python = ninja; # add 2022-08-03
nose3 = throw "nose3 has been removed since it is unmaintained and does not work with Python 3.12"; # added 2024-07-28
nosejs = throw "nosejs has been removed since it has not been maintained for 15 years and there are no dependent packages"; # added 2024-05-21
nose-cov = throw "nose-cov has been removed, it was archived and unmaintained since 2012"; # added 2024-05-21
nosexcover = throw "nosexcover has been removed since it has not been maintained and there are no dependent packages"; # added 2024-05-21
Expand Down Expand Up @@ -360,6 +361,7 @@ mapAliases ({
pdfposter = throw "pdfposter was promoted to a top-level attribute"; # Added 2023-06-29
pdfminer = pdfminer-six; # added 2022-05-25
pep257 = pydocstyle; # added 2022-04-12
pkutils = throw "pkutils was removed as it was unused and is not applicable to modern Python build tools"; # added 2024-07-28
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
Polygon3 = polygon3; # Added 2023-08-08
Expand Down
4 changes: 0 additions & 4 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9134,8 +9134,6 @@ self: super: with self; {

nose2pytest = callPackage ../development/python-modules/nose2pytest { };

nose3 = callPackage ../development/python-modules/nose3 { };

notebook = callPackage ../development/python-modules/notebook { };

notebook-shim = callPackage ../development/python-modules/notebook-shim { };
Expand Down Expand Up @@ -10454,8 +10452,6 @@ self: super: with self; {

pyzipper = callPackage ../development/python-modules/pyzipper { };

pkutils = callPackage ../development/python-modules/pkutils { };

plac = callPackage ../development/python-modules/plac { };

plaid-python = callPackage ../development/python-modules/plaid-python { };
Expand Down