Skip to content

Commit af2fc8c

Browse files
authored
Add support for Python 3.11 and remove 3.8 (#406)
* Remove support for Python 3.8 and add 3.11 * Add CI file * Replace epylint workflow that is deprecated * Linting * Use exit instead of do_exit
1 parent ee457cd commit af2fc8c

File tree

6 files changed

+15
-11
lines changed

6 files changed

+15
-11
lines changed

.github/workflows/python-app.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
20-
python-version: ["3.8", "3.9", "3.10"]
20+
python-version: ["3.9", "3.10", "3.11"]
2121

2222
defaults:
2323
run:
@@ -48,7 +48,7 @@ jobs:
4848
path: ${{ env.CONDA }}/envs
4949
key: conda-${{ matrix.os }}-${{ matrix.python-version }}-${{ env.cache_date }}-${{ hashFiles('dev-environment.yml') }}-${{ env.CACHE_NUMBER }}
5050
env:
51-
CACHE_NUMBER: 102 # Increase this value to reset cache if environment.yml has not changed
51+
CACHE_NUMBER: 0 # Increase this value to reset cache if environment.yml has not changed
5252
id: cache
5353

5454
# The trick below is necessary because the generic environment file does not specify a Python version, and only

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For more details, see the rest of this document.
1414

1515
## Development environment
1616

17-
GeoUtils currently supports only Python versions of 3.8 and higher, see `environment.yml` for detailed dependencies.
17+
GeoUtils currently supports only Python versions of 3.9 and higher, see `environment.yml` for detailed dependencies.
1818

1919
### Setup
2020

dev-environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: geoutils-dev
22
channels:
33
- conda-forge
44
dependencies:
5-
- python>=3.8
5+
- python>=3.9
66
- geopandas>=0.12.0
77
- matplotlib
88
- pyproj

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: geoutils
22
channels:
33
- conda-forge
44
dependencies:
5-
- python>=3.8
5+
- python>=3.9
66
- geopandas>=0.12.0
77
- matplotlib
88
- pyproj

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ classifiers =
2020
Topic :: Scientific/Engineering :: Image Processing
2121
Topic :: Scientific/Engineering :: Information Analysis
2222
Programming Language :: Python
23-
Programming Language :: Python :: 3.8
2423
Programming Language :: Python :: 3.9
2524
Programming Language :: Python :: 3.10
25+
Programming Language :: Python :: 3.11
2626
Programming Language :: Python :: 3
2727
Topic :: Software Development :: Libraries :: Python Modules
2828
Typing :: Typed
@@ -34,7 +34,7 @@ packages = find:
3434
scripts = bin/geoviewer.py
3535
zip_safe = False # https://mypy.readthedocs.io/en/stable/installed_packages.html
3636
include_package_data = True
37-
python_requires = >=3.8
37+
python_requires = >=3.9
3838
# Avoid pinning dependencies in requirements.txt (which we don't do anyways, and we rely mostly on Conda)
3939
# (https://caremad.io/posts/2013/07/setup-vs-requirement/, https://github.com/pypa/setuptools/issues/1951)
4040
install_requires = file: requirements.txt

tests/test_raster.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88
import re
99
import tempfile
1010
import warnings
11+
from io import StringIO
1112
from tempfile import TemporaryFile
1213

1314
import matplotlib.pyplot as plt
1415
import numpy as np
1516
import pytest
1617
import rasterio as rio
1718
import xarray as xr
18-
from pylint import epylint
19+
from pylint.lint import Run
20+
from pylint.reporters.text import TextReporter
1921

2022
import geoutils as gu
2123
import geoutils.projtools as pt
@@ -2316,7 +2318,7 @@ def test_type_hints(self) -> None:
23162318
[
23172319
"'''Sample code that should conform to pylint's standards.'''", # Add docstring
23182320
"import geoutils as gu", # Import geoutils
2319-
"raster = gu.Raster(gu.datasets.get_path('landsat_B4'))", # Load a raster
2321+
"raster = gu.Raster(gu.examples.get_path('landsat_B4'))", # Load a raster
23202322
]
23212323
+ [ # The below statements should not raise a 'no-member' (E1101) error.
23222324
f"{attribute.upper()} = raster.{attribute}" for attribute in attributes
@@ -2328,9 +2330,11 @@ def test_type_hints(self) -> None:
23282330
with open(temp_path, "w") as outfile:
23292331
outfile.write(sample_code)
23302332

2331-
# Run pylint and parse the stdout as a string
2332-
lint_string = epylint.py_run(temp_path, return_std=True)[0].getvalue()
2333+
# Run pylint and parse the stdout as a string, only test
2334+
pylint_output = StringIO()
2335+
Run([temp_path], reporter=TextReporter(pylint_output), exit=False)
23332336

2337+
lint_string = pylint_output.getvalue()
23342338
print(lint_string) # Print the output for debug purposes
23352339

23362340
# Bad linting errors are defined here. Currently just "no-member" errors

0 commit comments

Comments
 (0)