Python setuptools: Difference between revisions

From wikinotes
No edit summary
No edit summary
Line 3: Line 3:


{{ WARNING |
{{ WARNING |
setuptools (or at least setup.py) has been partially deprecated by [https://www.python.org/dev/peps/pep-0518/ PEP-0518]
you can now use <code>pyproject.toml</code> to bootstrap your pip environment.<br>
see blog post [https://snarky.ca/what-the-heck-is-pyproject-toml/ what-the-heck-is-pyproject-toml].
see [https://www.python.org/dev/peps/pep-0518/ PEP-0518] and [https://snarky.ca/what-the-heck-is-pyproject-toml/ blog/what-the-heck-is-pyproject-toml].
}}
}}



Revision as of 02:09, 25 January 2022

Setuptools is the primary tool for packaging python projects for distriution.
A setup.py file serves as both a makefile, a dependency resolver, and a place for project information.


WARNING:

you can now use pyproject.toml to bootstrap your pip environment.
see PEP-0518 and blog/what-the-heck-is-pyproject-toml.

Documentation

official docs https://setuptools.readthedocs.io/en/latest/

Examples

import setuptools

setuptools.setup(
    name         = 'my_package_name',
    version      = '0.0.0',
    author       = 'Will Pittman',
    author_email = 'willjpittman@gmail.com'
    url          = 'http://blah.com',
    licence      = 'BSD',
    keywords     = 'foo bar baz',
    classifiers = [
        'License :: OSI Approved :: BSD License',
        'Programming Language :: Python :: 3',
        'Operating System :: POSIX :: Linux',
        'Operating System :: POSIX :: BSD',
    ],
)

Notes

python setuptools: project info
python setuptools: requirements
python setuptools: files
python setuptools: custom targets
python setuptools: executables
python setuptools: distrobutions
python setuptools: repositories