Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/create_draft_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
sdist: ${{ steps.package.outputs.sdist }}
wheel: ${{ steps.package.outputs.wheel }}
container:
image: danielflook/python-minifier-build:python3.14-2025-09-26
image: danielflook/python-minifier-build:python3.15-2026-09-10
permissions:
contents: read
steps:
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
outputs:
wheel: ${{ steps.package.outputs.wheel }}
container:
image: danielflook/python-minifier-build:python2.7-2025-09-26
image: danielflook/python-minifier-build:python2.7-2026-09-10
steps:
- name: Download source distribution artifact
uses: actions/download-artifact@v7.0.0
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
runs-on: ubuntu-24.04
needs: [package_python3]
container:
image: danielflook/python-minifier-build:python3.14-2025-09-26
image: danielflook/python-minifier-build:python3.15-2026-09-10
permissions:
contents: read
steps:
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python: ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
package_type: [sdist, wheel]
steps:
- name: Checkout
Expand All @@ -177,7 +177,7 @@ jobs:
- name: Test
uses: $/.github/actions/run-in-container
with:
image: danielflook/python-minifier-build:python${{ matrix.python }}-2025-09-26
image: danielflook/python-minifier-build:python${{ matrix.python }}-2026-09-10
run: |
if [[ "${{ matrix.package_type }}" == "sdist" ]]; then
pip${{ matrix.python }} install dist/${{needs.package_python3.outputs.sdist}}
Expand Down Expand Up @@ -217,7 +217,7 @@ jobs:
permissions:
contents: read
container:
image: danielflook/python-minifier-build:python3.14-2025-09-26
image: danielflook/python-minifier-build:python3.15-2026-09-10
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v7.0.0
Expand All @@ -232,9 +232,9 @@ jobs:
PYTHON3_WHEEL: ${{ needs.package_python3.outputs.wheel }}
run: |
if [[ "${{ matrix.package_type }}" == "sdist" ]]; then
pip3.14 install "dist/$PYTHON3_SDIST"
pip3.15 install "dist/$PYTHON3_SDIST"
else
pip3.14 install "dist/$PYTHON3_WHEEL"
pip3.15 install "dist/$PYTHON3_WHEEL"
fi

- name: Checkout
Expand All @@ -246,7 +246,7 @@ jobs:

- name: Test typing
run: |
pip3.14 install 'mypy<1.12.0' types-setuptools
pip3.15 install 'mypy<1.12.0' types-setuptools
mypy --strict typing_test/test_typing.py

if mypy --strict typing_test/test_badtyping.py; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
outputs:
release_version: ${{ steps.set_version.outputs.version }}
container:
image: danielflook/python-minifier-build:python3.14-2025-09-26
image: danielflook/python-minifier-build:python3.15-2026-09-10
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["python2.7", "python3.3", "python3.4", "python3.5", "python3.6", "python3.7", "python3.8", "python3.9", "python3.10", "python3.11", "python3.12", "python3.13", "python3.14", "pypy", "pypy3"]
python: ["python2.7", "python3.3", "python3.4", "python3.5", "python3.6", "python3.7", "python3.8", "python3.9", "python3.10", "python3.11", "python3.12", "python3.13", "python3.14", "python3.15", "pypy", "pypy3"]
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Run tests
uses: $/.github/actions/run-in-container
with:
image: danielflook/python-minifier-build:${{ matrix.python }}-2025-09-26
image: danielflook/python-minifier-build:${{ matrix.python }}-2026-09-10
run: |
tox -r -e $(echo "${{ matrix.python }}" | tr -d .)

Expand All @@ -48,7 +48,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.15']
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
Expand All @@ -58,7 +58,7 @@ jobs:
persist-credentials: false

- name: Set up Python
if: ${{ matrix.python-version != '2.7' && matrix.python-version != '3.14' }}
if: ${{ matrix.python-version != '2.7' && matrix.python-version != '3.14' && matrix.python-version != '3.15' }}
uses: actions/setup-python@v7.0.0
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -69,6 +69,12 @@ jobs:
with:
python-version: '3.14.0-rc.3'

- name: Set up Python 3.15
if: ${{ matrix.python-version == '3.15' }}
uses: actions/setup-python@v7.0.0
with:
python-version: '3.15.0-rc.2'

- name: Set up Python
if: ${{ matrix.python-version == '2.7' }}
uses: LizardByte/actions/actions/setup_python@a46850981292c4bbc0c41715f286ad95adaaaf4a # v2026.625.20301
Expand Down Expand Up @@ -150,6 +156,7 @@ jobs:
- Dockerfile-fedora38
- Dockerfile-fedora40
- Dockerfile-fedora42
- Dockerfile-fedora44
- Dockerfile-fuzz
steps:
- name: Checkout
Expand Down Expand Up @@ -186,7 +193,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v7.0.0
with:
python-version: '3.14'
python-version: '3.15.0-rc.2'

