Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for python 3.7 #5892

Merged
merged 43 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a73a78a
remove requirement for setuptools.pkg_resources
marscher Oct 7, 2021
9d14a01
doh
marscher Oct 7, 2021
6104a05
doh2
marscher Oct 7, 2021
d500090
doh3, no reraise for fallback version number
marscher Oct 7, 2021
7537b33
black formatting
marscher Oct 7, 2021
4dcc371
ordering
marscher Oct 7, 2021
2fc6537
all this lifetime wasted by fucking linting tools
marscher Oct 7, 2021
b482d68
precommit
marscher Oct 7, 2021
c38b812
remove python 3.7 as min supported version
Illviljan Oct 24, 2021
3c286ef
remove 3.7 from min_deps
Illviljan Oct 24, 2021
0371924
Update ci-additional.yaml
Illviljan Oct 24, 2021
4f6454a
test increasing dask
Illviljan Oct 24, 2021
8f14e8b
test increasing numba
Illviljan Oct 24, 2021
69ca3dd
Update ci-additional.yaml
Illviljan Oct 24, 2021
3f69f5b
Merge branch 'pr/5845' into remove_python37
Illviljan Oct 26, 2021
a60a74f
remove setuptools from CI
Illviljan Oct 26, 2021
f5124ae
undo dask/numba tests
Illviljan Oct 26, 2021
28c5dfa
Remove importlib_metadata
Illviljan Oct 26, 2021
2b3f4f2
remove 3.7 compats
Illviljan Oct 27, 2021
82dcdff
Remove 3.7 compat
Illviljan Oct 27, 2021
3909271
remove sys
Illviljan Oct 27, 2021
c6a5871
Update options.py
Illviljan Oct 27, 2021
7f5cbb8
Merge branch 'main' into remove_python37
Illviljan Oct 31, 2021
465bc09
Merge branch 'main' into remove_python37
Illviljan Nov 2, 2021
37eb7bd
Merge branch 'main' into remove_python37
Illviljan Nov 6, 2021
df603c2
Merge branch 'main' into remove_python37
Illviljan Dec 11, 2021
0f357b9
Merge branch 'main' into remove_python37
Illviljan Dec 27, 2021
005a3fa
Update whats-new.rst
Illviljan Dec 27, 2021
8619df7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 27, 2021
a82eb6f
Merge branch 'main' into remove_python37
Illviljan Dec 27, 2021
eb197d7
Run flaky/all but dask with latest python version
Illviljan Jan 1, 2022
3f54e82
fix all_but_dask file as well
Illviljan Jan 1, 2022
8529e6c
Merge branch 'main' into remove_python37
Illviljan Jan 3, 2022
ec640e1
Merge branch 'main' into remove_python37
Illviljan Jan 4, 2022
db99229
Update dataarray.py
Illviljan Jan 4, 2022
262bd34
Update dataarray.py
Illviljan Jan 4, 2022
be4d2bd
Update doc/whats-new.rst
Illviljan Jan 4, 2022
9d25f4f
Merge branch 'main' into remove_python37
keewis Jan 5, 2022
2f3b6da
update the install guide
keewis Jan 5, 2022
b80d0dd
remove py37 only dependencies
keewis Jan 5, 2022
ea3901a
don't install importlib-metadata and typing_extensions into min-deps …
keewis Jan 5, 2022
2499be1
update the requirements file
keewis Jan 5, 2022
729789a
add back the optional typing_extensions dependency
keewis Jan 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ jobs:
os: ["ubuntu-latest"]
env:
[
"py37-bare-minimum",
"py37-min-all-deps",
"py38-all-but-dask",
"py38-flaky",
# Minimum python version:
"py38-bare-minimum",
"py38-min-all-deps",

# Latest python version:
"py39-all-but-dask",
"py39-flaky",
]
steps:
- uses: actions/checkout@v2
Expand All @@ -52,7 +55,7 @@ jobs:

- name: Set environment variables
run: |
if [[ ${{ matrix.env }} == "py38-flaky" ]] ;
if [[ ${{ matrix.env }} == "py39-flaky" ]] ;
then
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV
Expand All @@ -75,7 +78,7 @@ jobs:
mamba-version: "*"
activate-environment: xarray-tests
auto-update-conda: false
python-version: 3.8
python-version: 3.9
use-only-tar-bz2: true

- name: Install conda dependencies
Expand Down Expand Up @@ -128,7 +131,7 @@ jobs:
mamba-version: "*"
activate-environment: xarray-tests
auto-update-conda: false
python-version: "3.8"
python-version: "3.9"

