Skip to content

GitHub Action Package for Automating Python-Package Dependency Management

License

Notifications You must be signed in to change notification settings

WIPACrepo/wipac-dev-py-dependencies-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

wipac-dev-py-dependencies-action

GitHub Action Package for Automating Python-Package Dependency Management

Overview

This GitHub Action creates 1+ dependencies*.log file(s) for documenting dependency versions (ex: dependencies.log, dependencies-dev.log, dependencies-docker-default.log, etc.). These files are similar to requirements*.txt-type files, with the distinct difference that dependencies*.log-type files are a reflection of the built environment(s). If dependency-version pinning is wanted, it should be done by the user in the setup.cfg/pyproject.toml file.

Details

This action uses pip freeze + pipdeptree to generate the dependencies*.log file(s). All current dependencies*.log files are deleted/overwritten/updated. By default, these file(s) are placed at the client repository's root. Setting the input arg use_directory: true will place the generated file(s) in dependencies-logs/.

Generating from Python Package

By default, this action generates a dependencies*.log file using the environment built from the client's Python package. In addition, a dedicated dependencies-EXTRA.log file is generated for each package "extra".

Generating from Docker Images

If the user supplies Docker image(s) tagged with "py-dep-this" (configurable by the input arg, docker_tag_to_dep). dependencies*.log file(s), named dependencies-docker-{IMAGE_NAME}.log, are generated from within each container.

Example File

    ```
    #
    # This file was autogenerated by WIPACrepo/wipac-dev-py-setup-action
    #   from `pip install .`
    #   using Python 3.10.
    #
    ########################################################################
    #  pip freeze
    ########################################################################
    certifi==2023.7.22
    charset-normalizer==3.3.1
    idna==3.4
    requests==2.31.0
    typing_extensions==4.8.0
    urllib3==2.0.7
    ########################################################################
    #  pipdeptree
    ########################################################################
    pip==23.2.1
    pipdeptree==2.13.0
    setuptools==65.5.1
    wheel==0.41.2
    mock-package
    ├── requests [required: Any, installed: 2.31.0]
    │   ├── certifi [required: >=2017.4.17, installed: 2023.7.22]
    │   ├── charset-normalizer [required: >=2,<4, installed: 3.3.1]
    │   ├── idna [required: >=2.5,<4, installed: 3.4]
    │   └── urllib3 [required: >=1.21.1,<3, installed: 2.0.7]
    └── typing-extensions [required: Any, installed: 4.8.0]
    ```

Full CI-Workflow: Using Alongside Other GitHub Actions

See https://github.com/WIPACrepo/wipac-dev-py-setup-action#full-ci-workflow-using-alongside-other-github-actions

About

GitHub Action Package for Automating Python-Package Dependency Management

Resources

License

Stars

Watchers

Forks

Packages

No packages published