$ git clone [email protected]:questionpy-org/qpy-dev.git
$ cd qpy-dev
$ poetry install
$ alias poe="poetry run poe"
$ poe venv:install
$ poe moodle:start
$ poe qpy:serve
The most commonly used tasks.
Task | Description |
---|---|
venv:install |
Collect and install all dependencies in dev environment. Can be executed when updating dependencies in a sub-project, switching branches, etc. |
qpy:watch |
Run QuestionPy dev server in watch mode. |
docs:watch |
Start docs dev server in watch mode. |
check |
Run all checks on projects. Runs checks sequentially against your current dev environment. Preserves log output. |
toxp |
Run all checks on projects using tox. Runs checks in parallel in separate virtual environments (suppressing log output). Runs test suites against supported Python versions. |
up |
Bump all versions in pyproject.toml . |
moodle:* |
Manage Moodle dev stack. |
See the online help for a list of all available commands.
$ poe --help
$ cp .env .env.local
Edit .env.local
to your liking.
Add poe
as an alias to your login shell.
$ echo 'alias poe="poetry run poe"' >> ~/.bash_profile
Install all required Python versions for testing. Pyenv is easiest, but other methods work too.
$ pyenv install 3.11 3.12
Run arbitrary shell commands on Moodle start/shutdown. The example adds an exception to the firewall, so Moodle can access the host QuestionPy server.
MOODLE_DOCKER_POST_START_HOOK="IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' qpy-dev-moodle-webserver-1); sudo iptables -A INPUT -s $IP/16 -j ACCEPT"
MOODLE_DOCKER_PRE_STOP_HOOK="IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' qpy-dev-moodle-webserver-1); sudo iptables -D INPUT -s $IP/16 -j ACCEPT"
This repository does not address the PR waterfall issue directly that occurs when pushing commits that include breaking changes. But it does encourage to check against the other packages before pushing.
When pushing code/merging PRs that involve multiple repositories, you will need to respect the package's dependency graph, meaning you have to adhere to a particular order to avoid failed CI pipelines.
- questionpy-server
- questionpy-sdk
- questionpy-docs
Also, related PRs should be grouped and accepted in a timely manner to reduce friction for other developers as much as possible.