-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Arquitetura do Projeto e dicas de estrutura e qualidade 🐹
- Loading branch information
1 parent
c3c26f2
commit 6bcfaf9
Showing
15 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.egg-info* | ||
*.egg* | ||
*.build* | ||
build/ | ||
*__pycache__* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.PHONY: clean pep8 test install | ||
|
||
clean: ## remove Python file artifacts | ||
find . -name '*.pyc' -exec rm -f {} + | ||
find . -name '*.pyo' -exec rm -f {} + | ||
find . -name '*~' -exec rm -f {} + | ||
find . -name '__pycache__' -exec rm -fr {} + | ||
|
||
pep8: ## check style with flake8 | ||
flake8 cms tests | ||
|
||
test: pep8 ## run tests quickly with the default Python | ||
py.test -v | ||
|
||
install: clean test ## install the package to the active Python's site-packages | ||
python setup.py develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,23 @@ | ||
Neste diretório o projeto de CMS será desenvolvido, mão na massa! é com você | ||
# 1) Arquitetura do Projeto e dicas de estrutura e qualidade | ||
|
||
Instalado através do `setup.py` com `python setup.py develop` e irá prover | ||
a ferramenta de linha de comando `cms` a partir da qual iremos rodar | ||
`cms runserver` e `cms shell` e `cms adduser` | ||
|
||
A estrutura do projeto será: | ||
|
||
```bash | ||
Makefile # Utilidades `install`, `clean`, `pep8` e `test` | ||
setup.py # Instalador do projeto `python setup.py develop` | ||
tests/ # Testes com py.test | ||
cms/ # module root | ||
├── app/ # Application Factory (Flask app será iniciada aqui) | ||
├── config/ # Configuration Factory (Load de configurações) | ||
├── ext/ # Extensões (Blueprints) do app | ||
├── static/ # Arquivos estáticos (.css, .js, .images) | ||
├── templates/ # Templates Jinja2 | ||
├── cli.py # Ferramenta de linha de comando `cms --help` | ||
├── __init__.py # Python module init | ||
├── README.md # Este arquivo | ||
└── settings.yml # Configurações que serão carregadas | ||
``` |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from setuptools import setup | ||
|
||
requirements = [ | ||
'flask', | ||
'import_string', | ||
'pymongo', | ||
'tinymongo', | ||
'tinydb_serialization', | ||
'dynaconf', | ||
'awesome_slugify', | ||
'mistune', | ||
'flask_simplelogin', | ||
'flask_admin', | ||
'flask_wtf', | ||
] | ||
|
||
|
||
setup( | ||
name='cms', | ||
version='0.0.1', | ||
description="A simple CMS in Flask", | ||
author="Bruno Rocha", | ||
author_email='[email protected]', | ||
url='https://github.com/cursodepythonoficial/', | ||
packages=['cms'], | ||
package_dir={'cms': 'cms'}, | ||
entry_points={ | ||
'console_scripts': [ | ||
'cms=cms.cli:main' | ||
] | ||
}, | ||
include_package_data=True, | ||
install_requires=requirements | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def app(): | ||
"""Flask Pytest uses it""" | ||
# return create_app() | ||
return 'app' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import pytest | ||
|
||
|
||
@pytest.mark.skip | ||
def test_app_secret_is_set(app): | ||
assert 'SECRET_KEY' in app.config |