Skip to content

Commit

Permalink
Package tox and dependencies in distribution tarball (#785)
Browse files Browse the repository at this point in the history
* Package tox and dependencies in distribution tarball. Move configurations from setup.cfg to tox.ini.

* Small tweak to Makefile
  • Loading branch information
jadchaar committed May 6, 2020
1 parent 8523795 commit f974022
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 29 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include LICENSE CHANGELOG.rst README.rst
include LICENSE CHANGELOG.rst README.rst Makefile requirements.txt tox.ini
recursive-include tests *.py
recursive-include docs *.py *.rst *.bat Makefile
36 changes: 21 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,36 @@ build36: PYTHON_VER = python3.6
build37: PYTHON_VER = python3.7
build38: PYTHON_VER = python3.8

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

test:
rm -f .coverage
. venv/bin/activate && pytest
. venv/bin/activate; pytest

lint:
venv/bin/pre-commit run --all-files --show-diff-on-failure
. venv/bin/activate; pre-commit run --all-files --show-diff-on-failure

docs:
rm -rf docs/_build
. venv/bin/activate && cd docs; make html
. venv/bin/activate; cd docs; make html

clean:
rm -rf venv .tox ./**/__pycache__
rm -rf dist build .egg .eggs arrow.egg-info
rm -f ./**/*.pyc .coverage
clean: clean-dist
rm -rf venv .pytest_cache ./**/__pycache__
rm -f .coverage ./**/*.pyc

publish: test
rm -rf dist build .egg .eggs arrow.egg-info
pip3 install -U setuptools twine wheel
python3 setup.py sdist bdist_wheel
twine upload dist/*
clean-dist:
rm -rf dist build .egg .eggs arrow.egg-info

build-dist:
. venv/bin/activate; \
pip install -U setuptools twine wheel; \
python setup.py sdist bdist_wheel

upload-dist:
. venv/bin/activate; twine upload dist/*

publish: test clean-dist build-dist upload-dist clean-dist
13 changes: 0 additions & 13 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,15 +1,2 @@
[tool:pytest]
addopts = -v --cov-branch --cov=arrow tests --cov-fail-under=100 --cov-report=term-missing

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

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

[bdist_wheel]
universal = 1
17 changes: 17 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
envlist = py{27,35,36,37,38},lint,docs
skip_missing_interpreters = true

# Configure testing environments

[testenv]
deps = -rrequirements.txt
whitelist_externals = pytest
Expand All @@ -27,3 +29,18 @@ whitelist_externals = make
commands =
doc8 index.rst ../README.rst --extension .rst --ignore D001
make html SPHINXOPTS="-W --keep-going"

# Configure settings for pytest, isort, and flake8

[pytest]
addopts = -v --cov-branch --cov=arrow tests --cov-fail-under=100 --cov-report=term-missing

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

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

0 comments on commit f974022

Please sign in to comment.