Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
93 changes: 5 additions & 88 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ on:
push:
branches:
- main
- "0.3"
- "0.4"
- "0.5"
- "1.0"
- "2.0"
pull_request:
merge_group:

Expand All @@ -23,104 +18,26 @@ jobs:
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
os:
- ubuntu-latest
- windows-latest
# - windows-latest
- macos-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
- name: Sync
run: uv sync --all-extras
- name: Lint
- uses: j178/prek-action@v1
if: runner.os != 'Windows'
run: uv run pre-commit run --all-files
- name: Test on windows
if: runner.os == 'Windows'
shell: bash
env:
TMPDIR: 'D:\\a\\_temp'
run: uv run pytest tests
run: uv run pytest
- name: Test
if: runner.os != 'Windows'
run: uv run pytest tests --block-network --record-mode=none

coverage:
name: coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
- name: Install with dependencies
run: uv sync --all-extras
- name: Run coverage with orjson
run: uv run pytest tests --cov
- name: Uninstall orjson
run: uv pip uninstall orjson
- name: Run coverage without orjson, appending results
run: uv run pytest tests --cov --cov-append
- name: Prepare ./coverage.xml
# Ignore the configured fail-under to ensure we upload the coverage report. We
# will trigger a failure for coverage drops in a later job
run: uv run coverage xml --fail-under 0
- name: Upload All coverage to Codecov
uses: codecov/codecov-action@v5
if: ${{ env.GITHUB_REPOSITORY }} == 'stac-utils/pystac'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: false
- name: Check for coverage drop
# This will use the configured fail-under, causing this job to fail if the
# coverage drops.
run: uv run coverage report

without-orjson:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
- name: Sync
run: uv sync
- name: Uninstall orjson
run: uv pip uninstall orjson
- name: Run tests
run: uv run pytest tests

check-benchmarks:
# This checks to make sure any API changes haven't broken any of the
# benchmarks. It doesn't do any actual benchmarking, since (IMO) that's not
# appropriate for CI on Github actions.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.10"
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Sync
run: uv sync
- name: Set asv machine
run: uv run asv machine --yes
- name: Check benchmarks
run: uv run asv run -a repeat=1 -a rounds=1 HEAD

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
- name: Install pandoc
run: sudo apt-get install pandoc
- name: Sync
run: uv sync --group docs
- name: Check docs
run: uv run make -C docs html SPHINXOPTS="-W --keep-going -n"
run: uv run pytest
61 changes: 15 additions & 46 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,19 @@
# Configuration file for pre-commit (https://pre-commit.com/).
# Please run `pre-commit run --all-files` when adding or changing entries.

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: pyupgrade
args:
- "--py310-plus"

- repo: local
- id: codespell
types_or:
- jupyter
- markdown
- python
- shell
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.9
hooks:
- id: ruff
name: ruff
entry: ruff check --force-exclude --fix --exit-non-zero-on-fix
language: system
types_or: [python, pyi, jupyter]
require_serial: true

- id: ruff-check
- id: ruff-format
name: ruff-format
entry: ruff format --force-exclude
language: system
stages: [pre-commit]
types_or: [python, pyi, jupyter]
require_serial: true

- id: codespell
name: codespell
entry: codespell
language: system
stages: [pre-commit]
types_or: [jupyter, markdown, python, shell]

- id: doc8
name: doc8
entry: doc8
language: system
files: \.rst$
require_serial: true

- id: mypy
name: mypy
entry: mypy
args: [--no-incremental]
language: system
stages: [pre-commit]
types: [python]
require_serial: true
- repo: https://github.com/DetachHead/basedpyright-prek-mirror
rev: 1.36.1
hooks:
- id: basedpyright
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10
3.12
26 changes: 0 additions & 26 deletions .readthedocs.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

85 changes: 1 addition & 84 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1 @@
# PySTAC

[![Build Status](https://github.com/stac-utils/pystac/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/stac-utils/pystac/actions/workflows/continuous-integration.yml)
[![PyPI version](https://badge.fury.io/py/pystac.svg)](https://badge.fury.io/py/pystac)
[![Conda (channel only)](https://img.shields.io/conda/vn/conda-forge/pystac)](https://anaconda.org/conda-forge/pystac)
[![Documentation](https://readthedocs.org/projects/pystac/badge/?version=latest)](https://pystac.readthedocs.io/en/latest/)
[![codecov](https://codecov.io/gh/stac-utils/pystac/branch/main/graph/badge.svg)](https://codecov.io/gh/stac-utils/pystac)
[![Gitter](https://badges.gitter.im/SpatioTemporal-Asset-Catalog/python.svg)](https://gitter.im/SpatioTemporal-Asset-Catalog/python?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

PySTAC is a library for working with the [SpatioTemporal Asset Catalog](https://stacspec.org) specification in Python 3.

## Installation

### Install from PyPi (recommended)

```shell
python -m pip install pystac
```

If you would like to enable the validation feature utilizing the
[jsonschema](https://pypi.org/project/jsonschema/) project, install with the optional
`validation` requirements:

```shell
python -m pip install 'pystac[validation]'
```

If you would like to use the [`orjson`](https://pypi.org/project/orjson/) instead of the
standard `json` library for JSON serialization/deserialization, install with the
optional `orjson` requirements:

```shell
python -m pip install 'pystac[orjson]'
```

If you would like to use a custom `RetryStacIO` class for automatically retrying
network requests when reading with PySTAC, or if you have non-ASCII characters in
your urls you'll need
[`urllib3`](https://urllib3.readthedocs.io/en/stable/):

```shell
python -m pip install 'pystac[urllib3]'
```

If you are using jupyter notebooks and want to enable pretty display of pystac
objects you'll need [`jinja2`](https://pypi.org/project/Jinja2/)

```shell
python -m pip install 'pystac[jinja2]'
```

### Install from source

```shell
git clone https://github.com/stac-utils/pystac.git
cd pystac
python -m pip install .
```

See the [installation page](https://pystac.readthedocs.io/en/latest/installation.html)
for more options.

## Documentation

See the [documentation page](https://pystac.readthedocs.io/en/latest/) for the latest docs.

## Developing

See [contributing docs](https://pystac.readthedocs.io/en/latest/contributing.html)
for details on contributing to this project.

## Running the quickstart and tutorials

There is a quickstart and tutorials written as jupyter notebooks in the `docs/tutorials` folder.
To run the notebooks, run a jupyter notebook with the `docs` directory as the notebook directory:

```shell
jupyter notebook --ip 0.0.0.0 --port 8888 --notebook-dir=docs
```

You can then navigate to the notebooks and execute them.

Requires [Jupyter](https://jupyter.org/) be installed.
# pystac
29 changes: 0 additions & 29 deletions asv.conf.json

This file was deleted.

6 changes: 0 additions & 6 deletions benchmarks/_base.py

This file was deleted.

16 changes: 0 additions & 16 deletions benchmarks/_util.py

This file was deleted.

Loading
Loading