Skip to content

Commit f57bb2b

Browse files
committed
Improve docs in preparation for release
2 parents 73b2fce + bce326f commit f57bb2b

File tree

4 files changed

+22
-40
lines changed

4 files changed

+22
-40
lines changed

changelog.d/3068.change.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ standards are handled in the ``[tool.setuptools]`` sub-table.
44

55
In the future, existing ``setup.cfg`` configuration
66
may be automatically converted into the ``pyproject.toml`` equivalent before taking effect
7-
(as proposed in :issue:`1688`). Meanwhile users can use automated tools like
7+
(as proposed in #1688). Meanwhile users can use automated tools like
88
:pypi:`ini2toml` to help in the transition.
99

1010
Please note that the legacy backend is not guaranteed to work with

docs/conf.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
GH='https://github.com',
1010
),
1111
replace=[
12+
dict(
13+
pattern=r'(?<!\w)PR #(?P<pull>\d+)',
14+
url='{package_url}/pull/{pull}',
15+
),
1216
dict(
1317
pattern=r'(?<!\w)(Issue )?#(?P<issue>\d+)',
1418
url='{package_url}/issues/{issue}',
@@ -99,8 +103,6 @@
99103
github_repo_url = f'{github_url}/{github_repo_slug}'
100104
github_sponsors_url = f'{github_url}/sponsors'
101105
extlinks = {
102-
'issue': (f'{github_repo_url}/issues/%s', 'issue #%s'), # noqa: WPS323
103-
'pr': (f'{github_repo_url}/pull/%s', 'PR #%s'), # noqa: WPS323
104106
'user': (f'{github_sponsors_url}/%s', '@'), # noqa: WPS323
105107
'pypi': ('https://pypi.org/project/%s', '%s'), # noqa: WPS323
106108
'wiki': ('https://wikipedia.org/wiki/%s', '%s'), # noqa: WPS323
@@ -170,8 +172,8 @@
170172

171173
# Allow linking objects on other Sphinx sites seamlessly:
172174
intersphinx_mapping.update(
173-
python=('https://docs.python.org/3', None),
174175
python2=('https://docs.python.org/2', None),
176+
python=('https://docs.python.org/3', None),
175177
)
176178

177179
# Add support for the unreleased "next-version" change notes

docs/userguide/pyproject_config.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ Configuring setuptools using ``pyproject.toml`` files
1212
``setuptools`` via ``pyproject.toml`` files is still experimental and might
1313
change (or be removed) in future releases.
1414

15-
.. important::
16-
For the time being, you still might require a ``setup.py`` file containing
17-
a *arg-less* ``setup()`` function call to support
18-
:doc:`editable installs <pip:cli/pip_install>`.
19-
2015
Starting with :pep:`621`, the Python community selected ``pyproject.toml`` as
2116
a standard way of specifying *project metadata*.
2217
``Setuptools`` has adopted this standard and will use the information contained
@@ -106,8 +101,8 @@ Key Value Type (TOML) Notes
106101

107102
Please note that some of these configurations are deprecated or at least
108103
discouraged, but they are made available to ensure portability.
109-
New packages should avoid relying on them, and existing packages should
110-
consider alternatives.
104+
New packages should avoid relying on deprecated/discouraged fields, and
105+
existing packages should consider alternatives.
111106

112107
.. tip::
113108
When both ``py-modules`` and ``packages`` are left unspecified,

docs/userguide/quickstart.rst

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ setup also allows you to adopt a ``src/`` layout. For more details and advanced
178178
use, go to :ref:`package_discovery`.
179179

180180
.. tip::
181-
Starting with version 60.10.0, setuptools' automatic discovery capabilities
181+
Starting with version 61.0.0, setuptools' automatic discovery capabilities
182182
have been improved to detect popular project layouts (such as the
183183
:ref:`flat-layout` and :ref:`src-layout`) without requiring any
184184
special configuration. Check out our :ref:`reference docs <package_discovery>`
@@ -202,7 +202,7 @@ The following configuration examples show how to accomplish this:
202202
203203
[options.entry_points]
204204
console_scripts =
205-
cli-name = mypkg:some_func
205+
cli-name = mypkg.mymodule:some_func
206206
207207
.. tab:: setup.py [#setup.py]_
208208

@@ -212,7 +212,7 @@ The following configuration examples show how to accomplish this:
212212
# ...
213213
entry_points={
214214
'console_scripts': [
215-
'cli-name = mypkg:some_func',
215+
'cli-name = mypkg.mymodule:some_func',
216216
]
217217
}
218218
)
@@ -222,10 +222,11 @@ The following configuration examples show how to accomplish this:
222222
.. code-block:: toml
223223
224224
[project.scripts]
225-
cli-name = mypkg:some_func
225+
cli-name = mypkg.mymodule:some_func
226226
227-
When this project is installed, a ``cli-name`` executable will be installed and will
228-
invoke the ``some_func`` in the ``mypkg/__init__.py`` file when called by the user.
227+
When this project is installed, a ``cli-name`` executable will be created.
228+
``cli-name`` will invoke the function ``some_func`` in the
229+
``mypkg/mymodule.py`` file when called by the user.
229230
Note that you can also use the ``entry-points`` mechanism to advertise
230231
components between installed packages and implement plugin systems.
231232
For detailed usage, go to :doc:`entry_point`.
@@ -268,9 +269,9 @@ The example bellow show how to configure this kind of dependencies:
268269
]
269270
# ...
270271
271-
Each dependency is represented a string that can optionally contain version requirements
272+
Each dependency is represented by a string that can optionally contain version requirements
272273
(e.g. one of the operators <, >, <=, >=, == or !=, followed by a version identifier),
273-
and/or conditional environment markers, e.g. ``os_name = "windows"``
274+
and/or conditional environment markers, e.g. ``sys_platform == "win32"``
274275
(see :doc:`PyPUG:specifications/version-specifiers` for more information).
275276

276277
When your project is installed, all of the dependencies not already installed
@@ -338,28 +339,11 @@ Here's how to do it::
338339
This creates a link file in your interpreter site package directory which
339340
associate with your source code. For more information, see :doc:`development_mode`.
340341

341-
..
342-
TODO: Restore the following note once PEP 660 lands in setuptools.
343-
tip: Prior to :ref:`pip v21.1 <pip:v21-1>`, a ``setup.py`` script was
344-
required to be compatible with development mode. With late
345-
versions of pip, any project may be installed in this mode.
346-
347342
.. tip::
348-
If you are experimenting with :doc:`configuration using
349-
<pyproject_config>`, or have version of ``pip`` older than :ref:`v21.1 <pip:v21-1>`,
350-
you might need to keep a ``setup.py`` file in file in your repository if
351-
you want to use editable installs (for the time being).
352-
353-
A simple script will suffice, for example:
354-
355-
.. code-block:: python
356343

357-
from setuptools import setup
358-
359-
setup()
360-
361-
You can still keep all the configuration in :doc:`setup.cfg </userguide/declarative_config>`
362-
(or :doc:`pyproject.toml </userguide/pyproject_config>`).
344+
Prior to :ref:`pip v21.1 <pip:v21-1>`, a ``setup.py`` script was
345+
required to be compatible with development mode. With late
346+
versions of pip, any project may be installed in this mode.
363347

364348

365349
Uploading your package to PyPI
@@ -397,7 +381,8 @@ up-to-date references that can help you when it is time to distribute your work.
397381
.. rubric:: Notes
398382

399383
.. [#setup.py]
400-
The ``setup.py`` file should be used only when absolutely necessary.
384+
The ``setup.py`` file should be used only when custom scripting during the
385+
build is necessary.
401386
Examples are kept in this document to help people interested in maintaining or
402387
contributing to existing packages that use ``setup.py``.
403388
Note that you can still keep most of configuration declarative in

0 commit comments

Comments
 (0)