Skip to content

Commit

Permalink
Merge pull request #3513 from RonnyPfannschmidt/src-layout
Browse files Browse the repository at this point in the history
switch to src layout
  • Loading branch information
nicoddemus authored May 26, 2018
2 parents ee6c549 + eaa882f commit 075faa5
Show file tree
Hide file tree
Showing 50 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include/
.hypothesis/

# autogenerated
_pytest/_version.py
src/_pytest/_version.py
# setuptools
.eggs/

Expand Down
1 change: 1 addition & 0 deletions changelog/3513.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Switch pytest to the src/ layout as we already suggested it for good practice - now we implement it as well.
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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",
Expand All @@ -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,
Expand All @@ -123,9 +127,9 @@ def finalize_options(self):
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)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 075faa5

Please sign in to comment.