- name: Install coverage
run: pip install coverage
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_corpus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python: ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
ref: ["${{ inputs.ref }}", "${{ inputs.base-ref }}"]
steps:
- name: Clear workspace
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Run tests
uses: dflook/run-in-container@main
with:
image: danielflook/python-minifier-build:python${{ matrix.python }}-2025-09-26
image: danielflook/python-minifier-build:python${{ matrix.python }}-2026-09-10
volumes: |
/corpus:/corpus
/corpus-results:/corpus-results
Expand Down Expand Up @@ -143,11 +143,11 @@ jobs:
- name: Generate Report
uses: dflook/run-in-container@main
with:
image: danielflook/python-minifier-build:python3.14-2025-09-26
image: danielflook/python-minifier-build:python3.15-2026-09-10
volumes: |
/corpus-results:/corpus-results
run: |
python3.14 workflow/corpus_test/generate_report.py /corpus-results ${{ inputs.ref }} ${{ steps.ref.outputs.commit }} ${{ inputs.base-ref }} ${{ steps.base-ref.outputs.commit }} | tee -a $GITHUB_STEP_SUMMARY > report.md
python3.15 workflow/corpus_test/generate_report.py /corpus-results ${{ inputs.ref }} ${{ steps.ref.outputs.commit }} ${{ inputs.base-ref }} ${{ steps.base-ref.outputs.commit }} | tee -a $GITHUB_STEP_SUMMARY > report.md

- name: Lint Report
uses: DavidAnson/markdownlint-cli2-action@6bf21b07787794f89a243495939cd651942aeabe # v24.1.0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/verify_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
python: ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python: ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
container:
image: danielflook/python-minifier-build:python${{ matrix.python }}-2025-09-26
image: danielflook/python-minifier-build:python${{ matrix.python }}-2026-09-10
steps:
- name: Test
env:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/xtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["python2.7", "python3.3", "python3.4", "python3.5", "python3.6", "python3.7", "python3.8", "python3.9", "python3.10", "python3.11", "python3.12", "python3.13", "python3.14", "pypy3"]
python: ["python2.7", "python3.3", "python3.4", "python3.5", "python3.6", "python3.7", "python3.8", "python3.9", "python3.10", "python3.11", "python3.12", "python3.13", "python3.14", "python3.15", "pypy3"]
steps:
- name: Clear workspace
run: rm -rf "${GITHUB_WORKSPACE:?}/*"
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Run tests
uses: $/.github/actions/run-in-container
with:
image: danielflook/python-minifier-build:${{ matrix.python }}-2025-09-26
image: danielflook/python-minifier-build:${{ matrix.python }}-2026-09-10
run: |

if [[ "${{ matrix.python }}" == "python3.4" ]]; then
Expand Down Expand Up @@ -68,11 +68,11 @@ jobs:
- name: Run tests
uses: $/.github/actions/run-in-container
with:
image: danielflook/python-minifier-build:python3.14-2025-09-26
image: danielflook/python-minifier-build:python3.15-2026-09-10
run: |

pip3.14 install .
pip3.14 install hypothesis pytest
pip3.15 install .
pip3.15 install hypothesis pytest

pytest hypo_test --hypothesis-show-statistics

Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ and will output source code compatible with the version of the interpreter it is
This means that if you minify code written for Python 3.11 using python-minifier running with Python 3.12,
the minified code may only run with Python 3.12.

## [3.4.0] - Unreleased

### Added
- Python 3.15 support, including:
+ PEP 810 lazy imports
+ PEP 798 unpacking in comprehensions

### Fixed
- The combine imports transform now combines all runs of `from` imports that can be combined.
Previously only a leading run of imports from the same module was combined.

## [3.3.0] - 2026-09-04

### Added
Expand Down Expand Up @@ -331,6 +342,7 @@ the minified code may only run with Python 3.12.
- python-minifier package
- pyminify command

[3.4.0]: https://github.com/dflook/python-minifier/compare/3.3.0...3.4.0
[3.3.0]: https://github.com/dflook/python-minifier/compare/3.2.0...3.3.0
[3.2.0]: https://github.com/dflook/python-minifier/compare/3.1.1...3.2.0
[3.1.1]: https://github.com/dflook/python-minifier/compare/3.1.0...3.1.1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Transforms Python source code into its most compact representation.

