Move to src directory (#6506)

This commit is contained in:
Nate Prewitt
2023-08-13 14:46:13 -07:00
committed by GitHub
parent e9fa2e2da3
commit d63e94f552
22 changed files with 11 additions and 14 deletions
+5 -5
View File
@@ -1,23 +1,23 @@
.PHONY: docs .PHONY: docs
init: init:
pip install -r requirements-dev.txt python -m pip install -r requirements-dev.txt
test: test:
# This runs all of the tests on all supported Python versions. # This runs all of the tests on all supported Python versions.
tox -p tox -p
ci: ci:
pytest tests --junitxml=report.xml python -m pytest tests --junitxml=report.xml
test-readme: 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!" 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:
flake8 --ignore=E501,F401,E128,E402,E731,F821 requests python -m flake8 src/requests
coverage: 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: publish:
pip install 'twine>=1.5.0' python -m pip install 'twine>=1.5.0'
python setup.py sdist bdist_wheel python setup.py sdist bdist_wheel
twine upload dist/* twine upload dist/*
rm -fr build dist .egg requests.egg-info rm -fr build dist .egg requests.egg-info
+2 -5
View File
@@ -1,13 +1,10 @@
[tool.isort] [tool.isort]
profile = "black" profile = "black"
src_paths = ["requests", "test"] src_paths = ["src/requests", "test"]
honor_noqa = true honor_noqa = true
[tool.pytest.ini_options] [tool.pytest.ini_options]
addopts = "--doctest-modules" addopts = "--doctest-modules"
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS" doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS"
minversion = "6.2" minversion = "6.2"
testpaths = [ testpaths = ["tests"]
"requests",
"tests",
]
+2 -2
View File
@@ -12,6 +12,6 @@ requires-dist =
[flake8] [flake8]
ignore = E203, E501, W503 ignore = E203, E501, W503
per-file-ignores = per-file-ignores =
requests/__init__.py:E402, F401 src/requests/__init__.py:E402, F401
requests/compat.py:E402, F401 src/requests/compat.py:E402, F401
tests/compat.py:F401 tests/compat.py:F401
+2 -2
View File
@@ -75,7 +75,7 @@ test_requirements = [
about = {} about = {}
here = os.path.abspath(os.path.dirname(__file__)) 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) exec(f.read(), about)
with open("README.md", "r", "utf-8") as f: with open("README.md", "r", "utf-8") as f:
@@ -92,7 +92,7 @@ setup(
url=about["__url__"], url=about["__url__"],
packages=["requests"], packages=["requests"],
package_data={"": ["LICENSE", "NOTICE"]}, package_data={"": ["LICENSE", "NOTICE"]},
package_dir={"requests": "requests"}, package_dir={"": "src"},
include_package_data=True, include_package_data=True,
python_requires=">=3.7", python_requires=">=3.7",
install_requires=requires, install_requires=requires,