This MR brings in basic Jinja2 template rendering with l10n integration, as well as basic SQLAlchemy models (starting with User, AccountType).
Coverage Note: With this MR, we're at 86% total coverage across the base. Our goal is 100%, but with this MR, testing coverage was focused primarily on files being added (all new files should be at 100%) and some where we could easily get it. That being said; we expect that all new Python code added for FastAPI should have 100% coverage.
First, follow INSTALL for relevant configuration and database setup.
Then, run the FastAPI server in straight up development mode:
$ hypercorn aurweb.asgi:app
hypercorn running, you can browse to http://localhost:8000. You will be presented with the index page, which uses the entirety of
./templates/ to render through FastAPI. This page has the base layout of the website, without user authentication taken into account, including the
set_lang language form located at the top right underneath the main navigation bar.
aurweb.models.user, an SQLAlchemy ORM Users table mapping.
aurweb.models.account_type, an SQLAlchemy ORM AccountTypes table mapping.
aurweb.routers.html, a router used to render our HTML layout.
aurweb.templates, a jinja2-based template module.
aurweb.testing, a test utility module.
- aurweb.config [options] aurwebdir, useful to store the absolute root of aurweb in the config so we can just grab its location without introspecting scripts and other workarounds.
- modern pytest suites; see
aurweb.l10n: Make a global Translator object,
aurweb.l10n.translator; also added some more utility functions used in different higher level areas.
coverage run --appendto all Python script executions inside of our shell tests, added pytest suites. This is provided by
test/scripts/coverwithin sharness tests and specified for pytest inside of
pytesttarget, move the check target to
checkto cover both
.gitlab-ci.yml: Add pytest dependencies, install aurweb, setup a test config and run initdb, then print out coverage report after running
make -C test.
For a complete set of modifications, see
git log origin/pu..fork/pu_fastapi_base.