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

Documentation is completely broken - it points to the develop branch but says it's for 0.20.1 #1603

Closed
PawelRoman opened this issue May 5, 2024 · 9 comments

Comments

@PawelRoman
Copy link

PawelRoman commented May 5, 2024

The official documentation is generated from the develop branch, but it says it's for the official 0.20.1 version

For example, take a look at this page: https://tortoise.github.io/contrib/fastapi.html

And this: https://tortoise.github.io/examples/fastapi.html

It makes this import tortoise.contrib.fastapi.RegisterTortoise

But in 0.20.1 there is no such class. 0.20.1 is using register_tortoise synchronous function which seems to be a breaking change in the library.

@waketzheng
Copy link
Contributor

waketzheng commented May 5, 2024

You can install/upgrade the package from github to use the RegisterTortoise class:

pip install --upgrade 'tortoise-orm>=0.21' || pip install --upgrade --force-reinstall git+https://github.com/tortoise/tortoise-orm

Or by ssh

pip install --upgrade 'tortoise-orm>=0.21' || pip install --upgrade --force-reinstall git+ssh://[email protected]/tortoise/tortoise-orm

Then use this command to check the result:

python -c 'from tortoise.contrib.fastapi import RegisterTortoise'

@waketzheng
Copy link
Contributor

Documentation should be able to select version to fix this issue and #1569

@abondar
Copy link
Member

abondar commented May 7, 2024

Yeah, right now documentation publishing is wacky

I'll try to fix it with release of 0.21.0, so it will deploy docs only in case of new release, not just new commits

Github pages doesn't support doc versioning automatically, but it seems out there are some plugins, that say that they can handle it, I'll look into it in mean time

@qingshuiyuyu
Copy link

i cant believe why the FastAPI Examples can not be run
when i use register_tortoise
the error:async with register_tortoise( AttributeError: __aenter__

@waketzheng
Copy link
Contributor

@qingshuiyuyu Use async with RegisterTortoise instead. https://tortoise.github.io/examples/fastapi.html#main-py

@qingshuiyuyu
Copy link

@qingshuiyuyu Use async with RegisterTortoise instead. https://tortoise.github.io/examples/fastapi.html#main-py

but i can not import this class v:tortoise-orm==0.20.1 ,there only register_tortoise
i use another way this guy rewrite the class https://github.com/tortoise/tortoise-orm/issues/1576#issuecomment-2074505541

@waketzheng
Copy link
Contributor

Yeah, right now documentation publishing is wacky

I'll try to fix it with release of 0.21.0, so it will deploy docs only in case of new release, not just new commits

Github pages doesn't support doc versioning automatically, but it seems out there are some plugins, that say that they can handle it, I'll look into it in mean time

@abondar How is that?

@abondar
Copy link
Member

abondar commented May 21, 2024

Sadly, 0.21.0 is still not ready, as I want to fix #1607 before making release, but still didn't have time to sit for that properly

Other than that - I updated CI pipelines, so now it shouldn't update documentation on commits in develop branch, but didn't test it properly as it requires release for it

I am hoping to find time on this week for fix and release

@abondar
Copy link
Member

abondar commented May 24, 2024

Seems fixed now with release of 0.21.0

@abondar abondar closed this as completed May 24, 2024
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

4 participants