Skip to content

Commit ec14058

Browse files
Merge pull request #48 from ricardogsilva/41-migrate-to-uv
Migrated to uv
2 parents 7236c2e + ca70864 commit ec14058

File tree

9 files changed

+1366
-1857
lines changed

9 files changed

+1366
-1857
lines changed

.github/workflows/ci.yaml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,29 @@ jobs:
1212
run-ci:
1313
runs-on: ubuntu-24.04
1414
steps:
15-
- name: grab code
15+
- name: "Grab code"
1616
uses: actions/checkout@v4.2.2
1717

18-
- name: install poetry
19-
run: pipx install poetry==2.1.1
18+
- name: "Install uv"
19+
uses: astral-sh/setup-uv@v5
20+
with:
21+
version: "0.6.13"
22+
enable-cache: true
23+
cache-dependency-glob: "uv.lock"
2024

21-
- name: setup Python
22-
uses: actions/setup-python@v5.5.0
25+
- name: "Set up Python"
26+
uses: actions/setup-python@v5
2327
with:
24-
python-version: "3.10"
25-
cache: poetry
28+
python-version-file: "pyproject.toml"
2629

27-
- name: install code with dev dependencies
28-
run: poetry install --with ci --with test
30+
- name: "Install code"
31+
run: uv sync --frozen
2932

30-
- name: run ruff linter
31-
run: poetry run ruff check
33+
- name: "Run ruff linter"
34+
run: uv run ruff check
3235

33-
- name: run ruff formatter
34-
run: poetry run ruff format --check
36+
- name: "Run ruff formatter"
37+
run: uv run ruff format --check
3538

36-
- name: run tests
37-
run: poetry run pytest
39+
- name: "Run tests"
40+
run: uv run pytest

.github/workflows/docs.yaml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,28 @@ jobs:
1717
build-docs:
1818
runs-on: ubuntu-24.04
1919
steps:
20-
- name: grab code
20+
- name: "Grab code"
2121
uses: actions/checkout@v4.2.2
2222

23-
- name: install poetry
24-
run: pipx install poetry==2.1.1
23+
- name: "Install uv"
24+
uses: astral-sh/setup-uv@v5
25+
with:
26+
version: "0.6.13"
27+
enable-cache: true
28+
cache-dependency-glob: "uv.lock"
2529

26-
- name: setup Python
27-
uses: actions/setup-python@v5.5.0
30+
- name: "Set up Python"
31+
uses: actions/setup-python@v5
2832
with:
29-
python-version: "3.10"
30-
cache: poetry
33+
python-version-file: "pyproject.toml"
3134

32-
- name: install code with dev dependencies
33-
run: poetry install --with docs
35+
- name: "Install code"
36+
run: uv sync --frozen
3437

35-
- name: build docs
36-
run: poetry run mkdocs build --site-dir built-docs
38+
- name: "Build docs"
39+
run: uv run mkdocs build --site-dir built-docs
3740

38-
- name: upload docs as artifacts
41+
- name: "Upload docs as artifacts"
3942
uses: actions/upload-pages-artifact@v3.0.1
4043
with:
4144
path: built-docs/

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ jobs:
169169

170170
This action's code can also be installed locally:
171171

