pcpp icon indicating copy to clipboard operation
pcpp copied to clipboard

Drop Python 2.7 compatibility?

Open mrolle45 opened this issue 1 year ago • 1 comments

I'd like to contribute some modest enhancements to pcpp. But I find that code that is Python 2 compatible is a nuisance to work with. I'd like to be able to use Python 3.7 (at least) features.

Questions for you, Ned:

  1. Do you think anyone would be using pcpp with Python 2.7 anymore?
  2. How would you publish 3.7-only code on PyPI and still make the current code available? I'm not familiar with using PyPI to publish code. I suppose there's a way to make the code version dependent so that "pip install pcpp" would magically pull in the right version to match the Python version running pip.
  3. How would you distinguish the two versions on GitHub. My idea is that you would create a "Python 2.7" branch off the current "main" and then merge my stuff onto the main branch. Also update README page to say that it is now requiring 3.7, and have a link to the 2.7 branch for those who want it.

Please let me know right away at [email protected], so I can know whether I could use 3.7 features or not. Thanks.

FYI, the enhancements I have in mind are just to make pcpp easier to use, and not to alter the result.

  • New switch, -v. Used for the level of verbosity in the debug log only. Repeatable for higher levels.
  • An optional file name for the --debug switch, to replace the default pccp_debug.log.
  • Easier to read debug log, especially when no verbosity.
  • Indentation in the debug log, introduced by | characters. These will frame #include-ed files, code sections controlled by #if and friends, and details pertaining to various shown items.
  • Macro expansions, including #, ##, and rescanning.

mrolle45 avatar Jan 03 '24 02:01 mrolle45

I hope to make the next major release of pcpp around this time next year i.e. start of 2025 if that's any use. Until then, I simply do not have enough free time outside of work for this project (I am building a house).

I was intending to drop Python 2.7 support at that time. If you don't mind your PR waiting until 2025, feel free to use Python 3 features. Nothing newer than Python 3.7 however please.

ned14 avatar Jan 03 '24 14:01 ned14