Unverified Commit 8764d898 authored by Emily's avatar Emily Committed by GitHub
Browse files

Merge pull request #330741 from emilazy/push-rlvumrtyxrmk

python3Packages.nose3: drop
parents 25d39e29 9b7e7d74
Loading
Loading
Loading
Loading
+0 −42
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  coverage,
  fetchPypi,
  isPyPy,
  isPy311,
  python,
  pythonAtLeast,
  stdenv,
}:

buildPythonPackage rec {
  pname = "nose3";
  version = "1.3.8";
  format = "setuptools";

  # https://github.com/jayvdb/nose3/issues/5
  disabled = pythonAtLeast "3.12";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-diquIsrbiYsAudT0u7n46H+ODd5sSaiM0MVU9OWSW3Y=";
  };

  propagatedBuildInputs = [ coverage ];

  # PyPy hangs for unknwon reason
  # Darwin and python 3.11 fail at various assertions and I didn't find an easy way to find skip those tests
  doCheck = !isPyPy && !stdenv.isDarwin && !isPy311;

  checkPhase = ''
    ${python.pythonOnBuildForHost.interpreter} selftest.py
  '';

  meta = with lib; {
    description = "Fork of nose v1 not using lib2to3 for compatibility with Python 3";
    homepage = "https://github.com/jayvdb/nose3";
    license = licenses.lgpl3;
    maintainers = with maintainers; [ SuperSandro2000 ];
  };
}
+0 −45
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  nose3,
  pythonOlder,
  semver,
}:

buildPythonPackage rec {
  pname = "pkutils";
  version = "3.0.2";
  format = "setuptools";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "reubano";
    repo = "pkutils";
    rev = "refs/tags/v${version}";
    hash = "sha256-AK+xX+LPz6IVLZedsqMUm7G28ue0s3pXgIzxS4EHHLE=";
  };

  pythonRelaxDeps = [ "semver" ];


  propagatedBuildInputs = [ semver ];

  nativeCheckInputs = [ nose3 ];

  checkPhase = ''
    runHook preCheck
    nosetests
    runHook postCheck
  '';

  pythonImportsCheck = [ "pkutils" ];

  meta = with lib; {
    description = "Python packaging utility library";
    homepage = "https://github.com/reubano/pkutils/";
    license = licenses.mit;
    maintainers = with maintainers; [ drewrisinger ];
  };
}
+34 −19
Original line number Diff line number Diff line
{ 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";
@@ -11,9 +17,7 @@ let
          rev = "pyparsing_${version}";
          sha256 = "14pfy80q2flgzjcx8jkracvnxxnr59kjzp3kdm5nh232gk1v6g6h";
        };
        nativeBuildInputs = [
          super.setuptools
        ];
        nativeBuildInputs = [ super.setuptools ];
      };
    };
  };
@@ -21,10 +25,7 @@ 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 {
@@ -34,21 +35,34 @@ 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 = ''
@@ -56,8 +70,9 @@ python.pkgs.buildPythonApplication rec {
      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 ];
    license = lib.licenses.mpl20;
    maintainers = [ lib.maintainers.willibutz ];
    platforms = lib.platforms.unix;
  };
}
+52 −43
Original line number Diff line number Diff line
{ 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";
@@ -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";
  };
+13 −17
Original line number Diff line number Diff line
{ 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";
Loading