Skip to content

Commit 1186203

Browse files
committed
1 parent 02328bb commit 1186203

File tree

12 files changed

+1464
-1465
lines changed

12 files changed

+1464
-1465
lines changed

Diff for: .github/workflows/docs.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,37 @@ jobs:
2727
- 'examples/**'
2828
python_files:
2929
- 'src/libtmux/**'
30-
- poetry.lock
30+
- uv.lock
3131
- pyproject.toml
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
uses: jakejarvis/[email protected]

Diff for: .github/workflows/tests.yml

+22-22
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717

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

2123
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v5
23-
with:
24-
python-version: ${{ matrix.python-version }}
25-
cache: 'poetry'
24+
run: uv python install ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: uv sync --all-extras --dev
2628

2729
- name: Setup tmux build cache for tmux ${{ matrix.tmux-version }}
2830
id: tmux-build-cache
@@ -46,23 +48,19 @@ jobs:
4648
cd ~
4749
tmux -V
4850
49-
- name: Install python dependencies
50-
run: |
51-
poetry install --with=test,coverage,lint
52-
5351
- name: Lint with ruff check
54-
run: poetry run ruff check .
52+
run: uv run ruff check .
5553

5654
- name: Format with ruff format
57-
run: poetry run ruff format . --check
55+
run: uv run ruff format . --check
5856

5957
- name: Lint with mypy
60-
run: poetry run mypy .
58+
run: uv run mypy .
6159

6260
- name: Print python versions
6361
run: |
6462
python -V
65-
poetry run python -V
63+
uv run python -V
6664
6765
- name: Test with pytest
6866
continue-on-error: ${{ matrix.tmux-version == 'master' }}
@@ -71,7 +69,7 @@ jobs:
7169
export PATH=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin:$PATH
7270
ls $HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin
7371
tmux -V
74-
poetry run py.test --cov=./ --cov-append --cov-report=xml -n auto
72+
uv run py.test --cov=./ --cov-append --cov-report=xml -n auto
7573
env:
7674
COV_CORE_SOURCE: .
7775
COV_CORE_CONFIG: .coveragerc
@@ -92,18 +90,20 @@ jobs:
9290
steps:
9391
- uses: actions/checkout@v4
9492

95-
- name: Install poetry
96-
run: pipx install "poetry==1.8.4"
93+
- name: Install uv
94+
uses: astral-sh/setup-uv@v3
95+
with:
96+
enable-cache: true
9797

9898
- name: Set up Python ${{ matrix.python-version }}
99-
uses: actions/setup-python@v5
100-
with:
101-
python-version: ${{ matrix.python-version }}
102-
cache: 'poetry'
99+
run: uv python install ${{ matrix.python-version }}
100+
101+
- name: Install dependencies
102+
run: uv sync --all-extras --dev
103103

104104
- name: Build package
105105
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
106-
run: poetry build
106+
run: uv build
107107

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

Diff for: .tmuxp.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
session_name: libtmux
22
start_directory: ./ # load session relative to config location (project root).
3+
shell_command_before:
4+
- uv virtualenv --quiet > /dev/null 2>&1 && clear
35
windows:
46
- window_name: libtmux
57
focus: True

Diff for: .tool-versions

+1-1
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

Diff for: CHANGES

+6
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ $ pip install --user --upgrade --pre libtmux
2222

2323
### Development
2424