[Try it out!](https://python-minifier.com)

python-minifier currently supports Python 2.7 and Python 3.3 to 3.14. Previous releases supported Python 2.6.
python-minifier currently supports Python 2.7 and Python 3.3 to 3.15. Previous releases supported Python 2.6.

* [PyPI](https://pypi.org/project/python-minifier/)
* [Documentation](https://dflook.github.io/python-minifier/)
Expand Down Expand Up @@ -110,7 +110,7 @@ and outputs source code compatible with the version of the interpreter it is run
This means that if you minify code written for Python 3.11 using python-minifier running with Python 3.12,
the minified code may only run with Python 3.12.

python-minifier runs with and can minify code written for Python 2.7 and Python 3.3 to 3.14.
python-minifier runs with and can minify code written for Python 2.7 and Python 3.3 to 3.15.

## Usage

Expand Down
8 changes: 4 additions & 4 deletions corpus_test/generate_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def report(results_dir: str, minifier_ref: str, minifier_sha: str, base_ref: str
| Python Version | Valid Corpus Entries | Average Time | Minified Size | Larger than original | Recursion Error | Unstable Minification | Exception |
| -------------- | -------------------: | -----------: | ------------: | -------------------: | --------------: | --------------------: | --------: |'''

for python_version in ['2.7', '3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']:
for python_version in ['2.7', '3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.15']:
try:
summary = result_summary(results_dir, python_version, minifier_sha)
except FileNotFoundError:
Expand Down Expand Up @@ -410,11 +410,11 @@ def report(results_dir: str, minifier_ref: str, minifier_sha: str, base_ref: str
f'| {format_difference(summary.exception(), base_summary.exception())} |'
)

all_versions = ['2.7', '3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
all_versions = ['2.7', '3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.15']

yield from report_larger_than_original(results_dir, ['3.14'], minifier_sha)
yield from report_larger_than_original(results_dir, ['3.15'], minifier_sha)
yield from report_larger_than_base(results_dir, all_versions, minifier_sha, base_sha)
yield from report_slowest(results_dir, ['3.14'], minifier_sha, base_sha)
yield from report_slowest(results_dir, ['3.15'], minifier_sha, base_sha)
yield from report_unstable(results_dir, all_versions, minifier_sha)
yield from report_exceptions(results_dir, all_versions, minifier_sha)

Expand Down
54 changes: 54 additions & 0 deletions docker/Dockerfile-fedora44
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM fedora:44 AS python3.15

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# CircleCI required tools
RUN <<EOF
dnf install -y \
git \
tar \
gzip \
gpg \
ca-certificates
dnf clean all && rm -rf /var/cache/dnf/*
EOF

# Development tools
RUN <<EOF
dnf install -y \
@development-tools \
findutils \
zlib-devel \
bzip2-devel \
ncurses-devel \
gdbm-devel \
openssl-devel \
sqlite-devel \
tk-devel \
libuuid-devel \
readline-devel \
libnsl2-devel \
xz-devel \
libffi-devel \
wget
git clone https://github.com/python/cpython.git
cd cpython
git checkout v3.15.0rc2
./configure
make
make install
cd ..
rm -rf cpython
dnf clean all && rm -rf /var/cache/dnf/*
EOF

# Other packages required for tests
RUN <<EOF
dnf install -y bzip2
dnf clean all && rm -rf /var/cache/dnf/*
EOF

RUN pip3 install --no-cache-dir tox==4.61.4 virtualenv==21.7.9 cachetools==7.1.8 chardet==7.6.0 colorama==0.4.6 distlib==0.4.3 filelock==3.32.6 packaging==26.3 platformdirs==4.11.8 pluggy==1.6.0 pyproject-api==1.11.0

WORKDIR /tmp/work
ENTRYPOINT ["/bin/bash"]
2 changes: 1 addition & 1 deletion docker/Dockerfile-fuzz
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM danielflook/python-minifier-build:python3.14-2025-08-21 AS fuzz
FROM danielflook/python-minifier-build:python3.15-2026-09-10 AS fuzz

RUN pip3 install --no-cache-dir --root-user-action=ignore 'hypothesis[cli]' hypofuzz

Expand Down
4 changes: 4 additions & 0 deletions docker/build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ docker build --tag danielflook/python-minifier-build:python3.13-$DATE -f Dockerf
docker pull fedora:42
docker build --tag danielflook/python-minifier-build:python3.14-$DATE -f Dockerfile-fedora42 --target python3.14 .

docker pull fedora:44
docker build --tag danielflook/python-minifier-build:python3.15-$DATE -f Dockerfile-fedora44 --target python3.15 .

docker build --tag danielflook/python-minifier-build:fuzz-$DATE -f Dockerfile-fuzz --target fuzz .

docker push danielflook/python-minifier-build:python3.3-$DATE
Expand All @@ -50,6 +53,7 @@ docker push danielflook/python-minifier-build:python3.11-$DATE
docker push danielflook/python-minifier-build:python3.12-$DATE
docker push danielflook/python-minifier-build:python3.13-$DATE
docker push danielflook/python-minifier-build:python3.14-$DATE
docker push danielflook/python-minifier-build:python3.15-$DATE
docker push danielflook/python-minifier-build:pypy-$DATE
docker push danielflook/python-minifier-build:pypy3-$DATE
docker push danielflook/python-minifier-build:fuzz-$DATE
2 changes: 1 addition & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ and outputs source code compatible with the version of the interpreter it is run
This means that if you minify code written for Python 3.6 using python-minifier running with Python 3.12,
the minified code may only run with Python 3.12.

python-minifier runs with and can minify code written for Python 2.7 and Python 3.3 to 3.14.
python-minifier runs with and can minify code written for Python 2.7 and Python 3.3 to 3.15.
Loading