Skip to content

Commit 90b4a9d

Browse files
committed
1 parent 763da16 commit 90b4a9d

File tree

13 files changed

+1476
-1614
lines changed

13 files changed

+1476
-1614
lines changed

.github/workflows/docs.yml

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

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

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

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

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

.github/workflows/tests.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v4
2323

24-
- name: Install poetry
25-
run: pipx install "poetry==1.8.4"
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v3
26+
with:
27+
enable-cache: true
2628

2729
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v5
29-
with:
30-
python-version: ${{ matrix.python-version }}
31-
cache: 'poetry'
30+
run: uv python install ${{ matrix.python-version }}
31+
32+
- name: Install dependencies
33+
run: uv sync --all-extras --dev
3234

3335
- name: Setup tmux build cache for tmux ${{ matrix.tmux-version }}
3436
id: tmux-build-cache
@@ -94,18 +96,20 @@ jobs:
9496
steps:
9597
- uses: actions/checkout@v4
9698

97-
- name: Install poetry
98-
run: pipx install "poetry==1.8.4"
99+
- name: Install uv
100+
uses: astral-sh/setup-uv@v3
101+
with:
102+
enable-cache: true
99103

100104
- name: Set up Python ${{ matrix.python-version }}
101-
uses: actions/setup-python@v5
102-
with:
103-
python-version: ${{ matrix.python-version }}
104-
cache: 'poetry'
105+
run: uv python install ${{ matrix.python-version }}
106+
107+
- name: Install dependencies
108+
run: uv sync --all-extras --dev
105109

106110
- name: Build package
107111
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
108-
run: poetry build
112+
run: uv build
109113

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

