helpers¶
Core helpers API reference
Helper functions for the Python versions applet.
Parts borrowed from https://github.com/python/cpython-devcontainers/blob/main/cpython-ci/get_versions.py/ and Barry Warsaw
- app.applets.core.helpers.get_db_connection() Connection [source]¶
Get a database connection.
- Yields:
A database connection.
- async app.applets.core.helpers.start_periodic_update() None [source]¶
Start the periodic update task.
- async app.applets.core.helpers.periodic_update() None [source]¶
Periodically update the Python versions in the database.
- async app.applets.core.helpers.get_tags_from_github() list[dict] [source]¶
Get the Python tags from the GitHub API.
- async app.applets.core.helpers.get_version_eols() dict[str, date] [source]¶
Get the Python version EOL dates from endoflife.date.
- app.applets.core.helpers.get_version_from_tags(tags: list[dict]) list[Version] [source]¶
Get the Python versions from the GitHub tags.
- app.applets.core.helpers.get_latest_version(all_versions: list[Version]) dict[str, Version] [source]¶
Get the latest Python versions for each series.
- async app.applets.core.helpers.update_versions_in_db(versions: list[Version]) None [source]¶
Update the Python versions in the database.
- async app.applets.core.helpers.get_versions_from_db() list[Version] [source]¶
Get the latest Python versions from the database.
- async app.applets.core.helpers.fetch_and_update_versions() None [source]¶
Fetch the latest Python versions from GitHub and update the database.
- async app.applets.core.helpers.get_python_versions() list[Version] [source]¶
Get the latest Python versions from the database or fetch them from GitHub if the database is empty or outdated.
- app.applets.core.helpers.generate_app_config(app_config: AppConfig) AppConfig [source]¶
Configure the Python versions module.
This function is used as an on_app_init handler for Litestar.
- Parameters:
app_config – The Litestar AppConfig instance.
- Returns:
The updated AppConfig instance.
- Return type:
AppConfig