Publishing a Python Distribution Package in a Repository: Difference between revisions
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
Since we're aiming at publishing a library, the package will probably need an <code>[[Python_Language_Modularization#init_.py|__init__.py]]</code> but not a <code>[[Python_Project_Layout#Add_main_.py|__main__.py]]</code>. | Since we're aiming at publishing a library, the package will probably need an <code>[[Python_Language_Modularization#init_.py|__init__.py]]</code> but not a <code>[[Python_Project_Layout#Add_main_.py|__main__.py]]</code>. | ||
==Choose a Build Backend== | |||
Tools like <code>[[pip|pip]]</code> or <code>build</code> do not convert the source into a [[Python_Language_Modularization#Distribution_Package|distribution packages]], they're just [[Python_Language_Modularization#Build_Frontend|build frontends]] that delegate the process to a [[Python_Language_Modularization#Build_Backend|build backend]]. | |||
==Create <tt>pyproject.toml</tt>== | ==Create <tt>pyproject.toml</tt>== | ||
More details: {{Internal|Pyproject.toml#Overview|<tt>pyproject.toml</tt>}} | More details: {{Internal|Pyproject.toml#Overview|<tt>pyproject.toml</tt>}} |
Revision as of 01:58, 6 April 2024
External
Internal
Overview
Procedure
Create the Project Layout
The project is aimed at publishing a Python package, which contains a library. The layout and required initialization work is described here:
Since we're aiming at publishing a library, the package will probably need an __init__.py
but not a __main__.py
.
Choose a Build Backend
Tools like pip
or build
do not convert the source into a distribution packages, they're just build frontends that delegate the process to a build backend.
Create pyproject.toml
More details: