Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 8 additions & 4 deletions sdk/planetarycomputer/azure-planetarycomputer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Release History

## 1.0.0b1 (2025-12-01)
## 1.0.0b1 (Unreleased)

- Initial version
### Features Added

### Other Changes
- Added models `AssetStatisticsResponse`, `BandStatisticsMap`, `ClassMapLegendResponse`, `QueryableDefinitionsResponse`, `TilerAssetGeoJson`, `TilerInfoMapResponse`.
- `get_collection_queryables`, `list_queryables` now return `QueryableDefinitionsResponse`.
- `get_class_map_legend` now returns `ClassMapLegendResponse`.

- Introduce azure-planetarycomputer.
### Breaking Changes

- Renamed `StacOperations.list_collections` to `StacOperations.get_collections`.
36 changes: 27 additions & 9 deletions sdk/planetarycomputer/azure-planetarycomputer/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,24 @@ The code generator already produces a file-level suppression on line 1 of each `
| `from collections.abc import MutableMapping` | `# pylint: disable=import-error` | Not resolvable in the pylint virtualenv |
| `return super().__new__(cls)` (in `Model.__new__`) | `# pylint: disable=no-value-for-parameter` | False positive - pylint cannot resolve the MRO for `__new__` |

> **Important:** After adding pylint suppressions, run `tox -e black` first - Black may reformat single-line imports into multi-line, which moves your `# pylint: disable` comments. If Black reformats the `_deserialize_xml` import into multiple lines, the `# pylint: disable=unused-import` comment must be on the `from ... import (` line, **not** on the closing `)` or the individual name line.
> **Critical: Run Black _before_ adding pylint suppressions.** Black reformats imports (turning single-line into multi-line), which changes where `# pylint: disable` comments must go. If you add suppressions first and then run Black, the comments may end up on the wrong line. The correct order is: (1) run `tox -e black`, (2) restore tests/samples, (3) add pylint suppressions.

### Sample Updates
> **Emitter version variability:** The emitter may add different inline suppressions to different functions. For example, `build_data_get_mosaics_tile_json_request` gets the full `too-many-locals,too-many-branches,too-many-statements`, while `build_data_get_mosaics_tile_request` only gets `too-many-locals`. Always check the pylint output to see if additional suppressions are needed beyond what the emitter provides.

### Sphinx Docstring Fixes

The code generator sometimes produces RST formatting bugs in docstrings (e.g., code block terminators merged with following text, incorrect bullet continuation indentation). These must be fixed in **both** sync and async `_operations.py`. Run `tox -e sphinx` after each regeneration — Sphinx treats warnings as errors, so any formatting issues will cause a build failure.

### Sample and Test Updates

If the TypeSpec renames or removes API operations, the hand-written samples under `samples/` and `samples/async/` must be updated to match. MyPy and Pyright (which also check samples) will catch these as type errors.

**Test updates require special care:**

- **Do NOT rename test methods** even if the SDK method they test was renamed. Test method names determine recording file paths. Renaming a test method breaks the recording lookup — only change the API call *inside* the test body.
- **Update type assertions** if an API's return type changes (e.g., from `dict` to a typed model). The test assertions must match the new return type.
- **Run tests in playback mode** (`pytest tests/ -v`) after all fixes to verify all tests pass.

---

