Skip to content

Commit 54d77a6

Browse files
committed
docs: overview of Python packaging
1 parent 3edf3b8 commit 54d77a6

6 files changed

Lines changed: 79 additions & 30 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
def: module: a collection of code
2+
1 type of module object
3+
all modules are of this type
4+
independent of technology(e..g python, C, etc)
5+
6+
has:
7+
name
8+
9+
on import:
10+
whole module code ran, top to bottom and left to right
11+
cached in sys.modules

packaging_and_distribution/modules/REAMDE.md renamed to packaging_and_distribution/1_package.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
def: module: a collection of code
2-
1 type of module object
3-
all modules are of this type
4-
independent of technology(e..g python, C, etc)
5-
6-
has:
7-
name
8-
9-
on import:
10-
whole module code ran, top to bottom and left to right
11-
cached in sys.modules
12-
131
def: package: special kind of module for organizing other modules
142
has:
153
__path__ attribute
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
packaging considerations: target environment + deployment experience
2+
- target audience:
3+
- developers
4+
- datacenter operators
5+
- non technical end users
6+
- ...
7+
- runtime environment:
8+
- servers
9+
- mobile devices
10+
- embedded systems
11+
- ...
12+
- deployment mechanism:
13+
- one software install
14+
- large deployment batches
15+
- ...
16+
17+
18+
packaging scenarios:
19+
- libraries & tools:
20+
- target audience = developers AND runtime environment = development setting.
21+
- approaches:
22+
- python module:
23+
- properties:
24+
- constraints:
25+
- only depends on the standard library.
26+
- required python installed on runtime environment.
27+
- use cases: a single pure python file.
28+
- examples:
29+
- bottle.py
30+
31+
- python source distributions:
32+
- properties:
33+
- specification: https://packaging.python.org/en/latest/specifications/source-distribution-format/#source-distribution-format
34+
- constraints:
35+
- required python installed on runtime environment.
36+
- format: compressed zip(*.tar.gz)
37+
- alternative names:
38+
- sdist
39+
- remarks: this is Python's native distribution format.
40+
- use cases:
41+
- a collection of pure python files.
42+
43+
- python binary distributions:
44+
- properties:
45+
- specification: https://packaging.python.org/en/latest/specifications/binary-distribution-format/#binary-distribution-format
46+
- constraints:
47+
- required python installed on runtime environment.
48+
- implementation: wheel
49+
- recommendation: default to publishing BOTH wheel and sdist archives.
50+
- remarks:
51+
- pip prefers wheel format for speed, even for source distributions.
52+
- use cases:
53+
- pure python files and compiled dependencies written in(C,C++,FORTRAN, Rust, etc)
54+
55+
- python applications:
56+
- target audience: non-technical end users AND runtime environment = end user machines.
57+
- key: selection of tools is reasoned from dependence on the runtime environment.
58+
- approaches:
59+
-
60+
-
61+
-
62+
-
63+
-
64+
-
65+
-
66+
67+
References:
68+
https://packaging.python.org/en/latest/overview/#packaging-applications

packaging_and_distribution/README.md

Lines changed: 0 additions & 18 deletions
This file was deleted.
File renamed without changes.

packaging_and_distribution/modules/troubleshooting.md renamed to packaging_and_distribution/modules/troubleshooting.txt

File renamed without changes.

0 commit comments

Comments
 (0)