- name: Install conda dependencies
run: |
Expand Down Expand Up @@ -164,10 +167,10 @@ jobs:
channel-priority: strict
mamba-version: "*"
auto-update-conda: false
python-version: "3.8"
python-version: "3.9"

- name: minimum versions policy
run: |
mamba install -y pyyaml conda python-dateutil
python ci/min_deps_check.py ci/requirements/py37-bare-minimum.yml
python ci/min_deps_check.py ci/requirements/py37-min-all-deps.yml
python ci/min_deps_check.py ci/requirements/py38-bare-minimum.yml
python ci/min_deps_check.py ci/requirements/py38-min-all-deps.yml
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
# Bookend python versions
python-version: ["3.7", "3.9"]
python-version: ["3.8", "3.9"]
steps:
- uses: actions/checkout@v2
with:
Expand Down
1 change: 0 additions & 1 deletion ci/requirements/environment-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ dependencies:
- rasterio
- scipy
- seaborn
- setuptools
- sparse
- toolz
- typing_extensions
Expand Down
1 change: 0 additions & 1 deletion ci/requirements/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ dependencies:
- rasterio
- scipy
- seaborn
- setuptools
- sparse
- toolz
- typing_extensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.7
- python=3.8
- coveralls
- pip
- pytest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
# Run ci/min_deps_check.py to verify that this file respects the policy.
# When upgrading python, numpy, or pandas, must also change
# doc/installing.rst and setup.py.
- python=3.7
- python=3.8
- boto3=1.13
- bottleneck=1.3
# cartopy 0.18 conflicts with pynio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.8
- python=3.9
- black
- aiobotocore
- boto3
Expand Down Expand Up @@ -36,7 +36,6 @@ dependencies:
- rasterio
- scipy
- seaborn
- setuptools
- sparse
- toolz
- typing_extensions
Expand Down
4 changes: 4 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ Deprecations
By `Tom Nicholas <https://github.com/TomNicholas>`_.


- Support for ``python 3.7`` has been dropped.
``setuptools`` is no longer a dependency (:pull:`5892`).
Illviljan marked this conversation as resolved.
Show resolved Hide resolved
By `Jimmy Westling <https://github.com/illviljan>`_.

- Coercing a dataset to bool, e.g. ``bool(ds)``, is being deprecated and will raise an
error in a future version (not yet planned). For now, invoking ``Dataset.__bool__``
issues a ``PendingDeprecationWarning`` (:issue:`6124`, :pull:`6126`).
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ classifiers =
Intended Audience :: Science/Research
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Expand All @@ -74,7 +73,7 @@ classifiers =
packages = find:
zip_safe = False # https://mypy.readthedocs.io/en/latest/installed_packages.html
include_package_data = True
python_requires = >=3.7
python_requires = >=3.8
install_requires =
numpy >= 1.18
pandas >= 1.1
Expand Down
8 changes: 1 addition & 7 deletions xarray/core/dataarray.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import datetime
import sys
import warnings
from typing import (
TYPE_CHECKING,
Expand All @@ -11,6 +10,7 @@
Hashable,
Iterable,
List,
Literal,
Mapping,
Optional,
Sequence,
Expand Down Expand Up @@ -91,12 +91,6 @@

from .types import T_DataArray, T_Xarray

# TODO: Remove this check once python 3.7 is not supported:
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal


def _infer_coords_and_dims(
shape, coords, dims
Expand Down
6 changes: 1 addition & 5 deletions xarray/core/npcompat.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import sys
from typing import TYPE_CHECKING, Any, Sequence, TypeVar, Union

import numpy as np
Expand All @@ -39,10 +38,7 @@
from numpy.typing import ArrayLike, DTypeLike
except ImportError:
# fall back for numpy < 1.20, ArrayLike adapted from numpy.typing._array_like
if sys.version_info >= (3, 8):
from typing import Protocol
else:
from typing_extensions import Protocol
from typing import Protocol

if TYPE_CHECKING:

Expand Down
11 changes: 1 addition & 10 deletions xarray/core/options.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
import sys
import warnings
from typing import TYPE_CHECKING, Literal, TypedDict, Union

from .utils import FrozenDict

# TODO: Remove this check once python 3.7 is not supported:
if sys.version_info >= (3, 8):
from typing import TYPE_CHECKING, Literal, TypedDict, Union
else:
from typing import TYPE_CHECKING, Union

from typing_extensions import Literal, TypedDict


if TYPE_CHECKING:
try:
from matplotlib.colors import Colormap
Expand Down