Skip to content

Commit fb2d32e

Browse files
authored
Merge pull request #216 from graingert/configure-tox-and-pre-commit-py-upgrade
2 parents 1456415 + 48347e7 commit fb2d32e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1634
-895
lines changed

.gitignore

Lines changed: 138 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,138 @@
1-
*.pyc
2-
*~
3-
*.egg-info
4-
5-
/build
6-
/dist
7-
/docs/_build
8-
/nose-*
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98+
__pypackages__/
99+
100+
# Celery stuff
101+
celerybeat-schedule
102+
celerybeat.pid
103+
104+
# SageMath parsed files
105+
*.sage.py
106+
107+
# Environments
108+
.env
109+
.venv
110+
env/
111+
venv/
112+
ENV/
113+
env.bak/
114+
venv.bak/
115+
116+
# Spyder project settings
117+
.spyderproject
118+
.spyproject
119+
120+
# Rope project settings
121+
.ropeproject
122+
123+
# mkdocs documentation
124+
/site
125+
126+
# mypy
127+
.mypy_cache/
128+
.dmypy.json
129+
dmypy.json
130+
131+
# Pyre type checker
132+
.pyre/
133+
134+
# pytype static type analyzer
135+
.pytype/
136+
137+
# Cython debug symbols
138+
cython_debug/

.pre-commit-config.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
repos:
2+
- repo: https://github.com/asottile/pyupgrade
3+
rev: v2.7.2
4+
hooks:
5+
- id: pyupgrade
6+
args: ["--py36-plus"]
7+
8+
- repo: https://github.com/psf/black
9+
rev: 20.8b1
10+
hooks:
11+
- id: black
12+
args: ["--target-version", "py36"]
13+
14+
- repo: https://gitlab.com/pycqa/flake8
15+
rev: 3.8.3
16+
hooks:
17+
- id: flake8
18+
additional_dependencies: [flake8-2020]
19+
20+
- repo: https://github.com/pycqa/isort
21+
rev: 5.4.2
22+
hooks:
23+
- id: isort
24+
25+
- repo: https://github.com/pre-commit/pygrep-hooks
26+
rev: v1.6.0
27+
hooks:
28+
- id: python-check-blanket-noqa
29+
30+
- repo: https://github.com/pre-commit/pre-commit-hooks
31+
rev: v3.2.0
32+
hooks:
33+
- id: check-merge-conflict
34+
- id: check-toml
35+
- id: check-yaml
36+
37+
- repo: https://github.com/prettier/prettier
38+
rev: 2.1.1
39+
hooks:
40+
- id: prettier
41+
args: [--prose-wrap=always, --print-width=88]

.pre-commit-hooks.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
- id: python-modernize
2-
name: python-modernize
3-
description: Modernizes Python code for eventual Python 3 migration.
4-
entry: python-modernize
5-
args: [--write, --fix=default, --nobackups]
6-
language: python
7-
types: [python]
1+
- id: python-modernize
2+
name: python-modernize
3+
description: Modernizes Python code for eventual Python 3 migration.
4+
entry: python-modernize
5+
args: [--write, --fix=default, --nobackups]
6+
language: python
7+
types: [python]

.travis.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1+
sudo: false
12
language: python
2-
python:
3-
- "3.6"
4-
- "3.7"
5-
- "3.8"
6-
before_script:
7-
# stop the build if there are Python syntax errors or undefined names
8-
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
9-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
10-
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
11-
# command to run tests
12-
script: coverage run --branch --source=libmodernize setup.py test
13-
# Ensure dependencies are installed
3+
matrix:
4+
include:
5+
- python: "3.6"
6+
env: TOXENV=py36,lint,coveralls
7+
- python: "3.7"
8+
env: TOXENV=py37,lint,coveralls
9+
- python: "3.8"
10+
env: TOXENV=py38,lint,coveralls
1411
install:
15-
- pip install .
16-
- pip install 'coveralls==1.8.2'
17-
- pip install flake8
18-
- pip install 'six >= 1.13.0'
19-
after_success:
20-
coveralls
21-
sudo: false
12+
- nvm install 14
13+
- pip install tox
14+
script: tox
15+
cache:
16+
pip: true
17+
directories:
18+
- $HOME/.cache/pre-commit

__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from __future__ import absolute_import
1+
from __future__ import generator_stop
22

33
from libmodernize import main
44

5-
if __name__ == '__main__':
5+
if __name__ == "__main__":
66
main.main()

0 commit comments

Comments
 (0)