mirror of
https://github.com/elastic/eland.git
synced 2025-07-11 00:02:14 +08:00
Add Python 3.11 to support matrix (#681)
This commit is contained in:
parent
ae0bba34c6
commit
c16e36c051
@ -27,6 +27,7 @@ steps:
|
|||||||
matrix:
|
matrix:
|
||||||
setup:
|
setup:
|
||||||
python:
|
python:
|
||||||
|
- '3.11'
|
||||||
- '3.10'
|
- '3.10'
|
||||||
- '3.9'
|
- '3.9'
|
||||||
- '3.8'
|
- '3.8'
|
||||||
|
@ -3,7 +3,7 @@ version: 2
|
|||||||
build:
|
build:
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
tools:
|
tools:
|
||||||
python: "3.10"
|
python: "3.11"
|
||||||
|
|
||||||
python:
|
python:
|
||||||
install:
|
install:
|
||||||
|
@ -53,7 +53,7 @@ $ conda install -c conda-forge eland
|
|||||||
|
|
||||||
### Compatibility
|
### 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.
|
- 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
|
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
|
version of your Elasticsearch cluster. For all other features it is sufficient for the major versions
|
||||||
|
@ -100,7 +100,7 @@ def lint(session):
|
|||||||
session.error("\n" + "\n".join(sorted(set(errors))))
|
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"])
|
@nox.parametrize("pandas_version", ["1.5.0"])
|
||||||
def test(session, pandas_version: str):
|
def test(session, pandas_version: str):
|
||||||
session.install("-r", "requirements-dev.txt")
|
session.install("-r", "requirements-dev.txt")
|
||||||
@ -121,8 +121,8 @@ def test(session, pandas_version: str):
|
|||||||
"--nbval",
|
"--nbval",
|
||||||
)
|
)
|
||||||
|
|
||||||
# PyTorch doesn't support Python 3.11 yet
|
# PyTorch 2.1.2 doesn't support Python 3.12
|
||||||
if session.python == "3.11":
|
if session.python == "3.12":
|
||||||
pytest_args += ("--ignore=eland/ml/pytorch",)
|
pytest_args += ("--ignore=eland/ml/pytorch",)
|
||||||
session.run(
|
session.run(
|
||||||
*pytest_args,
|
*pytest_args,
|
||||||
|
@ -14,9 +14,9 @@ scikit-learn>=1.3,<1.4
|
|||||||
xgboost>=0.90,<2
|
xgboost>=0.90,<2
|
||||||
lightgbm>=2,<4
|
lightgbm>=2,<4
|
||||||
|
|
||||||
|
# Elasticsearch uses PyTorch 2.1.2
|
||||||
# Elasticsearch uses v2.1.2 of PyTorch
|
# Python 3.12 is not supported by PyTorch 2.1.2
|
||||||
torch==2.1.2
|
torch==2.1.2; python_version<'3.12'
|
||||||
# Versions known to be compatible with PyTorch 2.1.2
|
# 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
|
transformers[torch]>=4.31.0,<4.36.0
|
||||||
|
3
setup.py
3
setup.py
@ -41,6 +41,7 @@ CLASSIFIERS = [
|
|||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
"Topic :: Scientific/Engineering",
|
"Topic :: Scientific/Engineering",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -90,7 +91,7 @@ setup(
|
|||||||
entry_points={
|
entry_points={
|
||||||
"console_scripts": "eland_import_hub_model=eland.cli.eland_import_hub_model:main"
|
"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"]},
|
package_data={"eland": ["py.typed"]},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
|
@ -65,7 +65,7 @@ def find_files_to_fix(sources: List[str]) -> Iterator[str]:
|
|||||||
def does_file_need_fix(filepath: str) -> bool:
|
def does_file_need_fix(filepath: str) -> bool:
|
||||||
if not filepath.endswith(".py"):
|
if not filepath.endswith(".py"):
|
||||||
return False
|
return False
|
||||||
with open(filepath, mode="r") as f:
|
with open(filepath) as f:
|
||||||
first_license_line = None
|
first_license_line = None
|
||||||
for line in f:
|
for line in f:
|
||||||
if line == license_header_lines[0]:
|
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:
|
def add_header_to_file(filepath: str) -> None:
|
||||||
with open(filepath, mode="r") as f:
|
with open(filepath) as f:
|
||||||
lines = list(f)
|
lines = list(f)
|
||||||
i = 0
|
i = 0
|
||||||
for i, line in enumerate(lines):
|
for i, line in enumerate(lines):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user