A library and CLI to aid in configuring layered fingerprints.
Project description
Fingerprinter
This utility library can be used to create SHA256 fingerprints
using globs and paths. It is meant to be a replacement
for the sources/fingerprints.sh
in
common-build-scripts.
Installation
pip install uw-it-build-fingerprinter
Use
fingerprinter --help
fingerprinter -f fingerprints.yml -t assets
Configuration File
To get started, you'll need a configuration file. This file is a yaml file that defines your fingerprint targets.
targets:
target-name:
include-paths:
- src/**/*.py # Glob to match all python files recursively under a directory
- src/ # Will match every file under src/, recursively. (Same as 'src/**/*.*)
- src # interchangeable with `src/` or `src/**/*.*`
- src/foo.py # Include a specific file
You may also declare other targets as dependencies:
# This example has a source fingerprint that is generated for all python files
# under the src/ directory, but the fingerprint is dependent on the
# dependency locks. This means that even if all python files remain
# untouched, an update to the dependencies will generate a new
# source fingerprint.
# `fingerprints.yaml` is also included here to ensure that changes
# to the actual fingerprint configuration regenerates all fingerprints.
targets:
dependencies:
include-paths:
- poetry.lock
- fingerprints.yaml
source:
depends-on: [dependencies]
include-paths: ['src/**/*.py']
All paths will be lexicographically sorted at runtime, however dependencies are always resolved in the order provided.
python -m fingerprinter.cli -f fingerprints.yaml -t source
will do the rest!
Excluding Files
There may be some paths that you never want to consider.
.pyc
, __pycache__
and .pytest_cache/
are always ignored by default.
You can exclude paths at the base of your yaml:
ignore-paths:
- '**/ignore-me.py' # Ignore every 'ignore-me.py' in the tree
- 'src/special/ignore-me-also.py' # Ignores this specific file
targets:
foo:
# Will include src/foo/bar, but not src/.secrets/sekret or src/foo/__pycache__/blah
include-paths: ['src']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for uw-it-build-fingerprinter-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 711ac1b4248ebecd170aa09c23d5d2afba0553927d03bf73926c5cfe845052f0 |
|
MD5 | 0eae379c9e99a60cc54ed3e089d5875e |
|
BLAKE2b-256 | d82ec50310799a3302305a44fa828025e805ab993a92a11c8eff3a4b84be58dd |
Hashes for uw_it_build_fingerprinter-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94db8615e216e2dfc914f505393e0bff2c74b7adf754561ef1014ddaaa041daa |
|
MD5 | 0c403d899088347a83eed2f6aa1d9555 |
|
BLAKE2b-256 | 44619dd9bb9cd51e150ef7181e03bffad350b97503ca54756331b6c744e9ddf1 |