Skip to content

Commit bf34d04

Browse files
authored
2 parents 763da16 + 3019801 commit bf34d04

File tree

21 files changed

+1558
-1704
lines changed

21 files changed

+1558
-1704
lines changed

.github/workflows/docs.yml

+10-11
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

+22-23
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
@@ -52,22 +54,19 @@ jobs:
5254
cd ~
5355
tmux -V
5456
55-
- name: Install python dependencies
56-
run: poetry install --with=test,coverage,lint
57-
5857
- name: Lint with ruff check .
59-
run: poetry run ruff check .
58+
run: uv run ruff check .
6059

6160
- name: Format with ruff
62-
run: poetry run ruff format . --check
61+
run: uv run ruff format . --check
6362

6463
- name: Lint with mypy
65-
run: poetry run mypy .
64+
run: uv run mypy .
6665

6766
- name: Print python versions
6867
run: |
6968
python -V
70-
poetry run python -V
69+
uv run python -V
7170
7271
- name: Test with pytest
7372
continue-on-error: ${{ matrix.tmux-version == 'master' }}
@@ -76,7 +75,7 @@ jobs:
7675
export PATH=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin:$PATH
7776
ls $HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin
7877
tmux -V
79-
poetry run py.test --cov=./ --cov-report=xml
78+
uv run py.test --cov=./ --cov-report=xml
8079
8180
- uses: codecov/codecov-action@v5
8281
with:
@@ -94,21 +93,21 @@ jobs:
9493
steps:
9594
- uses: actions/checkout@v4
9695

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

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

106107
- name: Build package
107-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
108-
run: poetry build
108+
run: uv build
109109

110110
- name: Publish package
111-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
112111
uses: pypa/gh-action-pypi-publish@release/v1
113112
with:
114113
user: __token__

.tmuxp.json

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

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

.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

CHANGES

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

+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 ${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

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ _Experimental setting_: behavior and api is subject to change until stable.
416416
Omit sending {kbd}`enter` to key commands. Equivalent to having
417417
a [`time.sleep`](time.sleep) before and after [`send_keys`](libtmux.Pane.send_keys).
418418

419-
This is especially useful for expensive commands where the terminal needs some breathing room (virtualenv, poetry, pipenv, sourcing a configuration, launching a tui app, etc).
419+
This is especially useful for expensive commands where the terminal needs some breathing room (virtualenv, poetry, pipenv, uv, sourcing a configuration, launching a tui app, etc).
420420

421421
````{tab} Virtualenv
422422
@@ -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
```
@@ -740,7 +740,7 @@ the workspace file / project root.
740740

741741
:::
742742

743-
If you use [pipenv][pipenv] / [poetry][poetry], you can use a script like this to ensure
743+
If you use [pipenv] / [poetry] / [uv], you can use a script like this to ensure
744744
your packages are installed:
745745

746746
````{tab} YAML
@@ -784,6 +784,7 @@ windows:
784784

785785
[pipenv]: https://docs.pipenv.org/
786786
[poetry]: https://python-poetry.org/
787+
[uv]: https://github.com/astral-sh/uv
787788

788789
## Kung fu
789790

0 commit comments

Comments
 (0)