Move to src directory (#6506)
diff --git a/Makefile b/Makefile
index f74dc42..192b926 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,23 @@
.PHONY: docs
init:
- pip install -r requirements-dev.txt
+ python -m pip install -r requirements-dev.txt
test:
# This runs all of the tests on all supported Python versions.
tox -p
ci:
- pytest tests --junitxml=report.xml
+ python -m pytest tests --junitxml=report.xml
test-readme:
python setup.py check --restructuredtext --strict && ([ $$? -eq 0 ] && echo "README.rst and HISTORY.rst ok") || echo "Invalid markup in README.rst or HISTORY.rst!"
flake8:
- flake8 --ignore=E501,F401,E128,E402,E731,F821 requests
+ python -m flake8 src/requests
coverage:
- pytest --cov-config .coveragerc --verbose --cov-report term --cov-report xml --cov=requests tests
+ python -m pytest --cov-config .coveragerc --verbose --cov-report term --cov-report xml --cov=src/requests tests
publish:
- pip install 'twine>=1.5.0'
+ python -m pip install 'twine>=1.5.0'
python setup.py sdist bdist_wheel
twine upload dist/*
rm -fr build dist .egg requests.egg-info
diff --git a/pyproject.toml b/pyproject.toml
index d3ab7bd..1b7901e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,13 +1,10 @@
[tool.isort]
profile = "black"
-src_paths = ["requests", "test"]
+src_paths = ["src/requests", "test"]
honor_noqa = true
[tool.pytest.ini_options]
addopts = "--doctest-modules"
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS"
minversion = "6.2"
-testpaths = [
- "requests",
- "tests",
-]
+testpaths = ["tests"]
diff --git a/setup.cfg b/setup.cfg
index bf21c81..14e2d96 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -12,6 +12,6 @@
[flake8]
ignore = E203, E501, W503
per-file-ignores =
- requests/__init__.py:E402, F401
- requests/compat.py:E402, F401
+ src/requests/__init__.py:E402, F401
+ src/requests/compat.py:E402, F401
tests/compat.py:F401
diff --git a/setup.py b/setup.py
index e93bb41..dc8043a 100755
--- a/setup.py
+++ b/setup.py
@@ -75,7 +75,7 @@
about = {}
here = os.path.abspath(os.path.dirname(__file__))
-with open(os.path.join(here, "requests", "__version__.py"), "r", "utf-8") as f:
+with open(os.path.join(here, "src", "requests", "__version__.py"), "r", "utf-8") as f:
exec(f.read(), about)
with open("README.md", "r", "utf-8") as f:
@@ -92,7 +92,7 @@
url=about["__url__"],
packages=["requests"],
package_data={"": ["LICENSE", "NOTICE"]},
- package_dir={"requests": "requests"},
+ package_dir={"": "src"},
include_package_data=True,
python_requires=">=3.7",
install_requires=requires,
diff --git a/requests/__init__.py b/src/requests/__init__.py
similarity index 100%
rename from requests/__init__.py
rename to src/requests/__init__.py
diff --git a/requests/__version__.py b/src/requests/__version__.py
similarity index 100%
rename from requests/__version__.py
rename to src/requests/__version__.py
diff --git a/requests/_internal_utils.py b/src/requests/_internal_utils.py
similarity index 100%
rename from requests/_internal_utils.py
rename to src/requests/_internal_utils.py
diff --git a/requests/adapters.py b/src/requests/adapters.py
similarity index 100%
rename from requests/adapters.py
rename to src/requests/adapters.py
diff --git a/requests/api.py b/src/requests/api.py
similarity index 100%
rename from requests/api.py
rename to src/requests/api.py
diff --git a/requests/auth.py b/src/requests/auth.py
similarity index 100%
rename from requests/auth.py
rename to src/requests/auth.py
diff --git a/requests/certs.py b/src/requests/certs.py
similarity index 100%
rename from requests/certs.py
rename to src/requests/certs.py
diff --git a/requests/compat.py b/src/requests/compat.py
similarity index 100%
rename from requests/compat.py
rename to src/requests/compat.py
diff --git a/requests/cookies.py b/src/requests/cookies.py
similarity index 100%
rename from requests/cookies.py
rename to src/requests/cookies.py
diff --git a/requests/exceptions.py b/src/requests/exceptions.py
similarity index 100%
rename from requests/exceptions.py
rename to src/requests/exceptions.py
diff --git a/requests/help.py b/src/requests/help.py
similarity index 100%
rename from requests/help.py
rename to src/requests/help.py
diff --git a/requests/hooks.py b/src/requests/hooks.py
similarity index 100%
rename from requests/hooks.py
rename to src/requests/hooks.py
diff --git a/requests/models.py b/src/requests/models.py
similarity index 100%
rename from requests/models.py
rename to src/requests/models.py
diff --git a/requests/packages.py b/src/requests/packages.py
similarity index 100%
rename from requests/packages.py
rename to src/requests/packages.py
diff --git a/requests/sessions.py b/src/requests/sessions.py
similarity index 100%
rename from requests/sessions.py
rename to src/requests/sessions.py
diff --git a/requests/status_codes.py b/src/requests/status_codes.py
similarity index 100%
rename from requests/status_codes.py
rename to src/requests/status_codes.py
diff --git a/requests/structures.py b/src/requests/structures.py
similarity index 100%
rename from requests/structures.py
rename to src/requests/structures.py
diff --git a/requests/utils.py b/src/requests/utils.py
similarity index 100%
rename from requests/utils.py
rename to src/requests/utils.py