diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aaf3b10..f07f866 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: python-version: - ["3.7", "3.8", "3.9", "3.10", "pypy3.7", "pypy3.8", "pypy3.9"] + ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.7", "pypy3.8", "pypy3.9"] os: ["macos-latest", "windows-latest", "ubuntu-latest"] steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index d779ef1..0c51967 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `Delay.mod_x`, `Delay.mod_y`, `Delay.fat_mode` and `Delay.ping_pong` [#88]. - Improve enum performance by using `f-enum` library (`pyflp.parse` is 50% faster). - `Time.gate`, `Time.shift` and `Time.full_porta` [#89]. +- *Experimental* Python 3.11 support is back. ### Changed diff --git a/pyflp/__init__.py b/pyflp/__init__.py index dfa0153..2f413ae 100644 --- a/pyflp/__init__.py +++ b/pyflp/__init__.py @@ -32,9 +32,9 @@ import io import os import pathlib +import sys import construct as c -import fastenum from ._events import ( DATA, @@ -60,7 +60,10 @@ __all__ = ["parse", "save"] __version__ = "2.0.0a4" -fastenum.enable() +if sys.version_info < (3, 11): # https://github.com/Bobronium/fastenum/issues/2 + import fastenum + + fastenum.enable() # 50% faster parse() def parse(file: pathlib.Path | str) -> Project: diff --git a/pyproject.toml b/pyproject.toml index a203189..88563d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ classifiers = [ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Multimedia", @@ -27,7 +28,7 @@ classifiers = [ license = { text = "GPL-3.0" } dependencies = [ "colour>=0.1.5", - "f-enum>=0.2.0", + "f-enum>=0.2.0;python_version<='3.10'", "construct-typing @ git+https://github.com/timrid/construct-typing.git@ce871936d9e885c84f2f507c723fc5a7e99c9096", "sortedcontainers>=2.4.0", "typing_extensions>=4.4.0", diff --git a/requirements.txt b/requirements.txt index 40bb15f..7cbc1be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ colour==0.1.5 construct-typing @ git+https://github.com/timrid/construct-typing.git@ce871936d9e885c84f2f507c723fc5a7e99c9096 -f-enum==0.2.0 +f-enum==0.2.0;python_version<="3.10" sortedcontainers==2.4.0 typing_extensions==4.4.0 diff --git a/tox.ini b/tox.ini index 2263ca8..0fa3895 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{37,38,39,310},pypy{37,38,39},docs,linters +envlist = py{37,38,39,310,311},pypy{37,38,39},docs,linters minversion = 3.3.0 isolated_build = true parallel = auto @@ -79,6 +79,7 @@ python = 3.8: py38 3.9: py39 3.10: py310, docs + 3.11: py311 pypy-3.7: pypy37 pypy-3.8: pypy38 pypy-3.9: pypy39