Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 2.2 KB

CONTRIBUTING.md

File metadata and controls

55 lines (38 loc) · 2.2 KB

Contributions are welcome, just make sure that before you open a pull request:

  1. The test suite passes
  2. You add a description of your changes to the changelog

If your pull request includes some pytest setup/unit testing you'll be my new favorite person.

Development Environment Setup

  1. git clone https://github.com/michelcrypt4d4mus/pdfalyzer.git
  2. cd pdfalyzer

After that there's a forking path depending on whether or not you use poetry (which is what we use) to manage your python lifestyle.

Note that the minimum versions for each package were chosen because that's what worked on my machine and not because that version had some critical bug fix or feature so it's entirely possible that using earlier versions than are specified in pyproject.toml will work just fine. Feel free to experiment if there's some kind of version conflict for you.

With Python Poetry:

These commands are the poetry equivalent of the traditional virtualenv installation followed by source venv/bin/activate but there's a lot of ways to run a python script in a virtualenv with poetry so you do you if you prefer another approach.

poetry install
source $(poetry env info --path)/bin/activate

With A Manual venv:

python -m venv .venv              # Create a virtualenv in .venv
. .venv/bin/activate              # Activate the virtualenv
pip install .                     # Install packages

Note that I'm not sure exactly how to get the pdfalyze command installed when developing outside of a poetry env, but creating a simple run_pdfalyzer.py file with these contents would do the same thing:

from pdfalyzer import pdfalyzer
pdfalyzer()

Testing

Test coverage is relatively spartan but should throw failures if you really mess something up. See pytest's official docs for other instantiation options.

# Run tests (but not the slow ones):
pytest

# Run all tests (including the slow ones):
pytest -v --slow

# Run only the slow tests:
pytest -m slow --slow:

YARA Rules

We love any and all PDF malware related YARA rules so send them our way.