Closed maarten-k closed 10 months ago
Sorry I'm not quite sure what the issue is here? Are you asking for snakefmt to resolve the tab/space issue for you?
The issue is that this error does not occur under Python 3.11 and does occur under Python 3.12.
Are you asking for snakefmt to resolve the tab/space issue for you?
Yes, I think that tab/space formatting should be handled by snakefmt and not done by hand.
Well TabError
is raised because Python does not allow mixing tabs and spaces. (See this SO answer for a nice explanation).
Maybe we need a discussion about whether or not it is snakefmt
's responsibility to deal with this. I'm a little bit hesitant to have snakefmt
deal with this as I think it should be brought to the user's attention as it may indicate something going wrong in their editor or developer team.
In the meantime, seems like a lot of people use this to make the indentation consistent https://pypi.org/project/reindent/
I also think that it shouldn't be snakefmt
's responsibility
Feel free to reopen if you feel this warrants further discussion
I am testing snakemake to run with Python 3.12-rc3 by running the tests of snakemake itself.
I ran into the following error:
This is expected since this is clearly in the changelog of Python 3.12
Mixing tabs and spaces as indentation in the same file is not supported anymore and will raise a [TabError](https://docs.python.org/3.12/library/exceptions.html#TabError).
Snakemake itself is also unable to parse this file under Python 3.12. Removing the tabs/spaces issue from the snakefile solves both problems, but lowers the usability of snakefmt/snakemake to remove these issues by hand.