Skip to content

Commit 3c2b834

Browse files
committed
Add travis-ci
1 parent 6efc7a7 commit 3c2b834

10 files changed

+106
-18
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
*.egg-info
12
*.pyc
23
/.cache
34
/.coverage
5+
/.tox
6+
/venv*

.pre-commit-config.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- repo: https://github.com/pre-commit/pre-commit-hooks.git
2+
sha: v0.7.1
3+
hooks:
4+
- id: trailing-whitespace
5+
- id: end-of-file-fixer
6+
- id: autopep8-wrapper
7+
- id: check-docstring-first
8+
- id: check-yaml
9+
- id: debug-statements
10+
- id: name-tests-test
11+
- id: requirements-txt-fixer
12+
- id: flake8
13+
- repo: https://github.com/asottile/reorder_python_imports.git
14+
sha: v0.3.1
15+
hooks:
16+
- id: reorder-python-imports

.travis.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: python
2+
matrix:
3+
include:
4+
- env: TOXENV=py27
5+
- env: TOXENV=py35
6+
python: 3.5
7+
- env: TOXENV=py36
8+
python: 3.6
9+
- env: TOXENV=pypy
10+
install: pip install coveralls tox
11+
script: tox
12+
after_success: coveralls
13+
cache:
14+
directories:
15+
- $HOME/.cache/pip
16+
- $HOME/.pre-commit

LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2017 Anthony Sottile
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
[![Build Status](https://travis-ci.org/asottile/pyupgrade.svg?branch=master)](https://travis-ci.org/asottile/pyupgrade)
2+
[![Coverage Status](https://coveralls.io/repos/github/asottile/pyupgrade/badge.svg?branch=master)](https://coveralls.io/github/asottile/pyupgrade?branch=master)
3+
14
pyupgrade
25
=========
36

47
A tool (and pre-commit hook) to automatically upgrade syntax for newer
58
versions of the language.
69

10+
## Installation
11+
12+
`pip install pyupgrade`
13+
714
## Implemented features
815

916
### Set literals

requirements-dev.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
coverage
2+
flake8
3+
pre-commit
4+
pytest

setup.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from setuptools import setup
2+
3+
setup(
4+
name='pyupgrade',
5+
description='A tool to automatically upgrade syntax for newer versions.',
6+
url='https://github.com/asottile/pyupgrade',
7+
version='0.0.0',
8+
author='Anthony Sottile',
9+
author_email='asottile@umich.edu',
10+
classifiers=[
11+
'License :: OSI Approved :: MIT License',
12+
'Programming Language :: Python :: 2',
13+
'Programming Language :: Python :: 2.7',
14+
'Programming Language :: Python :: 3',
15+
'Programming Language :: Python :: 3.5',
16+
'Programming Language :: Python :: Implementation :: CPython',
17+
'Programming Language :: Python :: Implementation :: PyPy',
18+
],
19+
py_modules=['pyupgrade'],
20+
)

testing/resources/docstring.py

-16
This file was deleted.

tests/pyupgrade_test.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from pyupgrade import _fix_sets
1212
from pyupgrade import _fix_unicode_literals
1313
from pyupgrade import _imports_unicode_literals
14-
from pyupgrade import parse_format
1514
from pyupgrade import main
15+
from pyupgrade import parse_format
1616
from pyupgrade import Token
1717
from pyupgrade import tokenize_src
1818
from pyupgrade import unparse_parsed_string
@@ -63,7 +63,6 @@ def test_tokenize_src_simple():
6363
(
6464
'testing/resources/empty.py',
6565
'testing/resources/unicode_snowman.py',
66-
'testing/resources/docstring.py',
6766
'testing/resources/backslash_continuation.py',
6867
),
6968
)

tox.ini

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[tox]
2+
project = pyupgrade
3+
# These should match the travis env list
4+
envlist = py27,py35,py36,pypy
5+
6+
[testenv]
7+
deps = -rrequirements-dev.txt
8+
commands =
9+
coverage erase
10+
coverage run -m pytest {posargs:tests}
11+
coverage report --show-missing --fail-under 100
12+
pre-commit install -f --install-hooks
13+
pre-commit run --all-files
14+
15+
[testenv:venv]
16+
envdir = venv-{[tox]project}
17+
commands =
18+
19+
[pep8]
20+
ignore = E265,E309,E501

0 commit comments

Comments
 (0)