Skip to main content

# Unused Deps Py

unused_deps_py is a command line tool to determine any unused dependencies in [java_library](https://docs.bazel.build/versions/master/be/java.html#java_library) targets. It outputs buildozer commands to apply the suggested prunings. It’s based on [unused_deps](https://github.com/bazelbuild/buildtools/blob/master/unused_deps/README.md) but it also adds support for [rules_jvm_external](https://github.com/bazelbuild/rules_jvm_external) maven repositories.

## Installation

### Preferred way `shell $ pip install unused-deps-py $ unused_deps_py --help `

### Building from sources `shell $ bazel run //unused_deps_py -- --help `

## Usage

`shell unused_deps_py --workspace-path WORKSPACE_PATH TARGET... `

Here, TARGET is a space-separated list of Bazel labels, with support for :all and …

## Releasing to PyPI

In order to release a new version you first need update the version number in:

  1. BUILD.bazel

  2. main.py

Then you need to run:

`shell $ bazel build //unused_deps_py:unused_deps_py_wheel $ twine upload bazel-bin/unused_deps_py/unused_deps_py-<version>-py3-none-any.whl `

## Local manual testing

`shell # build bazel build //unused_deps_py/... # store the filename of the Python Wheel in a variable WHL="$(ls $(bazel info bazel-bin)/unused_deps_py/*.whl)" # move to a temporary directory pushd /tmp # setup a virtual environment to avoid polluting your Python installation pipenv install # install the wheel pipenv install $WHL # enter the pipenv environment to do manual testing pipenv shell # do some manual tests unused_deps_py -h unused_deps_py --version unused_deps_py --workspace-path /whatever //libs/super-lib # exit the virtual environment exit # delete the virtual environment pipenv --rm rm Pipfile && rm Pipfile.lock # go back to your previous directory popd `

Metadata

Release files for unused-deps-py 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for unused-deps-py 0.0.6
File Interpreter ABI Platform Actions
unused_deps_py-0.0.6-py3-none-any.whl Python 3 none any Details for unused_deps_py-0.0.6-py3-none-any.whl

Release files / unused_deps_py-0.0.6-py3-none-any.whl

Download URL unused_deps_py-0.0.6-py3-none-any.whl
Size 197.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53f8faf43f26c42c54ca1a00c46f042d80fab33ec2a1c0f7d49b59b1b6f0cc16
BLAKE2b-256 checksum
How to use checksums
b6753d9a8c6992c764ba0707eaa519ed675fbc0951155e333f958f14275d4fd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.7

Security for unused-deps-py 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page