Skip to content

Update requirements_test.txt for psycopg3#281

Closed
jimchamp wants to merge 1 commit into
masterfrom
upgrade-test-dependencies
Closed

Update requirements_test.txt for psycopg3#281
jimchamp wants to merge 1 commit into
masterfrom
upgrade-test-dependencies

Conversation

@jimchamp

Copy link
Copy Markdown
Collaborator

Completely untested.

requirements_test.txt is used by our python_tests workflow. Let's see if everything works.

@jimchamp

Copy link
Copy Markdown
Collaborator Author

In order for this to work, tests (and likely Infogami) will have to be rewritten such that they do not use WebPy's db module.

WebPy only accepts psycopg2 drivers for postgres connections today.

Here is the error stack trace for one of the failing tests:

infogami/infobase/tests/utils.py:88: in setup_site
    setup_db(mod)
infogami/infobase/tests/utils.py:35: in setup_db
    recreate_database()
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/web/utils.py:510: in __call__
    update(block=True)
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/web/utils.py:505: in update
    self.cache[key] = (self.func(*args, **keywords), time.time())
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
infogami/infobase/tests/utils.py:27: in recreate_database
    db = web.database(**db_parameters)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/web/db.py:1479: in database
    return _databases[dbn](**params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/web/db.py:1195: in __init__
    db_module = import_driver(pg_drivers, preferred=keywords.pop("driver", None))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As per:
https://github.com/webpy/webpy/blob/d3649322b85777b291ac2b7b3699fb6fc839e382/web/db.py#L48

https://github.com/webpy/webpy/blob/d3649322b85777b291ac2b7b3699fb6fc839e382/web/db.py#L1261-L1271

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

Successfully merging this pull request may close these issues.

1 participant