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

Part-07 onwards needs some dependency updates #75

Open
chen-bowen opened this issue May 28, 2024 · 2 comments
Open

Part-07 onwards needs some dependency updates #75

chen-bowen opened this issue May 28, 2024 · 2 comments

Comments

@chen-bowen
Copy link

Hi Chris,

Thank you so much creating this course. As I'm going through the material, I realize the dependencies installation now will have issues with the super old version of SQLAlchemy. I have personally updated the dependencies to make it work on my m2 mac, it would be good to update those dependencies in the repo for people to have the latest version of codebase. I could also help you do it if necessary.

Thanks,
Bowen

@ejm4567
Copy link

ejm4567 commented Jun 26, 2024

Bowen: Could you provide a list of what you did to get Part-07 onwards working on a Mac?
I am having similar issues in running prestart, either as a Bash script or Python script.

Thanks!
--Ed

@ejm4567
Copy link

ejm4567 commented Jun 27, 2024

I solved my issue with prestart.sh not finding app.db.base by defining PYTHONPATH to point to the base of the Part-07 git repo:

export PYTHONPATH=$HOME/Codes/PythonScripts/FastAPI-tutorial/ultimate-fastapi-tutorial/part-07-database

Then Ifound that the Pydantic schema for UserCreate had full_name in app/db/init_db.py but was missing first_name and surname. Adding dummy values for those Optional attributes then allowed prestart.sh to run to completion without error.

`
(base) part-07-database % ./prestart.sh
INFO:main:Initializing service
INFO:main:Starting call to 'main.init', this is the 1st time calling it.
/Users/XXX/Codes/PythonScripts/FastAPI-tutorial/ultimate-fastapi-tutorial/part-07-database/./app/backend_pre_start.py:25: RemovedIn20Warning: Deprecated API features detected! These feature(s) are not compatible with SQLAlchemy 2.0. To prevent incompatible upgrades prior to updating applications, ensure requirements files are pinned to "sqlalchemy<2.0". Set environment variable SQLALCHEMY_WARN_20=1 to show all deprecation warnings. Set environment variable SQLALCHEMY_SILENCE_UBER_WARNING=1 to silence this message. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
db.execute("SELECT 1")
INFO:main:Service finished initializing
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
/Users/XXX/opt/anaconda3/envs/Py312/lib/python3.12/site-packages/pydantic/_internal/_config.py:334: UserWarning: Valid config keys have changed in V2:

  • 'orm_mode' has been renamed to 'from_attributes'
    warnings.warn(message, UserWarning)
    INFO:main:Creating initial data
    INFO:main:Initial data created
    `

Thanks,

--Ed

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

No branches or pull requests

2 participants