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 verison #94

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

dhenschen
Copy link
Contributor

Prior to this commit the requirements.txt did not pin a SQLAlchemy version.

Newer versions of SQLAlchemy removed the relation function used in the videos: https://github.com/sqlalchemy/sqlalchemy/blob/d519bca7f953a0520cda79504dbc019e74e87b28/lib/sqlalchemy/orm/__init__.py#L143

The demo code uses relation instead of the newer relationship function, so in order for the demo to work, users must install an older version of SQLAlchemy.

The videos used SQLAlchemy 1.2.10. This version is old enough that it is incompatible with with Python 3.10. Trying to execute the demo code yields the following error:

AttributeError: module 'collections' has no attribute 'MutableMapping'

I found that version 1.2.19 was new enough to work with modern Python while still maintaining the relation function. This Pull Request pins 1.2.19 in the requirements.txt file so other students do not run into the same issue.

Prior to this commit the requirements.txt did not pin a SQLAlchemy version.

Newer versions of SQLAlchemy removed the relation function used in the videos:
https://github.com/sqlalchemy/sqlalchemy/blob/d519bca7f953a0520cda79504dbc019e74e87b28/lib/sqlalchemy/orm/__init__.py#L143

The demo code uses relation instead of the newer relationship code, so in order
for the demo to work, users must install an older version of SQLAlchemy.

The videos used SQLAlchemy 1.2.10. This version is old enough that it is
incompatible with with Python 3.10. Trying to execute the demo code yields the
following error:

> AttributeError: module 'collections' has no attribute 'MutableMapping'

I found that version 1.2.19 was new enough to work with modern Python while
still maintaining the relation function. This commit pins 1.2.19 in the
requirements.txt file so other students do not run into the same issue.
@bbelderbos
Copy link
Collaborator

Thanks @dhenschen for trying different versions and pinning the one that worked for you.

@bbelderbos bbelderbos merged commit 7b7a2a5 into talkpython:master Apr 24, 2023
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.

2 participants