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
1.**A fully configured package-setup file**, i.e., [`setup.cfg`](setup.cfg) or [`pyproject.toml`](https://github.com/Ahzyuan/Python-package-template/releases/download/v1.4.0/pyproject.toml).
29
29
- It covers most common config items, allows dynamic access to `version`, `README`, and project dependencies at build time.
30
30
- It is well commented, so you don't need to look up [documents](https://setuptools.pypa.io/en/latest/references/keywords.html) to understand each item's meaning.
31
31
@@ -94,8 +94,144 @@ Python-package-template/
94
94
## 🔨 Usage
95
95
96
96
> [!IMPORTANT]
97
-
> In demo below, we assume that your github ID is `me` and project name is `my-project`.
98
-
> **❗️❗️❗️ Remember to replace them with your own ID and project name when using ❗️❗️❗️**
97
+
> - In demo below, we assume that your github ID is `me` and project name is `my-project`.
98
+
> **❗️❗️❗️ Remember to replace them with your own ID and project name when using ❗️❗️❗️**
99
+
>
100
+
> - This template uses `setup.cfg` to manage all metadata by default. While `pyproject.toml` is an officially recommended alternative, I find it more complicated, so I prefer `setup.cfg`. But if you really want to use `pyproject.toml`, please **replace the `setup.cfg` with following file**.
> • If your `README` is in`rst` format, you need to change `long_description_content_type` to `"text/x-rst"`instead.
312
+
> • If your `README` is in`rst` format, you need to replace `"text/markdown"` with `"text/x-rst"`in`long_description_content_type`(`setup.cfg`) or `readme`(`pyproject.toml`).
177
313
>
178
-
> • If you want to create a CLI commandfor your package, enable`[options.entry_points]` option. See more [here](https://packaging.python.org/en/latest/guides/creating-command-line-tools/).
314
+
> • If you want to create a CLI commandforyour package, enable `[options.entry_points]` optionin`setup.cfg` or `[project.gui-scripts]`in`pyproject.toml`. See more [here](https://packaging.python.org/en/latest/guides/creating-command-line-tools/).
179
315
>
180
-
> • If you want more configuration, refer to [here](https://setuptools.pypa.io/en/latest/references/keywords.html)
316
+
> • If you want more configuration, refer to [keywords of `setup.cfg`](https://setuptools.pypa.io/en/latest/references/keywords.html) or [keywords of `pyproject.toml`](https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html)
181
317
182
-
**Look forthe following variablesinthe file and modify as per comments.**
318
+
**Look forthe following variablesin`setup.cfg` and modify as per comments.**
183
319
184
320
| Basic | Requirement related | Package structure related |
**If you are using `pyproject.toml`, you may need to replace `your-package` with `my-package`in file first, then check out and modify following variables.**
334
+
335
+
| Basic | Requirement related | Package structure related |
> • Also, don't forget to generate a token for uploading your package. See more [here](https://pypi.org/help/#apitoken).
364
514
365
515
> 📋 **𝖲𝗎𝗀𝗀𝖾𝗌𝗍𝗂𝗈𝗇**
366
-
> You likely have many commits to `PyPI` or `TestPyPI` to familiarize yourself with the process. In this case, you can maintain a **forged `PyPI` server locally**, see [`🧰 Tools Recommended -> pypi-server` below](#tools-recommended).
516
+
> You likely have many commits to `PyPI` or `TestPyPI` to familiarize yourself with the process. In this case, you can maintain a **forged `PyPI` server locally**, see [`🧰 Tools Recommended -> pypi-server` below](#-tools-recommended).
367
517
368
518
```bash
369
519
# pwd: .../MYPROJECT
@@ -379,7 +529,7 @@ Python-package-template/
379
529
380
530
- Sure, you can paste your token in terminal to go through the process.
381
531
382
-
- But if you are tired of doing this, you can use `.pypirc` and `keyring` to automatically access your token whenever needed. Follow the step in [`configure .pypirc and keyring 🔐` below](#tools-recommended).:
532
+
- But if you are tired of doing this, you can use `.pypirc` and `keyring` to automatically access your token whenever needed. Follow the step in [`configure .pypirc and keyring 🔐` below](#-tools-recommended).:
383
533
384
534
</details>
385
535
@@ -574,7 +724,7 @@ Standardizing project participation cuts communication costs and boosts developm
574
724
575
725
- [x] Add full pipeline of package development, from project preparation to maintaining.
0 commit comments