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/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.2.tar.gz (11.0 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.2-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkdocs_get_deps-0.2.2.tar.gz
  • Upload date:
  • Size: 11.0 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.2.tar.gz
Algorithm Hash digest
SHA256 8ee8d5f316cdbbb2834bc1df6e69c08fe769a83e040060de26d3c19fad3599a1
MD5 28890b3b44fa13ae6675854543695886
BLAKE2b-256 ce25b3cccb187655b9393572bde9b09261d267c3bf2f2cdabe347673be5976a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_get_deps-0.2.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_get_deps-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e7878cbeac04860b8b5e0ca31d3abad3df9411a75a32cde82f8e44b6c16ff650
MD5 4149f59099e163c6445980d3abdbbc62
BLAKE2b-256 8829744136411e785c4b0b744d5413e56555265939ab3a104c6a4b719dad33fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_get_deps-0.2.2-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