diff --git a/pkgs/development/tools/analysis/cpplint/0001-Remove-pytest-runner-version-pin.patch b/pkgs/development/tools/analysis/cpplint/0001-Remove-pytest-runner-version-pin.patch deleted file mode 100644 index 3b602421d100b..0000000000000 --- a/pkgs/development/tools/analysis/cpplint/0001-Remove-pytest-runner-version-pin.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/setup.py b/setup.py -index aef5c4e..030ea14 100755 ---- a/setup.py -+++ b/setup.py -@@ -73,7 +73,7 @@ setup(name='cpplint', - long_description=open('README.rst').read(), - license='BSD-3-Clause', - setup_requires=[ -- "pytest-runner==5.2" -+ "pytest-runner" - ], - tests_require=test_required, - # extras_require allow pip install .[dev] --- -2.31.1 - diff --git a/pkgs/development/tools/analysis/cpplint/default.nix b/pkgs/development/tools/analysis/cpplint/default.nix index f380f7086e820..f4dcd71f0b3c7 100644 --- a/pkgs/development/tools/analysis/cpplint/default.nix +++ b/pkgs/development/tools/analysis/cpplint/default.nix @@ -1,49 +1,46 @@ -{ lib, python3Packages, fetchFromGitHub, fetchpatch }: +{ lib, python3Packages, fetchFromGitHub }: python3Packages.buildPythonApplication rec { pname = "cpplint"; - version = "1.5.5"; - format = "setuptools"; + version = "1.6.1"; + pyproject = true; # Fetch from github instead of pypi, since the test cases are not in the pypi archive src = fetchFromGitHub { - owner = pname; - repo = pname; - rev = version; - hash = "sha256-JXz2Ufo7JSceZVqYwCRkuAsOR08znZlIUk8GCLAyiI4="; + owner = "cpplint"; + repo = "cpplint"; + rev = "refs/tags/${version}"; + hash = "sha256-N5YrlhEXQGYxhsJ4M5dGYZUzA81GKRSI83goaqbtCkI="; }; - patches = [ - ./0001-Remove-pytest-runner-version-pin.patch - - # The patch below stops using the sre_compile module, which was deprecated - # in Python 3.11 and replaces it with re.compile. Upstream is unsure if it - # should use re.compile or re._compiler.compile, so we should monitor the - # thread for updates. - # - # https://github.com/cpplint/cpplint/pull/214 - # - (fetchpatch { - name = "python-3.11-compatibility.patch"; - url = "https://github.com/cpplint/cpplint/commit/e84e84f53915ae2a9214e756cf89c573a73bbcd3.patch"; - hash = "sha256-u57AFWaVmGFSsvSGq1x9gZmTsuZPqXvTC7mTfyb2164="; - }) - ]; - postPatch = '' + substituteInPlace setup.py \ + --replace-fail '"pytest-runner==5.2"' "" + patchShebangs cpplint_unittest.py + + substituteInPlace cpplint_unittest.py \ + --replace-fail "assertEquals" "assertEqual" ''; - nativeCheckInputs = with python3Packages; [ pytest pytest-runner ]; + build-system = with python3Packages; [ + setuptools + ]; + + nativeCheckInputs = with python3Packages; [ + pytest + pytest-runner + ]; + checkPhase = '' ./cpplint_unittest.py ''; - meta = with lib; { + meta = { homepage = "https://github.com/cpplint/cpplint"; description = "Static code checker for C++"; mainProgram = "cpplint"; - maintainers = [ maintainers.bhipple ]; - license = [ licenses.bsd3 ]; + maintainers = [ lib.maintainers.bhipple ]; + license = [ lib.licenses.bsd3 ]; }; }