172-
- Install [poetry](https://python-poetry.org/docs/)
172+
- Install [uv](https://docs.astral.sh/uv/)
173173
- Clone this repository:
174174

175175
```shell
@@ -179,7 +179,7 @@ This action's code can also be installed locally:
179179

180180
```shell
181181
cd cite-runner
182-
poetry install
182+
uv sync
183183
```
184184

185185
- Start your service to be tested. Let's assume it is already running on `http://localhost:5000`
@@ -197,7 +197,7 @@ This action's code can also be installed locally:
197197
- Run the action code with
198198

199199
```shell
200-
poetry run cite-runner --help
200+
uv run cite-runner --help
201201
```
202202

203203
There are additional commands and options which can be used when running locally, which allow controlling the output
@@ -265,18 +265,18 @@ format and how the inputs are supplied. Read the online documentation for more d
265265
After having clone this repository, install the code with dev dependencies by running:
266266

267267
```shell
268-
poetry install --with dev
268+
uv sync
269269
```
270270

271271
Enable the pre-commit hooks by running:
272272

273273
```shell
274-
poetry run pre-commit install
274+
uv run pre-commit install
275275
```
276276

277277
Optionally, do a first run of pre-commit on all files, which will also initialize
278278
pre-commit's hooks:
279279

280280
```shell
281-
poetry run pre-commit run --all-files
281+
uv run pre-commit run --all-files
282282
```

action.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,21 @@ runs:
5656
- name: 'Add action path to the global path'
5757
shell: bash
5858
run: echo "${{ github.action_path }}" >> ${GITHUB_PATH}
59+
- name: 'Install uv'
60+
uses: astral-sh/setup-uv@v5
61+
with:
62+
version: "0.6.13"
63+
enable-cache: true
64+
cache-dependency-glob: "uv.lock"
5965
- name: 'Set up Python'
6066
uses: actions/setup-python@v5
6167
with:
62-
python-version: '3.10'
63-
- name: 'Set up poetry'
64-
uses: Gr1N/setup-poetry@v9
65-
with:
66-
poetry-version: '1.8.3'
67-
- name: 'Set up cache'
68-
uses: actions/cache@v4
69-
with:
70-
path: ~/.cache/pypoetry/virtualenvs
71-
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
68+
python-version-file: "pyproject.toml"
7269
- name: 'install action code'
7370
shell: 'bash'
7471
run: |
7572
cd ${{ github.action_path }}
76-
poetry install
73+
uv sync --frozen
7774
- name: 'Start TEAM engine container'
7875
if: ${{ !inputs.teamengine_url }}
7976
shell: 'bash'
@@ -90,7 +87,7 @@ runs:
9087
run: |
9188
cd ${{ github.action_path }}
9289
raw_result_output_path=raw-result.xml
93-
poetry run cite-runner \
90+
uv run cite-runner \
9491
--network-timeout=${{ inputs.network_timeout_seconds }} \
9592
execute-test-suite-from-github-actions \
9693
${{ inputs.teamengine_url || 'http://localhost:8080/teamengine' }} \
@@ -106,7 +103,7 @@ runs:
106103
run: |
107104
cd ${{ github.action_path }}
108105
md_result_output_path=test-result.md
109-
poetry run cite-runner \
106+
uv run cite-runner \
110107
parse-result \
111108
--output-format=markdown \
112109
--include-summary \

docs/development.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,20 @@ In a brief nutshell:
3535

3636
2. Clone you fork to your local environment
3737

38-
3. Install [poetry]
38+
3. Install [uv]
3939

40-
4. Use poetry to install the cite-runner code locally, also including the
41-
`dev` dependency group (and optionally also the `docs` group, if you plan
42-
to work on docs):
40+
4. Use uv to install the cite-runner code locally. This will create a virtualenv and install all
41+
dependencies needed for development, including for working on docs:
4342

4443
```shell
45-
poetry install --with dev --with test --with docs
44+
uv sync
4645
```
4746

4847
5. Optionally (but strongly recommended) enable the [pre-commit] hooks
4948
provided by cite-runner:
5049

5150
```shell
52-
poetry run pre-commit install
51+
uv run pre-commit install
5352
```
5453

5554
6. Stand up a docker container with a local teamengine instance:
@@ -72,19 +71,25 @@ In a brief nutshell:
7271

7372
7. Work on the cite-runner code
7473

74+
8. You can run cite-runner via uv with:
75+
76+
```shell
77+
uv run cite-runner
78+
```
79+
7580
8. If you want to work on documentation, you can start the mkdocs server with:
7681

7782
```shell
78-
poetry run mkdocs serve
83+
uv run mkdocs serve
7984
```
8085

8186

8287
[httpx]: https://www.python-httpx.org/
8388
[jinja]: https://jinja.palletsprojects.com/en/stable/
8489
[lxml]: https://lxml.de/
8590
[mkdocs]: https://www.mkdocs.org/
86-
[poetry]: https://python-poetry.org/
8791
[pre-commit]: https://pre-commit.com/
8892
[pydantic]: https://docs.pydantic.dev/latest/
8993
[teamengine's web API]: https://opengeospatial.github.io/teamengine/users.html
9094
[typer]: https://typer.tiangolo.com/
95+
[uv]: https://docs.astral.sh/uv/

docs/running-as-standalone-cli.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ hide:
1515

1616
!!! warning
1717

18-
This also means that for the moment, cite-runner needs to be run through poetry, by means of using
19-
`poetry run cite-runner`. As such, please remember to prefix all examples provided below with
20-
`poetry run`.
18+
This also means that for the moment, cite-runner needs to be run through uv, by means of using
19+
`uv run cite-runner`. As such, please remember to prefix all examples provided below with
20+
`uv run`.
2121

2222

23-
In order to use cite-runner locally you will need to have [git] and [poetry]
23+
In order to use cite-runner locally you will need to have [git] and [uv]
2424
installed. Once these are installed, cite-runner can be installed by cloning
25-
this repository and using poetry to install it:
25+
this repository and using uv to install it:
2626

2727
```shell
2828
git clone https://github.com/OSGeo/cite-runner.git
2929
cd cite-runner
30-
poetry install
30+
uv sync
3131
```
3232

3333
You can verify the installation by running
3434

3535
```shell
36-
poetry run cite-runner --help
36+
uv run cite-runner --help
3737
```
3838

3939

@@ -249,7 +249,7 @@ before the command.
249249

250250
[docker image]: https://hub.docker.com/r/ogccite/teamengine-production
251251
[git]: https://git-scm.com/
252-
[poetry]: https://python-poetry.org/
253252
[pygeoapi demo service]: https://demo.pygeoapi.io/stable
254253
[OGC TEAM Engine]: https://opengeospatial.github.io/teamengine/
255254
[teamengine EARL output format]: https://opengeospatial.github.io/teamengine/users.html#EARL_.28RDF.2FXML.29
255+
[uv]: https://docs.astral.sh/uv/

0 commit comments

Comments
 (0)