Extra checks for FOD BOSA's Accessibility Check tool.
The frontend for this tool can be found here.
We have created a list of improvements here.
General project documentation can be found in the docs folder.
To install this package in your environment, run:
pip install git+ssh://[email protected]/radix-ai/fod-bosa/[email protected]
It's easy to deploy this API anywhere using Docker. Make sure you have Docker running.
-
First, we need to build the image:
DOCKER_BUILDKIT=1 docker build --ssh default --target app-image --tag accessibility-check-backend-app .
Note: we use BuildKit to build our image.
Note: in case the Docker build crashes, you may need to increase the amount of RAM allowed to Docker.
-
To run the image locally, you can simply run the following command:
docker run --detach --name ac-container --publish 80:8000 accessibility-check-backend-app
This command runs the
app-image
image in a detached mode and publishes it on port 80. -
You can now find the API at http://0.0.0.0.
Tip: you can also open the link in the browser to test the API using the handy docs.
Instead of running the Docker image locally, you can also run it on a server. The easiest way to do this is pushing the container image you just built to a repository, and then pulling that image on your server.
Once per machine
- Generate an SSH key for GitLab, add the SSH key to GitLab, and add the SSH key to your authentication agent.
- Install Docker.
- Install VS Code.
- Install VS Code's Remote-Containers extension.
- Install Fira Code (optional).
Once per repository
You can set up your development environment as a self-contained development container with a single step. In VS Code, press ⌘ + ⇧ + P, select Remote-Containers: Clone Repository in Container Volume... and enter:
[email protected]:radix-ai/fod-bosa/accessibility-check-backend.git
Alternatively, if you prefer to install your environment locally, run ./tasks/init.sh
from VS Code's Terminal.
Activating the Python environment
- Open any Python file in the project to load VS Code's Python extension.
- Open a Integrated Terminal with ⌃ + ~ and you should see that the conda environment
accessibility-check-backend-env
is active. - Now you're ready to run any of tasks listed by
invoke --list
.
Running and debugging tests
- Activate the Python environment.
- If you don't see ⚡ Run tests in the blue bar, run ⌘ + ⇧ + P > Python: Discover Tests. Optionally debug the output in View > Output > Python Test Log in case this step fails.
- Go to any test function in
src/tests/pytest
. - Optional: put a breakpoint 🔴 next to the line number where you want to stop.
- Click on Run Test or Debug Test above the test you want to debug.
Releasing a new version
- Activate the Python environment.
- Commit any (un)staged changes on your branch and make sure to test them with
invoke test
. - Run
invoke bump --part=[major|minor|patch|post]
to (a) update the version number, (b) commit the changes, and (c) tag the commit with a version identifier. - Your tags will be pushed to the remote next time you
git push
(becausepush.followTags
is set to true in.git/config
). Or push the tag manually withgit push origin v0.2.0
. - You can now
pip install git+ssh://[email protected]/radix-ai/fod-bosa/[email protected]
.
Updating the Cookiecutter scaffolding
- Activate the Python environment.
- Run
cruft check
to check for updates. - Run
cruft update
to update to the latest scaffolding. - Address failed merges in any
.rej
files.