Skip to content

Commit e49640b

Browse files
authored
feat: provide a requirements.txt(laike9m#6)
* feat: provide an alternative traditional requirements.txt so users can install deps locally without using PDM * feat: add `pdm-autoexport` to automatically sync to requirements * chore: add missing configuration for pdm plugins
1 parent c5c4c98 commit e49640b

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ Learn Python 🐍 typing (type hints) by completing online challenges.
88

99
Happy typing!
1010

11+
## How to Run Locally
12+
13+
This project use [PDM](https://pdm.fming.dev/latest/), a modern Python package and dependency manager, to manage dependencies. After you [have installed PDM](https://pdm.fming.dev/latest/#installation), you can run this project locally based on the following steps:
14+
15+
```bash
16+
pdm install
17+
pdm run devserver
18+
```
19+
20+
Optionally, the `requirements.txt` file is also provided for you if PDM doesn't exist in your environment.
21+
22+
You can use traditional `pip` to install dependencies and run the project manually:
23+
24+
```bash
25+
pip install -r requirements.txt
26+
flask --app app run --debug
27+
```
28+
1129
## How to Contribute
1230

1331
You're more than welcome to contribute new challenges!

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@ requires-python = ">=3.12"
1616
readme = "README.md"
1717
license = {text = "MIT"}
1818

19+
[tool.pdm]
20+
plugins = ["pdm-autoexport"]
21+
1922
[tool.pdm.scripts]
2023
devserver = "flask --app app run --debug"
2124

25+
[[tool.pdm.autoexport]]
26+
filename = "requirements.txt"
27+
groups = ["default"]
28+
without-hashes = true
29+
2230
[tool.pyright]
2331
venvPath = "."
2432
venv = ".venv"

requirements.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This file is @generated by PDM.
2+
# Please do not edit it manually.
3+
4+
blinker==1.6.3
5+
click==8.1.7
6+
flask==3.0.0
7+
gunicorn==21.2.0
8+
itsdangerous==2.1.2
9+
Jinja2==3.1.2
10+
libcst==1.1.0
11+
MarkupSafe==2.1.3
12+
mypy==1.6.1
13+
mypy-extensions==1.0.0
14+
packaging==23.2
15+
pyyaml==6.0.1
16+
typing-extensions==4.8.0
17+
typing-inspect==0.9.0
18+
Werkzeug==3.0.0

0 commit comments

Comments
 (0)