Drop support for Python 3.6, pandas<1.2

This commit is contained in:
Seth Michael Larson 2021-07-27 14:43:03 -05:00 committed by GitHub
parent 193bcb73ef
commit c74fccbd74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 28 deletions

View File

@ -3,17 +3,15 @@
ELASTICSEARCH_VERSION: ELASTICSEARCH_VERSION:
- 8.0.0-SNAPSHOT - 8.0.0-SNAPSHOT
- 7.x-SNAPSHOT - 7.x-SNAPSHOT
- 7.10-SNAPSHOT
PANDAS_VERSION: PANDAS_VERSION:
- 1.2.0 - 1.2
- 1.3.0 - 1.3
PYTHON_VERSION: PYTHON_VERSION:
- 3.9 - 3.9
- 3.8 - 3.8
- 3.7 - 3.7
- 3.6
TEST_SUITE: TEST_SUITE:
- xpack - xpack

View File

@ -12,12 +12,12 @@ jobs:
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set up Python 3.8 - name: Set up Python 3
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3
- name: Install dependencies - name: Install dependencies
run: python3.8 -m pip install nox run: python3 -m pip install nox
- name: Lint the code - name: Lint the code
run: nox -s lint run: nox -s lint
@ -26,13 +26,13 @@ jobs:
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set up Python 3.8 - name: Set up Python 3
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get install --yes pandoc sudo apt-get install --yes pandoc
python3.8 -m pip install nox python3 -m pip install nox
- name: Build documentation - name: Build documentation
run: nox -s docs run: nox -s docs

View File

@ -310,7 +310,7 @@ def es_version(es_client: Elasticsearch) -> Tuple[int, int, int]:
f"Received: {version_info}" f"Received: {version_info}"
) )
eland_es_version = cast( eland_es_version = cast(
Tuple[int, int, int], tuple([int(x) for x in match.groups()]) Tuple[int, int, int], tuple(int(x) for x in match.groups())
) )
es_client._eland_es_version = eland_es_version # type: ignore es_client._eland_es_version = eland_es_version # type: ignore
else: else:

View File

@ -219,7 +219,7 @@ class Operations:
if is_dataframe: if is_dataframe:
# If multiple values of mode is returned for a particular column # If multiple values of mode is returned for a particular column
# find the maximum length and use that to fill dataframe with NaN/NaT # find the maximum length and use that to fill dataframe with NaN/NaT
rows_len = max([len(value) for value in results.values()]) rows_len = max(len(value) for value in results.values())
for key, values in results.items(): for key, values in results.items():
row_diff = rows_len - len(values) row_diff = rows_len - len(values)
# Convert np.ndarray to list # Convert np.ndarray to list

View File

@ -53,7 +53,7 @@ TYPED_FILES = (
def format(session): def format(session):
session.install("black", "isort") session.install("black", "isort")
session.run("python", "utils/license-headers.py", "fix", *SOURCE_FILES) session.run("python", "utils/license-headers.py", "fix", *SOURCE_FILES)
session.run("black", "--target-version=py36", *SOURCE_FILES) session.run("black", "--target-version=py37", *SOURCE_FILES)
session.run("isort", *SOURCE_FILES) session.run("isort", *SOURCE_FILES)
lint(session) lint(session)
@ -63,7 +63,7 @@ def lint(session):
session.install("black", "flake8", "mypy", "isort") session.install("black", "flake8", "mypy", "isort")
session.install("--pre", "elasticsearch") session.install("--pre", "elasticsearch")
session.run("python", "utils/license-headers.py", "check", *SOURCE_FILES) session.run("python", "utils/license-headers.py", "check", *SOURCE_FILES)
session.run("black", "--check", "--target-version=py36", *SOURCE_FILES) session.run("black", "--check", "--target-version=py37", *SOURCE_FILES)
session.run("isort", "--check", *SOURCE_FILES) session.run("isort", "--check", *SOURCE_FILES)
session.run("flake8", "--ignore=E501,W503,E402,E712,E203", *SOURCE_FILES) session.run("flake8", "--ignore=E501,W503,E402,E712,E203", *SOURCE_FILES)
@ -89,20 +89,13 @@ def lint(session):
session.error("\n" + "\n".join(sorted(set(errors)))) session.error("\n" + "\n".join(sorted(set(errors))))
@nox.session(python=["3.6", "3.7", "3.8", "3.9"]) @nox.session(python=["3.7", "3.8", "3.9"])
@nox.parametrize("pandas_version", ["1.2.0", "1.3.0"]) @nox.parametrize("pandas_version", ["1.2", "1.3"])
def test(session, pandas_version: str): def test(session, pandas_version: str):
session.install("-r", "requirements-dev.txt") session.install("-r", "requirements-dev.txt")
session.install(".") session.install(".")
session.run("python", "-m", "pip", "install", f"pandas=={pandas_version}") session.run("python", "-m", "pip", "install", f"pandas~={pandas_version}")
session.run("python", "-m", "tests.setup_tests") session.run("python", "-m", "tests.setup_tests")
# Notebooks are only run on Python 3.7+ due to pandas 1.2.0
if session.python == "3.6":
nbval = ()
else:
nbval = ("--nbval",)
session.run( session.run(
"python", "python",
"-m", "-m",
@ -111,7 +104,7 @@ def test(session, pandas_version: str):
"term-missing", "term-missing",
"--cov=eland/", "--cov=eland/",
"--doctest-modules", "--doctest-modules",
*nbval, "--nbval",
*(session.posargs or ("eland/", "tests/")), *(session.posargs or ("eland/", "tests/")),
) )

View File

@ -38,10 +38,10 @@ CLASSIFIERS = [
"Programming Language :: Python", "Programming Language :: Python",
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.7",
"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",
"Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering",
] ]
@ -70,8 +70,8 @@ setup(
classifiers=CLASSIFIERS, classifiers=CLASSIFIERS,
keywords="elastic eland pandas python", keywords="elastic eland pandas python",
packages=find_packages(include=["eland", "eland.*"]), packages=find_packages(include=["eland", "eland.*"]),
install_requires=["elasticsearch>=7.7", "pandas>=1", "matplotlib", "numpy"], install_requires=["elasticsearch>=7.13", "pandas>=1.2,<1.4", "matplotlib", "numpy"],
python_requires=">=3.6", python_requires=">=3.7",
package_data={"eland": ["py.typed"]}, package_data={"eland": ["py.typed"]},
include_package_data=True, include_package_data=True,
zip_safe=False, zip_safe=False,