pkgcheck
Dependencies
pkgcheck is developed alongside pkgcore and snakeoil. Running pkgcheck from git will often require both pkgcore and snakeoil from git as well.
For releases, see the required runtime dependencies.
There are also several optional runtime dependencies that add or extend check support in various ways if found on the host system including the following:
git: supports historical queries for git-based repos and commit-related checks
requests: supports various network-related checks
Gentoo-PerlMod-Version: supports Perl package version checks
tree-sitter-bash: used in checks that inspect the CST of ebuilds and eclasess. Must be language version >= 14.
Installing
Installing latest pypi release:
pip install pkgcheck
Installing from git:
pip install https://github.com/pkgcore/pkgcheck/archive/master.tar.gz
Installing from a tarball:
python setup.py install
Usage
Most users will use pkgcheck on the command line via pkgcheck scan to target ebuild repos. See the docs or the man page for more information on running pkgcheck.
It’s also possible to run pkgcheck natively from python. For example, to output the results for a given ebuild repo:
from pkgcheck import scan
for result in scan(['/path/to/ebuild/repo']):
print(result)
This allows third party tools written in python to leverage pkgcheck’s scanning functionality for purposes such as CI or VCS commit support.
Tests
Normal pytest is used, just execute:
pytest
In addition, a tox config is provided so the testsuite can be run in a virtualenv setup against all supported python versions. To run tests for all environments just execute tox in the root directory of a repo or unpacked tarball. Otherwise, for a specific python version execute something similar to the following:
tox -e py313
Adding new checks
Adding a new check consists of 2 main parts: writing the logic and documentation, and adding tests for the check.
Writing the logic
Select the best file for the check under src/pkgcheck/checks/.
Create new classes for the results:
You would need to select the correct result level (style, info, warning, error) - you might want to consult QA team.
You would need to select the correct context: category, package, version, profile, etc.
Add long user friendly documentation for the result.
Implement the desc property which is printed to the user.
Create a new class for the check:
Add long user friendly documentation for the result.
Put the source of input for the check. This is hard, so best case is to find similar check and copy the code.
Define the results it can return.
Implement the feed function.
Adding tests
Select one of the repos under testdata/repos. In most cases you would want standalone.
Add the ebuild/category/test case you want to catch.
cd into this directory, and run pkgcheck scan --cache-dir /tmp -R JsonStream. This should yield the results you want to catch (filter out what you expect).
Add the results to the test case under: testdata/data/repos/${REPO}/${CHECK CLASS}/${RESULT CLASS}/expected.json
If you want to check the fix for the test case, git add the files under testdata/repos/${REPO}, modify to fix the results, and using git diff testdata/repos/${REPO} collect the diff.
Copy similar patch, add the diff to the patch file, and fix file names, under: testdata/data/repos/${REPO}/${CHECK CLASS}/${RESULT CLASS}/fix.patch
Metadata
Release files for pkgcheck 0.10.48
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pkgcheck-0.10.48.tar.gz | 446.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pkgcheck-0.10.48-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 657.9 kB
Release files / pkgcheck-0.10.48.tar.gz
| Download URL | pkgcheck-0.10.48.tar.gz |
|---|---|
| Size | 446.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
231ce9cb7015df95adf6acb7e731b9496fa4c1bdde7fc5442b2ac90de8519e9f
|
|
BLAKE2b-256 checksum How to use checksums |
11b0cdb1da968e846e29d7f509f0c6bb37e461ccb069fb3701d2eb7b066270c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logRelease files / pkgcheck-0.10.48-py3-none-any.whl
| Download URL | pkgcheck-0.10.48-py3-none-any.whl |
|---|---|
| Size | 211.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2fdedee5f834ee38de0ac8e2ca4b7d84ec61e70a83160bf1f10929728c614ab9
|
|
BLAKE2b-256 checksum How to use checksums |
8b35e1b074b0687417c9817549d66593cd8eaa62c92905eae4ed03b32c5fe1e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency log