Skip to content

docs: add reference documentation for docker.utils module#3411

Open
Piyush0049 wants to merge 1 commit into
docker:mainfrom
Piyush0049:docs/document-docker-utils
Open

docs: add reference documentation for docker.utils module#3411
Piyush0049 wants to merge 1 commit into
docker:mainfrom
Piyush0049:docs/document-docker-utils

Conversation

@Piyush0049

Copy link
Copy Markdown

Fixes #3386

Context

The docker.utils.parse_env_file utility function was added in version 1.4.0, but it was never documented in the Sphinx reference files. As a result, the changelog link to the docs has been pointing to an empty location, leaving users unaware of how to officially parse .env files using docker-py.

Furthermore, kwargs_from_env (the backbone of docker.from_env()) was completely missing a docstring.

Changes Made

  • Added detailed Google-style Python docstrings with usage examples to both kwargs_from_env and parse_env_file in docker/utils/utils.py.
  • Created a new docs/utils.rst page using the .. autofunction:: directive to automatically pull the documentation.
  • Registered the new utils reference page in the docs/index.rst toctree.

Verification

  • Built the Sphinx documentation locally (make docs) successfully.
  • HTML renders cleanly without any warnings related to the newly added docstrings.

Signed-off-by: piyush0049 <piyushjoshi81204@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation missing for docker.utils.parse_env_file

1 participant