Skip to content

superlinear-ai/fod-bosa-accessibility-check-backend

Repository files navigation

Accessibility Check Backend

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.

Installation

To install this package in your environment, run:

pip install git+ssh://[email protected]/radix-ai/fod-bosa/[email protected]

Deployment

It's easy to deploy this API anywhere using Docker. Make sure you have Docker running.

  1. 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.

  2. 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.

  3. 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.

Contributing

Development environment setup

Once per machine
  1. Generate an SSH key for GitLab, add the SSH key to GitLab, and add the SSH key to your authentication agent.
  2. Install Docker.
  3. Install VS Code.
  4. Install VS Code's Remote-Containers extension.
  5. 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.

Common tasks

Activating the Python environment
  1. Open any Python file in the project to load VS Code's Python extension.
  2. Open a Integrated Terminal with + ~ and you should see that the conda environment accessibility-check-backend-env is active.
  3. Now you're ready to run any of tasks listed by invoke --list.
Running and debugging tests
  1. Activate the Python environment.
  2. 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.
  3. Go to any test function in src/tests/pytest.
  4. Optional: put a breakpoint 🔴 next to the line number where you want to stop.
  5. Click on Run Test or Debug Test above the test you want to debug.
Releasing a new version
  1. Activate the Python environment.
  2. Commit any (un)staged changes on your branch and make sure to test them with invoke test.
  3. 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.
  4. Your tags will be pushed to the remote next time you git push (because push.followTags is set to true in .git/config). Or push the tag manually with git push origin v0.2.0.
  5. You can now pip install git+ssh://[email protected]/radix-ai/fod-bosa/[email protected].
Updating the Cookiecutter scaffolding
  1. Activate the Python environment.
  2. Run cruft check to check for updates.
  3. Run cruft update to update to the latest scaffolding.
  4. Address failed merges in any .rej files.

About

Extra checks for FOD BOSA's Accessibility Check tool.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published