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

Move pip install command to a snippet #14192

Merged
merged 3 commits into from
Jun 20, 2024
Merged

Conversation

djsauble
Copy link
Contributor

Duplicate code blocks are difficult to update because you must update all code blocks simultaneously. If you miss one, you risk breakage or inconsistency between otherwise identical examples.

To minimize risk, let's use snippets to deduplicate the code, so that you only need to update the snippet for the change to be reflected in all instances of the code.

Example

Simplified example:

/snippets/installation.mdx

pip install prefect

Now you can import this code with:

import Installation from "/snippets/installation.mdx"

<Installation />

Checklist

  • This pull request includes a label categorizing the change e.g. maintenance, fix, feature, enhancement, docs.
  • This pull request references any related issue by including "closes <link to issue>"
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • If this pull request removes docs files, it includes redirect settings in mint.json.
  • If this pull request adds functions or classes, it includes helpful docstrings.

Copy link
Contributor

@billpalombi billpalombi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this feature - thanks for wiring it up and showing how it's done!

Copy link
Contributor

@discdiver discdiver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Two suggestions.

docs/snippets/installation.mdx Outdated Show resolved Hide resolved
docs/snippets/installation.mdx Outdated Show resolved Hide resolved
@djsauble djsauble merged commit 780a7d7 into main Jun 20, 2024
3 checks passed
@djsauble djsauble deleted the move_pip_install_to_a_snippet branch June 20, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants