Skip to content

Add black and updated docs #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
files: .

23 changes: 22 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# Contributing

## Branch workflow

READ BEFORE CREATE A BRANCH OR OPEN A PR/MR
- We use [Github Glow](https://guides.github.com/introduction/flow/)

## Commit Message Guidelines

- The messages of the commits use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
- See [Angular guideline](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines)


## Installation

After cloning this repo, create a [virtualenv](https://virtualenv.pypa.io/en/stable/) and ensure dependencies are installed by running:

```sh
virtualenv venv
source venv/bin/activate
pip install -e requirements-dev.txt
pip install -r requirements-dev.txt
```

Well-written tests and maintaining good test coverage is important to this project. While developing, run new and existing tests with:
Expand Down Expand Up @@ -80,6 +91,16 @@ pipenv install --deploy
pipenv shell
```


## Black
The code is formatted using [Black](https://github.com/psf/black).

### pre-commit
To activate *black* before each commit, run `pre-commit install`.
If any file is formatted before commit, you will need to add it again.



## Documentation

This project use sphinx
Expand Down
6 changes: 4 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ flake8 = "*"
tox = "*"
bandit = "*"
safety = "*"
pre-commit = ">=2.7.1"
black = ">=20.8b1"

[requires]
python_version = "3.6"
[pipenv]
allow_prereleases = true
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[tool.black]
line-length = 120
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ coverage==5.3
pylint==2.6.0
pytest-cov==2.10.1
pylint==2.6.0
pre-commit==2.7.1
black==20.8b1
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ SQLAlchemy==1.3.19
Flask-Script==2.0.6
py-ms[all]==2.6.1
marshmallow==3.8.0
marshmallow-sqlalchemy==0.23.1
marshmallow-sqlalchemy==0.23.1
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
test=pytest

[tool:pytest]
addopts = --cov=project --cov=tests tests/
addopts = --cov=project --cov=tests tests/
34 changes: 22 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

from setuptools import setup, find_packages

version = __import__('project').__version__
author = __import__('project').__author__
author_email = __import__('project').__email__
version = __import__("project").__version__
author = __import__("project").__author__
author_email = __import__("project").__email__

if os.path.exists('README.rst'):
long_description = codecs.open('README.rst', 'r', 'utf-8').read()
if os.path.exists("README.rst"):
long_description = codecs.open("README.rst", "r", "utf-8").read()
else:
long_description = 'https://github.com/python-microservices/microservices-scaffold'
long_description = "https://github.com/python-microservices/microservices-scaffold"

setup(
name="MS-Scaffold",
Expand All @@ -31,17 +31,27 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6"
"Programming Language :: Python :: 3.6",
],
python_requires='>=3.5',
python_requires=">=3.5",
license="GPLv3",
platforms=["any"],
keywords="python, microservices",
url='https://github.com/python-microservices/microservices-scaffold',
url="https://github.com/python-microservices/microservices-scaffold",
packages=find_packages(
exclude=['*.tests', '*.tests.*', 'tests.*', 'tests', '*.examples', '*.examples.*', 'examples.*', 'examples']),
exclude=[
"*.tests",
"*.tests.*",
"tests.*",
"tests",
"*.examples",
"*.examples.*",
"examples.*",
"examples",
]
),
setup_requires=[
'pytest-runner>=2.0,<3dev',
"pytest-runner>=2.0,<3dev",
],
include_package_data=True,
)
)