You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: episodes/1_intoduction_python_packaging.md
+6-9Lines changed: 6 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,13 +33,10 @@ Software development is a creative pursuit, and it is satisfying to write code t
33
33
34
34
By packaging code, you address several important challenges, including ensuring reproducibility, achieving cross-platform compatibility, and supporting multiple environments. Distributing code as a package offers many advantages over merely sharing source files, for example via GitHub:
35
35
36
-
Dependency management: A package can explicitly declare its dependencies. Tools such as pip (or uv) can then automatically install them for the user.
37
-
38
-
Versioning: You may version your package and distribute multiple versions, thereby supporting backwards compatibility.
39
-
40
-
Standardisation: Packaging is the established method of distributing code via recognised repositories such as PyPI.
41
-
42
-
Metadata: Packages include project-specific metadata, which is essential for end users.
36
+
- Dependency management: A package can explicitly declare its dependencies. Tools such as pip (or uv) can then automatically install them for the user.
37
+
- Versioning: You may version your package and distribute multiple versions, thereby supporting backwards compatibility.
38
+
- Standardisation: Packaging is the established method of distributing code via recognised repositories such as PyPI.
39
+
- Metadata: Packages include project-specific metadata, which is essential for end users.
43
40
44
41
## Python Package Structure Hierarchy
45
42
@@ -67,7 +64,7 @@ Metadata: Packages include project-specific metadata, which is essential for end
67
64
Any .py files (modules) or directories with __init__.py (packages) can be packaged.
68
65
69
66
70
-
## What Is __init__.Py File in Python?
67
+
## What Is __init__.py File in Python?
71
68
The __init__.py file is a Python file that is executed when a package is imported.
72
69
It serves two main purposes:
73
70
@@ -78,7 +75,7 @@ It serves two main purposes:
78
75
79
76
## What is PyPI
80
77
81
-
PyPI is the repository where all released Python packages are made available for end users. You may explore it here: [PyPI](https://pypi.org/).
78
+
[PyPI](https://pypi.org/) is the repository where all released Python packages are made available for end users.
82
79
There is also [TestPyPI](https://test.pypi.org/), a repository which allows us to experiment with distribution tools and procedures without affecting the live PyPI. In this course, we will publish our package to TestPyPI.
Copy file name to clipboardExpand all lines: episodes/2_why_pixi.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,10 +26,10 @@ Pixi is a fast, modern and reproducible package management tool. It has lots of
26
26
27
27
Key features include:
28
28
29
-
-**Support for both PyPI and Conda packages**: enabling flexibility in sourcing dependencies.
30
-
-**Performance**:lightweight and modern, designed for speed.
31
-
-**Multi-language dependency management**: e.g. Python with Rust, or Python with C/C++.
32
-
-**Integration with `uv`**: leveraging a high-performance package installer.
29
+
-**Support for both PyPI and Conda packages**: enabling flexibility in sourcing dependencies.
30
+
-**Performance**: lightweight and modern, designed for speed.
31
+
-**Multi-language dependency management**: e.g. Python with Rust, or Python with C/C++.
32
+
-**Integration with `uv`**: leveraging a high-performance package installer.
33
33
-**Reproducibility**: guaranteed through the use of `pixi.lock`.
34
34
-**Configuration via TOML files**: supports both `pixi.toml` and `pyproject.toml`.
35
35
@@ -44,9 +44,10 @@ Pixi allows you to define dependencies for specific operating systems (e.g. Wind
44
44
45
45
## pyproject.toml
46
46
For this demo, we will mainly focus on `pyproject.toml` file.
47
-
We make this choice due to following specifications and recomendations : [PEP 621](https://peps.python.org/pep-0621/), [PEP 517](https://peps.python.org/pep-0517/), and [PEP 660](https://peps.python.org/pep-0660/)
47
+
We make this choice due to following specifications and recomendations : [PEP 621](https://peps.python.org/pep-0621/), [PEP 517](https://peps.python.org/pep-0517/), and [PEP 660](https://peps.python.org/pep-0660/).
Please note: this wont create a problem when uploading the build but can create problems, when installing the builds.
118
+
Please note: this won't create a problem when uploading the build but can create problems when installing the builds.
118
119
So best to keep it empty for now and move this to `[tool.pixi.pypi-dependencies]` section , for all projects which need to come from via PyPI namely **build** and **twine** which are used to create and upload build respectively.
Copy file name to clipboardExpand all lines: episodes/4_project_metadata.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ Please note, for projects managed with Pixi, either `pyproject.toml` or `pixi.to
27
27
28
28
This section of a `pyproject.toml` file informs packaging tools such as `pip` which software is required to build your project. It specifies the **build backend** responsible for producing distributable packages such as wheels (`.whl`) or source distributions (`.sdist`).
29
29
30
-
This section was introduced by **[PEP 518]**(https://peps.python.org/pep-0518/) and is essential for modern Python packaging.
30
+
This section was introduced by **[PEP 518](https://peps.python.org/pep-0518/)** and is essential for modern Python packaging.
31
31
It has two main keys:
32
32
33
33
1.`requires`: A list of packages required to build the project. These are downloaded and installed into a temporary, isolated environment prior to the build process. The build backend itself must also be listed here.
- Log into [GitHub](https://github.com) and create a new repository for this lesson called `greet_me` and add a Licence File when creating the repository.
33
+
- Log into [GitHub](https://github.com) and create a new repository for this lesson called `greet_me` and add a Licence File when creating the repository. In this case it doesn't matter which licence (this is just a practice repo) - we just need something to initialise the repo, and a licence to satisfy the TestPyPI requirements.
34
34
35
35
- From the repository page, open the **Code** dropdown menu, select the **Codespaces** tab, and click **Create codespace on main**.
0 commit comments