Skip to main content

Compare and report on two artefacts summaries.

Project description

Artefacts Comparison

artefactscomparison is a Python package to compare and report on two artefacts summaries.

An artefact summary is a CSV listing files' paths and SHA512 sum. Assuming artefacts are saved under the results/ directory, an artefact summary is generated as follows:

$ find results/ -type f `# list files in the 'results/' directory…`\
    -exec sha512sum {} \; `# … and compute their SHA-512 sum`\
    | sed 's/  /,/' `# use comma — instead of double space — as separator`\
    | cat <(echo 'sha512,file_name') - `# add header to CSV`

sha512,file_name
<SHA512>,results/artefact_1
<SHA512>,results/path/to/artefact_2

The artefactscomparison package provides a CLI entry point that outputs a diff report on two artefacts summaries:

$ artefacts_comparison --base base_artefact_summary.csv --head head_artefact_summary.csv

@@ 3 file(s) added @@
+ path/to/new_file_1
+ path/to/new_file_2
+ path/to/new_file_3

@@ 1 file(s) deleted @@
- path/to/removed_file.csv

@@ 2 file(s) renamed @@
! path/to/to_rename_1 → path/to/renamed_1
! path/to/to_rename_2 → path/to/renamed_2

# 2 other file(s) remain unmodified

User Quickstart

Installation

You can install artefactscomparison from PyPI:

pip install artefactscomparison

How to use

From the command line:

artefacts_comparison --head head_artefact_summary.csv --base base_artefact_summary.csv

where:

  • head_artefact_summary.csv is the artefact summary of the branch you want to merge,
  • base_artefact_summary.csv is the artefact summary of the branch your PR points to (i.e. main, master, etc.).

Development Quickstart

This project adheres to Semantic Versioning, and releases descriptions can be found in CHANGELOG.md.

Use your own environment management preference

For pyvenv:

python -m venv .venv/
source .venv/bin/activate

Install this package

git clone git@github.com:EBoisseauSierra/artefacts_comparison.git
cd artefacts_comparison
pip install --upgrade pip
pip install -e '.[dev,test]'

Initialise pre-commit hooks

The pre-commit hooks defined in this repo ensure that code formating and linting is applied on any piece of code committed. This should enable a cleaner code base and less “formatting noise” in commits.

To install the hooks, simply run:

pre-commit install

Contributing

  1. Fork this repo (https://github.com/EBoisseauSierra/artefacts_comparison/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Licence

Distributed under the MIT License. See LICENSE for more information.

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

artefactscomparison-0.2.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

artefactscomparison-0.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file artefactscomparison-0.2.0.tar.gz.

File metadata

  • Download URL: artefactscomparison-0.2.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for artefactscomparison-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b492cb571bcf475ae2af9a066e1f0e3e72ee5a8a5009858b3d955f9139be1820
MD5 8ab84dcef09ae3a749c56777b664acf2
BLAKE2b-256 12792ba7b107599e7d4d3cb648a9440c2305f73cfe4087f76270942d004882db

See more details on using hashes here.

File details

Details for the file artefactscomparison-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for artefactscomparison-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5da714b292251e8be015e2ff54586d277089ef1c02d9948e81099e1f389c767
MD5 c7c429cfd84cf7f3f45498b4141201b1
BLAKE2b-256 b0df7bbbf1a6ccae8428de70cfc507671315a5e0586e3451aed223a6570b9516

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page