Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
Импорт изменений для версии 0.3.0 и для удаления ветви develop (#193)
Browse files Browse the repository at this point in the history
* Updating Python to version 3.10 (#122)

also updated uvicorn, fastapi, jinja2, websockets

* Переход на python 3.10 (замена If-Else на Match-Case) и переделка системы генерации ошибок (#123)

* feat(error): error dictionary is replaced by the function 

new function "check_error_pattern" checking the error status against the class HTTPStatus or ServerStatus

* fix(controller): error codes are replaced by their text descriptions

* feat(test_error): added new test for error.py

* fix(error): "check_error_pattern" function has been fixed

* fix(test_error): minor edits to the test code

* refactor: minor changes

* BREAKING CHANGE(controller): if-else is replaced by match-case

- the "check_auth_token function" is converted into decorator
- methods requiring user authentication wrapped in "check_auth_token" decorator

* feat(controller): Added new classes Error and User

- the __catch_error method functionality will be moved to the Error class
- the __check_auth_token method functionality will be moved to the User class
- minor changes

* fix(test_controller) fixed tests "check_auth" class method

* fix(test_controller): fixed all tests in class TestCheckAuthToken

* feat(controller): the check_login method has been moved to the User class

* refactor(test): small corrections in the code

* fix(controller) Fixed bug in UUID generation for flow

* refactor: minor changes

* Изменения для выполнения тикетов #98 #50 (#124)

* fix(test): added client_id in "api.json"

* fix(api): validation is enabled

a separate validation class for requests and responses is added

* BREAKING CHANGE(controller): methods and "Errors" class have been changed

- to all methods of the class, the passed parameter "request", and the returned object "response" are added.
- the "catching_error" method now returns "api.Errors" object
- the "get_response" method now returns a validated json object.

* BREAKING CHANGE(api): separate validation for requests and responses

* refactor(controller): renaming calls to instances of classes responsible

 for validating queries and responses

* fix(test): fixed in test_api

* fix(controller): small corrections

* fix(api) small corrections in the declaration of "data" and "client_id"

* fix(test): test fixes after modifying controller.py

* Исправления в системе тестирования кода, закрытие тикетов #125 #126 #101 #100 (#127)

* feat(test_api): added  test for wrong json
* feat(test): added test for wrong response and request and added new fixtures for tests
* feat(test): New tests for validation have been added
* fix(error): corrected the "check_error_pattern" function
- added exception catching related to wrong type of "status" parameter and a non-existent error name
* fix(test): Fixed tests for the "check_error_pattern" function
* refactor(test): remove unused import
* refactor(lib): minor changes
* fix(test): added cleint_id in fixtures
* fix(test): code readability improved
* fix(lib): added decorator property
* feat(test): added new test
- checking false status in password_check
- checking get_key and get_salt
* fix(test): Move the test JSON objects
from the test_controller.py file to the directory with the fixtures.
* fix(controller): the class method call is replaced by the attribute
* refactor(test): delete unused object
* feat(config): added setup.cfg to configure flake8 and coverage
* fix(test): minor changes
* feat(setup.cfg): the skip test setting has been added for coverage
* fix(api): delete print scheme
* fix(controller): small improvements to increase code coverage by tests
* fix(pipfile): update dependencies
* fix(pipfile) added coverage to pipfile.lock

* Добавлена панель администратора (#129)

* init admin

* add logging uvicorn setting

* add bootstrap in admin

* add fastapi-login libary in pipfile

* add login.py

* fix

* fix

* fix cookies

* add logout and exception handler

* fix bug login exception

* add login form

* fix bug

* fix

* fix bug

* add status.html

* add logs view

* add delete user

* fix

* refactoring manage.py and change password to hashPassword

* Squashed commit of the following:

commit 33d192f
Author: Stepan Skriabin <stepan.skrjabin@gmail.com>
Date:   Tue Oct 26 20:40:42 2021 +0300

    Исправления в системе тестирования кода, закрытие тикетов #125 #126 #101 #100 (#127)

    * feat(test_api): added  test for wrong json
    * feat(test): added test for wrong response and request and added new fixtures for tests
    * feat(test): New tests for validation have been added
    * fix(error): corrected the "check_error_pattern" function
    - added exception catching related to wrong type of "status" parameter and a non-existent error name
    * fix(test): Fixed tests for the "check_error_pattern" function
    * refactor(test): remove unused import
    * refactor(lib): minor changes
    * fix(test): added cleint_id in fixtures
    * fix(test): code readability improved
    * fix(lib): added decorator property
    * feat(test): added new test
    - checking false status in password_check
    - checking get_key and get_salt
    * fix(test): Move the test JSON objects
    from the test_controller.py file to the directory with the fixtures.
    * fix(controller): the class method call is replaced by the attribute
    * refactor(test): delete unused object
    * feat(config): added setup.cfg to configure flake8 and coverage
    * fix(test): minor changes
    * feat(setup.cfg): the skip test setting has been added for coverage
    * fix(api): delete print scheme
    * fix(controller): small improvements to increase code coverage by tests
    * fix(pipfile): update dependencies
    * fix(pipfile) added coverage to pipfile.lock

* merge develop into this banch

* fix

* add license notification in new file

* fix

* Update Pipfile.lock

* fix

* fix

* fix typehintings

* fix

* fix test_admin.py

* fix config example

* fix

* fix naming log_list to log_string

* change name manage.py to control.py

* Добавление дополнительной абстракции для работы с бд #128 (#136)

* feat(dbhandlers): add new class DbHelpers for work with database
* fix(dbhandler): Added an indication of type of returned data
* feat(dbhandler): added new error exceptions and new attribute
* feat(dbhandler): additional methods to the class
- added __repr__ and __str__
- added methods with date filtering (more, less or equal)
- small changes in code readability

* feat(dbhandler): added new property "debug"
- added new attribute - debug, logger, loglevel

* Реализация единой точки обработки конфигурационного файла (#137)

* feat: added config.py as a single point to read settings from config.ini
* fix(dbhandler): Fixed an error in writing table fields from parameters passed to the method

* Разделение кода протокола и контроллера #139 (#141)

* feat(controller): Creating the MainHandler method in which the protocol selection is implemented
-- main code from controller moved to worker.py of the mtp module
-- api.py is now part of the mtp module
-- added the matrix module as a stub

* BREAKING CHANGE(error): result of check_error_pattern function is now replaced by namedtuple
* feat(server): fixed name ProtocolMethod to MainHandler
* fix(tests): fixed file name
* feat(tests): new test fo controller.py
* fix(server): fixed type of response object
* fix(controller): added get_response method
fixed types returned in mtp_handler and matrix_handler
* fix(mtp.worker): fixed catch_error object in MTPErrorResponse
* fix(fixtures): fixed name in type
* fix(fixtures): fixed test
- rename ProtocolMethods to MTProtocol
- rename ErrorResponse to MTPErrorResponse
* fix(dbhandler): removed the default parameter with the database address
* fix(dbhandler): fixed default parameter to 'sqlite:/:memory:'
* fix(controller): Copyright's year is corrected

* Небольшие правки кода перед переносов в мастер и релизом версии 0.1.0 (#143)

* feat(contoller): added class Clients for collect clients session
* fix(server): the ability to account for connected clients has been completely removed
* fix: added ebala
* fix: minor changes and error fixed
* fix(controller): added docstring for MainHandler
* fix(dbhandler): added docstring for DBHandler and minor changes in methods
* fix(server): fixed bugs in static directory
* fix(mtp): fixed errors
* feat(tests): added one test for MatrixProtocol
* fix(setup.cfg): fixed name
* BREAKING CHANGE:(pipfile): bump'ed dependencies (fastapi, uvicorn, jinja2, websockets, pydantic, requests)
* refactor:(readme): update readme.md
* fix: fixed some errors
* fix(server): fixed type of response
* fix(client): added auth_id
* fix(readme): delete link to Trello

* delete "t.py" in .gitignore

* update Pipfile.lock and add bpython package

* delete header in example_config.ini

* fix bug #149

* fix bug #148

* fix bug #147

* Create python-app.yml

* Update and rename python-app.yml to test_and_linting.yml

* Update test_and_linting.yml

* Update test_and_linting.yml

* fix tests bugs

* Update test_and_linting.yml

* Update test_and_linting.yml

* Update test_and_linting.yml

* Update test_and_linting.yml

* add Dockerfile

* fix Dockerfile

* Create docker-image.yml

* Delete docker-image.yml

* fix bug config load

* add tests for server.py

* Update README.md

* Update test_and_linting.yml

* Update README.md

* Create docker-publish-image.yaml

* Delete docker-publish-image.yaml

* Create coveralls.yml

* Update coveralls.yml

* Delete coveralls.yml

* Update test_and_linting.yml

* Update test_and_linting.yml

* Update test_and_linting.yml

* Update README.md

* Update test_and_linting.yml

* Create docker-publish-image.yml

* Update docker-publish-image.yml

* Update docker-publish-image.yml

* Update docker-publish-image.yml

* Update docker-publish-image.yml

* Update docker-publish-image.yml

* Update docker-publish-image.yml

* Update docker-publish-image.yml

* Update docker-publish-image.yml

* Update docker-publish-image.yml

* Update docker-publish-image.yml

* Update docker-publish-image.yml

* Update docker-publish-image.yml

* Rename docker-publish-image.yml to docker-publish-image-unstable.yml

* Create docker-publish-image-stable.yml

* Update docker-publish-image-unstable.yml

* Update docker-publish-image-stable.yml

* Update docker-publish-image-stable.yml

* Update docker-publish-image-unstable.yml

* Update docker-publish-image-unstable.yml

* Update docker-publish-image-stable.yml

* Update docker-publish-image-unstable.yml

* Update docker-publish-image-unstable.yml

* feat(doc): initial commit for added documentation in project

* fixed(config): move config.py to the root of the project

* refactor(controller): delete unused imports

* feat(Pipfile): added "furo" theme and fixing package version

* fixed(Pipfile): update Pipfile.lock

* refactor(matrix): delete unused imports

* feat(sphinx): added extension module - duration, autodoc, autosummary

* feat(sphinx): added new pages development, doc, install

* feat(sphinx): added extension "napoleon" to use Google style docstring

* refactor: refactoring docstrings and fixed errors

* feat(doc): update index.rst and doc.rst which added new documentation about project

* feat(gitignore): add "log" in "docs" directory

* docs(models): correcting and expanding existing documentation

* docs(logging): correcting and expanding existing documentation

* docs(matrix): correcting and expanding existing documentation

* docs(error): correcting and expanding existing documentation

* docs(lib): correcting and expanding existing documentation

* docs(controller): correcting and expanding existing documentation

* docs(server): correcting and expanding existing documentation

* docs(mtp): correcting and expanding existing documentation

* docs(mtp): correcting and expanding existing documentation

* docs(dbhandler): correcting and expanding existing documentation

* docs(sphinx): added new documents description

* feat(sphinx): added extension which generated ".nojekyll" for GitHub Pages

* docs(readme): fixed minor errors

* docs(licence): added new licence.rst file

* docs(development): added full info about project development

* docs(install): added full info about project install and run

* docs(index): added new section "Contacts" and other minor changes

* docs(sphinx) corrected text in doc.rst

* docs(doc): minor changes

* fixed(tests): fixed minor errors

* fixed: added two modules ("db", "protocol") in init file in "mod"

* updated version of loguru to 0.6.0, fixing vulnerability CVE-2022-0329

* feat: added "revision" in MTP api and worker

* feat: added "token_ttl" in database models and dbhandler class

* feat(error): added new status code 505 "VERSION_NOT_SUPPORTED"

* fixed(tests): added new test for jsonapi and minor changes

* feat(tests): added checking new fields: "token_ttl", "client_id", "key", "salt", "revision"

* fixed(tests): added new test for jsonapi and minor changes

* feat(tests): added checking new fields: "token_ttl", "client_id", "key", "salt", "revision"

* add test main page for server.py

* fix

* fix

* fix

* Create docs.yml

* Update docs.yml

* Update docs.yml

* Update docs.yml

* Update docs.yml

* Update docs.yml

* Update docs.yml

* Update docs.yml

* Update docs.yml

* Update docs.yml

* Update docs.yml

* Update docs.yml

* Update test_and_linting.yml

* Update test_and_linting.yml

* Update test_and_linting.yml

* Update and rename test_and_linting.yml to tests.yml

* add python-coveralls in dev-dependencies and update Pipfile.lock

* Update tests.yml

* fix

* fix

* add test

* fix test

* fix test

* fix test

* Update README_ENG.md

* fix test

* fix test

* fix test

* fix docs

* fix docs

* fix docs

* fix docs

* fix docs

* fix test_server.py

* fix test_server.py

* fix test_server.py

* fix test_server.py

* fix test_server.py

* fix docs

* fix docs

* feat(validator): added validator.py to validate config file

* feat(test): added tests for validator.py

* feat(config): added new module config

* fix(validator): many classes convert to one main class ConfigModel with pydantic validation and fixed tests in test_validator.py

* feat(config): add new ConfigHandler method - read, write and fixed other hidden methods

* feat(tests): add new test for ConfigHandler

* feat(mod_config): add new class for exceptions, methods which added: _set_configparser(), _backup_file(). also added str and repr dunder-methods, added property to set root directory and config name, finalized write method,

* feat(gitignore): add backup file

* fixed(tests): fixed some errors in test validator

* fixed(config): delete autoimport validator.py

* feat(lib): added function to rebuild config.ini on example_config.ini

* feat(tests): added test for rebuild_config()

* fixed(config): fixed some errors and minor changes for good work

* feat(tests): added new test for config.py

* fixed: fixed importing config options from config.ini

* refactor: added copyright and blank line

* refactor: moving rebuild_config to ConfigHandler

* fixed: update gitignore

* feat(tests): added new fixtures and new tests for config module

* feat(config): added _copy_string() and rebuild_config()
added new errors: RebuildConfigError, CopyConfigError
and other minor changes

* feat(config): added _copy_string() and rebuild_config()
added new errors: RebuildConfigError, CopyConfigError
and other minor changes

* fixed(tests): rename exeption

* fixed(tests): delete non_write_config.ini

* doc(config): added documentation for config module

* fixed(config): delete unused import, delete if...else in property methods, delete unused exceptions in write()

* fixed(tests): fixed bug #157 - SQL flood

* fixed(workflow): fixed moved file to copy file

* fixed(validator): fixed some bugs

* fixed(validator): fixed some bugs

* fixed(validator): fixed some bugs

* fixed: fixed bug #171 - rename "password" to "size_password" and "auth_id" to "size_auth_id" in config file

* feat: added rules fo code documentation and template to pull request (PR) (#175)

* Добавление линтера в actions и реализация функции проверки версии API протокола используемого клиентом (#179)

* refactor(controller): rename mtp_handler and matrix_hamdler to private type methods
* feat(worker): added function for server to control client version API
- added new methods _check_protocol_version()
- added new parameters MAX_VERSION and MIN_VERSION to config.ini and example_config.ini
- added validation for new parameters
- fixed test
- also add docstring to _check_auth()

* fix: fixed parameters name contains on example_config.ini
* feat: added auto linting all commits
* fixed: fixed all flake8 warning and errors, information about running flake8 added in project documentation

* Объединён код manage.py, debug_server.py и client.py (#181)

* add run

* add

* finish client

* Update README.md

* add register_user method

* add get_update and send_message methods

* add all_messages method

* refactor all client)))

* mini fix

* add scripts binding for manage.py

* #93

* Update docker-publish-image-stable.yml

* Update docker-publish-image-unstable.yml

* fix

* fix

* fix for linting successful

* Update README.md

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* Добавлена проверка типов (#184)

* add mypy

* fix code

* new batch of type conflict fixes

* new batch of type conflict fixes

* fix imports in admin module

* fix types in api.py

* new batch of type conflict fixes

* new batch of type conflict fixes

* fix

* new batch of type conflict fixes

* new batch of type conflict fixes

* fix for flake8

* fix

* Update tests.yml

* fix

* fix imports

* fix imports

* fix docstrings

* fix imports

* Закрыты ошибки #170 #96 (#186)

* fixed(error): Closed #170

- optimized code in the try...except structure
- CatchError class was moved outside the function check_error_pattern()
- change check_error_pattern() returns to CatchError | Exception
- fixed docstrings and tests.

* fixed(db): fix text message return in DatabaseWriteError

* fixed(error): change CatchError to NamedTuple class

* fixed(error): fixed docstrings

* fixed(error): delete Exception in function type returns

* fix(manage): add option "--login" in flow-create cli command

user search by UUID is replaced by login search

* fixed(db): fix text message return in DatabaseReadError

and DatabaseAccessError

* fixed(manage): fixed uuid type in create_flow() and admin_create_user()

* feat(tests): add test for manage.py

- create_user()
- create_flow()
- admin_create_user()
- db_create()
- db_delete()

* fixed: rename logging.py to log_handler.py

because asyncio imports a logging module with the same name as the project's logging module

* fixed: fixed several errors, test_send_normal_message skip

* fixed(manage): added cli option "--uri" for db_create() and db_delete()

fixed several errors in tests_manage.py

* fixed(server): fixed logger module name

* fixed(manage): fixed raise to click.echo in try...except

from function db_create() and db_delete()
add typing in test_manage.py

* Исправлена проблема при создании образа Docker (#190)

* fix

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* fix format code

* change runner to self-hosted

* Revert "change runner to self-hosted"

This reverts commit a2832cd.

* fix branch

* fix

* fix

* some changes

* some changes

* some changes

* some changes

* final fix docker and frezee

* fix

* fix

* fix

* Update docker-publish-image.yml

* Update docker-publish-image.yml

* fix

* fix

* Update docker-publish-image.yml

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* Update CHANGES.md

* fix

Co-authored-by: Stepan Skriabin <stepan.skrjabin@gmail.com>
  • Loading branch information
NekrodNIK and stepanskryabin authored May 25, 2022
1 parent 21b9311 commit 8907937
Show file tree
Hide file tree
Showing 57 changed files with 2,642 additions and 1,072 deletions.
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Synopsis
Description about main changes and how that would affected on project.

## Main changes

- a
- b
- c
- d

## Other important changes

- a
- b
- c
- d

### Closes issue and bug

Closes ...
Closes ...
40 changes: 0 additions & 40 deletions .github/workflows/docker-publish-image-stable.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Build and publish docker image
on:
push:
branches: [ develop ]
branches: [ master ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}_unstable
IMAGE_NAME: ${{ github.repository }}_docker

jobs:
build-and-push-image:
Expand All @@ -16,7 +16,13 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
Expand All @@ -25,20 +31,24 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y.%m.%d')"

- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver, pattern={{raw}}
type=raw, value=${{ steps.date.outputs.date }}
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}_${{ steps.date.outputs.date }}
platforms: linux/amd64, linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and push docs
on:
push:
branches: [ master, develop ]
branches: [ master ]

jobs:
build-and-deploy:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ jobs:
- name: Create config for server
run: |
mv example_config.ini config.ini
cp example_config.ini config.ini
- name: Run tests
run: |
pipenv run coverage run -m unittest discover tests
- name: Linting code
run: |
pipenv run flake8 --config ./setup.cfg --show-source --statistics
- name: Type checking
run: |
pipenv run mypy --config=./setup.cfg .
- name: Push report to coveralls.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ dmypy.json
.idea

## Morelia stuff
db_sqlite.db
config.ini
*.db
/config.ini
config.ini.BAK*
ngrok.exe
/docs/log/
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Version 0.3.0

- Added a module for managing the server config
- Added linter code checking for style compliance and mypy code checking for type hinting
- Application scripts for working with the server were combined into one manage.py
- Errors were closed To fix an error in the declaration of the variable obj in error.py #170 and Add tests for manage.py #96
- Fixed a problem when building a multi platform docker image
- Minor fixes and improvements
100 changes: 100 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# How to contribute to MoreliaServer #

## Support questions ##

Please don't use the issue tracker for this. The issue tracker is a tool
to address bugs and feature requests in Morelia server itself. Use one of the
following resources for questions about using Morelia server or issues with your
own code:

- The ``#general`` channel on our [Slack](https://moreliatalk.slack.com) chat.
- Ask on our [GitHub Discussions](https://github.com/MoreliaTalk/morelia_server/discussions).
- Ask for support in our telegram chatroom:
[Project MoreliaTalk](https://t.me/joinchat/LImHShzAmIWvpMxDTr5Vxw).


## Reporting issues ##

Include the following information in your post:

- Describe what you expected to happen.
- If possible, include a
[minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) to help us
identify the issue. This also helps check that the issue is not with
your own code.
- Describe what actually happened. Include the full traceback if there
was an exception.
- List your Python and Morelia server versions. If possible, check if this
issue is already fixed in the latest releases or the latest code in
the repository.


## Submitting patches ##

If there is not an open issue for what you want to submit, prefer
opening one for discussion before working on a PR. You can work on any
issue that doesn't have an open PR linked to it or a maintainer assigned
to it. These show up in the sidebar. No need to ask if you can work on
an issue that interests you.

Include the following in your patch:

- All patches create in [develop](https://github.com/MoreliaTalk/morelia_server/tree/develop).
For example new branch name ``develop-#xxx``. Where xxx in name is the issue number.
- Use [Flake8](https://github.com/PyCQA/flake8) to format your code.
- Include tests if your patch adds or changes code. Make sure the test
not fails.
- Update any relevant docs pages and docstrings. Doc pages and
docstrings should be wrapped at 120 characters.
- Add an entry in ``CHANGES.md``. Use the same style as other
entries. Also include ``.. versionchanged::`` inline changelogs in
relevant docstrings.

After you checking all steps for create patch you can create Pull Request (aka PR). Before that, read the
[rules](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).


## Main code rules ##

### Conventional Commits ###

Commit messages should be of the following structure:
`<type>(optional scope): <description> [optional body] [optional footer]`:

`<type>` - for example `fix`, `feat`, `refactor`, `add`, `BREAKING CHANGE`, `docs`, `perf`, `test`.

`(optional scope)` - context MUST BE a noun enclosed in parentheses, describing the part of the code base affected by
the commit, for example `fix(parser)`

`<description>` - a brief description of changes to the code

`[optional body]` - additional description of changes to the code

`[optional footer]` - meta-information about commit. For example, related pull-requests, discussions, issues, people, etc.

Read more at [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)

### Code style ###

- If not specified below, the entire code is executed according to the [PEP8](https://www.python.org/dev/peps/pep-0008/)
standard.
- Length of string is limited to 79 characters.
- For name constant declaration MUST BE used UPPERCASE.
- Each import MUST BE on a separate line.
- Import templates (from import *) SHOULD NOT be used.
- `lower_case_with_underscores` style MUST BE used for function.
- `CapitalizedWords` style MUST BE used for classes.
- `lowercase` or `lower_case` stype MUST BE used for simple object (variable)
- Each function parameter MUST BE on a separate line.
- All transfers MUST BE vertically aligned
- For docstring MUST BE uses [Google style](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings)
of comment and docstring.
- Project uses automatic generation of documentation using [Sphinx](https://www.sphinx-doc.org/en/stable/),
for which use the following keywords in the docstrings:
`Args (alias of Parameters)`, `Arguments (alias of Parameters)`, `Attention`, `Attributes`, `Caution`, `Danger`, `Error`
, `Example`, `Examples`, `Hint`, `Important`, `Keyword Args (alias of Keyword Arguments)`, `Keyword Arguments`, `Methods`
`Note`, `Notes`, `Other Parameters`, `Parameters`, `Return (alias of Returns)`, `Returns`, `Raise (alias of Raises)`,
`Raises`, `References`, `See Also`, `Tip`, `Todo`, `Warning`, `Warnings (alias of Warning)`, `Warn (alias of Warns)`,
`Warns`, `Yield (alias of Yields)`, `Yields`.
- All new class (also class methods) and function MUST BE contained a docstring
- All code MUST BE documenting in sphinx-format *.rst files which contains in ./docs
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM python:3.10.2-slim-bullseye
FROM python:3.10.4-slim

WORKDIR /morelia-server

Expand Down
7 changes: 7 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ verify_ssl = true

[dev-packages]
flake8 = "*"
flake8-import-order = "*"
flake8-docstrings = "*"
flake8-builtins = "*"
pyflakes = "*"
pycodestyle = "*"
mccabe = "*"
coveralls = "==3.3.1"
mypy = "==0.942"

[packages]
fastapi = "==0.71.0"
Expand All @@ -29,5 +33,8 @@ win32-setctime = "*"
sphinx = "==4.4.0"
furo = "==2022.1.2"

[scripts]
manage = "python manage.py"

[requires]
python_version = "3.10"
Loading

0 comments on commit 8907937

Please sign in to comment.