Skip to content

Commit 26a8af8

Browse files
jadchaarsystemcatch
authored andcommitted
Updated tox file and changed Travis CI to use tox (#597)
* Updated tox file and changed Travis CI to use tox * Tweak travis yml * Added environment to 3.8 * Fix CI builds with changes from emergency fix pr * Fix unpack * Updated setup.py * Removed intermediate variable from get_version() * Added test-dev target to Makefile and added tests back to coverage * Updated HISTORY and bump version to 0.14.2 * Replaced codecs with io in setup.py after some research
1 parent 95f2be6 commit 26a8af8

File tree

8 files changed

+50
-61
lines changed

8 files changed

+50
-61
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
hooks:
2020
- id: isort
2121
- repo: https://github.com/asottile/pyupgrade
22-
rev: v1.17.1
22+
rev: v1.18.0
2323
hooks:
2424
- id: pyupgrade
2525
- repo: https://github.com/pre-commit/pygrep-hooks

.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ dist: xenial
33
matrix:
44
include:
55
- python: 2.7
6+
env: TOXENV=py27
67
- python: 3.5
8+
env: TOXENV=py35
79
- python: 3.6
10+
env: TOXENV=py36
811
- python: 3.7
12+
env: TOXENV=py37
913
- python: 3.8-dev
14+
env: TOXENV=py38
1015
- name: "Linting"
1116
python: 3.7
12-
env: TARGET=lint-ci
17+
env: TOXENV=lint
1318
cache:
1419
directories:
1520
- $HOME/.cache/pre-commit
1621
allow_failures:
1722
- python: 3.8-dev
18-
before_install: pip install -U codecov
19-
install:
20-
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then make build27; fi
21-
- if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then make build35; fi
22-
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then make build36; fi
23-
- if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then make build37; fi
24-
- if [[ $TRAVIS_PYTHON_VERSION == '3.8-dev' ]]; then make build38; fi
25-
script: make "${TARGET:-test}"
23+
env: TOXENV=py38
24+
install: pip install -U codecov tox
25+
script: tox
2626
after_success: codecov

HISTORY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## History
22

3+
### 0.14.2
4+
5+
- [CHANGE] Travis CI builds now use tox to lint and run tests.
6+
- [FIX] Fixed UnicodeDecodeError on certain locales (#600).
7+
38
### 0.14.1
49

510
- [FIX] Fixed "ImportError: No module named 'dateutil'" (#598).

Makefile

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,33 @@
22

33
auto: build27
44

5-
build27:
6-
virtualenv local --python=python2.7
7-
local/bin/pip install -r requirements.txt
8-
local/bin/pre-commit install
9-
10-
build35:
11-
virtualenv local --python=python3.5
12-
local/bin/pip install -r requirements.txt
13-
local/bin/pre-commit install
14-
15-
build36:
16-
virtualenv local --python=python3.6
17-
local/bin/pip install -r requirements.txt
18-
local/bin/pre-commit install
19-
20-
build37:
21-
virtualenv local --python=python3.7
22-
local/bin/pip install -r requirements.txt
23-
local/bin/pre-commit install
24-
25-
build38:
26-
virtualenv local --python=python3.8
5+
build27: PYTHON_VER = python2.7
6+
build35: PYTHON_VER = python3.5
7+
build36: PYTHON_VER = python3.6
8+
build37: PYTHON_VER = python3.7
9+
build38: PYTHON_VER = python3.8
10+
11+
build27 build35 build36 build37 build38:
12+
virtualenv local --python=$(PYTHON_VER)
2713
local/bin/pip install -r requirements.txt
2814
local/bin/pre-commit install
2915

3016
test:
3117
rm -f .coverage
3218
. local/bin/activate && nosetests
3319

34-
lint:
35-
local/bin/pre-commit run --all-files
20+
test-dev:
21+
rm -f .coverage
22+
. local/bin/activate && python -Wd -m nose
3623

37-
lint-ci:
24+
lint:
3825
local/bin/pre-commit run --all-files --show-diff-on-failure
3926

4027
docs:
4128
touch docs/index.rst
4229
. local/bin/activate && cd docs; make html
4330

4431
clean:
45-
rm -rf local ./**/__pycache__
32+
rm -rf local .tox ./**/__pycache__
33+
rm -rf dist build .egg arrow.egg-info
4634
rm -f ./**/*.pyc .coverage

arrow/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- coding: utf-8 -*-
2-
32
from .api import get, now, utcnow
43
from .arrow import Arrow
54
from .factory import ArrowFactory
65

7-
__version__ = "0.14.1"
6+
__version__ = "0.14.2"

setup.cfg

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@ cover-package = arrow
88
cover-erase = true
99

1010
[coverage:run]
11-
branch = True
11+
branch = true
1212
source =
1313
arrow
1414
tests
1515

1616
[coverage:report]
17-
show_missing = True
17+
show_missing = true
1818
fail_under = 100
1919

2020
[flake8]
2121
per-file-ignores = arrow/__init__.py:F401
2222
ignore = E203,E501,W503
2323

2424
[tool:isort]
25+
line_length = 88
26+
multi_line_output = 3
27+
include_trailing_comma = true
2528
known_third_party = chai,dateutil,pytz,setuptools,simplejson
2629

2730
[bdist_wheel]

setup.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
# -*- coding: utf-8 -*-
2-
import codecs
2+
import io
33
import re
44

55
from setuptools import setup
66

7-
with codecs.open("README.rst", encoding="utf-8") as f:
7+
with io.open("README.rst", "r", encoding="utf-8") as f:
88
readme = f.read()
99

10-
with codecs.open("arrow/__init__.py", encoding="utf-8") as f:
10+
with io.open("arrow/__init__.py", "r", encoding="utf-8") as f:
1111
init = f.read()
1212

1313

1414
def get_version():
1515
pattern = r'{}\W*=\W*"([^"]+)"'.format("__version__")
16-
strval = re.findall(pattern, init)[0]
17-
return strval
16+
return re.findall(pattern, init)[0]
1817

1918

2019
setup(

tox.ini

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
[tox]
2-
envlist = py27,py35,py36,py37
3-
skip_missing_interpreters = True
4-
5-
[common]
6-
deps =
7-
nose
8-
nose-cov
9-
simplejson
2+
envlist = py{27,35,36,37,38},lint
3+
skip_missing_interpreters = true
104

115
[testenv]
12-
deps =
13-
{[common]deps}
14-
chai
15-
commands = nosetests --all-modules --with-coverage arrow tests
6+
deps = -rrequirements.txt
7+
commands =
8+
nosetests
9+
pre-commit install
1610

17-
[testenv:py26]
18-
deps =
19-
{[common]deps}
20-
chai==0.3.1
11+
[testenv:lint]
12+
basepython = python3
13+
skip_install = true
14+
deps = pre-commit
15+
commands = pre-commit run --all-files --show-diff-on-failure

0 commit comments

Comments
 (0)