Skip to content

Allow setting target python version independently from the currently running python version #148

Description

@dfangl

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions