element-hq / element-hq/synapse
Convert our Poetry lock file to a `uv` lock file
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
*See [parent issue](https://github.com/element-hq/synapse/issues/19566) for more context*
We should convert our poetry lock file to a uv lock file, ideally without changing the versions we install.
### Steps
1. Export pinned versions from the poetry lockfile:
```
uvx --with poetry-plugin-export poetry export --all-groups --all-extras -o constraints.txt
```
2. Strip hashes and environment markers to get clean `package==version` pins:
```
sed -i 's/ \\$//; /^ --hash/d; /^$/d; s/ ;.*//' constraints.txt
```
3. Add a temporary `[tool.uv]` section to `pyproject.toml` with those pins as `constraint-dependencies`:
```toml
[tool.uv]
constraint-dependencies = [
"attrs==25.4.0",
"twisted==25.5.0",
...
]
```
4. Generate the lockfile:
```
uv lock
```
5. Restore `pyproject.toml` and clean up:
```
git restore pyproject.toml
rm requirements.txt constraints.txt
```
Contributor guide
Research direction
Start with the Poetry lockfile and pyproject.toml, then follow the listed poetry export, cleanup, and uv lock commands. Done means a uv lockfile is generated with the existing pinned versions preserved, while the temporary constraints and pyproject.toml changes are removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100