summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2018-05-26 09:05:41 +0200
committerRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2018-05-26 09:10:38 +0200
commiteaa882f3d5340956beb176aa1753e07e3f3f2190 (patch)
treef06d332cb33b5172c63bcfc7247d1ee25cd94795
parentee6c54904b236fae0a15245ac0317a1818e71afc (diff)
downloadpytest-eaa882f3d5340956beb176aa1753e07e3f3f2190.tar.gz
switch to src layout
-rw-r--r--.gitignore2
-rw-r--r--changelog/3513.trivial.rst1
-rw-r--r--setup.py12
-rw-r--r--src/_pytest/__init__.py (renamed from _pytest/__init__.py)0
-rw-r--r--src/_pytest/_argcomplete.py (renamed from _pytest/_argcomplete.py)0
-rw-r--r--src/_pytest/_code/__init__.py (renamed from _pytest/_code/__init__.py)0
-rw-r--r--src/_pytest/_code/_py2traceback.py (renamed from _pytest/_code/_py2traceback.py)0
-rw-r--r--src/_pytest/_code/code.py (renamed from _pytest/_code/code.py)0
-rw-r--r--src/_pytest/_code/source.py (renamed from _pytest/_code/source.py)0
-rw-r--r--src/_pytest/assertion/__init__.py (renamed from _pytest/assertion/__init__.py)0
-rw-r--r--src/_pytest/assertion/rewrite.py (renamed from _pytest/assertion/rewrite.py)0
-rw-r--r--src/_pytest/assertion/truncate.py (renamed from _pytest/assertion/truncate.py)0
-rw-r--r--src/_pytest/assertion/util.py (renamed from _pytest/assertion/util.py)0
-rwxr-xr-xsrc/_pytest/cacheprovider.py (renamed from _pytest/cacheprovider.py)0
-rw-r--r--src/_pytest/capture.py (renamed from _pytest/capture.py)0
-rw-r--r--src/_pytest/compat.py (renamed from _pytest/compat.py)0
-rw-r--r--src/_pytest/config.py (renamed from _pytest/config.py)0
-rw-r--r--src/_pytest/debugging.py (renamed from _pytest/debugging.py)0
-rw-r--r--src/_pytest/deprecated.py (renamed from _pytest/deprecated.py)0
-rw-r--r--src/_pytest/doctest.py (renamed from _pytest/doctest.py)0
-rw-r--r--src/_pytest/fixtures.py (renamed from _pytest/fixtures.py)0
-rw-r--r--src/_pytest/freeze_support.py (renamed from _pytest/freeze_support.py)0
-rw-r--r--src/_pytest/helpconfig.py (renamed from _pytest/helpconfig.py)0
-rw-r--r--src/_pytest/hookspec.py (renamed from _pytest/hookspec.py)0
-rw-r--r--src/_pytest/junitxml.py (renamed from _pytest/junitxml.py)0
-rw-r--r--src/_pytest/logging.py (renamed from _pytest/logging.py)0
-rw-r--r--src/_pytest/main.py (renamed from _pytest/main.py)0
-rw-r--r--src/_pytest/mark/__init__.py (renamed from _pytest/mark/__init__.py)0
-rw-r--r--src/_pytest/mark/evaluate.py (renamed from _pytest/mark/evaluate.py)0
-rw-r--r--src/_pytest/mark/legacy.py (renamed from _pytest/mark/legacy.py)0
-rw-r--r--src/_pytest/mark/structures.py (renamed from _pytest/mark/structures.py)0
-rw-r--r--src/_pytest/monkeypatch.py (renamed from _pytest/monkeypatch.py)0
-rw-r--r--src/_pytest/nodes.py (renamed from _pytest/nodes.py)0
-rw-r--r--src/_pytest/nose.py (renamed from _pytest/nose.py)0
-rw-r--r--src/_pytest/outcomes.py (renamed from _pytest/outcomes.py)0
-rw-r--r--src/_pytest/pastebin.py (renamed from _pytest/pastebin.py)0
-rw-r--r--src/_pytest/pytester.py (renamed from _pytest/pytester.py)0
-rw-r--r--src/_pytest/python.py (renamed from _pytest/python.py)0
-rw-r--r--src/_pytest/python_api.py (renamed from _pytest/python_api.py)0
-rw-r--r--src/_pytest/recwarn.py (renamed from _pytest/recwarn.py)0
-rw-r--r--src/_pytest/resultlog.py (renamed from _pytest/resultlog.py)0
-rw-r--r--src/_pytest/runner.py (renamed from _pytest/runner.py)0
-rw-r--r--src/_pytest/setuponly.py (renamed from _pytest/setuponly.py)0
-rw-r--r--src/_pytest/setupplan.py (renamed from _pytest/setupplan.py)0
-rw-r--r--src/_pytest/skipping.py (renamed from _pytest/skipping.py)0
-rw-r--r--src/_pytest/terminal.py (renamed from _pytest/terminal.py)0
-rw-r--r--src/_pytest/tmpdir.py (renamed from _pytest/tmpdir.py)0
-rw-r--r--src/_pytest/unittest.py (renamed from _pytest/unittest.py)0
-rw-r--r--src/_pytest/warnings.py (renamed from _pytest/warnings.py)0
-rw-r--r--src/pytest.py (renamed from pytest.py)0
50 files changed, 10 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 99c4c7bad..afb6bf9fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,7 +19,7 @@ include/
.hypothesis/
# autogenerated
-_pytest/_version.py
+src/_pytest/_version.py
# setuptools
.eggs/
diff --git a/changelog/3513.trivial.rst b/changelog/3513.trivial.rst
new file mode 100644
index 000000000..e8c0948e0
--- /dev/null
+++ b/changelog/3513.trivial.rst
@@ -0,0 +1 @@
+Switch pytest to the src/ layout as we already suggested it for good practice - now we implement it as well.
diff --git a/setup.py b/setup.py
index 1e67f27f0..3f5ed39be 100644
--- a/setup.py
+++ b/setup.py
@@ -50,6 +50,9 @@ def get_environment_marker_support_level():
return 1
except Exception as exc:
sys.stderr.write("Could not test setuptool's version: %s\n" % exc)
+
+ # as of testing on 2018-05-26 fedora was on version 37* and debian was on version 33+
+ # we should consider erroring on those
return 0
@@ -84,7 +87,7 @@ def main():
name="pytest",
description="pytest: simple powerful testing with Python",
long_description=long_description,
- use_scm_version={"write_to": "_pytest/_version.py"},
+ use_scm_version={"write_to": "src/_pytest/_version.py"},
url="http://pytest.org",
project_urls={
"Source": "https://github.com/pytest-dev/pytest",
@@ -102,6 +105,7 @@ def main():
cmdclass={"test": PyTest},
# the following should be enabled for release
setup_requires=["setuptools-scm"],
+ package_dir={"": "src"},
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
install_requires=install_requires,
extras_require=extras_require,
@@ -123,9 +127,9 @@ class PyTest(Command):
def run(self):
import subprocess
- PPATH = [x for x in os.environ.get("PYTHONPATH", "").split(":") if x]
- PPATH.insert(0, os.getcwd())
- os.environ["PYTHONPATH"] = ":".join(PPATH)
+ python_path = [x for x in os.environ.get("PYTHONPATH", "").split(":") if x]
+ python_path.insert(0, os.getcwd())
+ os.environ["PYTHONPATH"] = ":".join(python_path)
errno = subprocess.call([sys.executable, "pytest.py", "--ignore=doc"])
raise SystemExit(errno)
diff --git a/_pytest/__init__.py b/src/_pytest/__init__.py
index 46c7827ed..46c7827ed 100644
--- a/_pytest/__init__.py
+++ b/src/_pytest/__init__.py
diff --git a/_pytest/_argcomplete.py b/src/_pytest/_argcomplete.py
index 8f480d71d..8f480d71d 100644
--- a/_pytest/_argcomplete.py
+++ b/src/_pytest/_argcomplete.py
diff --git a/_pytest/_code/__init__.py b/src/_pytest/_code/__init__.py
index 815c13b42..815c13b42 100644
--- a/_pytest/_code/__init__.py
+++ b/src/_pytest/_code/__init__.py
diff --git a/_pytest/_code/_py2traceback.py b/src/_pytest/_code/_py2traceback.py
index 2dd100c33..2dd100c33 100644
--- a/_pytest/_code/_py2traceback.py
+++ b/src/_pytest/_code/_py2traceback.py
diff --git a/_pytest/_code/code.py b/src/_pytest/_code/code.py
index cb788c17f..cb788c17f 100644
--- a/_pytest/_code/code.py
+++ b/src/_pytest/_code/code.py
diff --git a/_pytest/_code/source.py b/src/_pytest/_code/source.py
index 6b982a4ca..6b982a4ca 100644
--- a/_pytest/_code/source.py
+++ b/src/_pytest/_code/source.py
diff --git a/_pytest/assertion/__init__.py b/src/_pytest/assertion/__init__.py
index 2c9a8890c..2c9a8890c 100644
--- a/_pytest/assertion/__init__.py
+++ b/src/_pytest/assertion/__init__.py
diff --git a/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py
index eceed611f..eceed611f 100644
--- a/_pytest/assertion/rewrite.py
+++ b/src/_pytest/assertion/rewrite.py
diff --git a/_pytest/assertion/truncate.py b/src/_pytest/assertion/truncate.py
index 79adeca6a..79adeca6a 100644
--- a/_pytest/assertion/truncate.py
+++ b/src/_pytest/assertion/truncate.py
diff --git a/_pytest/assertion/util.py b/src/_pytest/assertion/util.py
index bcb800a4a..bcb800a4a 100644
--- a/_pytest/assertion/util.py
+++ b/src/_pytest/assertion/util.py
diff --git a/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py
index eb0fcc06f..eb0fcc06f 100755
--- a/_pytest/cacheprovider.py
+++ b/src/_pytest/cacheprovider.py
diff --git a/_pytest/capture.py b/src/_pytest/capture.py
index 7a57adb75..7a57adb75 100644
--- a/_pytest/capture.py
+++ b/src/_pytest/capture.py
diff --git a/_pytest/compat.py b/src/_pytest/compat.py
index e4072ecdb..e4072ecdb 100644
--- a/_pytest/compat.py
+++ b/src/_pytest/compat.py
diff --git a/_pytest/config.py b/src/_pytest/config.py
index 53e74cf1c..53e74cf1c 100644
--- a/_pytest/config.py
+++ b/src/_pytest/config.py
diff --git a/_pytest/debugging.py b/src/_pytest/debugging.py
index 2e253aaa2..2e253aaa2 100644
--- a/_pytest/debugging.py
+++ b/src/_pytest/debugging.py
diff --git a/_pytest/deprecated.py b/src/_pytest/deprecated.py
index 7ebdcf999..7ebdcf999 100644
--- a/_pytest/deprecated.py
+++ b/src/_pytest/deprecated.py
diff --git a/_pytest/doctest.py b/src/_pytest/doctest.py
index 3b58f955f..3b58f955f 100644
--- a/_pytest/doctest.py
+++ b/src/_pytest/doctest.py
diff --git a/_pytest/fixtures.py b/src/_pytest/fixtures.py
index bfae4cb61..bfae4cb61 100644
--- a/_pytest/fixtures.py
+++ b/src/_pytest/fixtures.py
diff --git a/_pytest/freeze_support.py b/src/_pytest/freeze_support.py
index 002e07730..002e07730 100644
--- a/_pytest/freeze_support.py
+++ b/src/_pytest/freeze_support.py
diff --git a/_pytest/helpconfig.py b/src/_pytest/helpconfig.py
index 5514fec40..5514fec40 100644
--- a/_pytest/helpconfig.py
+++ b/src/_pytest/helpconfig.py
diff --git a/_pytest/hookspec.py b/src/_pytest/hookspec.py
index fec43a400..fec43a400 100644
--- a/_pytest/hookspec.py
+++ b/src/_pytest/hookspec.py
diff --git a/_pytest/junitxml.py b/src/_pytest/junitxml.py
index 29da27de7..29da27de7 100644
--- a/_pytest/junitxml.py
+++ b/src/_pytest/junitxml.py
diff --git a/_pytest/logging.py b/src/_pytest/logging.py
index 00bb9aeb5..00bb9aeb5 100644
--- a/_pytest/logging.py
+++ b/src/_pytest/logging.py
diff --git a/_pytest/main.py b/src/_pytest/main.py
index 23562358d..23562358d 100644
--- a/_pytest/main.py
+++ b/src/_pytest/main.py
diff --git a/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py
index e3918ca6a..e3918ca6a 100644
--- a/_pytest/mark/__init__.py
+++ b/src/_pytest/mark/__init__.py
diff --git a/_pytest/mark/evaluate.py b/src/_pytest/mark/evaluate.py
index a3d11ee0f..a3d11ee0f 100644
--- a/_pytest/mark/evaluate.py
+++ b/src/_pytest/mark/evaluate.py
diff --git a/_pytest/mark/legacy.py b/src/_pytest/mark/legacy.py
index ab016a035..ab016a035 100644
--- a/_pytest/mark/legacy.py
+++ b/src/_pytest/mark/legacy.py
diff --git a/_pytest/mark/structures.py b/src/_pytest/mark/structures.py
index 7e86aee44..7e86aee44 100644
--- a/_pytest/mark/structures.py
+++ b/src/_pytest/mark/structures.py
diff --git a/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py
index 16080b5d5..16080b5d5 100644
--- a/_pytest/monkeypatch.py
+++ b/src/_pytest/monkeypatch.py
diff --git a/_pytest/nodes.py b/src/_pytest/nodes.py
index 8d82bf606..8d82bf606 100644
--- a/_pytest/nodes.py
+++ b/src/_pytest/nodes.py
diff --git a/_pytest/nose.py b/src/_pytest/nose.py
index bb2e4277d..bb2e4277d 100644
--- a/_pytest/nose.py
+++ b/src/_pytest/nose.py
diff --git a/_pytest/outcomes.py b/src/_pytest/outcomes.py
index 8a3662e1b..8a3662e1b 100644
--- a/_pytest/outcomes.py
+++ b/src/_pytest/outcomes.py
diff --git a/_pytest/pastebin.py b/src/_pytest/pastebin.py
index 6af202d1f..6af202d1f 100644
--- a/_pytest/pastebin.py
+++ b/src/_pytest/pastebin.py
diff --git a/_pytest/pytester.py b/src/_pytest/pytester.py
index c9defe03a..c9defe03a 100644
--- a/_pytest/pytester.py
+++ b/src/_pytest/pytester.py
diff --git a/_pytest/python.py b/src/_pytest/python.py
index 48516199f..48516199f 100644
--- a/_pytest/python.py
+++ b/src/_pytest/python.py
diff --git a/_pytest/python_api.py b/src/_pytest/python_api.py
index 955fb4165..955fb4165 100644
--- a/_pytest/python_api.py
+++ b/src/_pytest/python_api.py
diff --git a/_pytest/recwarn.py b/src/_pytest/recwarn.py
index 565af8a3f..565af8a3f 100644
--- a/_pytest/recwarn.py
+++ b/src/_pytest/recwarn.py
diff --git a/_pytest/resultlog.py b/src/_pytest/resultlog.py
index 8f300c983..8f300c983 100644
--- a/_pytest/resultlog.py
+++ b/src/_pytest/resultlog.py
diff --git a/_pytest/runner.py b/src/_pytest/runner.py
index ef1a0e694..ef1a0e694 100644
--- a/_pytest/runner.py
+++ b/src/_pytest/runner.py
diff --git a/_pytest/setuponly.py b/src/_pytest/setuponly.py
index 81240d9d0..81240d9d0 100644
--- a/_pytest/setuponly.py
+++ b/src/_pytest/setuponly.py
diff --git a/_pytest/setupplan.py b/src/_pytest/setupplan.py
index 23f4f97e6..23f4f97e6 100644
--- a/_pytest/setupplan.py
+++ b/src/_pytest/setupplan.py
diff --git a/_pytest/skipping.py b/src/_pytest/skipping.py
index a348d5484..a348d5484 100644
--- a/_pytest/skipping.py
+++ b/src/_pytest/skipping.py
diff --git a/_pytest/terminal.py b/src/_pytest/terminal.py
index 94b416556..94b416556 100644
--- a/_pytest/terminal.py
+++ b/src/_pytest/terminal.py
diff --git a/_pytest/tmpdir.py b/src/_pytest/tmpdir.py
index 260d28422..260d28422 100644
--- a/_pytest/tmpdir.py
+++ b/src/_pytest/tmpdir.py
diff --git a/_pytest/unittest.py b/src/_pytest/unittest.py
index 6ad9fda88..6ad9fda88 100644
--- a/_pytest/unittest.py
+++ b/src/_pytest/unittest.py
diff --git a/_pytest/warnings.py b/src/_pytest/warnings.py
index e023d0ab4..e023d0ab4 100644
--- a/_pytest/warnings.py
+++ b/src/_pytest/warnings.py
diff --git a/pytest.py b/src/pytest.py
index f27f5a195..f27f5a195 100644
--- a/pytest.py
+++ b/src/pytest.py