Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Matheusafonsouza committed Oct 19, 2023
0 parents commit 0f5ee1c
Show file tree
Hide file tree
Showing 49 changed files with 4,134 additions and 0 deletions.
144 changes: 144 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
### Python template

deploy/
.idea/
.vscode/
.git/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
root = true

[*]
tab_width = 4
end_of_line = lf
max_line_length = 88
ij_visual_guides = 88
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,py,html}]
charset = utf-8

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab

[.flake8]
indent_style = space
indent_size = 2

[*.py]
indent_style = space
indent_size = 4
ij_python_from_import_parentheses_force_if_multiline = true
115 changes: 115 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
[flake8]
max-complexity = 6
inline-quotes = double
max-line-length = 88
extend-ignore = E203
docstring_style=sphinx

ignore =
; Found `f` string
WPS305,
; Missing docstring in public module
D100,
; Missing docstring in magic method
D105,
; Missing docstring in __init__
D107,
; Found `__init__.py` module with logic
WPS412,
; Found class without a base class
WPS306,
; Missing docstring in public nested class
D106,
; First line should be in imperative mood
D401,
; Found wrong variable name
WPS110,
; Found `__init__.py` module with logic
WPS326,
; Found string constant over-use
WPS226,
; Found upper-case constant in a class
WPS115,
; Found nested function
WPS602,
; Found method without arguments
WPS605,
; Found overused expression
WPS204,
; Found too many module members
WPS202,
; Found too high module cognitive complexity
WPS232,
; line break before binary operator
W503,
; Found module with too many imports
WPS201,
; Inline strong start-string without end-string.
RST210,
; Found nested class
WPS431,
; Found wrong module name
WPS100,
; Found too many methods
WPS214,
; Found too long ``try`` body
WPS229,
; Found unpythonic getter or setter
WPS615,
; Found a line that starts with a dot
WPS348,
; Found complex default value (for dependency injection)
WPS404,
; not perform function calls in argument defaults (for dependency injection)
B008,
; Model should define verbose_name in its Meta inner class
DJ10,
; Model should define verbose_name_plural in its Meta inner class
DJ11,
; Found mutable module constant.
WPS407,
; Found too many empty lines in `def`
WPS473,
; too many no-cover comments.
WPS403,

per-file-ignores =
; all tests
test_*.py,tests.py,tests_*.py,*/tests/*,conftest.py:
; Use of assert detected
S101,
; Found outer scope names shadowing
WPS442,
; Found too many local variables
WPS210,
; Found magic number
WPS432,
; Missing parameter(s) in Docstring
DAR101,
; Found too many arguments
WPS211,

; all init files
__init__.py:
; ignore not used imports
F401,
; ignore import with wildcard
F403,
; Found wrong metadata variable
WPS410,

exclude =
./.cache,
./.git,
./.idea,
./.mypy_cache,
./.pytest_cache,
./.venv,
./venv,
./env,
./cached_venv,
./docs,
./deploy,
./var,
./.vscode,
*migrations*,
79 changes: 79 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Testing gestao

on: push

jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run black check
run: poetry run black --check .
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run flake8 check
run: poetry run flake8 --count .
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run mypy check
run: poetry run mypy .
pytest:
runs-on: ubuntu-latest
services:

gestao-db:
image: postgres:13.8-bullseye
env:
POSTGRES_PASSWORD: gestao
POSTGRES_USER: gestao
POSTGRES_DB: gestao
options: >-
--health-cmd="pg_isready"
--health-interval=10s
--health-timeout=5s
--health-retries=5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run pytest check
run: poetry run pytest -vv --cov="gestao" .
env:
GESTAO_HOST: "0.0.0.0"
GESTAO_DB_HOST: localhost
Loading

0 comments on commit 0f5ee1c

Please sign in to comment.