Skip to main content

An extra command for MkDocs that infers required PyPI packages from `plugins` in mkdocs.yml

Project description

mkdocs-get-deps

An extra command for MkDocs that infers required PyPI packages from plugins in mkdocs.yml.

PyPI License GitHub Workflow Status

Installation:Alternatively through MkDocs itself:
pip install mkdocs-get-deps
pip install mkdocs

This command guesses the Python dependencies that a MkDocs site requires in order to build. It simply prints the PyPI packages that need to be installed. In the terminal it can be combined directly with a pip install command, as per the last example below:

Usage:Alternatively through MkDocs itself:
# Print dependencies of the current project
mkdocs-get-deps
# Save them into a file
mkdocs-get-deps > requirements.txt
# Install dependencies on the fly
pip install $(mkdocs-get-deps)
mkdocs get-deps

mkdocs get-deps > requirements.txt
pip install -r requirements.txt

pip install $(mkdocs get-deps)

The idea is that right after running this command, you can directly follow it up with mkdocs build and it will almost always "just work", without needing to think which dependencies to install.

The way it works is by scanning mkdocs.yml for themes:, plugins:, markdown_extensions: items and doing a reverse lookup based on a large list of known projects (catalog, see below).

Of course, you're encouraged to use a "virtualenv" with such a command. Also note that for environments that require stability (for example CI) directly installing deps in this way is not a very reliable approach as it precludes dependency pinning.

The command allows overriding which config file is used (instead of mkdocs.yml in the current directory) as well as which catalog of projects is used (instead of downloading it from the default location). See mkdocs get-deps --help.

MkDocs' official catalog of plugins

Check out https://github.com/mkdocs-community/catalog and add all your general-purpose plugins, themes and extensions there, so that they can be looked up through mkdocs get-deps.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_get_deps-0.2.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_get_deps-0.2.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_get_deps-0.2.1.tar.gz.

File metadata

  • Download URL: mkdocs_get_deps-0.2.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mkdocs_get_deps-0.2.1.tar.gz
Algorithm Hash digest
SHA256 177f9629f71716a8250b417f41b0a2d2145a9fd986d84d0d723b2e3406ce3741
MD5 449aa307032a17bd7157597ed7b5ee2a
BLAKE2b-256 30c58294bbbbdc2c6438158a94798df7ec48d8be64ced30f926941c4dd5d2c38

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_get_deps-0.2.1.tar.gz:

Publisher: deploy-release.yml on mkdocs-community/get-deps

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mkdocs_get_deps-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_get_deps-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 07d6076298715dfcb8232e7dec083d09015b4e65482ce7f6743cb07cd1da847e
MD5 a24f96ef2043574710e3970a298a028f
BLAKE2b-256 cafaab291bbb8f7453f8449a982843b044b37050c85f5895ef97f599683a1249

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_get_deps-0.2.1-py3-none-any.whl:

Publisher: deploy-release.yml on mkdocs-community/get-deps

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page