.tmuxp.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"session_name": "tmuxp",
33
"start_directory": "./",
4+
"shell_command_before": [
5+
"uv virtualenv --quiet > /dev/null 2>&1 && clear"
6+
],
47
"windows": [
58
{
69
"window_name": "tmuxp",

.tmuxp.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
session_name: tmuxp
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: tmuxp
57
focus: True

CHANGES

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

2222
### Development
2323

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

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

32+
[uv]: https://github.com/astral-sh/uv
33+
2834
## tmuxp 1.47.0 (2024-04-21)
2935

3036
_Maintenance only, no bug fixes or new features_

Makefile

Lines changed: 7 additions & 7 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 ${TEST_FILES} | entr -c $(MAKE) test; else $(MAKE) test entr_warn; fi
@@ -39,16 +39,16 @@ design_docs:
3939
$(MAKE) -C docs design
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
npx 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 {}'

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
BUILDDIR = _build
1212

@@ -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/configuration/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,9 @@ windows:
636636
- focus: True
637637
- blank
638638
- >
639-
poetry run ./manage.py migrate &&
639+
uv run ./manage.py migrate &&
640640
npm -C js run start
641-
- poetry run ./manage.py runserver
641+
- uv run ./manage.py runserver
642642
options:
643643
main-pane-height: 35
644644
```

docs/developing.md

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ $ cd tmuxp
3333

3434
### Bootstrap
3535

36-
The easiest way to configure a dev environment is through [poetry]. This
36+
The easiest way to configure a dev environment is through [uv]. This
3737
automatically will manage virtualenv and python dependencies for tmuxp.
38-
For information on installing poetry visit the [poetry's documentation].
38+
For information on installing uv visit the [uv's documentation].
3939

4040
To begin developing, check out the code from github:
4141

@@ -48,34 +48,29 @@ $ cd tmuxp
4848
```
4949

5050
You can create a virtualenv, and install all of the locked
51-
packages as listed in poetry.lock:
51+
packages as listed in uv.lock:
5252

5353
```console
54-
$ poetry install
54+
$ uv sync --all-extras --dev
5555
```
5656

5757
If you ever need to update packages during your development session, the
58-
following command can be used to update all packages as per poetry settings or
59-
individual package (second command):
58+
following command can be used to update all packages as per uv settings:
6059

6160
```console
62-
$ poetry update
61+
$ uv sync --all-extras --dev --upgrade
6362
```
6463

65-
```console
66-
$ poetry update requests
67-
```
68-
69-
Then activate it to your current tty / terminal session with:
64+
Then before any python command in tty / terminal session, run with:
7065

7166
```console
72-
$ poetry shell
67+
$ uv run [command]
7368
```
7469

7570
That is it! You are now ready to code!
7671

77-
[poetry]: https://python-poetry.org/
78-
[poetry's documentation]: https://python-poetry.org/docs/
72+
[uv]: https://github.com/astral-sh/uv
73+
[uv's documentation]: https://docs.astral.sh/uv
7974

8075
### Advanced: Manual virtualenv
8176

@@ -134,7 +129,7 @@ $ make watch_test
134129
### Manual (just the command, please)
135130

136131
```console
137-
$ poetry run py.test
132+
$ uv run py.test
138133
```
139134

140135
or:
@@ -159,19 +154,19 @@ $ env PYTEST_ADDOPTS="-verbose" make start
159154
Pick a file:
160155

161156
```console
162-
$ env PYTEST_ADDOPTS="tests/workspace/test_builder.py" poetry run make start
157+
$ env PYTEST_ADDOPTS="tests/workspace/test_builder.py" uv run make start
163158
```
164159

165160
Drop into `test_automatic_rename_option()` in `tests/workspace/test_builder.py`:
166161

167162
```console
168-
$ env PYTEST_ADDOPTS="-s -x -vv tests/workspace/test_builder.py" poetry run make start
163+
$ env PYTEST_ADDOPTS="-s -x -vv tests/workspace/test_builder.py" uv run make start
169164
```
170165

171166
Drop into `test_automatic_rename_option()` in `tests/workspace/test_builder.py` and stop on first error:
172167

173168
```console
174-
$ env PYTEST_ADDOPTS="-s -x -vv tests/workspace/test_builder.py::test_automatic_rename_option" poetry run make start
169+
$ env PYTEST_ADDOPTS="-s -x -vv tests/workspace/test_builder.py::test_automatic_rename_option" uv run make start
175170
```
176171

177172
Drop into `pdb` on first error:
@@ -299,10 +294,8 @@ $ cd doc
299294
$ make watch
300295
```
301296

302-
If you're not source'd via `poetry shell`, you can use this:
303-
304297
```console
305-
$ make SPHINXBUILD='poetry run sphinx-build' watch
298+
$ make SPHINXBUILD='uv run sphinx-build' watch
306299
```
307300

308301
(tmuxp-developer-config)=
@@ -335,10 +328,10 @@ The project uses [ruff] to handle formatting, sorting imports and linting.
335328

336329
````{tab} Command
337330
338-
poetry:
331+
uv:
339332
340333
```console
341-
$ poetry run ruff
334+
$ uv run ruff
342335
```
343336
344337
If you setup manually:
@@ -369,10 +362,10 @@ requires [`entr(1)`].
369362

370363
````{tab} Fix files
371364
372-
poetry:
365+
uv:
373366
374367
```console
375-
$ poetry run ruff check . --fix
368+
$ uv run ruff check . --fix
376369
```
377370
378371
If you setup manually:
@@ -389,10 +382,10 @@ $ ruff check . --fix
389382

390383
````{tab} Command
391384
392-
poetry:
385+
uv:
393386
394387
```console
395-
$ poetry run ruff format .
388+
$ uv run ruff format .
396389
```
397390
398391
If you setup manually:
@@ -417,10 +410,10 @@ $ make ruff_format
417410

418411
````{tab} Command
419412
420-
poetry:
413+
uv:
421414
422415
```console
423-
$ poetry run mypy .
416+
$ uv run mypy .
424417
```
425418
426419
If you setup manually:

0 commit comments

Comments
 (0)