python3Packages.pycodestyle: 2.10.0 -> 2.11.0

This commit is contained in:
Martin Weinelt 2023-09-15 14:06:45 +02:00
parent 7d05efd1f0
commit b0279b8daa
2 changed files with 12 additions and 31 deletions

View file

@ -3,11 +3,12 @@
, fetchPypi , fetchPypi
, lib , lib
, python , python
, pytestCheckHook
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "pycodestyle"; pname = "pycodestyle";
version = "2.10.0"; version = "2.11.0";
disabled = pythonOlder "3.6"; disabled = pythonOlder "3.6";
@ -15,25 +16,21 @@ buildPythonPackage rec {
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
hash = "sha256-NHGHvbR2Mp2Y9pXCE9cpWoRtEVL/T+m6y4qVkLjucFM="; hash = "sha256-JZvMF4V9ios7SiMnMkt55fAgoTwWB0Zw+cjI+HLqdtA=";
}; };
patches = [ pythonImportsCheck = [
# https://github.com/PyCQA/pycodestyle/issues/1151 "pycodestyle"
# Applies a modified version of an upstream patch that only applied
# to Python 3.12.
./python-3.11.4-compat.patch
]; ];
# https://github.com/PyCQA/pycodestyle/blob/2.10.0/tox.ini#L13 nativCheckInputs = [
checkPhase = '' pytestCheckHook
${python.interpreter} -m pycodestyle --statistics pycodestyle.py ];
${python.interpreter} -m pycodestyle --max-doc-length=72 --testsuite testsuite
${python.interpreter} -m pycodestyle --max-doc-length=72 --doctest
${python.interpreter} -m unittest discover testsuite -vv
'';
pythonImportsCheck = [ "pycodestyle" ]; # https://github.com/PyCQA/pycodestyle/blob/2.11.0/tox.ini#L16
postCheck = ''
${python.interpreter} -m pycodestyle --statistics pycodestyle.py
'';
meta = with lib; { meta = with lib; {
changelog = "https://github.com/PyCQA/pycodestyle/blob/${version}/CHANGES.txt"; changelog = "https://github.com/PyCQA/pycodestyle/blob/${version}/CHANGES.txt";

View file

@ -1,16 +0,0 @@
diff --git a/testsuite/test_api.py b/testsuite/test_api.py
index 8dde32ff..38e34acf 100644
--- a/testsuite/test_api.py
+++ b/testsuite/test_api.py
@@ -329,7 +329,10 @@ def test_check_nullbytes(self):
count_errors = pep8style.input_file('stdin', lines=['\x00\n'])
stdout = sys.stdout.getvalue()
- expected = "stdin:1:1: E901 ValueError"
+ if sys.version_info < (3, 11, 4):
+ expected = "stdin:1:1: E901 ValueError"
+ else:
+ expected = "stdin:1:1: E901 SyntaxError: source code string cannot contain null bytes" # noqa: E501
self.assertTrue(stdout.startswith(expected),
msg='Output %r does not start with %r' %
(stdout, expected))