diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8a1d348739..3469cf6b83 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,9 +6,10 @@ repos: args: [--line-length=99, --safe] python_version: python3.6 - repo: https://github.com/asottile/seed-isort-config - rev: v0.1.0 + rev: v1.0.0 hooks: - id: seed-isort-config + args: [--application-directories, src] - repo: https://github.com/pre-commit/mirrors-isort rev: v4.3.4 hooks: diff --git a/setup.py b/setup.py index 5839d3788f..2f4286cf39 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,8 @@ import io import sys -import setuptools +from setuptools import __version__ as setuptools_version +from setuptools import find_packages, setup def has_environment_marker_support(): @@ -19,7 +20,7 @@ def has_environment_marker_support(): import pkg_resources try: - v = pkg_resources.parse_version(setuptools.__version__) + v = pkg_resources.parse_version(setuptools_version) return v >= pkg_resources.parse_version("0.7.2") except Exception as e: sys.stderr.write("Could not test setuptool's version: {}\n".format(e)) @@ -33,7 +34,7 @@ def get_long_description(): def main(): - setuptools.setup( + setup( name="tox", description="virtualenv-based automation of test activities", long_description=get_long_description(), @@ -43,7 +44,8 @@ def main(): platforms=["unix", "linux", "osx", "cygwin", "win32"], author="holger krekel", author_email="holger@merlinux.eu", - packages=["tox"], + packages=find_packages("src"), + package_dir={"": "src"}, entry_points={ "console_scripts": ["tox=tox:cmdline", "tox-quickstart=tox._quickstart:main"] }, diff --git a/tox/__init__.py b/src/tox/__init__.py similarity index 100% rename from tox/__init__.py rename to src/tox/__init__.py diff --git a/tox/__main__.py b/src/tox/__main__.py similarity index 100% rename from tox/__main__.py rename to src/tox/__main__.py diff --git a/tox/_pytestplugin.py b/src/tox/_pytestplugin.py similarity index 100% rename from tox/_pytestplugin.py rename to src/tox/_pytestplugin.py diff --git a/tox/_quickstart.py b/src/tox/_quickstart.py similarity index 100% rename from tox/_quickstart.py rename to src/tox/_quickstart.py diff --git a/tox/_verlib.py b/src/tox/_verlib.py similarity index 100% rename from tox/_verlib.py rename to src/tox/_verlib.py diff --git a/tox/config.py b/src/tox/config.py similarity index 100% rename from tox/config.py rename to src/tox/config.py diff --git a/tox/constants.py b/src/tox/constants.py similarity index 100% rename from tox/constants.py rename to src/tox/constants.py diff --git a/tox/exception.py b/src/tox/exception.py similarity index 100% rename from tox/exception.py rename to src/tox/exception.py diff --git a/tox/hookspecs.py b/src/tox/hookspecs.py similarity index 100% rename from tox/hookspecs.py rename to src/tox/hookspecs.py diff --git a/tox/interpreters.py b/src/tox/interpreters.py similarity index 100% rename from tox/interpreters.py rename to src/tox/interpreters.py diff --git a/tox/result.py b/src/tox/result.py similarity index 100% rename from tox/result.py rename to src/tox/result.py diff --git a/tox/session.py b/src/tox/session.py similarity index 100% rename from tox/session.py rename to src/tox/session.py diff --git a/tox/venv.py b/src/tox/venv.py similarity index 100% rename from tox/venv.py rename to src/tox/venv.py diff --git a/tox.ini b/tox.ini index 37effe5011..9acd122bf4 100644 --- a/tox.ini +++ b/tox.ini @@ -42,7 +42,7 @@ commands = pre-commit run --all-files --show-diff-on-failure description = combine coverage data and create reports deps = coverage skip_install = True -changedir = {toxworkdir} +changedir = {toxworkdir}/src setenv = COVERAGE_FILE=.coverage commands = coverage erase coverage combine @@ -97,7 +97,7 @@ show_missing = True exclude_lines = if __name__ == ["']__main__["']: [coverage:paths] -source = tox +source = src/tox {toxworkdir}/*/lib/python*/site-packages/tox {toxworkdir}/*/Lib/site-packages/tox {toxworkdir}/pypy*/site-packages/tox