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/4_project_metadata.md
+14-11Lines changed: 14 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,14 +38,15 @@ It has two main keys:
38
38
requires = ["hatchling"]
39
39
build-backend = "hatchling.build"
40
40
```
41
-
Some other build tools to read are
42
-
-[pdm.backend](https://backend.pdm-project.org) e.g. [fastapi](https://github.com/fastapi/fastapi/blob/master/pyproject.toml)
43
-
-[mesonpy](https://mesonbuild.com/meson-python/) e.g. [numpy](https://github.com/numpy/numpy/blob/main/pyproject.toml)
44
-
-[setuptools.build_meta]() e.g. [parselmouth](https://github.com/prefix-dev/parselmouth/blob/main/pyproject.toml)
41
+
Some other build tools to read are:
42
+
43
+
-[pdm.backend](https://backend.pdm-project.org) e.g. [fastapi](https://github.com/fastapi/fastapi/blob/cd40c5b40ffd8ba0c6a6a6c96bbf34ec1cf9c525/pyproject.toml#L2)
44
+
-[mesonpy](https://mesonbuild.com/meson-python/) e.g. [numpy](https://github.com/numpy/numpy/blob/1d053b3482b178ed057474402ae94c80701796e0/pyproject.toml#L2)
45
+
-[setuptools.build_meta](https://setuptools.pypa.io/en/latest/build_meta.html) e.g. [parselmouth](https://github.com/prefix-dev/parselmouth/blob/eb3eda68672ba95871719866403318690e1b37be/pyproject.toml#L3)
45
46
46
47
## Editable Installation
47
48
48
-
Projects may be installed in editable mode, which allows you to make changes to the source code and have them reflected immediately in the environment without reinstallation. For example, the `greet_me` package can be added as an editable dependency.
49
+
Projects may be installed in editable mode, which allows you to make changes to the source code and have them reflected immediately in the environment without reinstallation. For example, the `greet_me` package we are creating is listed as editable by default.
Additional sections in `pyproject.toml` may include:
61
-
`[tool.pixi.workspace]`: Defines project-wide settings, including package sources and target platforms for resolution.
62
-
`[tool.pixi.pypi-dependencies]` : Declares the dependencies to be installed from PyPI (or equivalent sources). These are the external libraries required by the project.
62
+
63
+
-`[tool.pixi.workspace]`: Defines project-wide settings, including package sources and target platforms for resolution.
64
+
-`[tool.pixi.pypi-dependencies]` : Declares the dependencies to be installed from PyPI (or equivalent sources). These are the external libraries required by the project.
63
65
64
66
You can specify a range or multiple supported Python versions using the syntax below.
65
67
```toml
@@ -69,11 +71,11 @@ Final `pyproject.toml` should look like this below, for reference.
For insipiration, also check [here](https://github.com/prefix-dev/parselmouth/blob/main/pyproject.toml)
98
+
For insipiration, also check [here](https://github.com/prefix-dev/parselmouth/blob/main/pyproject.toml).
97
99
98
100
## Lockfiles
99
101
A **lockfile** contains the complete set of dependencies, including specific versions, required to reproduce the project environment. It is automatically generated based on the dependencies listed in the `.toml` file, ensuring that builds remain consistent and reproducible.
100
102
101
-
103
+
## Readme
102
104
Please add and update the README.md file, in case you havent done so. You can easily generate a README text on [readme.so](https://readme.so/) and copy its content to your READMe file.
105
+
103
106
::::::::::::::::::::::::::::::::::::: keypoints
104
107
- Every project must include a `pyproject.toml` file
105
108
- The `[build-system]` section is required and must define both `requires` and `build-backend`.
Copy file name to clipboardExpand all lines: episodes/5_project_publishing.md
+13-14Lines changed: 13 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,8 +30,6 @@ The two key tools we need are:
30
30
31
31
**Twine** – for securely uploading those distributions to **PyPI** or **TestPyPI**.
32
32
33
-
**Note**: Before proceeding, rename or remove the `pixi.tom`l file, as we will focus on `pyproject.toml`. You may experiment with `pixi.toml` later by removing or renaming `pyproject.toml`.
34
-
35
33
## Step 1: Create your build
36
34
37
35
The `build` tool reads your `pyproject.toml` file and generates the package distribution files.
@@ -44,7 +42,7 @@ pixi add --pypi build
44
42
✔ Added build >=1.3.0, <2
45
43
Added these as pypi-dependencies.
46
44
```
47
-
Empty the depenencies under `[project]` and move/edit them to `[tool.pixi.pypi-dependencies]` section, like shown below :
45
+
Empty the depenencies under `[project]` and move/edit them to `[tool.pixi.pypi-dependencies]` section, like shown below:
48
46
49
47
```toml
50
48
[project]
@@ -54,6 +52,7 @@ dependencies = []
54
52
requests = ">=2.32.5,<3"
55
53
build = ">=1.3.0,<2"
56
54
```
55
+
Then run the `build` command:
57
56
58
57
```bash
59
58
pixi run python -m build
@@ -75,13 +74,13 @@ Successfully built greet_me-0.1.0.tar.gz and greet_me-0.1.0-py3-none-any.whl
75
74
```
76
75
77
76
This command creates a `dist` directory containing two files:
77
+
78
78
- A wheel file (`greet_me-0.1.0-py3-none-any.whl`).
Copy file name to clipboardExpand all lines: learners/acknowledgements.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ title: 'Acknowledgements'
14
14
*[Danny Garside](https://orcid.org/0000-0002-4579-003X) was consulted for help with reviewing the course materials, suggesting corrections through pull requests, and facilitating the demo run of the course by organizing the session and leading a post-meeting reflection.
15
15
16
16
**Resources**
17
+
17
18
* I would like to thank the PyOpenSci team for their excellent course delivered during the [PyOpenSci Fall Festival 2024](https://github.com/pyOpenSci/ff-2024-create-python-package), which provided valuable inspiration and insights.
0 commit comments