Skip to content

Development

This doc explains how to set up dev env if you want to get involved with this project.

Requirements

  • Python 3.10+

Setup

This project uses uv as a project manager and Lefthook as a Git hooks manager.

git clone https://github.com/urlscan/urlscan-python
cd urlscan-python

# install uv
pip install -r requirements.txt
# sync uv
uv sync
# install Lefthook
uv run lefthook install

Test

This project uses pytest as a testing framework.

Unit Test

Unit tests use a mock HTTP server (csernazs/pytest-httpserver) and are located under <root>/tests/unit/

uv run pytest

Integration Test

Integration tests require the environment variable URLSCAN_API_KEY and located under <root>/tests/integration/

uv run pytest --run-optional-tests=integration

Docs

This project uses MkDocs as a documentation tool and uses Mike for versioning.

# run the dev server
uv run mike serve
# or build the docs
uv run mke build