element-hq / element-hq/synapse
pyrsistent "transitive dep" is problematic
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
### Background
*As discussed in the [Synapse Package Maintainers](https://matrix.to/#/!rh9Uxk45AsPongyP3ypgpsCmuIufiggD6mDXFWh4_FM/$bhDimbyDN2TIGtzN04s_6Kr9ulGwq5og1Rgt2rEVXdI?via=jki.re&via=matrix.org&via=element.io) room,*
`pyproject.toml` declares synapse's dependencies. In addition to what synapse actually depends on there are "transitive dependencies". These are a least-bad approach for avoiding user problems (and bug reports!) because A that Synapse depends on is a version which is good enough, except that it depends on B, and the B installed was good enough for what A said at release, except that it actually isn't good enough for correct behavior. Synapse therefore adds a dependency on new-enough B. This is all merely background.
### Description
One of the "transitive dependencies" is `pyrsistent`, said to be for `jsonschema`. However, `jsonschema` dropped `pyrsistent` as a dependency in `4.18.0`, summer of 2023. People who are up to date then won't need `pyrsistent`. But Synapse only requires `jsonschema` > 3, and people with ancient `jsonschema` might have problems.
My suggestion is to require `jsonschema` >= 4.18.0, and drop the `pyrsistent` transitive dependency. (I realize that wades into the supporting LTS question, but I don't understand wanting new synapse and old everything else.)
### Steps to reproduce
Read the source code and then go read lots of other repo history.
### Homeserver
reading.the.code
### Synapse Version
1.148.0
### Installation Method
Other (please mention below)
### Database
none
### Workers
I don't know
### Platform
Discovered during packaging by code reading.
### Configuration
_No response_
### Relevant log output
```shell
N/A
```
### Anything else that would be useful to know?
_No response_
Contributor guide
Research direction
Start with the dependency declarations in pyproject.toml, then review the repository history and supporting-LTS discussion mentioned in the issue. Confirm the supported jsonschema versions and whether jsonschema >=4.18.0 is acceptable; done means removing the pyrsistent transitive dependency while preserving the project's compatibility policy.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100