python3Packages.autopep8: patch for pycodestyle-2.10.0

This adjusts autopep8 to fetch from GitHub so it can be patched (patch does not
apply cleanly to PyPI source tarball), and a test that had to be disabled
because it was fetched from PyPI is re-enabled since it could work now (and as
far as I understand, pulling from git is generally preferred for Python
packages in nixpkgs for test reasons).

This lets the package now build successfully with the recent pycodestyle 2.10.0
bump.
This commit is contained in:
Lily Foster 2022-12-12 11:45:44 -05:00 committed by Bjørn Forsman
parent f0dda807b2
commit 058d817fd4

View File

@ -1,5 +1,6 @@
{ lib
, fetchPypi
, fetchFromGitHub
, fetchpatch
, buildPythonPackage
, pycodestyle
, glibcLocales
@ -11,11 +12,21 @@ buildPythonPackage rec {
pname = "autopep8";
version = "2.0.0";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-ixZZx/AD5pMZn1LK/9wGWFuwcWkAu8anRC/ZMdZYwHc=";
src = fetchFromGitHub {
owner = "hhatto";
repo = "autopep8";
rev = "v${version}";
sha256 = "sha256-77ZVprACHUP8BmylTtvHvJMjb70E1YFKKdQDigAZG6s=";
};
patches = [
(fetchpatch {
name = "fix-pycodestyle-2.10.0.patch";
url = "https://github.com/hhatto/autopep8/pull/659.patch";
hash = "sha256-ulvQqJ3lUm8/9QZwH+whzrxbz8c11/ntc8zH2zfmXiE=";
})
];
propagatedBuildInputs = [ pycodestyle tomli ];
checkInputs = [
@ -23,11 +34,6 @@ buildPythonPackage rec {
pytestCheckHook
];
disabledTests = [
# missing tox.ini file from pypi package
"test_e101_skip_innocuous"
];
LC_ALL = "en_US.UTF-8";
meta = with lib; {