The reasons why this is a problem stated in those issues are the same as mine: I noticed this after losing my sanity because I tried to generate a patch from the Github repository and it didn't work with Conda:
Found source in cache: ratarmount-0.14.1_4eb3987fd9.tar.gz
Extracting download
Applying patch: /ratarmount-feedstock/recipe/remove-rapidgzip.patch
Applying patch: /ratarmount-feedstock/recipe/remove-rapidgzip.patch with args:
['-Np0', '-i', '/tmp/tmpt8csnys_/remove-rapidgzip.patch.native', '--binary']
checking file setup.cfg
Hunk #1 FAILED at 41.
1 out of 1 hunk FAILED
Warning: failed to download source. If building, will try again after downloading recipe dependencies.
Error was:
Command '['/opt/miniconda3/bin/patch', '--no-backup-if-mismatch', '--batch', '-Np0', '-i', '/tmp/tmpt8csnys_/remove-rapidgzip.patch.native', '--binary', '--dry-run']' returned non-zero exit status 1.
I'm not sure whether this applies to build, but it seems to be a ConfigParser problem for the other linked issues. This is documented behavior of ConfigParser and therefore unlikely to change. I think the easiest workaround, as already implied by the above diff commands, would be these steps:
Generate new setup.cfg with ConfigParser
Generate a diff ignoring whitespace changes with diff -w or an equivalent Python library.
Apply the minimal non-whitespace-changing diff to the original setup.cfg.
(Removing the whitespaces I used for alignment might be contestable. But I think adding trailing whitespaces is unequivocally a worse style and I also have not seen tabs being used for indentation for quite a while and didn't expect that change.)
Steps to reproduce:
Output:
And with
diff -w setup.cfg ratarmount-*/setup.cfg
:There are multiple similar issues in other projects: bumpversion, setuptools
The reasons why this is a problem stated in those issues are the same as mine: I noticed this after losing my sanity because I tried to generate a patch from the Github repository and it didn't work with Conda:
I'm not sure whether this applies to
build
, but it seems to be a ConfigParser problem for the other linked issues. This is documented behavior of ConfigParser and therefore unlikely to change. I think the easiest workaround, as already implied by the above diff commands, would be these steps:diff -w
or an equivalent Python library.(Removing the whitespaces I used for alignment might be contestable. But I think adding trailing whitespaces is unequivocally a worse style and I also have not seen tabs being used for indentation for quite a while and didn't expect that change.)