Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with pydantic in latest release #38

Closed
gnunicorn opened this issue Nov 14, 2023 · 8 comments
Closed

Error with pydantic in latest release #38

gnunicorn opened this issue Nov 14, 2023 · 8 comments

Comments

@gnunicorn
Copy link

gnunicorn commented Nov 14, 2023

Trying to build a new synapse module using the cookiecutter template. Adding tests using the released matrix-synapse-testutils (big thanks for doing that!) but run into the pydantic v2 error ( #16332 ) which is meant to work in the latest matrix-synapse release already (using the compat layer) but as I am pulling in matrix-synapse-testutils it fails. The latest release of that package is 1.80.0 from April leading to pulling in matrix-synapse 1.80 which doesn't have the fix either :( .

Would highly appreciate if a new release of the testutils could be cut fixing that issue.

Steps to reproduce

  • create new synapse template with cookiecutter
  • add dependencies:
dependencies = [
  "matrix-synapse >= 1.95.1",
]

[project.optional-dependencies]
dev = [
  "matrix_synapse_testutils",
]

See it fail:

ERROR: Cannot install matrix-synapse[test]==1.65.0 and synapse-super-invites[dev]==0.1.dev1+g215546d.d20231114 because these package versions have conflicting dependencies.

The conflict is caused by:
    synapse-super-invites[dev] 0.1.dev1+g215546d.d20231114 depends on matrix-synapse>=1.95.1
    matrix-synapse[test] 1.65.0 depends on matrix-synapse 1.65.0 (from https://files.pythonhosted.org/packages/7b/d4/a2e1dc91492aca455fb7507d069b6f75de6cea15c2534d2e2c3c3bb6b23b/matrix_synapse-1.65.0-py3-none-any.whl (from https://pypi.org/simple/matrix-synapse/) (requires-python:>=3.7.1,<4.0.0))

Workaround

Workaround until then: adding "pydantic >=1.7.4, <2" as a dev dependency on the local project:

[project.optional-dependencies]
dev = [
  # ...
  "matrix_synapse_testutils",
  "pydantic >=1.7.4, <2", ## FIXME: https://github.com/matrix-org/synapse/issues/16630
  # ...
]
@julianhille
Copy link
Owner

Currently my laptop is broken and so I'm unable tohelp or investigate. Will take some days if that is fine for you

@gnunicorn
Copy link
Author

yeah, sure. As posted on the bottom, I have a work-a-round, which I also added for anyone else finding this problem. That is sufficient for me for now...

@julianhille
Copy link
Owner

on saturday replacement parts are coming i guess i've got time then after repairing my machine

@julianhille
Copy link
Owner

Laptop repaired. Will get to it shortly releasing all the old versions.

Did not know that anyone actually using it, besides me. There where zero interaction or stars or forks so I figured I could stop supporting versions. But now i know so I start keeping up the versions.

@julianhille
Copy link
Owner

julianhille commented Nov 19, 2023

Btw what i just saw is that you should use the same matrix-testutils version as you use matrix synapse.

Like if you use 1.95.1 as Matrix Version you should use 1.95.1.0 as testitils version. The first three digits correspond to Matrix Version the last is some kind of Bugfix for these.

@julianhille
Copy link
Owner

released corresponding matrix-synapse-testutils 1.95.1.0 please try

@gnunicorn
Copy link
Author

@julianhille thanks, mate! Seems to work fine.

My example was just pointing out how this fails. I have not bound either dependency in my actual code, and pip resolves that fine enough.

@julianhille
Copy link
Owner

julianhille commented Nov 21, 2023

Hey. Great to hear.
Something you should know and maybe I did not transfer these Infos correctly.

You need to pin your testutils version. Pip is not able to find the correct version for your matrix synapse.

If you use 1.95.1 of synapse you should pin testutils to 1.95.1.x or if you use version. 1.76.0 of synapse you should to pin to testutils 1.76.0.x otherwise there might be unforeseen test issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants