... | ... | @@ -2,7 +2,15 @@ |
|
|
|
|
|
## Overview
|
|
|
|
|
|
**TO BE WRITTEN**
|
|
|
At some point, a porting of aurweb to Python was proposed on the `aur-dev` mailing list, which was subsequently accepted as a milestone. The HTTP framework of choice in the conversation settled on [FastAPI](https://fastapi.tiangolo.com) along with the popular database management library, [SQLAlchemy](https://www.sqlalchemy.org) and [Alembic](https://alembic.sqlalchemy.org/en/latest) to manage its migrations.
|
|
|
|
|
|
This effort has been started and its beginnings now exist in the `pu` branch of aurweb, located at https://gitlab.archlinux.org/archlinux/aurweb/-/tree/pu.
|
|
|
|
|
|
As we port the PHP implementation of aurweb over to Python, we should keep a few things in mind:
|
|
|
1. Existing API **must** persist in Python; there can be no difference told between FastAPI and PHP. Browseable pages are another story, however -- as long as they contain similar content, the same CSS style and functionality, implementations can be changed. With that being said; we should strive to pay attention to any bugs with the existing PHP implementation and proactively solve them.
|
|
|
2. As tasks in this port are approached, developers should strive to increase test coverage wherever they can. Do not allow this to overwhelmingly consume your time, all help is highly valued and appreciated. Our goal is **100%** coverage across the Python codebase (see [Contribution Guidelines](#contribution-guidelines)).
|
|
|
|
|
|
All contributions, advice or other assistance is greatly appreciated and welcome. We encourage you to speak with us if you need any help or wish to discuss any topics regarding the project; our contact information can be found down in the [Who, Where?](#who-where) section.
|
|
|
|
|
|
## Docker Build
|
|
|
|
... | ... | @@ -81,8 +89,8 @@ The Python 3 port of this project uses a few frameworks and tools to make life e |
|
|
* A database connector library for Python.
|
|
|
* SQLAlchemy ORM - [https://docs.sqlalchemy.org/en/13/orm](https://docs.sqlalchemy.org/en/13/orm)
|
|
|
* [**O**]bject [**R**]elational [**M**]apping tools which allow a developer to represent database tables with Python objects.
|
|
|
* Alembic - [https://alembic.sqlalchemy.org/en/latest](https://alembic.sqlalchemy.org/en/latest/)
|
|
|
* A database instrumentation tool used to initialize databases and apply [migrations](https://some_link) to them.
|
|
|
* Alembic - [https://alembic.sqlalchemy.org/en/latest](https://alembic.sqlalchemy.org/en/latest)
|
|
|
* An SQLAlchemy instrumentation tool used to initialize databases and apply [migrations](https://cloud.google.com/architecture/database-migration-concepts-principles-part-1) to them.
|
|
|
* Jinja2 - [https://jinja.palletsprojects.com/en/2.11.x](https://jinja.palletsprojects.com/en/2.11.x)
|
|
|
* A template framework which we use to generate HTML files. Jinja2 templates allow a developer to use "Python tags" defined which he/she can define in addition to helpful built-ins.
|
|
|
* Requests - [https://docs.python-requests.org/en/master](https://docs.python-requests.org/en/master)
|
... | ... | @@ -114,13 +122,23 @@ Additionally, this project uses the following programs to orchestrate developmen |
|
|
|
|
|
## Contribution Guidelines
|
|
|
|
|
|
All contributions **must** maintain 100% test coverage over any newly added or modified
|
|
|
source code.
|
|
|
<!-- Marker for this section: #contribution-guidelines -->
|
|
|
<div id="contribution-guidelines"></div>
|
|
|
|
|
|
1. All contributions **must** maintain 100% test coverage over any newly added or modified
|
|
|
source code
|
|
|
* Test coverage can be maintained by writing `pytest` units that exercise all paths in
|
|
|
the code that your commits affect
|
|
|
2. Do not exceed 80 columns in any Python source file
|
|
|
3. If not otherwise specified, code should maintain PEP-8 compliance in terms of code style
|
|
|
and spacing. `autopep8` can be used to automatically format your code
|
|
|
4. All new Python code should be `isort`ed
|
|
|
5. SQLAlchemy ORM model attributes should be Capitalized if they are literal table columns, otherwise snake_cased in accordance with PEP-8 guidelines
|
|
|
|
|
|
Test coverage can be maintained by writing `pytest` units that exercise all paths in
|
|
|
the code that your commits affect.
|
|
|
## Who, Where?
|
|
|
|
|
|
## Who, Where
|
|
|
<!-- Marker for this section: #who-where -->
|
|
|
<div id="who-where"></div>
|
|
|
|
|
|
**Looking for the code?**
|
|
|
- FastAPI Specific Branch: **pu_fastapi** (based on **pu**)
|
... | ... | |