diff --git a/python/docs/api/store/aws.md b/python/docs/api/store/aws.md new file mode 100644 index 0000000..d72fbc4 --- /dev/null +++ b/python/docs/api/store/aws.md @@ -0,0 +1,11 @@ +# AWS S3 + +::: async_tiff.store.S3Store +::: async_tiff.store.S3ConfigInput + options: + show_if_no_docstring: true +::: async_tiff.store.S3Config + options: + show_if_no_docstring: true +::: async_tiff.store.S3Credential +::: async_tiff.store.S3CredentialProvider diff --git a/python/docs/api/store/azure.md b/python/docs/api/store/azure.md new file mode 100644 index 0000000..eec88e9 --- /dev/null +++ b/python/docs/api/store/azure.md @@ -0,0 +1,14 @@ +# Microsoft Azure + +::: async_tiff.store.AzureStore +::: async_tiff.store.AzureAccessKey +::: async_tiff.store.AzureConfigInput + options: + show_if_no_docstring: true +::: async_tiff.store.AzureConfig + options: + show_if_no_docstring: true +::: async_tiff.store.AzureSASToken +::: async_tiff.store.AzureBearerToken +::: async_tiff.store.AzureCredential +::: async_tiff.store.AzureCredentialProvider diff --git a/python/docs/api/store/config.md b/python/docs/api/store/config.md new file mode 100644 index 0000000..bba4bbb --- /dev/null +++ b/python/docs/api/store/config.md @@ -0,0 +1,5 @@ +# Configuration + +::: async_tiff.store.ClientConfig +::: async_tiff.store.BackoffConfig +::: async_tiff.store.RetryConfig diff --git a/python/docs/api/store/gcs.md b/python/docs/api/store/gcs.md new file mode 100644 index 0000000..d395e33 --- /dev/null +++ b/python/docs/api/store/gcs.md @@ -0,0 +1,11 @@ +# Google Cloud Storage + +::: async_tiff.store.GCSStore +::: async_tiff.store.GCSConfigInput + options: + show_if_no_docstring: true +::: async_tiff.store.GCSConfig + options: + show_if_no_docstring: true +::: async_tiff.store.GCSCredential +::: async_tiff.store.GCSCredentialProvider diff --git a/python/docs/api/store/http.md b/python/docs/api/store/http.md new file mode 100644 index 0000000..dbeff69 --- /dev/null +++ b/python/docs/api/store/http.md @@ -0,0 +1,3 @@ +# HTTP + +::: async_tiff.store.HTTPStore diff --git a/python/docs/api/store/index.md b/python/docs/api/store/index.md new file mode 100644 index 0000000..f3b588d --- /dev/null +++ b/python/docs/api/store/index.md @@ -0,0 +1,4 @@ +# ObjectStore + +::: async_tiff.store.from_url +::: async_tiff.store.ObjectStore diff --git a/python/docs/api/store/local.md b/python/docs/api/store/local.md new file mode 100644 index 0000000..ec6ba35 --- /dev/null +++ b/python/docs/api/store/local.md @@ -0,0 +1,3 @@ +# Local + +::: async_tiff.store.LocalStore diff --git a/python/docs/api/store/memory.md b/python/docs/api/store/memory.md new file mode 100644 index 0000000..11bb15f --- /dev/null +++ b/python/docs/api/store/memory.md @@ -0,0 +1,3 @@ +# Memory + +::: async_tiff.store.MemoryStore diff --git a/python/docs/assets/logo_no_text.png b/python/docs/assets/logo_no_text.png new file mode 100644 index 0000000..f9f3773 Binary files /dev/null and b/python/docs/assets/logo_no_text.png differ diff --git a/python/docs/index.md b/python/docs/index.md new file mode 120000 index 0000000..32d46ee --- /dev/null +++ b/python/docs/index.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/python/docs/overrides/main.html b/python/docs/overrides/main.html new file mode 100644 index 0000000..03a9bdc --- /dev/null +++ b/python/docs/overrides/main.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block content %} +{% if page.nb_url %} + + {% include ".icons/material/download.svg" %} + +{% endif %} + +{{ super() }} +{% endblock content %} + +{% block outdated %} + You're not viewing the latest version. + + Click here to go to latest. + +{% endblock %} diff --git a/python/docs/overrides/stylesheets/extra.css b/python/docs/overrides/stylesheets/extra.css new file mode 100644 index 0000000..58a42cd --- /dev/null +++ b/python/docs/overrides/stylesheets/extra.css @@ -0,0 +1,43 @@ +:root, +[data-md-color-scheme="default"] { + /* --md-heading-font: "Oswald"; */ + --md-primary-fg-color: #cf3f02; + --md-default-fg-color: #443f3f; + --boxShadowD: 0px 12px 24px 0px rgba(68, 63, 63, 0.08), + 0px 0px 4px 0px rgba(68, 63, 63, 0.08); +} +body { + margin: 0; + padding: 0; + /* font-size: 16px; */ +} +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: var(--md-heading-font); + font-weight: bold; +} +.md-typeset h1, +.md-typeset h2 { + font-weight: normal; + color: var(--md-default-fg-color); +} +.md-typeset h3, +.md-typeset h4 { + font-weight: bold; + color: var(--md-default-fg-color); +} +.md-button, +.md-typeset .md-button { + font-family: var(--md-heading-font); +} +.md-content .supheading { + font-family: var(--md-heading-font); + text-transform: uppercase; + color: var(--md-primary-fg-color); + font-size: 0.75rem; + font-weight: bold; +} diff --git a/python/mkdocs.yml b/python/mkdocs.yml new file mode 100644 index 0000000..26d04d8 --- /dev/null +++ b/python/mkdocs.yml @@ -0,0 +1,149 @@ +site_name: async-tiff +repo_name: developmentseed/async-tiff +repo_url: https://github.com/developmentseed/async-tiff +site_description: A fast, low-level async TIFF reader powered by Rust. +site_author: Development Seed +# Note: trailing slash recommended with mike: +# https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/#publishing-a-new-version +site_url: https://developmentseed.org/async-tiff/ +docs_dir: docs + +extra: + social: + - icon: "fontawesome/brands/github" + link: "https://github.com/developmentseed" + - icon: "fontawesome/brands/twitter" + link: "https://twitter.com/developmentseed" + - icon: "fontawesome/brands/linkedin" + link: "https://www.linkedin.com/company/development-seed" + version: + alias: true + provider: mike + +nav: + - "index.md" + - API Reference: + - async-tiff.store: + - api/store/index.md + - api/store/aws.md + - api/store/gcs.md + - api/store/azure.md + - api/store/http.md + - api/store/local.md + - api/store/memory.md + - api/store/config.md + # - API Reference: + # - api/rtree.md + # - api/kdtree.md + # - Changelog: CHANGELOG.md + +watch: + - python + - docs + +theme: + language: en + name: material + custom_dir: docs/overrides + logo: assets/logo_no_text.png + palette: + # Palette toggle for automatic mode + - media: "(prefers-color-scheme)" + toggle: + icon: material/brightness-auto + name: Switch to light mode + + # Palette toggle for light mode + - media: "(prefers-color-scheme: light)" + primary: default + accent: deep orange + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Palette toggle for dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: default + accent: deep orange + toggle: + icon: material/brightness-4 + name: Switch to system preference + + font: + text: Roboto + code: Roboto Mono + + features: + - content.code.annotate + - content.code.copy + - navigation.indexes + - navigation.instant + - navigation.tracking + - search.suggest + - search.share + +extra_css: + - overrides/stylesheets/extra.css + +plugins: + - search + # - social + - mike: + alias_type: "copy" + canonical_version: "latest" + - mkdocstrings: + enable_inventory: true + handlers: + python: + paths: [python] + options: + # We set allow_inspection: false to ensure that all docstrings come + # from the pyi files, not the Rust-facing doc comments. + allow_inspection: false + docstring_section_style: list + docstring_style: google + line_length: 80 + separate_signature: true + show_root_heading: true + show_signature_annotations: true + show_source: false + show_symbol_type_toc: true + signature_crossrefs: true + extensions: + - griffe_inherited_docstrings + + import: + - https://docs.python.org/3/objects.inv + - https://developmentseed.org/obstore/latest/objects.inv + +# https://github.com/developmentseed/titiler/blob/50934c929cca2fa8d3c408d239015f8da429c6a8/docs/mkdocs.yml#L115-L140 +markdown_extensions: + - admonition + - attr_list + - codehilite: + guess_lang: false + - def_list + - footnotes + - md_in_html + - pymdownx.arithmatex + - pymdownx.betterem + - pymdownx.caret: + insert: false + - pymdownx.details + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.escapeall: + hardbreak: true + nbsp: true + - pymdownx.magiclink: + hide_protocol: true + repo_url_shortener: true + - pymdownx.smartsymbols + - pymdownx.superfences + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.tilde + - toc: + permalink: true diff --git a/python/pyproject.toml b/python/pyproject.toml index a9282b0..d0651eb 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -20,16 +20,19 @@ python-source = "python" [tool.uv] dev-dependencies = [ + # To enable following symlinks for pyi files + "griffe>=1.6.0", "griffe-inherited-docstrings>=1.0.1", "ipykernel>=6.29.5", "maturin>=1.7.4", "mike>=2.1.3", - "mkdocs-material[imaging]>=9.5.40", + "mkdocs-material[imaging]>=9.6.3", "mkdocs>=1.6.1", "mkdocstrings-python>=1.13.0", "mkdocstrings>=0.27.0", "numpy>=1", "pip>=24.2", + "pytest-asyncio>=0.24.0", "pytest>=8.3.3", "ruff>=0.8.4", ] diff --git a/python/uv.lock b/python/uv.lock index 852f77b..ad43a46 100644 --- a/python/uv.lock +++ b/python/uv.lock @@ -29,6 +29,7 @@ source = { editable = "." } [package.dev-dependencies] dev = [ + { name = "griffe" }, { name = "griffe-inherited-docstrings" }, { name = "ipykernel" }, { name = "maturin" }, @@ -41,6 +42,7 @@ dev = [ { name = "numpy", version = "2.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, { name = "pip" }, { name = "pytest" }, + { name = "pytest-asyncio" }, { name = "ruff" }, ] @@ -48,17 +50,19 @@ dev = [ [package.metadata.requires-dev] dev = [ + { name = "griffe", specifier = ">=1.6.0" }, { name = "griffe-inherited-docstrings", specifier = ">=1.0.1" }, { name = "ipykernel", specifier = ">=6.29.5" }, { name = "maturin", specifier = ">=1.7.4" }, { name = "mike", specifier = ">=2.1.3" }, { name = "mkdocs", specifier = ">=1.6.1" }, - { name = "mkdocs-material", extras = ["imaging"], specifier = ">=9.5.40" }, + { name = "mkdocs-material", extras = ["imaging"], specifier = ">=9.6.3" }, { name = "mkdocstrings", specifier = ">=0.27.0" }, { name = "mkdocstrings-python", specifier = ">=1.13.0" }, { name = "numpy", specifier = ">=1" }, { name = "pip", specifier = ">=24.2" }, { name = "pytest", specifier = ">=8.3.3" }, + { name = "pytest-asyncio", specifier = ">=0.24.0" }, { name = "ruff", specifier = ">=0.8.4" }, ] @@ -376,14 +380,14 @@ wheels = [ [[package]] name = "griffe" -version = "1.5.7" +version = "1.6.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/59/80/13b6456bfbf8bc854875e58d3a3bad297ee19ebdd693ce62a10fab007e7a/griffe-1.5.7.tar.gz", hash = "sha256:465238c86deaf1137761f700fb343edd8ffc846d72f6de43c3c345ccdfbebe92", size = 391503 } +sdist = { url = "https://files.pythonhosted.org/packages/a0/1a/d467b93f5e0ea4edf3c1caef44cfdd53a4a498cb3a6bb722df4dd0fdd66a/griffe-1.6.0.tar.gz", hash = "sha256:eb5758088b9c73ad61c7ac014f3cdfb4c57b5c2fcbfca69996584b702aefa354", size = 391819 } wheels = [ - { url = "https://files.pythonhosted.org/packages/76/67/b43330ed76f96be098c165338d47ccb952964ed77ba1d075247fbdf05c04/griffe-1.5.7-py3-none-any.whl", hash = "sha256:4af8ec834b64de954d447c7b6672426bb145e71605c74a4e22d510cc79fe7d8b", size = 128294 }, + { url = "https://files.pythonhosted.org/packages/bf/02/5a22bc98d0aebb68c15ba70d2da1c84a5ef56048d79634e5f96cd2ba96e9/griffe-1.6.0-py3-none-any.whl", hash = "sha256:9f1dfe035d4715a244ed2050dfbceb05b1f470809ed4f6bb10ece5a7302f8dd1", size = 128470 }, ] [[package]] @@ -1222,6 +1226,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, ] +[[package]] +name = "pytest-asyncio" +version = "0.25.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f2/a8/ecbc8ede70921dd2f544ab1cadd3ff3bf842af27f87bbdea774c7baa1d38/pytest_asyncio-0.25.3.tar.gz", hash = "sha256:fc1da2cf9f125ada7e710b4ddad05518d4cee187ae9412e9ac9271003497f07a", size = 54239 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/67/17/3493c5624e48fd97156ebaec380dcaafee9506d7e2c46218ceebbb57d7de/pytest_asyncio-0.25.3-py3-none-any.whl", hash = "sha256:9e89518e0f9bd08928f97a3482fdc4e244df17529460bc038291ccaf8f85c7c3", size = 19467 }, +] + [[package]] name = "python-dateutil" version = "2.9.0.post0"