Skip to content

Commit 139f3af

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix-mlm-artefact-v2
2 parents ec4430c + 70b0af5 commit 139f3af

23 files changed

+1575
-2115
lines changed

.dockerignore

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/publish.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424
- name: Set up Python
25-
uses: actions/setup-python@v5.2.0
25+
uses: actions/setup-python@v5.3.0
2626
with:
2727
python-version: "3.10"
28-
- name: Install poetry
29-
run: make poetry-install
28+
- name: Install uv
29+
run: make setup
3030
- name: Publish stac-model to PyPI
3131
run: |
32-
poetry build
33-
poetry publish --username __token__ --password ${{ secrets.PYPI_SECRET }}
32+
uv build
33+
uv publish --username __token__ --password ${{ secrets.PYPI_SECRET }}

.github/workflows/stac-model.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414
- name: Set up Python ${{ matrix.python-version }}
15-
uses: actions/setup-python@v5.2.0
15+
uses: actions/setup-python@v5.3.0
1616
with:
1717
python-version: ${{ matrix.python-version }}
1818

19-
- name: Install poetry
20-
run: make poetry-install
19+
- name: Install uv
20+
run: make setup
2121

2222
- name: Set up cache
23-
uses: actions/cache@v4.0.2
23+
uses: actions/cache@v4.1.2
2424
with:
2525
path: .venv
26-
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}
26+
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('uv.lock') }}
2727
- name: Install dependencies
2828
run: make install-dev
2929

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ jobs:
1111
- uses: actions/checkout@v4
1212
- run: |
1313
npm install
14+
npm list
1415
npm test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
requirements*.txt
2+
13
### ArchLinuxPackages ###
24
*.tar
35
*.tar.*

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
default_language_version:
2-
python: python3.10
2+
python: python3
33

44
default_stages: [commit, push]
5-
65
repos:
76
- repo: https://github.com/pre-commit/pre-commit-hooks
87
rev: v4.5.0

CONTRIBUTING.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@
22

33
## Project setup
44

5-
1. If you don't have `Poetry` installed run:
5+
1. If you don't have `uv` installed run:
66

77
```bash
8-
make poetry-install
8+
make setup
99
```
1010

11-
> This installs Poetry as a [standalone application][poetry-install]. <br>
12-
> For more details, see also the [Poetry Documentation][poetry-docs]. <br>
13-
> If you prefer, you can simply install it inside your virtual environment.
11+
> This installs `uv` as a [standalone application][uv-install]. <br>
12+
> For more details, see also the [`uv` documentation][uv-docs]. <br>
1413
15-
2. Initialize project dependencies with poetry and install `pre-commit` hooks:
14+
2. Initialize project dependencies with `uv` and install `pre-commit` hooks:
1615

1716
```bash
1817
make install-dev
1918
make pre-commit-install
2019
```
2120

21+
This will install project dependencies into the currently active environment. If you would like to
22+
use uv's default behavior of managing a project-scoped environment, use `uv` commands directly to
23+
install dependencies. `uv sync` will install dependencies and dev dependencies in `.venv` and update the `uv.lock`.
24+
2225
## PR submission
2326

2427
Before submitting your code please do the following steps:
@@ -85,7 +88,7 @@ git push -u origin your-branch
8588
### Building a new version of `stac-model`
8689

8790
- Apply any relevant changes and `CHANGELOG.md` entries in a PR that modifies `stac-model`.
88-
- Bump the version with `poetry version <version>`.
91+
- Bump the version with `bumpversion bump <version>`.
8992
- You can pass the new version explicitly, or a rule such as `major`, `minor`, or `patch`. <br>
9093
For more details, refer to the [Semantic Versions][semver] standard;
9194
- Once CI validation succeeded, merge the corresponding PR branch.
@@ -110,6 +113,6 @@ You can also share how the ML Model extension does or does
110113
not serve your needs with us in the GitHub Discussions or raise
111114
Issues for bugs.
112115

113-
[poetry-install]: https://github.com/python-poetry/install.python-poetry.org
114-
[poetry-docs]: https://python-poetry.org/docs/
116+
[uv-install]: https://docs.astral.sh/uv/getting-started/installation/
117+
[uv-docs]: https://docs.astral.sh/uv/
115118
[semver]: https://semver.org/

