-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Simplify instructions for installing dependencies with uv #11655
Conversation
|
||
You can use ``-r docs/requirements.txt``, etc. instead as needed. MkDocs projects could use ``NO_COLOR=1 .venv/bin/mkdocs build --strict --site-dir $READTHEDOCS_OUTPUT/html`` instead. | ||
MkDocs projects could use ``NO_COLOR=1 uv run mkdocs build --strict --site-dir $READTHEDOCS_OUTPUT/html`` instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it required the -m
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uv run mkdocs
tries to run the mkdocs
binary, while uv run -m mkdocs
tries to run mkdocs as module, and AFAIK both work:
➜ uv run -m mkdocs --help
Usage: python -m mkdocs [OPTIONS] COMMAND [ARGS]...
MkDocs - Project documentation with Markdown.
Options:
-V, --version Show the version and exit.
-q, --quiet Silence warnings
-v, --verbose Enable verbose output
--color / --no-color Force enable or disable color and wrapping for the output. Default is auto-detect.
-h, --help Show this message and exit.
Commands:
build Build the MkDocs documentation.
get-deps Show required PyPI packages inferred from plugins in mkdocs.yml.
gh-deploy Deploy your documentation to GitHub Pages.
new Create a new MkDocs project.
serve Run the builtin development server.
➜ uv run mkdocs --help
Usage: mkdocs [OPTIONS] COMMAND [ARGS]...
MkDocs - Project documentation with Markdown.
Options:
-V, --version Show the version and exit.
-q, --quiet Silence warnings
-v, --verbose Enable verbose output
--color / --no-color Force enable or disable color and wrapping for the output. Default is auto-detect.
-h, --help Show this message and exit.
Commands:
build Build the MkDocs documentation.
get-deps Show required PyPI packages inferred from plugins in mkdocs.yml.
gh-deploy Deploy your documentation to GitHub Pages.
new Create a new MkDocs project.
serve Run the builtin development server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I don't have too much experience with uv
, but I'm happy to merge this if you already tested it on Read the Docs. Do you have a working example?
Great question 😄 Yes, we use this in cookiecutter-django: cookiecutter/cookiecutter-django#5440 |
I get
for
I assume this requires a lock file? |
Yes, of course |
The old instructions don't so I consider this a regression. Not every project (I'd argue very few at the moment) are using uv lockfiles. |
As far as I understand, the I didn't know it was possible to opt-out of lockfile with uv... If you don't want lockfiles, what's the point of
That's only a documented recommended way, you have to copy the config into your own project. Then you're free to branch it and adapt it however you like, calling that a "regression" a bit of a strong wording IMO 😄 Perhaps add a note after the snippet that this workflow needs a lockfile? |
Since the instructions were added in #11322, uv gained a new capability to run
uv sync
anduv run
enabling some simplifications📚 Documentation previews 📚
docs
): https://docs--11655.org.readthedocs.build/en/11655/dev
): https://dev--11655.org.readthedocs.build/en/11655/