Skip to content

Commit 79d918b

Browse files
committed
1 parent a0e25db commit 79d918b

File tree

11 files changed

+1410
-1409
lines changed

11 files changed

+1410
-1409
lines changed

.github/workflows/docs.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,37 @@ jobs:
2828
python_files:
2929
- 'src/g.py'
3030
- 'src/g/**'
31+
- pyproject.toml
32+
- uv.lock
3133
3234
- name: Should publish
3335
if: steps.changes.outputs.docs == 'true' || steps.changes.outputs.root_docs == 'true' || steps.changes.outputs.python_files == 'true'
3436
run: echo "PUBLISH=$(echo true)" >> $GITHUB_ENV
3537

36-
- name: Install poetry
38+
- name: Install uv
39+
uses: astral-sh/setup-uv@v3
3740
if: env.PUBLISH == 'true'
38-
run: pipx install "poetry==1.8.4"
41+
with:
42+
enable-cache: true
3943

4044
- name: Set up Python ${{ matrix.python-version }}
4145
if: env.PUBLISH == 'true'
42-
uses: actions/setup-python@v5
43-
with:
44-
python-version: ${{ matrix.python-version }}
45-
cache: 'poetry'
46+
run: uv python install ${{ matrix.python-version }}
4647

47-
- name: Install dependencies [w/ docs]
48+
- name: Install dependencies
4849
if: env.PUBLISH == 'true'
49-
run: poetry install --with=docs,lint
50+
run: uv sync --all-extras --dev
5051

5152
- name: Print python versions
5253
if: env.PUBLISH == 'true'
5354
run: |
5455
python -V
55-
poetry run python -V
56+
uv run python -V
5657
5758
- name: Build documentation
5859
if: env.PUBLISH == 'true'
5960
run: |
60-
pushd docs; make SPHINXBUILD='poetry run sphinx-build' html; popd
61+
pushd docs; make SPHINXBUILD='uv run sphinx-build' html; popd
6162
6263
- name: Push documentation to S3
6364
if: env.PUBLISH == 'true'

.github/workflows/tests.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,33 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16-
- name: Install poetry
17-
run: pipx install "poetry==1.8.4"
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v3
18+
with:
19+
enable-cache: true
1820

1921
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v5
21-
with:
22-
python-version: ${{ matrix.python-version }}
23-
cache: 'poetry'
22+
run: uv python install ${{ matrix.python-version }}
2423

2524
- name: Install dependencies
26-
run: poetry install --with=docs,test,coverage,lint
25+
run: uv sync --all-extras --dev
2726

2827
- name: Print python versions
2928
run: |
3029
python -V
31-
poetry run python -V
30+
uv run python -V
3231
3332
- name: Lint with ruff check
34-
run: poetry run ruff check .
33+
run: uv run ruff check .
3534

3635
- name: Format with ruff format
37-
run: poetry run ruff format . --check
36+
run: uv run ruff format . --check
3837

3938
- name: Lint with mypy
40-
run: poetry run mypy .
39+
run: uv run mypy .
4140

4241
- name: Test with pytest
43-
run: poetry run py.test --cov=./ --cov-report=xml
42+
run: uv run py.test --cov=./ --cov-report=xml
4443

4544
- uses: codecov/codecov-action@v5
4645
with:
@@ -58,18 +57,20 @@ jobs:
5857
steps:
5958
- uses: actions/checkout@v4
6059

61-
- name: Install poetry
62-
run: pipx install "poetry==1.8.4"
60+
- name: Install uv
61+
uses: astral-sh/setup-uv@v3
62+
with:
63+
enable-cache: true
6364

6465
- name: Set up Python ${{ matrix.python-version }}
65-
uses: actions/setup-python@v5
66-
with:
67-
python-version: ${{ matrix.python-version }}
68-
cache: 'poetry'
66+
run: uv python install ${{ matrix.python-version }}
67+
68+
- name: Install dependencies
69+
run: uv sync --all-extras --dev
6970

7071
- name: Build package
7172
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
72-
run: poetry build
73+
run: uv build
7374

7475
- name: Publish package
7576
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
poetry 1.8.4
1+
uv 0.5.4
22
python 3.13.0 3.12.7 3.11.10 3.10.15 3.9.20 3.8.20 3.7.17

CHANGES

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ $ pipx install --suffix=@next g --pip-args '\--pre' --force
2121

2222
<!-- Maintainers, insert changes / features for the next release here -->
2323

24+
### Development
25+
26+
#### Project and package management: poetry to uv (#30)
27+
28+
[uv] is the new package and project manager for the project, replacing Poetry.
29+
30+
[uv]: https://github.com/astral-sh/uv
31+
2432
## g 0.0.5 (2024-06-08)
2533

2634
### Fixes

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ entr_warn:
1212
@echo "----------------------------------------------------------"
1313

1414
test:
15-
poetry run py.test $(test)
15+
uv run py.test $(test)
1616

1717
start:
18-
$(MAKE) test; poetry run ptw .
18+
$(MAKE) test; uv run ptw .
1919

