Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 9 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
docs/_build
/docs/_build
tmp.py
htmlcov/
.coverage.*
*.py[cod]
.mypy_cache

# emacs
*~
Expand Down Expand Up @@ -32,11 +29,16 @@ lib64
# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox/
# Testing
/.tox/
nosetests.xml

# Coverage
/.coverage
/.coverage.*
/htmlcov/
/.mypy_cache

# Translations
*.mo

Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ matrix:
- python: "3.8"
env: TOXENV=test-py38,codecov
- python: "pypy"
env: TOXENV=test-pypy,codecov
env: TOXENV=test-pypy2,codecov
- python: "pypy3"
env: TOXENV=test-pypy3,codecov
- python: "2.7"
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include README.md LICENSE CHANGELOG.md tox.ini requirements-test.txt .coveragerc Makefile pytest.ini .tox-coveragerc
Comment thread
mahmoud marked this conversation as resolved.
Resolved
include README.md LICENSE CHANGELOG.md tox.ini .coveragerc Makefile pytest.ini .tox-coveragerc
exclude TODO.md .appveyor.yml

graft docs
Expand Down
109 changes: 63 additions & 46 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,27 @@ envlist =
skip_missing_interpreters = {tty:True:False}


[default]

basepython = python3.8

deps =
idna==2.9

test: typing==3.7.4.1
test: {[testenv:coverage_report]deps}
test-{py26,py27,py34}: pytest==4.6.9
test-{py35,py36,py37,py38}: pytest==5.2.4
test: pytest-cov==2.8.1

setenv =
PY_MODULE=hyperlink

PYTHONPYCACHEPREFIX={envtmpdir}/pycache


Comment thread
mahmoud marked this conversation as resolved.
Resolved
##
# Build (default environment)
# Default environment: unit tests
##

[testenv]
Expand All @@ -27,39 +46,16 @@ basepython =
py37: python3.7
py38: python3.8
py39: python3.9
pypy: pypy
pypy3: pypy3

deps =
test: coverage==4.5.4 # rq.filter: <5
test: idna==2.9
test: typing==3.7.4.1
test: {py26,py27,py34}: pytest==4.6.9
test: {py35,py36,py37,py38}: pytest==5.2.4
test: pytest-cov==2.8.1

passenv =
# See https://github.com/codecov/codecov-python/blob/master/README.md#using-tox
# And CI-specific docs:
# https://help.github.com/en/articles/virtual-environments-for-github-actions#default-environment-variables
# https://docs.travis-ci.com/user/environment-variables#default-environment-variables
# https://www.appveyor.com/docs/environment-variables/
codecov: TOXENV CODECOV_* CI
codecov: GITHUB_*
codecov: TRAVIS TRAVIS_*
codecov: APPVEYOR APPVEYOR_*
pypy2: pypy
pypy3: pypy3

# Used in our AppVeyor config
codecov: OS
deps = {[default]deps}

setenv =
PY_MODULE=hyperlink

test: PYTHONPYCACHEPREFIX={envtmpdir}/pycache
{[default]setenv}

test: COVERAGE_FILE={toxworkdir}/coverage.{envname}
{coverage_report,codecov}: COVERAGE_FILE={toxworkdir}/coverage
codecov: COVERAGE_XML={envlogdir}/coverage_report.xml

commands =
test: pytest --cov={env:PY_MODULE} --cov-report=term-missing:skip-covered --doctest-modules {posargs:src/{env:PY_MODULE}}
Expand All @@ -73,16 +69,16 @@ commands =

description = run Flake8 (linter)

basepython = python3.8
basepython = {[default]basepython}

skip_install = True

deps =
flake8-bugbear==20.1.4
#flake8-docstrings==1.5.0
flake8==3.7.9
mccabe==0.6.1
pep8-naming==0.10.0
pycodestyle==2.5.0
pydocstyle==5.0.2
# pin pyflakes pending a release with https://github.com/PyCQA/pyflakes/pull/455
git+git://github.com/PyCQA/pyflakes@ffe9386#egg=pyflakes
Expand Down Expand Up @@ -137,13 +133,13 @@ application-import-names = deploy

description = run Mypy (static type checker)

basepython = python3.8

skip_install = True
Comment thread
mahmoud marked this conversation as resolved.
Resolved
basepython = {[default]basepython}

deps =
mypy==0.770

{[default]deps}

commands =
mypy \
--config-file="{toxinidir}/tox.ini" \
Expand All @@ -170,11 +166,7 @@ warn_return_any = True
warn_unreachable = True
warn_unused_ignores = True

[mypy-hyperlink._url]
# Don't complain about dependencies known to lack type hints
# 4 at time of writing (2020-20-01), so maybe disable this soon
allow_untyped_defs = True

Comment thread
mahmoud marked this conversation as resolved.
Resolved

[mypy-idna]
ignore_missing_imports = True
Expand All @@ -188,12 +180,19 @@ ignore_missing_imports = True

description = generate coverage report

depends = test-py{26,27,34,35,36,37,38,py,py3}

basepython = python

skip_install = True

deps =
coverage==4.5.4
coverage==4.5.4 # rq.filter: <5

setenv =
{[default]setenv}

COVERAGE_FILE={toxworkdir}/coverage

commands =
coverage combine
Expand All @@ -209,17 +208,34 @@ commands =

description = upload coverage to Codecov

depends = {[coverage_report]depends}

basepython = python

skip_install = True

deps =
coverage==4.5.4
{[testenv:coverage_report]deps}
codecov==2.0.22

commands =
# Note documentation for CI variables in default environment's passenv
passenv =
# See https://github.com/codecov/codecov-python/blob/master/README.md#using-tox
# And CI-specific docs:
# https://help.github.com/en/articles/virtual-environments-for-github-actions#default-environment-variables
# https://docs.travis-ci.com/user/environment-variables#default-environment-variables
# https://www.appveyor.com/docs/environment-variables/
TOXENV CODECOV_* CI
GITHUB_*
TRAVIS TRAVIS_*
APPVEYOR APPVEYOR_*

setenv =
{[testenv:coverage_report]setenv}

COVERAGE_XML={envlogdir}/coverage_report.xml
Comment thread
mahmoud marked this conversation as resolved.
Resolved

commands =
# Note documentation for CI variables in passenv above
coverage combine
coverage xml -o "{env:COVERAGE_XML}"
codecov --file="{env:COVERAGE_XML}" --env \
Expand All @@ -239,7 +255,7 @@ commands =

description = build documentation

basepython = python3.8
basepython = {[default]basepython}

deps =
Sphinx==2.3.1
Expand All @@ -256,11 +272,10 @@ commands =

description = build documentation and rebuild automatically

basepython = python3.8
basepython = {[default]basepython}

deps =
Sphinx==2.2.2
sphinx-rtd-theme==0.4.3
{[testenv:docs]deps}
sphinx-autobuild==0.7.1

commands =
Expand All @@ -279,7 +294,9 @@ commands =

description = check for potential packaging problems

basepython = python
basepython = {[default]basepython}

skip_install = True
Comment thread
mahmoud marked this conversation as resolved.
Resolved

deps =
check-manifest==0.41
Expand Down