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

add/fix missing tests annotations, cleanup requirements.txt #639

Closed
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
3 changes: 2 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ jobs:
sudo apt-add-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt-get -y update
sudo apt-get install -y gdal-bin python-tk libgdal-dev libproj-dev libgeos-dev
GDAL_VERSION=`gdalinfo --version | grep -Eo "[0-9]\.[0-9]\.[0-9]+"`
python -m pip install --upgrade pip wheel
pip install -r test/requirements.txt
pip install -e .[complete]
pip install gdal==${GDAL_VERSION} -e .[complete]
pip freeze

- name: Start containers
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
Changelog
#########

---------------------
2024.7.1 - 2024-07-TBD
---------------------

* core

* fix annotation of `test/test_io_raster.py::test_read_raster` and split it into `test/test_io_raster.py::test_read_raster` and `test/test_io_raster.py::test_read_remote_raster`

* packaging

* align dependencies `requirements.txt`, `requirements-dev.txt` with `pyproject.toml` with `hatch` package

* `hatch dep show requirements --all`
* `hatch dep show requirements --all >> requirements.txt`

* `requrements-dev.txt` still need to be managed manually when required

---------------------
2024.7.0 - 2024-07-24
Expand Down
2 changes: 1 addition & 1 deletion mapchete/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"VectorInput",
"VectorInputGroup",
]
__version__ = "2024.7.0"
__version__ = "2024.7.1"

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies = [
"distributed",
"fiona>=1.8.13.post1",
"fsspec",
"gdal>=3.6.4",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be here because we don't import GDALs python bindings anywhere in the package. All GDAL related stuff is "hidden" within the builds of fiona and rasterio.

"importlib-metadata",
"importlib-resources",
"numpy>=1.16",
Expand Down Expand Up @@ -79,6 +80,7 @@ profiling = [
]
s3 = [
"aiobotocore>=1.1.2",
"aioitertools>=0.7.0",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with aioitertools here. They are not a direct dependency of the package itself.

"boto3>=1.14.44",
"fsspec[s3]",
"s3fs!=2023.9.0",
Expand Down
49 changes: 30 additions & 19 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
aiobotocore>=1.1.2
aiohttp>=3.6.2
aiohttp
aioitertools>=0.7.0
boto3>=1.14.44
cachetools>=4.1.0
cachetools
click-plugins
click-spinner
click>=7.1.1
click-plugins>=1.1.1
click-spinner>=0.1.10
dask
distributed
python-dateutil
fiona>=1.8.13.post1
Flask>=1.1.2,<=3.0.0
Flask-RangeRequest>=0.0.2
flask-rangerequest
flask<3.0.0
fsspec
fsspec[http,s3]>=2023.12.0
importlib-metadata>=1.6.0
importlib-resources>=1.5.0
lxml>=4.5.0
matplotlib>=3.2.1
fsspec[http]
fsspec[s3]
gdal>=3.6.4
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why gdal and >=3.6.4?

importlib-metadata
importlib-resources
lxml
matplotlib
memray
numpy>=1.16
oyaml>=0.9
pyproj
oyaml
pydantic-geojson
pydantic-settings>=2.0.0
pydantic>=2.3.0
pydantic_settings>=2.0.0
retry>=0.9.2
pyproj
pystac-client>=0.7.2
pystac[urllib3]>=1.8.2
python-dateutil
rasterio>1.2.10
s3fs>2023.9.0
Shapely>=2.0.0
requests
retry
rtree
s3fs!=2023.9.0
shapely>=2.0.0
tilebench
tilematrix>=2022.12.0
tqdm>=4.46.0
werkzeug>=0.15
tqdm
werkzeug>=0.15
19 changes: 16 additions & 3 deletions test/test_io_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,9 +1056,6 @@ def test_read_raster_window_aws_s3(path, grid, pixelbuffer, zoom):
@pytest.mark.parametrize(
"path",
[
lazy_fixture("raster_4band_s3"),
lazy_fixture("raster_4band_http"),
lazy_fixture("raster_4band_secure_http"),
lazy_fixture("raster_4band"),
lazy_fixture("stacta"),
],
Expand All @@ -1069,6 +1066,22 @@ def test_read_raster(path):
assert not rr.data.mask.all()


@pytest.mark.aws_s3
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aws_s3 is only for tests which access s3://mapchete-test testdata. These fixtures only use data from our docker based integration setup, so marking them with integration is sufficient.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is one raster_4bands_s3 so this somewhat applies only for 1 param there, and would probably not split this even further

@pytest.mark.integration
@pytest.mark.parametrize(
"path",
[
lazy_fixture("raster_4band_s3"),
lazy_fixture("raster_4band_http"),
lazy_fixture("raster_4band_secure_http"),
],
)
def test_read_remote_raster(path):
rr = read_raster(path)
assert isinstance(rr, ReferencedRaster)
assert not rr.data.mask.all()


@pytest.mark.parametrize("masked", [True, False])
@pytest.mark.parametrize("grid", [lazy_fixture("s2_band_tile")])
def test_read_raster_args(s2_band, masked, grid):
Expand Down
Loading