Skip to content

Commit

Permalink
Try to comply wiht PEP503
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanjmcdougall committed Feb 27, 2025
1 parent 5cf8821 commit b51c3be
Show file tree
Hide file tree
Showing 16 changed files with 1,263 additions and 1,143 deletions.
105 changes: 105 additions & 0 deletions docs/basemap/index.html

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions docs/cartopy/index.html

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions docs/cftime/index.html

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions docs/fiona/index.html

Large diffs are not rendered by default.

125 changes: 125 additions & 0 deletions docs/gdal/index.html

Large diffs are not rendered by default.

1,122 changes: 13 additions & 1,109 deletions docs/index.html

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions docs/netcdf4/index.html

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions docs/pygeos/index.html

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions docs/pyproj/index.html

Large diffs are not rendered by default.

104 changes: 104 additions & 0 deletions docs/rasterio/index.html

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions docs/rtree/index.html

Large diffs are not rendered by default.

113 changes: 113 additions & 0 deletions docs/shapely/index.html

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ authors = [
requires-python = ">=3.13"
classifiers = [ "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.13" ]
dependencies = [
"gdal>=3.10.1",
"httpx>=0.28.1",
]

Expand Down Expand Up @@ -44,13 +43,19 @@ filterwarnings = [ "error" ]

[tool.uv]
default-groups = [ "test", "dev" ]
find-links = [ "https://nathanjmcdougall.github.io/geospatial-wheels-windows-flatlinks" ]

[tool.uv.sources]
gdal = [
{ index = "large_image_wheels" },
# { index = "large_image_wheels", marker = "sys_platform == 'linux'" },
{ index = "geospatial_wheels", marker = "sys_platform == 'win32'" },
]

# [[tool.uv.index]]
# name = "large_image_wheels"
# url = "https://girder.github.io/large_image_wheels"
# explicit = true

[[tool.uv.index]]
name = "large_image_wheels"
url = "https://girder.github.io/large_image_wheels"
name = "geospatial_wheels"
url = "https://nathanjmcdougall.github.io/geospatial-wheels-windows-flatlinks"
explicit = true
4 changes: 4 additions & 0 deletions tests/test_install.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import pytest


@pytest.mark.skip(reason="Not ready to pass this test yet.")
def test_importable() -> None:
import osgeo

Expand Down
85 changes: 71 additions & 14 deletions tests/test_up_to_date.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import os
from pathlib import Path

import httpx
import pytest

PACKAGE_NAMES = [
"basemap",
"cartopy",
"cftime",
"fiona",
"gdal",
"netcdf4",
"pygeos",
"pyproj",
"rasterio",
"rtree",
"shapely",
]


def _get_whl_urls() -> list[str]:
Expand All @@ -20,40 +36,81 @@ def _get_whl_urls() -> list[str]:
return whl_urls


def test_up_to_date(tmp_path: Path) -> None:
def _get_package_name(whl_url: str) -> str:
return Path(whl_url).name.split("-")[0].lower()


@pytest.mark.skipif(not os.getenv("CI"), reason="API rate limits")
def test_index_up_to_date(tmp_path: Path) -> None:
"""Save asset URLs to a text file, filtering for those containing 'GDAL'."""

whl_urls = _get_whl_urls()
package_names = sorted({_get_package_name(whl_url) for whl_url in whl_urls})

assert package_names == PACKAGE_NAMES

html_contents = (
"""\
<!DOCTYPE html>
<html>
<body>
"""
+ "\n".join(
[
f""" <a href="/{whl_name}/">{whl_name}</a>"""
for whl_name in package_names
]
)
+ """\
</body>
</html>
"""
)

<head>
<title>geospatial-wheels-windows-flatlinks</title>
</head>
html_file = tmp_path / "index.html"
html_file.write_text(html_contents)
assert (
html_file.read_text()
== (Path(__file__).parent.parent / "docs" / "index.html").read_text()
)


@pytest.mark.skipif(not os.getenv("CI"), reason="API rate limits")
@pytest.mark.parametrize("package_name", PACKAGE_NAMES)
def test_package_versions_up_to_date(package_name: str, tmp_path: Path) -> None:
"""Save asset URLs to a text file, filtering for those containing 'GDAL'."""
whl_urls = [
whl_url
for whl_url in _get_whl_urls()
if _get_package_name(whl_url) == package_name
]

html_contents = (
f"""\
<!DOCTYPE html>
<html>
<head><title>{package_name}</title></head>
<body>
<h1>geospatial-wheels-windows-flatlinks</h1>
<pre>
<h1>{package_name}</h1>
"""
+ "\n".join(
[
f"""<a href="{whl_url}" download="{Path(whl_url).name}">{Path(whl_url).name}</a>"""
f""" <a href="{whl_url}" download="{Path(whl_url).name}">{Path(whl_url).name}</a>"""
for whl_url in whl_urls
]
)
+ """\
</pre>
</body>
</html>"""
</html>
"""
)

html_file = tmp_path / "index.html"
html_file.write_text(html_contents)

assert (
html_file.read_text()
== (Path(__file__).parent.parent / "docs" / "index.html").read_text()
)
pkg_dir = Path(__file__).parent.parent / "docs" / package_name

if not pkg_dir.exists():
pkg_dir.mkdir(parents=True)

assert html_file.read_text() == (pkg_dir / "index.html").read_text()
16 changes: 1 addition & 15 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b51c3be

Please sign in to comment.