Makefile

Lines changed: 31 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,43 @@
11
#* Variables
22
SHELL ?= /usr/bin/env bash
3-
PYTHON ?= python
4-
PYTHONPATH := `pwd`
5-
POETRY ?= poetry
3+
ACTIVEPYTHON = $(shell which python)
64

7-
#* Poetry
8-
.PHONY: poetry-install
9-
poetry-install:
10-
curl -sSL https://install.python-poetry.org | $(PYTHON) -
11-
12-
.PHONY: poetry-remove
13-
poetry-remove:
14-
curl -sSL https://install.python-poetry.org | $(PYTHON) - --uninstall
15-
16-
.PHONY: poetry-plugins
17-
poetry-plugins:
18-
$(POETRY) self add poetry-plugin-up
19-
20-
.PHONY: poetry-env
21-
poetry-env:
22-
$(POETRY) config virtualenvs.in-project true
5+
#* UV
6+
.PHONY: setup
7+
setup:
8+
which uv >/dev/null || (curl -LsSf https://astral.sh/uv/install.sh | sh)
239

2410
.PHONY: publish
2511
publish:
26-
$(POETRY) publish --build
12+
uv publish --build
2713

2814
#* Installation
2915
.PHONY: install
30-
install: poetry-env
31-
$(POETRY) lock -n && poetry export --without-hashes > requirements-lock.txt
32-
$(POETRY) install -n
33-
-poetry run mypy --install-types --non-interactive ./
16+
install: setup
17+
uv export --format requirements-txt -o requirements.txt --no-dev
18+
uv pip install --python $(ACTIVEPYTHON) -r requirements.txt
3419

3520
.PHONY: install-dev
36-
install-dev: poetry-env install
37-
$(POETRY) install -n --with dev
21+
install-dev: setup
22+
uv export --format requirements-txt -o requirements-dev.txt
23+
uv pip install --python $(ACTIVEPYTHON) -r requirements-dev.txt
3824

3925
.PHONY: pre-commit-install
40-
pre-commit-install:
41-
$(POETRY) run pre-commit install
42-
26+
pre-commit-install: setup
27+
uv run --python $(ACTIVEPYTHON) pre-commit install
4328

4429
#* Formatters
4530
.PHONY: codestyle
46-
codestyle:
47-
$(POETRY) run ruff format --config=pyproject.toml stac_model tests
31+
codestyle: setup
32+
uv run --python $(ACTIVEPYTHON) ruff format --config=pyproject.toml stac_model tests
4833

4934
.PHONY: format
5035
format: codestyle
5136

5237
#* Linting
5338
.PHONY: test
54-
test:
55-
PYTHONPATH=$(PYTHONPATH) poetry run pytest -c pyproject.toml --cov-report=html --cov=stac_model tests/
39+
test: setup
40+
uv run --python $(ACTIVEPYTHON) pytest -c pyproject.toml --cov-report=html --cov=stac_model tests/
5641

5742
.PHONY: check
5843
check: check-examples check-markdown check-lint check-mypy check-safety check-citation
@@ -61,37 +46,28 @@ check: check-examples check-markdown check-lint check-mypy check-safety check-ci
6146
check-all: check
6247

6348
.PHONY: mypy
64-
mypy:
65-
$(POETRY) run mypy --config-file pyproject.toml ./
49+
mypy: setup
50+
uv run --python $(ACTIVEPYTHON) mypy --config-file pyproject.toml ./
6651

6752
.PHONY: check-mypy
6853
check-mypy: mypy
6954

70-
# NOTE:
71-
# purposely running with docker rather than python package due to conflicting dependencies
72-
# see https://github.com/citation-file-format/cffconvert/issues/292
73-
.PHONY: check-citation
74-
check-citation:
75-
docker run --rm -v $(PYTHONPATH)/CITATION.cff:/app/CITATION.cff citationcff/cffconvert --validate
76-
7755
.PHONY: check-safety
78-
check-safety:
79-
$(POETRY) check
80-
$(POETRY) run safety check --full-report
81-
$(POETRY) run bandit -ll --recursive stac_model tests
56+
check-safety: setup
57+
uv run --python $(ACTIVEPYTHON) safety check --full-report
58+
uv run --python $(ACTIVEPYTHON) bandit -ll --recursive stac_model tests
8259

8360
.PHONY: lint
84-
lint:
85-
$(POETRY) run ruff --config=pyproject.toml ./
86-
$(POETRY) run pydocstyle --count --config=pyproject.toml ./
87-
$(POETRY) run pydoclint --config=pyproject.toml ./
61+
lint: setup
62+
uv run --python $(ACTIVEPYTHON) ruff check --fix --config=pyproject.toml ./
8863

8964
.PHONY: check-lint
9065
check-lint: lint
66+
uv run --python $(ACTIVEPYTHON) ruff check --config=pyproject.toml ./
9167

9268
.PHONY: format-lint
93-
format-lint:
94-
$(POETRY) run ruff --config=pyproject.toml --fix ./
69+
format-lint: lint
70+
ruff format --config=pyproject.toml ./
9571

9672
.PHONY: install-npm
9773
install-npm:
@@ -120,8 +96,9 @@ $(addprefix fix-, $(FORMATTERS)): fix-%: format-%
12096
lint-all: lint mypy check-safety check-markdown
12197

12298
.PHONY: update-dev-deps
123-
update-dev-deps:
124-
$(POETRY) up --only=dev-dependencies --latest
99+
update-dev-deps: setup
100+
uv export --only-dev --format requirements-txt -o requirements-only-dev.txt
101+
uv pip install --python $(ACTIVEPYTHON) -r requirements-only-dev.txt
125102

126103
#* Cleaning
127104
.PHONY: pycache-remove

README_STAC_MODEL.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
[![PyPI Release][bp3]][bp2]
99
[![Repository][bscm1]][bp4]
1010
[![Releases][bscm2]][bp5]
11-
[![Docs][bdoc1]][bdoc2]
1211

1312
[![Contributions Welcome][bp8]][bp9]
1413

15-
[![Poetry][bp11]][bp12]
14+
[![uv][bp11]][bp12]
1615
[![Pre-commit][bp15]][bp16]
1716
[![Semantic versions][blic3]][bp5]
1817
[![Pipelines][bscm6]][bscm7]
@@ -30,10 +29,10 @@ _A PydanticV2 and PySTAC validation and serialization library for the STAC ML Mo
3029
pip install -U stac-model
3130
```
3231

33-
or install with `Poetry`:
32+
or install with uv:
3433

3534
```shell
36-
poetry add stac-model
35+
uv add stac-model
3736
```
3837
Then you can run
3938

@@ -73,8 +72,8 @@ See [LICENSE][blic2] for more details.
7372
[bp7]: https://kutt.it/7fYqQl
7473
[bp8]: https://img.shields.io/static/v1.svg?label=Contributions&message=Welcome&color=0059b3&style=for-the-badge
7574
[bp9]: https://github.com/stac-extensions/mlm/blob/main/CONTRIBUTING.md
76-
[bp11]: https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json&style=for-the-badge
77-
[bp12]: https://python-poetry.org/
75+
[bp11]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json&style=for-the-badge
76+
[bp12]: https://docs.astral.sh/uv/
7877

7978
[bp15]: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=for-the-badge
8079
[bp16]: https://github.com/stac-extensions/mlm/blob/main/.pre-commit-config.yaml
@@ -95,6 +94,3 @@ See [LICENSE][blic2] for more details.
9594
[hub6]: https://docs.github.com/en/code-security/dependabot
9695
[hub8]: https://github.com/stac-extensions/mlm/blob/main/.github/release-drafter.yml
9796
[hub9]: https://github.com/stac-extensions/mlm/blob/main/.github/.stale.yml
98-
99-
[bdoc1]: https://img.shields.io/badge/docs-github%20pages-0a507a?style=for-the-badge
100-
[bdoc2]: https://github.com/stac-extensions/mlm/blob/main/README_STAC_MODEL.md

docker/Dockerfile

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)