In this project, several minification decisions are based on the python version the minifier is currently running on:
Example:
|
if sys.version_info < (3, 12): |
|
pep701 = False |
|
else: |
|
pep701 = True |
This can lead to backwards incompatibility of the minified code, even if the original code might run on older python versions.
I'd like to propose a change to make this configurable - at least to target an older version than the one currently running.
Proposal
Add a target_version configuration option, which allows specification of a different target python version. The default could reasonably be the currently running one, for backwards compatibility.
I am not too familiar with the internal workings of this project, if a higher python version would be doable in all cases, but it could be limited to the currently running one and below.
I'm happy to give it a try, however I would like to start a discussion first if this is a sensible change / if it would be accepted, before opening up a PR.
In this project, several minification decisions are based on the python version the minifier is currently running on:
Example:
python-minifier/src/python_minifier/expression_printer.py
Lines 739 to 742 in 3f4c582
This can lead to backwards incompatibility of the minified code, even if the original code might run on older python versions.
I'd like to propose a change to make this configurable - at least to target an older version than the one currently running.
Proposal
Add a
target_versionconfiguration option, which allows specification of a different target python version. The default could reasonably be the currently running one, for backwards compatibility.I am not too familiar with the internal workings of this project, if a higher python version would be doable in all cases, but it could be limited to the currently running one and below.
I'm happy to give it a try, however I would like to start a discussion first if this is a sensible change / if it would be accepted, before opening up a PR.