diff --git a/.coveragerc b/.coveragerc index fac1b07a..5a1a08f9 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,7 +1,11 @@ [run] branch = True -omit = attr/_compat.py source = attr +[paths] +source = + src/attr + .tox/*/lib/python*/site-packages/attr + .tox/pypy/site-packages/attr [report] show_missing = True diff --git a/.gitignore b/.gitignore index b4f9c71c..321aae50 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .tox -.coverage +.coverage* *.pyc *.egg-info docs/_build/ diff --git a/docs/conf.py b/docs/conf.py index ef046966..cacf3c2d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -90,7 +90,7 @@ copyright = u'2015{0}, Hynek Schlawack'.format( # built documents. # # The short X.Y version. -release = find_version("../attr/__init__.py") +release = find_version("../src/attr/__init__.py") version = release.rsplit(u".", 1)[0] # The full version, including alpha/beta/rc tags. diff --git a/setup.py b/setup.py index e6f7814b..3ba74784 100644 --- a/setup.py +++ b/setup.py @@ -8,8 +8,8 @@ from setuptools import setup, find_packages ############################################################################### NAME = "attrs" -PACKAGES = find_packages(exclude=["tests*"]) -META_PATH = os.path.join("attr", "__init__.py") +PACKAGES = find_packages(where="src", exclude=["tests*"]) +META_PATH = os.path.join("src", "attr", "__init__.py") KEYWORDS = ["class", "attribute", "boilerplate"] CLASSIFIERS = [ "Development Status :: 5 - Production/Stable", @@ -75,6 +75,7 @@ if __name__ == "__main__": keywords=KEYWORDS, long_description=read("README.rst"), packages=PACKAGES, + package_dir={"": "src"}, zip_safe=False, classifiers=CLASSIFIERS, install_requires=INSTALL_REQUIRES, diff --git a/attr/__init__.py b/src/attr/__init__.py similarity index 100% rename from attr/__init__.py rename to src/attr/__init__.py diff --git a/attr/_compat.py b/src/attr/_compat.py similarity index 100% rename from attr/_compat.py rename to src/attr/_compat.py diff --git a/attr/_config.py b/src/attr/_config.py similarity index 100% rename from attr/_config.py rename to src/attr/_config.py diff --git a/attr/_funcs.py b/src/attr/_funcs.py similarity index 100% rename from attr/_funcs.py rename to src/attr/_funcs.py diff --git a/attr/_make.py b/src/attr/_make.py similarity index 100% rename from attr/_make.py rename to src/attr/_make.py diff --git a/attr/filters.py b/src/attr/filters.py similarity index 100% rename from attr/filters.py rename to src/attr/filters.py diff --git a/attr/validators.py b/src/attr/validators.py similarity index 100% rename from attr/validators.py rename to src/attr/validators.py diff --git a/tox.ini b/tox.ini index 92391dbb..c1880229 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py26, py27, py33, py34, py35, pypy, flake8, manifest, docs +envlist = coverage-clean, py26, py27, py33, py34, py35, pypy, flake8, manifest, docs, coverage-report [testenv] passenv = TERM # ensure colors @@ -8,15 +8,14 @@ deps = pytest>=2.7.2 # see https://github.com/hynek/attrs/issues/14 zope.interface commands = - coverage run {envbindir}/py.test tests - coverage report -m + coverage run --parallel -m pytest tests [testenv:flake8] basepython = python2.7 deps = flake8 -commands = flake8 attr tests setup.py +commands = flake8 src tests setup.py [testenv:docs] @@ -37,3 +36,16 @@ deps = check-manifest commands = check-manifest + +[testenv:coverage-clean] +deps = coverage +skip_install = true +commands = coverage erase + +[testenv:coverage-report] +basepython = python3.5 +deps = coverage +skip_install = true +commands = + coverage combine + coverage report