2020
watch_test:
2121
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) test; else $(MAKE) test entr_warn; fi
@@ -30,7 +30,7 @@ design_docs:
3030
$(MAKE) -C docs design
3131

3232
ruff_format:
33-
poetry run ruff format .
33+
uv run ruff format .
3434

3535
ruff:
3636
ruff check .
@@ -39,7 +39,7 @@ watch_ruff:
3939
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) ruff; else $(MAKE) ruff entr_warn; fi
4040

4141
mypy:
42-
poetry run mypy `${PY_FILES}`
42+
uv run mypy `${PY_FILES}`
4343

4444
watch_mypy:
4545
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) mypy; else $(MAKE) mypy entr_warn; fi
@@ -48,7 +48,7 @@ format_markdown:
4848
prettier --parser=markdown -w *.md docs/*.md docs/**/*.md CHANGES
4949

5050
monkeytype_create:
51-
poetry run monkeytype run `poetry run which py.test`
51+
uv run monkeytype run `uv run which py.test`
5252

5353
monkeytype_apply:
54-
poetry run monkeytype list-modules | xargs -n1 -I{} sh -c 'poetry run monkeytype apply {}'
54+
uv run monkeytype list-modules | xargs -n1 -I{} sh -c 'uv run monkeytype apply {}'

docs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ dev:
182182
$(MAKE) -j watch serve
183183

184184
start:
185-
poetry run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --port ${HTTP_PORT} $(O)
185+
uv run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --port ${HTTP_PORT} $(O)
186186

187187
design:
188188
# This adds additional watch directories (for _static file changes) and disable incremental builds
189-
poetry run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --port ${HTTP_PORT} --watch "." -a $(O)
189+
uv run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --port ${HTTP_PORT} --watch "." -a $(O)

docs/developing.md

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
11
# Development
22

3-
[poetry] is a required package to develop.
3+
[uv] is a required package to develop.
44

5-
`git clone https://github.com/vcs-python/g.git`
5+
## Bootstrap the project
66

7-
`cd g`
7+
Install and [git] and [uv]
88

9-
`poetry install -E "docs test coverage lint"`
9+
Clone:
1010

11-
Makefile commands prefixed with `watch_` will watch files and rerun.
11+
```console
12+
$ git clone https://github.com/vcs-python/g.git
13+
```
14+
15+
```console
16+
$ cd g
17+
```
18+
19+
Install packages:
20+
21+
```console
22+
$ uv sync --all-extras --dev
23+
```
24+
25+
[installation documentation]: https://docs.astral.sh/uv/getting-started/installation/
26+
[git]: https://git-scm.com/
1227

1328
## Tests
1429

15-
`poetry run py.test`
30+
`uv run py.test`
1631

1732
Helpers: `make test`
1833

@@ -54,10 +69,10 @@ The project uses [ruff] to handle formatting, sorting imports and linting.
5469

5570
````{tab} Command
5671
57-
poetry:
72+
uv:
5873
5974
```console
60-
$ poetry run ruff
75+
$ uv run ruff
6176
```
6277
6378
If you setup manually:
@@ -88,10 +103,10 @@ requires [`entr(1)`].
88103

89104
````{tab} Fix files
90105
91-
poetry:
106+
uv:
92107
93108
```console
94-
$ poetry run ruff check . --fix
109+
$ uv run ruff check . --fix
95110
```
96111
97112
If you setup manually:
@@ -108,10 +123,10 @@ $ ruff check . --fix
108123

109124
````{tab} Command
110125
111-
poetry:
126+
uv:
112127
113128
```console
114-
$ poetry run ruff format .
129+
$ uv run ruff format .
115130
```
116131
117132
If you setup manually:
@@ -136,10 +151,10 @@ $ make ruff_format
136151

137152
````{tab} Command
138153
139-
poetry:
154+
uv:
140155
141156
```console
142-
$ poetry run mypy .
157+
$ uv run mypy .
143158
```
144159
145160
If you setup manually:
@@ -169,7 +184,7 @@ requires [`entr(1)`].
169184

170185
## Releasing
171186

172-
[poetry] handles virtualenv creation, package requirements, versioning,
187+
[uv] handles virtualenv creation, package requirements, versioning,
173188
building, and publishing. Therefore there is no setup.py or requirements files.
174189

175190
Update `__version__` in `__about__.py` and `pyproject.toml`::
@@ -178,10 +193,8 @@ Update `__version__` in `__about__.py` and `pyproject.toml`::
178193
git tag v0.1.1
179194
git push
180195
git push --tags
181-
poetry build
182-
poetry publish
183196

184-
[poetry]: https://python-poetry.org/
197+
[uv]: https://github.com/astral-sh/uv
185198
[entr(1)]: http://eradman.com/entrproject/
186199
[`entr(1)`]: http://eradman.com/entrproject/
187200
[ruff format]: https://docs.astral.sh/ruff/formatter/

0 commit comments

Comments
 (0)