Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

from pydantic import v1 as pydantic #16331

Closed
wants to merge 1 commit into from
Closed

from pydantic import v1 as pydantic #16331

wants to merge 1 commit into from

Conversation

polyzen
Copy link

@polyzen polyzen commented Sep 17, 2023

Basic pydantic V2 support.

Fixes #15858

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Pull request includes a sign off
  • Code style is correct
    (run the linters)

@polyzen polyzen requested a review from a team as a code owner September 17, 2023 04:07
@polyzen
Copy link
Author

polyzen commented Sep 17, 2023

After running poetry lock --no-update and poetry install in order to try to run the linters, I received the following error:

~/r/synapse > poetry install
Installing dependencies from lock file

Package operations: 41 installs, 0 updates, 0 removals

  • Installing click-default-group (1.2.2): Failed

  TypeError

  Can't instantiate abstract class IsolatedEnv with abstract methods make_extra_environ, python_executable

  at /usr/lib/python3.11/site-packages/poetry/installation/chef.py:109 in _prepare
      105│     ) -> Path:
      106│         from subprocess import CalledProcessError
      107│
      108│         with ephemeral_environment(self._env.python) as venv:
    → 109│             env = IsolatedEnv(venv, self._pool)
      110│             builder = ProjectBuilder(
      111│                 directory,
      112│                 python_executable=env.executable,
      113│                 scripts_dir=env.scripts_dir,

Basic pydantic V2 support.

Fixes #15858

Signed-off-by: Daniel M. Capella <polyzen@archlinux.org>
@clokep
Copy link
Member

clokep commented Sep 18, 2023

See also #16332.

Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't maintain compatibility with pydantic v1.

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

Successfully merging this pull request may close these issues.

Synapse does not take advantage of Pydantic 2.0
2 participants