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

Pin sqlalchemy to versions before 1.4 #1156

Closed
wants to merge 1 commit into from

Conversation

uSpike
Copy link
Member

@uSpike uSpike commented Mar 26, 2021

If I try to run tests on master:

_____________________________________________________________________________________ ERROR collecting tests/test_database.py _____________________________________________________________________________________
ImportError while importing test module '/home/jordan/src/starlette/tests/test_database.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../.pyenv/versions/3.7.5/lib/python3.7/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_database.py:31: in <module>
    database = databases.Database(DATABASE_URL, force_rollback=True)
venv/lib/python3.7/site-packages/databases/core.py:66: in __init__
    backend_cls = import_from_string(backend_str)
venv/lib/python3.7/site-packages/databases/importer.py:21: in import_from_string
    raise exc from None
venv/lib/python3.7/site-packages/databases/importer.py:18: in import_from_string
    module = importlib.import_module(module_str)
../../.pyenv/versions/3.7.5/lib/python3.7/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
venv/lib/python3.7/site-packages/databases/backends/sqlite.py:8: in <module>
    from sqlalchemy.engine.result import ResultMetaData, RowProxy
E   ImportError: cannot import name 'RowProxy' from 'sqlalchemy.engine.result' (/home/jordan/src/starlette/venv/lib/python3.7/site-packages/sqlalchemy/engine/result.py)

It seems that sqlalchemy 1.4 changed the name from RowProxy to Row, and databases probably needs to be updated. This PR pins sqlalchemy to versions before 1.4 which is the quickest fix for the issue.

@tomchristie
Copy link
Member

In favour of this, yup. Although this ought to be a fix against the databases package, rather than this one.

@tomchristie
Copy link
Member

The databases setup.py there should be something like sqlalchemy==1.3.*

@uSpike
Copy link
Member Author

uSpike commented Mar 26, 2021

There's also encode/databases#299 open to use sqlalchemy 1.4

@Kludex
Copy link
Sponsor Member

Kludex commented Mar 26, 2021

Does it still fail on 1.4.3? I didn't check the exact changes they made, but this is in the changelog:

@uSpike
Copy link
Member Author

uSpike commented Mar 26, 2021

@Kludex yes, my tests were run with 1.4.3

@tomchristie
Copy link
Member

Latest databases release should now pin SQLAlchemy correctly.

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.

None yet

3 participants