Skip to content

Commit

Permalink
Merge d8a9e55 into 1456415
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Sep 1, 2020
2 parents 1456415 + d8a9e55 commit e9748d5
Show file tree
Hide file tree
Showing 66 changed files with 1,545 additions and 921 deletions.
146 changes: 138 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,138 @@
*.pyc
*~
*.egg-info

/build
/dist
/docs/_build
/nose-*
# 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/
41 changes: 41 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
hooks:
- id: pyupgrade
args: ["--py36-plus"]

- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
args: ["--target-version", "py36"]

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: flake8
additional_dependencies: [flake8-2020]

- repo: https://github.com/pycqa/isort
rev: 5.4.2
hooks:
- id: isort

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.6.0
hooks:
- id: python-check-blanket-noqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-merge-conflict
- id: check-toml
- id: check-yaml

- repo: https://github.com/prettier/prettier
rev: 2.1.1
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
14 changes: 7 additions & 7 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- id: python-modernize
name: python-modernize
description: Modernizes Python code for eventual Python 3 migration.
entry: python-modernize
args: [--write, --fix=default, --nobackups]
language: python
types: [python]
- id: python-modernize
name: python-modernize
description: Modernizes Python code for eventual Python 3 migration.
entry: python-modernize
args: [--write, --fix=default, --nobackups]
language: python
types: [python]
35 changes: 16 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
sudo: false
language: python
python:
- "3.6"
- "3.7"
- "3.8"
before_script:
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# command to run tests
script: coverage run --branch --source=libmodernize setup.py test
# Ensure dependencies are installed
matrix:
include:
- python: "3.6"
env: TOXENV=py36,lint,coveralls
- python: "3.7"
env: TOXENV=py37,lint,coveralls
- python: "3.8"
env: TOXENV=py38,lint,coveralls
install:
- pip install .
- pip install 'coveralls==1.8.2'
- pip install flake8
- pip install 'six >= 1.13.0'
after_success:
coveralls
sudo: false
- nvm install 14
- pip install tox
script: tox
cache:
pip: true
directories:
- $HOME/.cache/pre-commit
4 changes: 1 addition & 3 deletions __main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from __future__ import absolute_import

from libmodernize import main

if __name__ == '__main__':
if __name__ == "__main__":
main.main()

0 comments on commit e9748d5

Please sign in to comment.