Opened 3 years ago
Last modified 3 years ago
#13414 new enhancement
Support PyPy — at Initial Version
Reported by: | kallisti5 | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | undecided |
Component: | general | Version: | |
Severity: | normal | Keywords: | pypy |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I was able to get trac running under PyPy in https://foss.heptapod.net/pypy/pypy/-/issues/3528
Originally it was crashing on ticket queries, but switching psycopg2 to psycopg2cffi via this patch below resolved the crashing:
diff --git a/trac/db/postgres_backend.py b/trac/db/postgres_backend.py index f9f910630..8670f83ac 100644 --- a/trac/db/postgres_backend.py +++ b/trac/db/postgres_backend.py @@ -31,6 +31,14 @@ from trac.util.html import Markup from trac.util.text import empty, exception_to_unicode, to_unicode from trac.util.translation import _ +# Attempt to use psycopg2cffi in compatibility mode if available +# this enables usage of psycopg2cffi under pypy +try: + from psycopg2cffi import compat + compat.register() +except ImportError: + pass + try: import psycopg2 as psycopg import psycopg2.extensions
Note:
See TracTickets
for help on using tickets.