25+
- Project and package management: poetry to uv (#547)
26+
27+
[uv] is the new package and project manager for the project, replacing Poetry.
28+
2529
- Code quality: Use f-strings in more places (#540)
2630

2731
via [ruff 0.4.2](https://github.com/astral-sh/ruff/blob/v0.4.2/CHANGELOG.md).
2832

33+
[uv]: https://github.com/astral-sh/uv
34+
2935
## libtmux 0.37.0 (04-21-2024)
3036

3137
_Maintenance only, no bug fixes or new features_

Diff for: Makefile

+7-7
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 ${ALL_FILES} | entr -c $(MAKE) test; else $(MAKE) test entr_warn; fi
@@ -39,16 +39,16 @@ dev_docs:
3939
$(MAKE) -j watch_docs serve_docs
4040

4141
ruff_format:
42-
poetry run ruff format .
42+
uv run ruff format .
4343

4444
ruff:
45-
poetry run ruff check .
45+
uv run ruff check .
4646

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

5050
mypy:
51-
poetry run mypy `${PY_FILES}`
51+
uv run mypy `${PY_FILES}`
5252

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

5959
monkeytype_create:
60-
poetry run monkeytype run `poetry run which py.test`
60+
uv run monkeytype run `uv run which py.test`
6161

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

Diff for: docs/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ WATCH_FILES= find .. -type f -not -path '*/\.*' | grep -i '.*[.]\(rst\|md\)\$\|.
55

66
# You can set these variables from the command line.
77
SPHINXOPTS =
8-
SPHINXBUILD = poetry run sphinx-build
8+
SPHINXBUILD = uv run sphinx-build
99
PAPER =
1010
BUILDDIR = _build
1111

@@ -181,8 +181,8 @@ dev:
181181
$(MAKE) -j watch serve
182182

183183
start:
184-
poetry run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --port ${HTTP_PORT} $(O)
184+
uv run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --port ${HTTP_PORT} $(O)
185185

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

Diff for: docs/developing.md

+21-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Development
22

3-
[poetry] is a required package to develop.
3+
Install and [git] and [uv]
4+
5+
Clone:
46

57
```console
68
$ git clone https://github.com/tmux-python/libtmux.git
@@ -10,15 +12,20 @@ $ git clone https://github.com/tmux-python/libtmux.git
1012
$ cd libtmux
1113
```
1214

15+
Install packages:
16+
1317
```console
14-
$ poetry install -E "docs test coverage lint"
18+
$ uv sync --all-extras --dev
1519
```
1620

21+
[installation documentation]: https://docs.astral.sh/uv/getting-started/installation/
22+
[git]: https://git-scm.com/
23+
1724
Makefile commands prefixed with `watch_` will watch files and rerun.
1825

1926
## Tests
2027

21-
`poetry run py.test`
28+
`uv run py.test`
2229

2330
Helpers: `make test`
2431
Rerun tests on file change: `make watch_test` (requires [entr(1)])
@@ -60,10 +67,10 @@ The project uses [ruff] to handle formatting, sorting imports and linting.
6067

6168
````{tab} Command
6269
63-
poetry:
70+
uv:
6471
6572
```console
66-
$ poetry run ruff
73+
$ uv run ruff
6774
```
6875
6976
If you setup manually:
@@ -94,10 +101,10 @@ requires [`entr(1)`].
94101

95102
````{tab} Fix files
96103
97-
poetry:
104+
uv:
98105
99106
```console
100-
$ poetry run ruff check . --fix
107+
$ uv run ruff check . --fix
101108
```
102109
103110
If you setup manually:
@@ -114,10 +121,10 @@ $ ruff check . --fix
114121

115122
````{tab} Command
116123
117-
poetry:
124+
uv:
118125
119126
```console
120-
$ poetry run ruff format .
127+
$ uv run ruff format .
121128
```
122129
123130
If you setup manually:
@@ -142,10 +149,10 @@ $ make ruff_format
142149

143150
````{tab} Command
144151
145-
poetry:
152+
uv:
146153
147154
```console
148-
$ poetry run mypy .
155+
$ uv run mypy .
149156
```
150157
151158
If you setup manually:
@@ -213,12 +220,12 @@ $ git tag v0.9.1
213220
After `git push` and `git push --tags`, CI will automatically build and deploy
214221
to PyPI.
215222

216-
### Releasing with Poetry (manual)
223+
### Releasing via GitHub Actions (manual)
217224

218225
This isn't used yet since package maintainers may want setup.py in the source.
219226
See https://github.com/tmux-python/tmuxp/issues/625.
220227

221-
As of 0.10, [poetry] handles virtualenv creation, package requirements, versioning,
228+
As of 0.10, [uv] handles virtualenv creation, package requirements, versioning,
222229
building, and publishing. Therefore there is no setup.py or requirements files.
223230

224231
Update `__version__` in `__about__.py` and `pyproject.toml`::
@@ -227,11 +234,9 @@ Update `__version__` in `__about__.py` and `pyproject.toml`::
227234
git tag v0.1.1
228235
git push
229236
git push --tags
230-
poetry build
231-
poetry deploy
232237

233238
[twine]: https://twine.readthedocs.io/
234-
[poetry]: https://python-poetry.org/
239+
[uv]: https://github.com/astral-sh/uv
235240
[entr(1)]: http://eradman.com/entrproject/
236241
[`entr(1)`]: http://eradman.com/entrproject/
237242
[ruff format]: https://docs.astral.sh/ruff/formatter/

0 commit comments

Comments
 (0)