orgua / shepherd-datalib

Programming- and CLI-Interface for the h5-dataformat of the Shepherd-Testbed
MIT License
3 stars 0 forks source link

Shepherd - Datalib

PyPiVersion image Pytest CodeStyle

Data-Package: https://pypi.org/project/shepherd_data

Core-library: https://pypi.org/project/shepherd_core

Main Documentation: https://orgua.github.io/shepherd

Main Project: https://github.com/orgua/shepherd

Source Code: https://github.com/orgua/shepherd-datalib


The Repository contains python packages for the shepherd-testbed

Navigate there to get an in depth view for the tools.

Development

PipEnv

The environment brings everything needed for dev-work, steps for installing are described below also as shell-commands (OS-independent).

git clone https://github.com/orgua/shepherd-datalib
cd .\shepherd-datalib

pipenv install --dev
pipenv shell

pipenv update
pipenv install --dev pytest

Update dynamic Fixtures

When external dependencies (Target-Lib) or core-models change, the fixtures should be also updated for the testbed.

python3 extra/gen_firmwares.py
python3 extra/gen_energy_envs.py
python3 extra/prime_database.py
# commit the updated 'shepherd_core/shepherd_core/data_models/content/_external_fixtures.yaml'
# delete (optional) 'extra/content'

Running Testbench

pytest
pytest --stepwise

Code Coverage (with pytest)

coverage run -m pytest

coverage html
# or simpler
coverage report

Release-Procedure

pipenv shell

bump2version --allow-dirty --new-version 2024.9.1 patch
# ⤷ format: year.month.patch_release

pre-commit run --all-files

# additional QA-Tests (currently with open issues)
pyright

# inside sub-modules unittests
cd shepherd_core
pytest --stepwise
cd ../shepherd_data
pytest --stepwise
# when developers add code they should make sure its covered by the testsuite
coverage run -m pytest
coverage html

Open Tasks / TODO