## Local Validation
Expand Down Expand Up @@ -269,15 +281,21 @@ Each file has a sync and async variant (e.g., `test_00_stac_collection.py` and `

After running `npx tsp-client update`:

- [ ] Restore `tests/` and `samples/` - `git checkout -- tests/ samples/`
- [ ] Delete `generated_samples/` and `generated_tests/`
- [ ] Restore `tests/` and `samples/` — `git checkout -- tests/ samples/`
- [ ] Run `tox -e black` — formatting (MUST be done before adding pylint suppressions)
- [ ] Restore `tests/` and `samples/` again if Black modified them
- [ ] Add inline `# pylint: disable=import-error` to `MutableMapping` imports (3 files)
- [ ] Add `# pylint: disable=unused-import` on the `from ... import (` line for `_deserialize_xml` (2 files)
- [ ] Add `# pylint: disable=too-many-locals,too-many-branches,too-many-statements` inline on `build_data_get_mosaics_tile_request` (sync `_operations.py` only)
- [ ] Add `# pylint: disable=too-many-locals,too-many-branches,too-many-statements` inline on `build_data_get_mosaics_tile_*` functions (check emitter output — may need to add missing suppressions)
- [ ] Add inline `# pylint: disable=no-value-for-parameter` to `Model.__new__` in `model_base.py`
- [ ] Run `tox -e black` - formatting (may reformat imports; re-check pylint comment placement)
- [ ] Restore `tests/` and `samples/` again if Black modified them
- [ ] Run `tox -e pylint` - linting (should score 10.00/10)
- [ ] Run `tox -e sphinx` - documentation
- [ ] Run `tox -e mypy` and `tox -e pyright` - type checking (will catch renamed/removed APIs in samples)
- [ ] Fix any Sphinx docstring issues (both sync and async `_operations.py`) — check `tox -e sphinx` output
- [ ] Run `tox -e pylint` — linting (should score 10.00/10)
- [ ] Run `tox -e sphinx` — documentation (should build with 0 warnings)
- [ ] Run `tox -e mypy` and `tox -e pyright` — type checking (will catch renamed/removed APIs in samples)
- [ ] Update samples if any operations were renamed or removed
- [ ] Update tests: fix API calls (not method names!), update `isinstance` checks for changed return types
- [ ] Run `pytest tests/ -v` in playback mode — should be 202 passed
- [ ] Run `tox -e apistub` — API stub generation
- [ ] Re-record tests if HTTP request/response data changed (see Testing section)
- [ ] Update `CHANGELOG.md` with a release date if preparing a release
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"CrossLanguagePackageId": "Microsoft.PlanetaryComputer",
"CrossLanguageDefinitionId": {
"azure.planetarycomputer.models.AssetMetadata": "Microsoft.PlanetaryComputer.AssetMetadata",
"azure.planetarycomputer.models.AssetStatisticsResponse": "Microsoft.PlanetaryComputer.AssetStatisticsResponse",
"azure.planetarycomputer.models.BandStatistics": "Microsoft.PlanetaryComputer.BandStatistics",
"azure.planetarycomputer.models.BandStatisticsMap": "Microsoft.PlanetaryComputer.BandStatisticsMap",
"azure.planetarycomputer.models.ClassMapLegendResponse": "ClassMapLegendResponse",
"azure.planetarycomputer.models.DefaultLocation": "Microsoft.PlanetaryComputer.DefaultLocation",
"azure.planetarycomputer.models.ErrorInfo": "Microsoft.PlanetaryComputer.ErrorInfo",
"azure.planetarycomputer.models.Feature": "Feature",
Expand All @@ -27,6 +30,7 @@
"azure.planetarycomputer.models.PartitionType": "Microsoft.PlanetaryComputer.PartitionType",
"azure.planetarycomputer.models.Point": "Point",
"azure.planetarycomputer.models.Polygon": "Polygon",
"azure.planetarycomputer.models.QueryableDefinitionsResponse": "Microsoft.PlanetaryComputer.QueryableDefinitionsResponse",
"azure.planetarycomputer.models.RenderOption": "Microsoft.PlanetaryComputer.RenderOption",
"azure.planetarycomputer.models.RenderOptionCondition": "Microsoft.PlanetaryComputer.RenderOptionCondition",
"azure.planetarycomputer.models.RenderOptionLegend": "Microsoft.PlanetaryComputer.RenderOptionLegend",
Expand Down Expand Up @@ -66,9 +70,11 @@
"azure.planetarycomputer.models.TileMatrix": "TileMatrix",
"azure.planetarycomputer.models.TileMatrixSet": "TileMatrixSet",
"azure.planetarycomputer.models.TileMatrixSetBoundingBox": "TileMatrixSetBoundingBox",
"azure.planetarycomputer.models.TilerAssetGeoJson": "Microsoft.PlanetaryComputer.TilerAssetGeoJson",
"azure.planetarycomputer.models.TilerCoreModelsResponsesPoint": "Microsoft.PlanetaryComputer.TilerCoreModelsResponsesPoint",
"azure.planetarycomputer.models.TilerInfo": "Microsoft.PlanetaryComputer.TilerInfo",
"azure.planetarycomputer.models.TilerInfoGeoJsonFeature": "Microsoft.PlanetaryComputer.TilerInfoGeoJsonFeature",
"azure.planetarycomputer.models.TilerInfoMapResponse": "Microsoft.PlanetaryComputer.TilerInfoMapResponse",
"azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse": "Microsoft.PlanetaryComputer.TilerMosaicSearchRegistrationResponse",
"azure.planetarycomputer.models.TilerStacItemStatistics": "Microsoft.PlanetaryComputer.TilerStacItemStatistics",
"azure.planetarycomputer.models.TilerStacSearchDefinition": "Microsoft.PlanetaryComputer.TilerStacSearchDefinition",
Expand Down Expand Up @@ -162,8 +168,8 @@
"azure.planetarycomputer.aio.operations.StacOperations.begin_delete_collection": "Customizations.Stac.deleteCollection",
"azure.planetarycomputer.operations.StacOperations.get_collection": "Customizations.Stac.getCollection",
"azure.planetarycomputer.aio.operations.StacOperations.get_collection": "Customizations.Stac.getCollection",
"azure.planetarycomputer.operations.StacOperations.list_collections": "Customizations.Stac.listCollections",
"azure.planetarycomputer.aio.operations.StacOperations.list_collections": "Customizations.Stac.listCollections",
"azure.planetarycomputer.operations.StacOperations.get_collections": "Customizations.Stac.getCollections",
"azure.planetarycomputer.aio.operations.StacOperations.get_collections": "Customizations.Stac.getCollections",
"azure.planetarycomputer.operations.StacOperations.get_partition_type": "Customizations.Stac.getPartitionType",
"azure.planetarycomputer.aio.operations.StacOperations.get_partition_type": "Customizations.Stac.getPartitionType",
"azure.planetarycomputer.operations.StacOperations.replace_partition_type": "Customizations.Stac.replacePartitionType",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@
from typing import Union

BandMetadataElement = Union[str, dict[str, str]]
IntervalLegendsElement = Union[list[int], dict[str, str]]
Loading