Skip to content

Commit

Permalink
Build for python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
dflook committed Sep 19, 2023
1 parent eb46ee6 commit e564e7c
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
release:
runs-on: ubuntu-latest
container:
image: danielflook/python-minifier-build:python3.11-2022-10-25
image: danielflook/python-minifier-build:python3.12-2023-09-19
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
id-token: write
environment:
name: pypi
url: https://pypi.org/project/python-minifier/
url: https://pypi.org/project/python-minifier/${{ github.event.release.tag_name }}
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Create Package
runs-on: ubuntu-latest
container:
image: danielflook/python-minifier-build:python3.11-2022-10-25
image: danielflook/python-minifier-build:python3.12-2023-09-19
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
needs: [package]
container:
image: danielflook/python-minifier-build:python3.11-2022-10-25
image: danielflook/python-minifier-build:python3.12-2023-09-19
steps:
- uses: actions/download-artifact@v3
with:
Expand All @@ -62,10 +62,10 @@ jobs:
needs: [package]
strategy:
matrix:
python: ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
package_type: [.tar.gz, .whl]
container:
image: danielflook/python-minifier-build:python${{ matrix.python }}-2022-10-25
image: danielflook/python-minifier-build:python${{ matrix.python }}-2023-09-19
steps:
- uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
matrix:
package_type: [.tar.gz, .whl]
container:
image: danielflook/python-minifier-build:python3.11-2022-10-25
image: danielflook/python-minifier-build:python3.12-2023-09-19
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ 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", "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", "pypy", "pypy3"]
container:
image: danielflook/python-minifier-build:${{ matrix.python }}-2022-10-25
image: danielflook/python-minifier-build:${{ matrix.python }}-2023-09-19
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test_corpus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ 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"]
python: ["python2.7", "python3.3", "python3.4", "python3.5", "python3.6", "python3.7", "python3.8", "python3.9", "python3.10", "python3.11", "python3.12"]
ref: ["${{ inputs.ref }}", "${{ inputs.base-ref }}"]
container:
image: danielflook/python-minifier-build:${{ matrix.python }}-2022-10-25
image: danielflook/python-minifier-build:${{ matrix.python }}-2023-09-19
volumes:
- /corpus:/corpus
- /corpus-results:/corpus-results
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
needs: generate_results
runs-on: self-hosted
container:
image: danielflook/python-minifier-build:python3.11-2022-10-25
image: danielflook/python-minifier-build:python3.12-2023-09-19
volumes:
- /corpus-results:/corpus-results
if: ${{ always() }}
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 @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
container:
image: danielflook/python-minifier-build:python${{ matrix.python }}-2022-10-25
image: danielflook/python-minifier-build:python${{ matrix.python }}-2023-09-19
steps:
- name: Test
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/xtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ 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", "pypy3"]
python: ["python2.7", "python3.3", "python3.4", "python3.5", "python3.6", "python3.7", "python3.8", "python3.9", "python3.10", "python3.11", "python3.12", "pypy3"]
container:
image: danielflook/python-minifier-build:${{ matrix.python }}-2022-10-25
image: danielflook/python-minifier-build:${{ matrix.python }}-2023-09-19
steps:
- name: Checkout
uses: actions/checkout@v3
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.11. Previous releases supported Python 2.6.
python-minifier currently supports Python 2.7 and Python 3.3 to 3.12. Previous releases supported Python 2.6.

* [PyPI](https://pypi.org/project/python-minifier/)
* [Documentation](https://dflook.github.io/python-minifier/)
Expand Down Expand Up @@ -107,7 +107,7 @@ $ pip install python-minifier
Note that python-minifier depends on the python interpreter for parsing source code,
so install using a version of python appropriate for your source.

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

## Usage

Expand Down
47 changes: 47 additions & 0 deletions docker/Dockerfile-fedora38
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM fedora:38 AS python3.12

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

# Development tools
RUN 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.12.0rc2 \
&& ./configure \
&& make \
&& make install \
&& cd .. \
&& rm -rf cpython \
&& dnf clean all && rm -rf /var/cache/dnf/*

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

RUN pip3 install tox==4.11.3

WORKDIR /tmp/work
ENTRYPOINT ["/bin/bash"]
2 changes: 2 additions & 0 deletions docker/build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ docker pull fedora:36
docker build --tag danielflook/python-minifier-build:python3.11-$DATE -f Dockerfile-fedora36 --target python3.11 .

docker pull fedora:38
docker build --tag danielflook/python-minifier-build:python3.12-$DATE -f Dockerfile-fedora38 --target python3.12 .
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 @@ -39,6 +40,7 @@ docker push danielflook/python-minifier-build:python3.8-$DATE
docker push danielflook/python-minifier-build:python3.9-$DATE
docker push danielflook/python-minifier-build:python3.10-$DATE
docker push danielflook/python-minifier-build:python3.11-$DATE
docker push danielflook/python-minifier-build:python3.12-$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 @@ -9,4 +9,4 @@ To install python-minifier use pip:
Note that python-minifier depends on the python interpreter for parsing source code, so install using a version of python appropriate for your source.

python-minifier runs with and can minify code written for Python 2.7 and Python 3.3 to 3.11.
python-minifier runs with and can minify code written for Python 2.7 and Python 3.3 to 3.12.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os.path
import sys

from setuptools import setup, find_packages

Expand Down Expand Up @@ -27,7 +26,7 @@
long_description=long_desc,
long_description_content_type='text/markdown',

python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <3.12',
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <3.13',
setup_requires=['setuptools_scm'],

classifiers=[
Expand All @@ -44,6 +43,7 @@
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: Implementation :: CPython',
Expand Down
8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ deps =
pyyaml==6.0.0
pyperf==2.4.1

[testenv:python312]
basepython = /usr/local/bin/python3.12
deps =
pytest==7.4.2
sh==2.0.6
pyyaml==6.0.1
pyperf==2.6.1

[testenv:pypy]
basepython = /usr/bin/pypy

Expand Down

0 comments on commit e564e7c

Please sign in to comment.