-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
How to implement requirements when using a project management tool like hatch #10706
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
Comments
Hi! I don't know too much about hatch. Could you specify the commands you would usually run to build your documentation locally? |
Yes! so I would run Under the hood, there are two things that feed into this. I have within my config file defined my hatch [envs.docs]
dependencies = [
"mkdocs",
"mkdocs-material",
"mkdocstrings[python]",
] and then also a script [envs.docs.scripts]
changelog = "scriv create"
serve = "mkdocs serve" which together allow me the above command. Does that help or somewhat explain where the difficulty comes from. Which is essentially a shortcut for |
I think I understand. OK, it seems you should be able to use I'd recommend you to use the feature version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
commands:
- pip install hatch
- hatch run docs:build
- mkdir --parents $READTHEDOCS_OUTPUT
- mv output/html $READTHEDOCS_OUTPUT/html Note that I'm using |
Awesome, will try that. Maybe one last QQ:
|
Yes. |
I have seen that the build process is still in I have noted down however that as soon as these things are supported, we would love to jump back on the opportunity :) Thanks so much for the help, I am actually sure that this is the correct solution to the problem |
This is old. In fact, I updated the documentation an hour ago to reflect the reality: #10708. Projects using I'd appreciate if you give it a try and give us feedback on that, since we are actively working on it and we need more users testing it and reporting issues 🙏🏼 |
To see it in action @maxschulz-COL https://docs.pypi.org/ 😄 (uses MkDocs and |
Awesome, so I implemented the custom build, and I think the documentation works correctly (see https://vizro--6.org.readthedocs.build/en/6/) However, I cannot see the flyout there, whereas before I think I could on PRs, is there anything additional I need to do? build:
os: ubuntu-22.04
tools:
python: "3.11"
commands:
- pip install hatch
- cd vizro-core/ && hatch run docs:mkdocs build
- mkdir --parents $READTHEDOCS_OUTPUT
- mv vizro-core/site/ $READTHEDOCS_OUTPUT/html |
It should just work. I think you already found a bug 😄 . I did a quick test by myself at readthedocs/test-builds#2110 and I'm not showing the flyout in my PR 😅 I will take a deeper look to see if I can find the issue and fix it. |
🎉 I found and fixed the issue. @maxschulz-COL Now it's working on your PR preview as well 🚀 |
@humitos Are you sure it is fixed? Unless I am missing something, the flyout does not appear: https://vizro--6.org.readthedocs.build/en/6/ |
You can also try adding a query attribute to the URL to force the cache https://vizro--6.org.readthedocs.build/en/6/?cache=no |
It does work :) Very sleep also with the pop up that it was built from a PR :) Thanks a lot for the support, I guess we all profited from this haha! Maybe two last QQ:
|
See squidfunk/mkdocs-material#4315
Yes, you can have multiple active versions of your documentation and they will appear in the flyout so users can switch them over. |
I'm closing this issue since the original issue is already solved, but feel free to re-open if you consider. |
@humitos I am coming back to this as there is a related issue popping up. Due to us working in a monorepo, we would love to use the functionality of cancelling builds for unrelated changes: https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition However it seems that one cannot use Is there a way still to cancel custom build processes even when wanting to use |
@maxschulz-COL yes. You can run any command and output 183 exit code to cancel the build https://docs.readthedocs.io/en/stable/builds.html#cancelling-builds |
What's the problem this feature will solve?
I am currently implementing the documentation for an OS project: https://github.com/mckinsey/vizro and there we use a project management tool https://github.com/pypa/hatch
Hatch is great at managing your projects development, and in its configuration (.toml) file we specify the dev dependencies (ie also the docs dependencies)
Currently, unless I overlooked something, there is no other way to pass the docs dependencies to RTD unless I add a new
requirements.txt
. This would be a duplication and "hard" to maintain.Describe the solution you'd like
I would like either a hint, or a solution on how I can pass the docs dependencies.
Best solution:
hatch
environment dependenciesSecond best solution:
Alternative solutions
So far I work with the duplicate
requirements.txt
Additional context
So far RTD is awesome, this is more a quality of life improvement :)
The text was updated successfully, but these errors were encountered: