Unverified Commit d35735ae authored by Jörg Thalheim's avatar Jörg Thalheim Committed by GitHub
Browse files

Merge pull request #91479 from Mic92/python-fixes

parents bdb59380 b422dd62
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
From fd56b0d85393d684bd3bf99f33d8638da884282f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Thu, 25 Jun 2020 09:52:11 +0100
Subject: [PATCH] disable flake8/black8/coverage from tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
 pytest.ini | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pytest.ini b/pytest.ini
index 5027d34..4e2a2d2 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,5 +1,5 @@
 [pytest]
 norecursedirs=dist build .tox .eggs
-addopts=--doctest-modules --flake8 --black --cov
+addopts=--doctest-modules
 doctest_optionflags=ALLOW_UNICODE ELLIPSIS ALLOW_BYTES
 filterwarnings=
-- 
2.27.0
+5 −0
Original line number Diff line number Diff line
@@ -12,6 +12,11 @@ buildPythonPackage rec {
  };

  nativeBuildInputs = [ setuptools_scm ];

  patches = [
    ./0001-Don-t-run-flake8-checks-during-the-build.patch
  ];

  propagatedBuildInputs = [ inflect more-itertools six ];
  checkInputs = [ pytest ];

+29 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchPypi
, freezegun
, pytest
}:

buildPythonPackage rec {
  pname = "pytest-freezegun";
  version = "0.4.1";

  src = fetchPypi {
    inherit pname version;
    extension = "zip";
    sha256 = "060cdf192848e50a4a681a5e73f8b544c4ee5ebc1fab3cb7223a0097bac2f83f";
  };

  propagatedBuildInputs = [
    freezegun
    pytest
  ];

  meta = with lib; {
    description = "Wrap tests with fixtures in freeze_time";
    homepage = "https://github.com/ktosiek/pytest-freezegun";
    license = licenses.mit;
    maintainers = [ maintainers.mic92 ];
  };
}
+28 −0
Original line number Diff line number Diff line
From 9dfd2a8fac4a643fd007390762ccc8564588b4bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Thu, 25 Jun 2020 10:16:52 +0100
Subject: [PATCH] pytest: remove flake8/black/coverage
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
 pytest.ini | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pytest.ini b/pytest.ini
index bd6998d..a464529 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,6 +1,6 @@
 [pytest]
 norecursedirs=dist build .tox .eggs
-addopts=--doctest-modules --flake8 --black --cov
+addopts=--doctest-modules
 doctest_optionflags=ALLOW_UNICODE ELLIPSIS
 filterwarnings=
 	# suppress known warning
-- 
2.27.0
+12 −6
Original line number Diff line number Diff line
{ lib, buildPythonPackage, fetchPypi
, setuptools_scm, pytest, freezegun, backports_unittest-mock
, pytest-black, pytestcov, pytest-flake8
, six, pytz, jaraco_functools }:
, setuptools_scm, pytest, pytest-freezegun, freezegun, backports_unittest-mock
, six, pytz, jaraco_functools, pythonOlder }:

buildPythonPackage rec {
  pname = "tempora";
@@ -12,15 +11,22 @@ buildPythonPackage rec {
    sha256 = "e370d822cf48f5356aab0734ea45807250f5120e291c76712a1d766b49ae34f8";
  };

  disabled = pythonOlder "3.2";

  nativeBuildInputs = [ setuptools_scm ];

  patches = [
    ./0001-pytest-remove-flake8-black-coverage.patch
  ];

  propagatedBuildInputs = [ six pytz jaraco_functools ];

  checkInputs = [ pytest pytest-flake8 pytest-black pytestcov freezegun backports_unittest-mock ];
  checkInputs = [
    pytest-freezegun pytest freezegun backports_unittest-mock
  ];

  # missing pytest-freezegun package
  checkPhase = ''
    pytest -k 'not get_nearest_year_for_day'
    pytest
  '';

  meta = with lib; {
Loading