Utilities for helping maintain static sites.
# Migrates dates from the file name to the post's frontmatter
./migrate_post_date.py <post_files>
This project uses python3
.
This project uses pipenv
to isolate its environment. Install it with:
python3 -m pip install --user pipenv
Then install the project's dependencies:
pipenv install
This project uses unittest
for testing. To run the tests:
pipenv run python -m unittest
Use pipenv run
to run commands inside the virtualenv from outside the virtualenv.
Use pipenv shell
to get a shell inside the virtualenv.
The tests use Python's built-in unittest
module.
Add new files prefixed with test_
to the tests
directory.
Mirror the structure of the code.
From the root of the repository, run:
# Outside the virtualenv
pipenv run python -m unittest
# Inside the virtualenv
python -m unittest
To run a specific module, specify it after the command:
# Outside the virtualenv
pipenv run python -m unittest tests/lib/test_post.py
# Inside the virtualenv
python -m unittest tests/lib/test_post.py
Refer to the unittest docs or use the --help
option to get further help.