diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 375dada..1abd5f0 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 @@ -78,6 +78,10 @@ jobs: with: name: "wheel-3.11" path: "dist/" + - uses: actions/download-artifact@v2 + with: + name: "wheel-3.12" + path: "dist/" - run: | ls -lh dist/ - name: Setup PyPI config diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 26f2bd0..a48835b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.9, "3.10", "3.11"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] experimental: [false] steps: - uses: actions/checkout@v3 diff --git a/setup.py b/setup.py index ad27a0a..43c352f 100644 --- a/setup.py +++ b/setup.py @@ -24,19 +24,13 @@ import os import subprocess import sys -from distutils.version import LooseVersion import setuptools.command.build_py import setuptools.command.develop from setuptools import find_packages, setup -if LooseVersion(sys.version) < LooseVersion("3.6") or LooseVersion( - sys.version -) > LooseVersion("3.12"): - raise RuntimeError( - "Trainer requires python >= 3.6 and <=3.12 " - "but your Python version is {}".format(sys.version) - ) +if sys.version_info < (3, 6) or sys.version_info >= (3, 13): + raise RuntimeError("Trainer requires python >= 3.6 and <3.13 " "but your Python version is {}".format(sys.version)) cwd = os.path.dirname(os.path.abspath(__file__)) @@ -105,7 +99,7 @@ def pip_install(package_name): "test": requirements_test, "all": requirements_all }, - python_requires=">=3.6.0, <3.12", + python_requires=">=3.6.0, <3.13", classifiers=[ "Environment :: Console", "Natural Language :: English", @@ -123,6 +117,7 @@ def pip_install(package_name): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ], zip_safe=False, ) diff --git a/trainer/trainer.py b/trainer/trainer.py index 75378c0..948a9dd 100644 --- a/trainer/trainer.py +++ b/trainer/trainer.py @@ -1086,8 +1086,7 @@ def master_params(optimizer: torch.optim.Optimizer): optimizer: Target optimizer. """ for group in optimizer.param_groups: - for p in group["params"]: - yield p + yield from group["params"] @staticmethod def _model_train_step(