Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 --recreate
after_success: codecov
35 changes: 9 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,14 @@

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

Expand All @@ -32,15 +18,12 @@ test:
. local/bin/activate && nosetests

lint:
local/bin/pre-commit run --all-files

lint-ci:
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 -f ./**/*.pyc .coverage
11 changes: 6 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ cover-package = arrow
cover-erase = true

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

[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
16 changes: 13 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
# -*- coding: utf-8 -*-
from setuptools import setup
import re

from arrow import __version__
from setuptools import setup

with open("README.rst", "r") as f:
readme = f.read()

with open("arrow/__init__.py", "r") as f:
init = f.read()


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


setup(
name="arrow",
version=__version__,
version=get_version(),
description="Better dates and times for Python",
long_description=readme,
long_description_content_type="text/x-rst",
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 = py27,py35,py36,py37,py38,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