diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 5942fa6..e6cdb30 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -27,6 +27,7 @@ steps: matrix: setup: python: + - '3.11' - '3.10' - '3.9' - '3.8' diff --git a/.readthedocs.yml b/.readthedocs.yml index c0c8cb7..86550a8 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.10" + python: "3.11" python: install: diff --git a/README.md b/README.md index 833bc8b..4d44a8a 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ $ conda install -c conda-forge eland ### Compatibility -- Supports Python 3.8, 3.9, 3.10 and Pandas 1.5 +- Supports Python 3.8, 3.9, 3.10, 3.11 and Pandas 1.5 - Supports Elasticsearch clusters that are 7.11+, recommended 8.13 or later for all features to work. If you are using the NLP with PyTorch feature make sure your Eland minor version matches the minor version of your Elasticsearch cluster. For all other features it is sufficient for the major versions diff --git a/noxfile.py b/noxfile.py index 19698d3..d07c835 100644 --- a/noxfile.py +++ b/noxfile.py @@ -100,7 +100,7 @@ def lint(session): session.error("\n" + "\n".join(sorted(set(errors)))) -@nox.session(python=["3.8", "3.9", "3.10"]) +@nox.session(python=["3.8", "3.9", "3.10", "3.11"]) @nox.parametrize("pandas_version", ["1.5.0"]) def test(session, pandas_version: str): session.install("-r", "requirements-dev.txt") @@ -121,8 +121,8 @@ def test(session, pandas_version: str): "--nbval", ) - # PyTorch doesn't support Python 3.11 yet - if session.python == "3.11": + # PyTorch 2.1.2 doesn't support Python 3.12 + if session.python == "3.12": pytest_args += ("--ignore=eland/ml/pytorch",) session.run( *pytest_args, diff --git a/requirements-dev.txt b/requirements-dev.txt index 5171da2..a6ac664 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -14,11 +14,11 @@ scikit-learn>=1.3,<1.4 xgboost>=0.90,<2 lightgbm>=2,<4 - -# Elasticsearch uses v2.1.2 of PyTorch -torch==2.1.2 +# Elasticsearch uses PyTorch 2.1.2 +# Python 3.12 is not supported by PyTorch 2.1.2 +torch==2.1.2; python_version<'3.12' # Versions known to be compatible with PyTorch 2.1.2 -sentence-transformers>=2.1.0,<=2.3.1 +sentence-transformers>=2.1.0,<=2.3.1 transformers[torch]>=4.31.0,<4.36.0 # # Testing diff --git a/setup.py b/setup.py index a00f06d..5f1e2a9 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,7 @@ CLASSIFIERS = [ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Scientific/Engineering", ] @@ -90,7 +91,7 @@ setup( entry_points={ "console_scripts": "eland_import_hub_model=eland.cli.eland_import_hub_model:main" }, - python_requires=">=3.8", + python_requires=">=3.8,<3.12", package_data={"eland": ["py.typed"]}, include_package_data=True, zip_safe=False, diff --git a/utils/license-headers.py b/utils/license-headers.py index d501c85..8ba5b31 100644 --- a/utils/license-headers.py +++ b/utils/license-headers.py @@ -65,7 +65,7 @@ def find_files_to_fix(sources: List[str]) -> Iterator[str]: def does_file_need_fix(filepath: str) -> bool: if not filepath.endswith(".py"): return False - with open(filepath, mode="r") as f: + with open(filepath) as f: first_license_line = None for line in f: if line == license_header_lines[0]: @@ -82,7 +82,7 @@ def does_file_need_fix(filepath: str) -> bool: def add_header_to_file(filepath: str) -> None: - with open(filepath, mode="r") as f: + with open(filepath) as f: lines = list(f) i = 0 for i, line in enumerate(lines):