Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to src layout #3513

Merged
merged 1 commit into from
May 26, 2018
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
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.