@@ -178,7 +178,7 @@ setup also allows you to adopt a ``src/`` layout. For more details and advanced
178
178
use, go to :ref: `package_discovery `.
179
179
180
180
.. tip ::
181
- Starting with version 60.10 .0, setuptools' automatic discovery capabilities
181
+ Starting with version 61.0 .0, setuptools' automatic discovery capabilities
182
182
have been improved to detect popular project layouts (such as the
183
183
:ref: `flat-layout ` and :ref: `src-layout `) without requiring any
184
184
special configuration. Check out our :ref: `reference docs <package_discovery >`
@@ -202,7 +202,7 @@ The following configuration examples show how to accomplish this:
202
202
203
203
[options.entry_points]
204
204
console_scripts =
205
- cli-name = mypkg:some_func
205
+ cli-name = mypkg.mymodule :some_func
206
206
207
207
.. tab :: setup.py [#setup.py]_
208
208
@@ -212,7 +212,7 @@ The following configuration examples show how to accomplish this:
212
212
# ...
213
213
entry_points = {
214
214
' console_scripts' : [
215
- ' cli-name = mypkg:some_func' ,
215
+ ' cli-name = mypkg.mymodule :some_func' ,
216
216
]
217
217
}
218
218
)
@@ -222,10 +222,11 @@ The following configuration examples show how to accomplish this:
222
222
.. code-block :: toml
223
223
224
224
[project.scripts]
225
- cli-name = mypkg:some_func
225
+ cli-name = mypkg.mymodule :some_func
226
226
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.
229
230
Note that you can also use the ``entry-points `` mechanism to advertise
230
231
components between installed packages and implement plugin systems.
231
232
For detailed usage, go to :doc: `entry_point `.
@@ -268,9 +269,9 @@ The example bellow show how to configure this kind of dependencies:
268
269
]
269
270
# ...
270
271
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
272
273
(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 " ``
274
275
(see :doc: `PyPUG:specifications/version-specifiers ` for more information).
275
276
276
277
When your project is installed, all of the dependencies not already installed
@@ -338,28 +339,11 @@ Here's how to do it::
338
339
This creates a link file in your interpreter site package directory which
339
340
associate with your source code. For more information, see :doc: `development_mode `.
340
341
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
-
347
342
.. 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
356
343
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.
363
347
364
348
365
349
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.
397
381
.. rubric :: Notes
398
382
399
383
.. [#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.
401
386
Examples are kept in this document to help people interested in maintaining or
402
387
contributing to existing packages that use ``setup.py ``.
403
388
Note that you can still keep most of configuration declarative in
0 commit comments