Skip to content

Commit

Permalink
Updated tox file and changed Travis CI to use tox (arrow-py#597)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jadchaar authored and systemcatch committed Jun 4, 2019
1 parent 95f2be6 commit 26a8af8
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v1.17.1
rev: v1.18.0
hooks:
- id: pyupgrade
- repo: https://github.com/pre-commit/pygrep-hooks
Expand Down
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ dist: xenial
matrix:
include:
- python: 2.7
env: TOXENV=py27
- python: 3.5
env: TOXENV=py35
- python: 3.6
env: TOXENV=py36
- python: 3.7
env: TOXENV=py37
- python: 3.8-dev
env: TOXENV=py38
- name: "Linting"
python: 3.7
env: TARGET=lint-ci
env: TOXENV=lint
cache:
directories:
- $HOME/.cache/pre-commit
allow_failures:
- python: 3.8-dev
before_install: pip install -U codecov
install:
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then make build27; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then make build35; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then make build36; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then make build37; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.8-dev' ]]; then make build38; fi
script: make "${TARGET:-test}"
env: TOXENV=py38
install: pip install -U codecov tox
script: tox
after_success: codecov
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## History

### 0.14.2

- [CHANGE] Travis CI builds now use tox to lint and run tests.
- [FIX] Fixed UnicodeDecodeError on certain locales (#600).

### 0.14.1

- [FIX] Fixed "ImportError: No module named 'dateutil'" (#598).
Expand Down
40 changes: 14 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,33 @@

auto: build27

build27:
virtualenv local --python=python2.7
local/bin/pip install -r requirements.txt
local/bin/pre-commit install

build35:
virtualenv local --python=python3.5
local/bin/pip install -r requirements.txt
local/bin/pre-commit install

build36:
virtualenv local --python=python3.6
local/bin/pip install -r requirements.txt
local/bin/pre-commit install

build37:
virtualenv local --python=python3.7
local/bin/pip install -r requirements.txt
local/bin/pre-commit install

build38:
virtualenv local --python=python3.8
build27: PYTHON_VER = python2.7
build35: PYTHON_VER = python3.5
build36: PYTHON_VER = python3.6
build37: PYTHON_VER = python3.7
build38: PYTHON_VER = python3.8

build27 build35 build36 build37 build38:
virtualenv local --python=$(PYTHON_VER)
local/bin/pip install -r requirements.txt
local/bin/pre-commit install

test:
rm -f .coverage
. local/bin/activate && nosetests

lint:
local/bin/pre-commit run --all-files
test-dev:
rm -f .coverage
. local/bin/activate && python -Wd -m nose

lint-ci:
lint:
local/bin/pre-commit run --all-files --show-diff-on-failure

docs:
touch docs/index.rst
. local/bin/activate && cd docs; make html

clean:
rm -rf local ./**/__pycache__
rm -rf local .tox ./**/__pycache__
rm -rf dist build .egg arrow.egg-info
rm -f ./**/*.pyc .coverage
3 changes: 1 addition & 2 deletions arrow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-

from .api import get, now, utcnow
from .arrow import Arrow
from .factory import ArrowFactory

__version__ = "0.14.1"
__version__ = "0.14.2"
7 changes: 5 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@ cover-package = arrow
cover-erase = true

[coverage:run]
branch = True
branch = true
source =
arrow
tests

[coverage:report]
show_missing = True
show_missing = true
fail_under = 100

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

[tool:isort]
line_length = 88
multi_line_output = 3
include_trailing_comma = true
known_third_party = chai,dateutil,pytz,setuptools,simplejson

[bdist_wheel]
Expand Down
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# -*- coding: utf-8 -*-
import codecs
import io
import re

from setuptools import setup

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

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


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


setup(
Expand Down
27 changes: 11 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
[tox]
envlist = py27,py35,py36,py37
skip_missing_interpreters = True

[common]
deps =
nose
nose-cov
simplejson
envlist = py{27,35,36,37,38},lint
skip_missing_interpreters = true

[testenv]
deps =
{[common]deps}
chai
commands = nosetests --all-modules --with-coverage arrow tests
deps = -rrequirements.txt
commands =
nosetests
pre-commit install

[testenv:py26]
deps =
{[common]deps}
chai==0.3.1
[testenv:lint]
basepython = python3
skip_install = true
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure

0 comments on commit 26a8af8

Please sign in to comment.