-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add precommits with black and import sort
- Loading branch information
Showing
9 changed files
with
239 additions
and
187 deletions.
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
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,11 @@ | ||
# See: https://pre-commit.com/ | ||
|
||
repos: | ||
- repo: https://github.com/ambv/black | ||
rev: 19.3b0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/asottile/reorder_python_imports | ||
rev: v1.7.0 | ||
hooks: | ||
- id: reorder-python-imports |
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
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,35 @@ | ||
# Contributing | ||
|
||
## Development environment | ||
|
||
Create a development environment with `Python>=3.6`. | ||
|
||
You can then install the development and test dependencies with: | ||
|
||
```bash | ||
python -m pip install lektor | ||
python -m pip install --editable .[test] | ||
``` | ||
|
||
## Tests | ||
|
||
To run the test suite, we use `pytest`: | ||
|
||
```bash | ||
pytest . --tb=long -svv | ||
``` | ||
|
||
## Pre-commit | ||
|
||
We use precommit hooks to ensure code style and format. | ||
|
||
Install `precommit` from pip | ||
|
||
```bash | ||
pip install pre-commit | ||
pre-commit install | ||
``` | ||
|
||
Now after each commit, the style hooks will run and auto format the code. | ||
|
||
You can also manually run the pre-commit hooks without a commit with `pre-commit run -a`. |
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
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
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 |
---|---|---|
|
@@ -4,51 +4,43 @@ | |
|
||
from setuptools import setup | ||
|
||
with io.open('README.md', 'rt', encoding="utf8") as f: | ||
with io.open("README.md", "rt", encoding="utf8") as f: | ||
readme = f.read() | ||
|
||
_description_re = re.compile(r'description\s+=\s+(?P<description>.*)') | ||
_description_re = re.compile(r"description\s+=\s+(?P<description>.*)") | ||
|
||
with open('lektor_atom.py', 'rb') as f: | ||
description = str(ast.literal_eval(_description_re.search( | ||
f.read().decode('utf-8')).group(1))) | ||
with open("lektor_atom.py", "rb") as f: | ||
description = str( | ||
ast.literal_eval(_description_re.search(f.read().decode("utf-8")).group(1)) | ||
) | ||
|
||
tests_require = [ | ||
'lxml', | ||
'pytest' | ||
], | ||
tests_require = (["lxml", "pytest"],) | ||
|
||
|
||
setup( | ||
author=u'A. Jesse Jiryu Davis', | ||
author_email='[email protected]', | ||
author=u"A. Jesse Jiryu Davis", | ||
author_email="[email protected]", | ||
description=description, | ||
install_requires=[ | ||
'MarkupSafe', | ||
'Werkzeug<1.0', # Werkzeug 1.0 removed the feed generator | ||
"MarkupSafe", | ||
"Werkzeug<1.0", # Werkzeug 1.0 removed the feed generator | ||
], | ||
keywords='Lektor plugin static-site blog atom rss', | ||
license='MIT', | ||
keywords="Lektor plugin static-site blog atom rss", | ||
license="MIT", | ||
long_description=readme, | ||
long_description_content_type='text/markdown', | ||
name='lektor-atom', | ||
py_modules=['lektor_atom'], | ||
url='https://github.com/nixjdm/lektor-atom', | ||
version='0.3.1', | ||
long_description_content_type="text/markdown", | ||
name="lektor-atom", | ||
py_modules=["lektor_atom"], | ||
url="https://github.com/nixjdm/lektor-atom", | ||
version="0.3.1", | ||
classifiers=[ | ||
'Environment :: Plugins', | ||
'Environment :: Web Environment', | ||
'Framework :: Lektor', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: MIT License', | ||
"Environment :: Plugins", | ||
"Environment :: Web Environment", | ||
"Framework :: Lektor", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
], | ||
entry_points={ | ||
'lektor.plugins': [ | ||
'atom = lektor_atom:AtomPlugin', | ||
] | ||
}, | ||
extras_require={ | ||
'test': tests_require, | ||
}, | ||
entry_points={"lektor.plugins": ["atom = lektor_atom:AtomPlugin"]}, | ||
extras_require={"test": tests_require}, | ||
tests_require=tests_require, | ||
) |
Oops, something went wrong.