@@ -19,9 +19,9 @@ looking for the project's ``manage.py`` file and adding its directory to the
1919Python path.
2020
2121Looking for the ``manage.py `` file uses the same algorithm as pytest uses to
22- find ``pytest.ini ``, ``tox.ini `` and ``setup.cfg ``: Each test root directories
23- parents will be searched for ``manage.py `` files, and it will stop when the
24- first file is found.
22+ find ``pyproject.toml ``, `` pytest.ini ``, ``tox.ini `` and ``setup.cfg ``: Each
23+ test root directories parents will be searched for ``manage.py `` files, and it
24+ will stop when the first file is found.
2525
2626If you have a custom project setup, have none or multiple ``manage.py `` files
2727in your project, the automatic detection may not be correct. See
@@ -47,16 +47,19 @@ Managing your project with virtualenv, pip and editable mode
4747~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4848
4949The easiest way to have your code available on the Python path when using
50- virtualenv and pip is to have a setup.py file and install your project in
51- editable mode when developing.
50+ virtualenv and pip is to install your project in editable mode when developing.
5251
53- If you don't already have a setup.py file, creating a setup.py file with this
54- content will get you started::
52+ If you don't already have a pyproject.toml file, creating a pyproject.toml file
53+ with this content will get you started::
5554
56- import setuptools
57- setuptools.setup(name='myproj', version='1.0')
55+ # pyproject.toml
56+ [build-system]
57+ requires = [
58+ "setuptools>=61.0.0",
59+ ]
60+ build-backend = "setuptools.build_meta"
5861
59- This ``setup.py `` file is not sufficient to distribute your package to PyPI or
62+ This ``pyproject.toml `` file is not sufficient to distribute your package to PyPI or
6063more general packaging, but it should help you get started. Please refer to the
6164`Python Packaging User Guide
6265<https://python-packaging-user-guide.readthedocs.io/en/latest/tutorial.html#creating-your-own-project> `_
@@ -71,7 +74,7 @@ add this directly to your project's requirements.txt file like this::
7174
7275 # requirements.txt
7376 -e .
74- django>=1.11
77+ django
7578 pytest-django
7679
7780
@@ -80,8 +83,6 @@ Using pytest's ``pythonpath`` option
8083
8184You can explicitly add paths to the Python search path using pytest's
8285:pytest-confval: `pythonpath ` option.
83- This option is available since pytest 7; for older versions you can use the
84- `pytest-pythonpath <https://pypi.python.org/pypi/pytest-pythonpath >`_ plugin.
8586
8687Example: project with src layout
8788````````````````````````````````
0 commit comments