liccheck is a Python library and command-line tool that checks package licenses listed in a requirements.txt file or pyproject.toml and their dependencies against a user-defined strategy. This strategy includes lists of authorized and unauthorized licenses, as well as explicitly authorized packages. The current version is 0.9.2, with a fairly active release cadence addressing features like Poetry support and improved license parsing.
pip install liccheckNo compatibility data collected yet for this library.
This quickstart demonstrates how to use `liccheck` as a command-line tool. It creates a mock `requirements.txt` and `liccheck.ini` strategy file, then executes `liccheck` to verify licenses. For a real-world scenario, ensure the packages listed in `requirements.txt` are actually installed in the same Python environment where `liccheck` is run.
Upgrade to Python 3.5+ or pin `liccheck<0.9.2` for Python 2 projects.
Install `liccheck` alongside your project's dependencies: `pip install -r requirements.txt liccheck`.
Always provide a strategy file, either explicitly via `--strategy-ini-file` or by placing `liccheck.ini` or a `[tool.liccheck]` section in `pyproject.toml` in the current working directory. Refer to documentation for example configurations.
Ensure you are using `liccheck` version 0.9.1 or newer for accurate handling of complex license expressions.
For new projects or migration, consider using `pyproject.toml` for your `liccheck` configuration. For older `liccheck` versions, `.ini` files are the primary option.
Install the package using pip: `pip install liccheck`
Ensure a `requirements.txt` file exists in the current directory or specify its path using the `-r` option: `liccheck -r path/to/your/requirements.txt`
Create a `liccheck.ini` (or `pyproject.toml` with `tool.liccheck` section) in the current directory, or specify the strategy file's path using the `-s` option: `liccheck -s path/to/your/strategy.ini`
Manually investigate the license of the reported package. If it's a valid license you wish to permit, add it to the `authorized_licenses` section in your strategy file. If it's an internal package or one you want to explicitly allow, add it to the `authorized_packages` section. You may need to specify the license string exactly as `liccheck` reports it for recognition.
Try upgrading or downgrading `setuptools` and related packages (`pip install --upgrade setuptools`, `pip install 'setuptools<60.0.0'`) or run `liccheck` in a fresh virtual environment to isolate its dependencies. Using the `--no-deps` option might also help in some cases if the conflict is within the dependencies rather than the top-level packages.