Skip to content

Commit bec6f26

Browse files
authored
2 parents 7fca899 + 367ef44 commit bec6f26

File tree

10 files changed

+1380
-1531
lines changed

10 files changed

+1380
-1531
lines changed

.github/workflows/docs.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,37 +28,36 @@ jobs:
2828
python_files:
2929
- 'src/unihan_etl/**'
3030
- pyproject.toml
31-
- poetry.lock
31+
- uv.lock
3232
3333
- name: Should publish
3434
if: steps.changes.outputs.docs == 'true' || steps.changes.outputs.root_docs == 'true' || steps.changes.outputs.python_files == 'true'
3535
run: echo "PUBLISH=$(echo true)" >> $GITHUB_ENV
3636

37-
- name: Install poetry
37+
- name: Install uv
3838
if: env.PUBLISH == 'true'
39-
run: pipx install "poetry==1.8.4"
39+
uses: astral-sh/setup-uv@v3
40+
with:
41+
enable-cache: true
4042

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

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

5251
- name: Print python versions
5352
if: env.PUBLISH == 'true'
5453
run: |
5554
python -V
56-
poetry run python -V
55+
uv run python -V
5756
5857
- name: Build documentation
5958
if: env.PUBLISH == 'true'
6059
run: |
61-
pushd docs; make SPHINXBUILD='poetry run sphinx-build' html; popd
60+
pushd docs; make SPHINXBUILD='uv run sphinx-build' html; popd
6261
6362
- name: Push documentation to S3
6463
if: env.PUBLISH == 'true'

.github/workflows/tests.yml

Lines changed: 17 additions & 21 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,21 +57,18 @@ 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 }}
6967

7068
- name: Build package
71-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
72-
run: poetry build
69+
run: uv build
7370

7471
- name: Publish package
75-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
7672
uses: pypa/gh-action-pypi-publish@release/v1
7773
with:
7874
user: __token__

.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
@@ -19,6 +19,14 @@ $ pipx install --suffix=@next unihan-etl --pip-args '\--pre' --force
1919

2020
<!-- Maintainers, insert changes / features for the next release here -->
2121

22+
### Development
23+
24+
- Project and package management: poetry to uv (#329)
25+
26+
[uv] is the new package and project manager for the project, replacing Poetry.
27+
28+
[uv]: https://github.com/astral-sh/uv
29+
2230
## unihan-etl 0.35.0 (2024-11-25)
2331

2432
### Documentation

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ entr_warn:
1111
@echo "----------------------------------------------------------"
1212

1313
test:
14-
poetry run py.test $(test)
14+
uv run py.test $(test)
1515

1616
start:
17-
$(MAKE) test; poetry run ptw .
17+
$(MAKE) test; uv run ptw .
1818

1919
watch_test:
2020
if command -v entr > /dev/null; then ${ALL_FILES} | entr -c $(MAKE) test; else $(MAKE) test entr_warn; fi
2121

2222
vulture:
23-
poetry run vulture unihan_etl
23+
uv run vulture unihan_etl
2424

2525
watch_vulture:
2626
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) vulture; else $(MAKE) vulture entr_warn; fi
@@ -44,16 +44,16 @@ design_docs:
4444
$(MAKE) -C docs design
4545

4646
ruff_format:
47-
poetry run ruff format .
47+
uv run ruff format .
4848

4949
ruff:
50-
poetry run ruff check .
50+
uv run ruff check .
5151

5252
watch_ruff:
5353
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) ruff; else $(MAKE) ruff entr_warn; fi
5454

5555
mypy:
56-
poetry run mypy `${PY_FILES}`
56+
uv run mypy `${PY_FILES}`
5757

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

6464
monkeytype_create:
65-
poetry run monkeytype run `poetry run which py.test`
65+
uv run monkeytype run `uv run which py.test`
6666

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

docs/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ WATCH_FILES= find .. -type f -not -path '*/\.*' | grep -i '.*[.]\(rst\|md\)\$\|.
66

77
# You can set these variables from the command line.
88
SPHINXOPTS =
9-
SPHINXBUILD = poetry run sphinx-build
9+
SPHINXBUILD = uv run sphinx-build
1010
PAPER =
1111
SOURCEDIR = .
1212
BUILDDIR = _build
@@ -183,8 +183,8 @@ dev:
183183
$(MAKE) -j watch serve
184184

185185
start:
186-
poetry run sphinx-autobuild -b html $(SPHINXOPTS) --port ${HTTP_PORT} $(O) $(SOURCEDIR) $(BUILDDIR)/html
186+
uv run sphinx-autobuild -b html $(SPHINXOPTS) --port ${HTTP_PORT} $(O) $(SOURCEDIR) $(BUILDDIR)/html
187187

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

0 commit comments

Comments
 (0)