• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:setup

10     pip install --upgrade setuptools
16 only provide backend support, no longer being the de-facto packaging tool in
19 be generated with whatever tool that provides a ``build sdist``-like
22 change is driven under :pep:`PEP 517 <517#build-requirements>`. To learn more about Python packagin…
23 navigate to the :ref:`bottom <packaging-resources>` of this page.
32 .. code-block:: toml
34 [build-system]
36 build-backend = "setuptools.build_meta"
41 Setuptools currently supports configurations from either ``setup.cfg``,
42 ``setup.py`` or ``pyproject.toml`` [#experimental]_ files, however, configuring new
43 projects via ``setup.py`` is discouraged [#setup.py]_.
47 .. tab:: setup.cfg
49 .. code-block:: ini
59 importlib-metadata; python_version < "3.8"
63 .. tab:: setup.py [#setup.py]_
65 .. code-block:: python
67 from setuptools import setup
69 setup(
75 'importlib-metadata; python_version == "3.8"',
83 .. code-block:: toml
90 'importlib-metadata; python_version<"3.8"',
99 setup.cfg # or setup.py
102 Then, you need a builder, such as :std:doc:`PyPA build <pypa-build:index>`
106 python -m build
112 more information to your setup script to help people find or learn about your
122 the ``packages`` keyword in ``setup.cfg``. However, for very large projects,
127 .. tab:: setup.cfg
129 .. code-block:: ini
141 .. tab:: setup.py [#setup.py]_
143 .. code-block:: python
147 setup(
159 .. code-block:: toml
177 setup also allows you to adopt a ``src/`` layout. For more details and advanced
183 :ref:`flat-layout` and :ref:`src-layout`) without requiring any
194 <PyPUG:specifications/entry-points>`.
196 to type ``python -m pip install``.
199 .. tab:: setup.cfg
201 .. code-block:: ini
205 cli-name = mypkg.mymodule:some_func
207 .. tab:: setup.py [#setup.py]_
209 .. code-block:: python
211 setup(
215 'cli-name = mypkg.mymodule:some_func',
222 .. code-block:: toml
225 cli-name = mypkg.mymodule:some_func
227 When this project is installed, a ``cli-name`` executable will be created.
228 ``cli-name`` will invoke the function ``some_func`` in the
230 Note that you can also use the ``entry-points`` mechanism to advertise
241 .. tab:: setup.cfg
243 .. code-block:: ini
250 .. tab:: setup.py [#setup.py]_
252 .. code-block:: python
254 setup(
262 .. code-block:: toml
275 (see :doc:`PyPUG:specifications/version-specifiers` for more information).
290 are placed in a platform-specific location. Setuptools offers three ways to
294 .. tab:: setup.cfg
296 .. code-block:: ini
301 .. tab:: setup.py [#setup.py]_
303 .. code-block:: python
305 setup(
313 .. code-block:: toml
316 include-package-data = true
319 # You can deactivate that with `include-package-data = false`
332 to your interpreter directory (e.g. the ``site-packages`` directory).
337 pip install --editable .
344 Prior to :ref:`pip v21.1 <pip:v21-1>`, a ``setup.py`` script was
346 versions of pip, ``setup.cfg``-only projects may be installed in this mode.
350 ``setup.py`` file in file in your repository if you want to use editable
355 .. code-block:: python
357 from setuptools import setup
359 setup()
361 You can still keep all the configuration in :doc:`setup.cfg </userguide/declarative_config>`
370 <PyPUG:tutorials/packaging-projects>`.
373 Transitioning from ``setup.py`` to ``setup.cfg``
376 into a full-fledged ``setup.cfg`` to declare your package information instead
377 of running ``setup()``. This inevitably brings challenges due to a different
379 understanding how ``setup.cfg`` is parsed by ``setuptools`` to ease the pain of
382 .. _packaging-resources:
388 up-to-date references that can help you when it is time to distribute your work.
392 .. _MANIFEST.in: https://packaging.python.org/en/latest/guides/using-manifest-in/
395 ----
399 .. [#setup.py]
400 The ``setup.py`` file should be used only when custom scripting during the
403 contributing to existing packages that use ``setup.py``.
405 :doc:`setup.cfg <declarative_config>` or :doc:`pyproject.toml
406 <pyproject_config>` and use ``setup.py`` only for the parts not
410 While the ``[build-system]`` table should always be specified in the