Development¶
Set up a development environment, run tests, and build the package.
In this guide¶
Prerequisites¶
- Git
- Python 3.8+
- pip
Clone and install¶
git clone https://github.com/rkriad585/ActiveVPN.git
cd ActiveVPN
python -m venv .venv
# macOS/Linux
. .venv/bin/activate
# Windows PowerShell
. .venv\Scripts\Activate.ps1
pip install -r requirements.txt pytest build twine
Run the tests¶
pytest -q
The suite in tests/ covers:
tests/test_detector.py— process matching, API failover, and verdict scoring (psutil/requests mocked).tests/test_logger.py— history persistence, clearing, and JSON/CSV/TXT export.
Build the package¶
python -m build
Creates dist/activevpn-<version>.tar.gz and dist/activevpn-<version>-py3-none-any.whl.
python -m twine check dist/*
Validates metadata. To publish, configure ~/.pypirc with a PyPI token and run:
python -m twine upload dist/*
Continuous integration¶
.github/workflows/ci.ymlrunspytest -qon Ubuntu, Windows, and macOS with Python 3.8 and 3.12 on every push tomainand every pull request, and builds the docs withmkdocs build --strictas a check..github/workflows/docs.ymlbuilds the MkDocs site and deploys it to GitHub Pages (https://rkriad585.github.io/ActiveVPN/) wheneverdocs/,mkdocs.yml, orpyproject.tomlchange onmain, or on manualworkflow_dispatch.
Code style¶
- Follow PEP 8 (4-space indentation).
- Keep the project's tone: descriptive names, minimal comments.
- Update the docs when you change behavior. See CONTRIBUTING.md.