User Tools

Site Tools


programming:python:packaging

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
programming:python:packaging [2018-09-22 10:45] – [Single Member Importing] better explain namespacing zlgprogramming:python:packaging [2023-11-06 20:36] (current) – add notice about Python community's kerfuffle about packaging zlg
Line 1: Line 1:
 ====== Packaging ====== ====== Packaging ======
 +
 +FIXME :!: The Python community has some PEPs and a lot of debate over what the 'correct' way to package Python programs is. As of November 2023 I'm not totally sure what the way forward is meant to be for PyPI projects, or if the below information is still true about Python's module handling. Consume appropriate amounts of salt where sus. :!:
  
 In Python, individual source files are referred to as **modules**. They represent a single collection of code, and can be ''import''ed. **Packages** are directories containing an ''%%__init__.py%%'' file and other modules. They are comparable to namespaces, and can also be ''import''ed. A package with an empty ''%%__init__.py%%'' file is completely fine; it just won't import any modules when imported. In Python, individual source files are referred to as **modules**. They represent a single collection of code, and can be ''import''ed. **Packages** are directories containing an ''%%__init__.py%%'' file and other modules. They are comparable to namespaces, and can also be ''import''ed. A package with an empty ''%%__init__.py%%'' file is completely fine; it just won't import any modules when imported.
programming/python/packaging.txt · Last modified: 2023-11-06 20:36 by zlg