Third party pull requests help expand pyinfra's functionality and are essential to it's continued growth. This guide should help get you started adding additional modules/facts to pyinfra.
# Create a virtualenv
virtualenv /path/to/venv
# Clone the repo
git clone [email protected]:Fizzadar/pyinfra.git
# Install the package in editable mode with development requirements
pip install -e .[dev]
# Configure git to use pre-commit hook
flake8 --install-hook git
# Install direnv (see https://direnv.net/ )
# Note: The .env assumes the /path/to/venv is ./venv
direnv allow
If you want to make changes to pyinfra and test it, you can follow the Dev Setup steps above then run:
python setup.py install
To generate:
scripts/build_docs.sh
To view (on mac):
open docs/build/index.html
Use pytest
to run tests, or pytest --cov
to run with coverage.
For bash, see scripts/pyinfra-complete.sh
or source scripts/pyinfra-complete.sh
.
For zsh, see scripts/pyinfra-complete.sh
or source scripts/pyinfra-complete.zsh
.
These were generated using these commands:
env _PYINFRA_COMPLETE=source pyinfra > pyinfra-complete.sh
env _PYINFRA_COMPLETE=source_zsh pyinfra > pyinfra-complete.zsh
- How to write modules (operations + facts)
- API reference
- Always add tests for modules (operations + facts)
- Keep code style consistent:
- ~90 character lines
- no hanging indents
- single quotes everywhere possible