A CLI helper for [Distributed-Something](https://github.com/DistributedScience/Distributed-Something)
Project description
ds-reify
A CLI helper tool for Distributed-Something
Development
Setup Virtual Environment
Setup a python environment using the method of your choice.
Using the builtin venv:
python -m venv <ENV_NAME>
source <ENV_NAME>/bin/activate
Using conda (replace with any python >= 3.8):
conda create -n <ENV_NAME> python=3.8
conda activate <ENV_NAME>
Using whatever else you want, like pyenv.
Install dev tools
Install Poetry
curl -sSL https://install.python-poetry.org/ | python
source ~/.poetry/env
Install Nox
pip install --user --upgrade nox
See this post if you're curious as to why we don't install nox via Poetry.
Install pre-commit
pip install --user --upgrade pre-commit
Let Poetry install the rest from pyproject.toml
poetry install
Testing
Coverage.py is used for test coverage, alongside pytest, via the pytest-cov plugin.
To run the tests directly, in you virtual environment, run pytest --cov.
To let nox run across multiple isolated environments, run nox.
To avoid nox recreating the virtual environments from scratch on each invocation, run nox -r.
Run a specific test with nox -s tests -- tests/test_TESTNAME.
Static analysis
Autoformatting is performed with Black.
Run formatting with nox -s black or specify files/directors with nox -s black -- file1 dir1 ....
Black auto-formatting is not run by default when running nox in isolation, it must be specified.
Flake8 is used for linting. Under the hood, it uses:
- pylint
- pyflakes - invalid python code
- errors reported as
F
- errors reported as
- pycodestyle - PEP 8 style checking
Wfor warnings,Efor errors
- mccabe - code complexity
- errors reported as
C.
- errors reported as
- flake8-black plugin - adherence to Black code style
- erros reported as
BLK.
- erros reported as
- flake8-import-order plugin - import grouping and ordering checked against the Google styleguide
- errors reported as
I
- errors reported as
- flake8-bugbear plugin - various miscellaneous bugs and design problems
- likely bugs reported as
B - opinionated bugs reported as
B9 B950replacesE501for max line length checking (adds tolerance margin of 10%)
- likely bugs reported as
- flake8-bandit plugin - uses Bandit to find common security issues
- issues reported as
S
- issues reported as
- flake8-annotations plugin - detects absence of type annotations for functions
- issues reported as
ANN
- issues reported as
All of these are configured in the .flake8 file.
Run linting with nox -s lint or specify files/directoriess with nox -s lint -- file1 dir1 ....
Import ordering is not auto-formatted although may in the future by migrating to flake8-isort.
Safety is uesd for checking project dependencies against known security violations. For example, insecure-package.
Run it with nox -s safety.
Pre-commit
If you would like to enable the pre-commit hooks, run pre-commit install.
The hooks will run on files changed by the commit in question. To trigger hooks automatically run pre-commit run --all-files.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ds_reify-0.1.0.tar.gz.
File metadata
- Download URL: ds_reify-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.8.16 Darwin/22.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69e85157810599b041f3ad4d76567693da6b4a730a8a711e48bc3e2c93ebd64f
|
|
| MD5 |
432a8eaacb9f9c0c1f7b1bc2d4880d29
|
|
| BLAKE2b-256 |
a743997e9147ab5661980b2c3b944cc994510d38366fb055917606df51334705
|
File details
Details for the file ds_reify-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ds_reify-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.8.16 Darwin/22.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d0b0f98c877d1941aa8b54fbcdf34aed125b29e5ebb5b125c642681b862e2dc
|
|
| MD5 |
ed0e7213d9714aaf8582d9f4a7b988f5
|
|
| BLAKE2b-256 |
2c7ce61eea119d174a74fb03c206b9a82835d8147841eb1e4392f656447f7417
|