A set of Justfiles for my development tasks.
Currently only targets Python projects.
There are 2 main Justfiles
Justfile.init
- Initializes a new project with the
init
recipe- Can be run from any directory.
- Retrieves the main Justfiles from Github.
- Initializes a new project with the
Justfile
- The main entry point for project management
- Includes the other Justfiles.
- Linked from
Justfile.main
in thejust directory
Download Justfile.init and run
just --justfile=Justfile.init init project <project-name>
to create a project <project-name>
under $HOME/development/project
.
Then cd
to $HOME/development/project/<project-name>
and run
just init-devenv
Development related files are stored in $HOME/development
with the folowing structure
<project-stage>
<project-name>
venv
<project-name>
<python-version>
The current project layout is as follows
pyproject.toml
src
<project name>
docs - Source files for the documentation
tests
docs - Built documentation
Use the following to create a new project
just -f <path to Justfile.init> init project <project-name> <project-language>
or
just -f <path to Justfile.init> init bluesky <project-name> <project-language>
Currently the only language is 'python'.
Main recipes for project management. Linked to Justfile
Running just
will display a list of the recipes.
just-update
- Updates the local Justfiles from Github
just-develop
- Switch to the develop
branch
just-main
- Switch to the main
branch
add
- Add distributions to the project
add-dev
- Add distributions for development tasks
build
- Uses pdm
to build the distribution files
build-docs
- Builds the documentation using Sphinx
init-pre-commit
- Initialize pre-commit tool
init-devenv
- Initializes a new project using pdm
,
adds the required development packages
and creates a set of documentation files.
Works by running the following recipes init-pyproject
, init-dev-pkgs
, and init-docs
init-venv-pyproject
- Intializes a virtual environment using the version of python defined in
pyproject.toml
.
init-venv-python
- Intializes a virtual environment using the current version of python.
lint
- Runs the ruff
linter
profile-module
- Runs the module with pyinstrument
profile-script
- Runs a script with pyinstrument
project-info
- Displays project information.
python-info
- Displays information about the python being used.
repl
- Opens a Python REPL
run
- Runs a Python one-liner
run-module
- Runs the project's module
set-venv-pyproject
- Set pdm's venv based on the python version in pyproject.toml
test
- Uses tox
to run the unit and integration tests
test-coverage
- Generates test coverage metrics
test-coverage-html
- Creates the test coverage report in HTML and opens it in a browser.
test-coverage-term
- Creates the test coverage report and displays it in the terminal.
test-docs
- Uses tox to test the documentation generation
test-integration
- Runs integration tests using pytest
test-types
- Uses mypy
to perform type checking
test-unit
- Runs unit tests using pytest
For Python projects I'm currently using the following tools