Skip to content

Commit 688b2a2

Browse files
committed
Update README
1 parent 03401cc commit 688b2a2

File tree

1 file changed

+35
-30
lines changed

1 file changed

+35
-30
lines changed

README.md

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Python Project Template
2-
This is basic python project template with basic CI/CD GA workflow & GH issue & PR template. Anyone can use this template to start a new python project.
2+
This is a Python project template that anyone can use with basic CI/CD pipeline, issue and PR templates etc.
33

44
## Directory Structure
55
You can remove the `(optional)` directories if you don't need them. (e.g. `docker/`, `setup.py`, etc.)
@@ -10,54 +10,61 @@ python-project-template/
1010
├── tests/ # Test codes with pytest
1111
├── .gitignore # gitignore file
1212
├── README.md # README file
13+
├── pyproject.toml # (optional) PyPI package configuration file
14+
├── setup.py # (optional) PyPI package setup file
1315
└── requirements.txt # Project dependencies
1416
```
1517

1618
## Github Actions
17-
1. [`ci.yml`](https://github.com/jhj0517/python-project-template/tree/master/.github/workflows/ci.yml)
18-
Basic CI workflow with pytest. It runs tests in the [`tests`](https://github.com/jhj0517/python-project-template/tree/master/tests) directory, with master branch commit & PR triggers by default.
19-
2. [`publish-dockerhub.yml`](https://github.com/jhj0517/python-project-template/tree/master/.github/workflows/publish-dockerhub.yml)
20-
Basic CD workflow for DockerHub. This workflow is optional, only needed when you want to publish the docker image to the dockerhub. You can remove this workflow if you don't need it.<br>
21-
It will build the docker image with [`docker/Dockerfile`](https://github.com/jhj0517/python-project-template/tree/master/docker/Dockerfile) and [`docker/docker-compose.yaml`](https://github.com/jhj0517/python-project-template/tree/master/docker/docker-compose.yaml) for the project and publish it to the dockerhub with the tag `latest`.<br>
22-
The auto-trigger for this workflow is disabled by default. You can edit the workflow to enable it.<br>
23-
Before using the workflow, you need to set the `DOCKERHUB_USERNAME` & `DOCKERHUB_TOKEN` in the repository secrets.
19+
1. [ci.yml](https://github.com/jhj0517/python-project-template/tree/master/.github/workflows/ci.yml)
2420

25-
[image](URL)
21+
Basic CI workflow with pytest. It runs tests in the [tests/](https://github.com/jhj0517/python-project-template/tree/master/tests) directory, with master branch commit & PR triggers by default.
22+
23+
2. [publish-dockerhub.yml](https://github.com/jhj0517/python-project-template/tree/master/.github/workflows/publish-dockerhub.yml)
24+
25+
Basic CD workflow for DockerHub publishing. You can remove this workflow if you don't need it.<br>
26+
It will build the docker image with files in the [docker/](https://github.com/jhj0517/python-project-template/tree/master/docker) and publish it to the dockerhub. The auto-trigger of the action is disabled by default.<br>
27+
Before using the workflow, you need to set the `DOCKERHUB_USERNAME` & `DOCKERHUB_TOKEN` in the repository settings.
28+
29+
![image](https://github.com/user-attachments/assets/ab9f7081-fa07-4181-af30-b6646161bc0b)
2630

2731
And make sure to edit the `image-name` in the workflow.
2832

29-
[code-url](URL)
33+
https://github.com/jhj0517/python-project-template/blob/0c9dc95cece122815f1096607b952b1a033e2e7d/.github/workflows/publish-dockerhub.yml#L43-L44
34+
35+
36+
3. [publish-pypi.yml](https://github.com/jhj0517/python-project-template/tree/master/.github/workflows/publish-dockerhub.yml)
37+
38+
Basic CD workflow for pypi package. You can remove this workflow if you don't need it. <br>
39+
The auto-trigger for this workflow is disabled by default. If enabled, it will build and publish to pypi whenever you make a new "release" in the repository.
3040

31-
3. [`publish-pypi.yml`](https://github.com/jhj0517/python-project-template/tree/master/.github/workflows/publish-dockerhub.yml)
32-
Basic CD workflow for pypi package. This is the workflow that only used in case when your project is a python package that will be published in the pypi. You can remove this workflow if you don't need it.<br>
33-
It will build it and publish it to pypi whenever you make a new "release" in the repository.<br>
34-
The auto-trigger for this workflow is disabled by default. You can edit the workflow to enable it.<br>
3541
Before using the workflow, edit package name to yours in the workflow.
3642

37-
[code-url](URL)
43+
https://github.com/jhj0517/python-project-template/blob/0c9dc95cece122815f1096607b952b1a033e2e7d/.github/workflows/publish-pypi.yml#L18-L19
3844

3945
## Issue & PR Template
4046
There are some basic templates for the issue & PR. You can edit them or add more to fit your project's needs.
4147

4248
- Issue Templates:
43-
1. [`bug_report.md`](https://github.com/jhj0517/python-project-template/tree/master/.github/ISSUE_TEMPLATE/bug_report.md) : Basic bug report template
44-
2. [`feature_request.md`](https://github.com/jhj0517/python-project-template/tree/master/.github/ISSUE_TEMPLATE/feature_request.md) : Feature request template
49+
1. [bug_report.md](https://github.com/jhj0517/python-project-template/tree/master/.github/ISSUE_TEMPLATE/bug_report.md) : Basic bug report template
50+
2. [feature_request.md](https://github.com/jhj0517/python-project-template/tree/master/.github/ISSUE_TEMPLATE/feature_request.md) : Feature request template
4551

46-
- PR Template: [`pull_request_template.md`](https://github.com/jhj0517/python-project-template/tree/master/.github/pull_request_template.md)
52+
- PR Template: [pull_request_template.md](https://github.com/jhj0517/python-project-template/tree/master/.github/pull_request_template.md)
4753

4854

4955
## Docker
5056

51-
The [`docker/`](https://github.com/jhj0517/python-project-template/tree/master/docker) directory and [`publish-dockerhub.yml`](https://github.com/jhj0517/python-project-template/tree/master/.github/workflows/publish-dockerhub.yml) are associated with building the docker image and publishing to dockerhub. You can remove them if you don't need them.<br>
52-
Before building image, make sure to edit the variable in the [`docker/Dockerfile`](https://github.com/jhj0517/python-project-template/tree/master/docker/Dockerfile):
57+
The [docker/](https://github.com/jhj0517/python-project-template/tree/master/docker) directory and [publish-dockerhub.yml](https://github.com/jhj0517/python-project-template/tree/master/.github/workflows/publish-dockerhub.yml) are associated with the Docker CI/CD pipeline. You can remove them if you don't need them.
58+
59+
Before building image, make sure to edit the variable in the [docker/Dockerfile](https://github.com/jhj0517/python-project-template/tree/master/docker/Dockerfile):
5360

54-
[code-url](URL)
61+
https://github.com/jhj0517/python-project-template/blob/0c9dc95cece122815f1096607b952b1a033e2e7d/docker/Dockerfile#L3-L4
5562

56-
And in [`docker/docker-compose.yaml`](https://github.com/jhj0517/python-project-template/tree/master/docker/docker-compose.yaml) as well:
63+
And edit [docker/docker-compose.yaml](https://github.com/jhj0517/python-project-template/tree/master/docker/docker-compose.yaml) as well:
5764

58-
[code-url](URL)
65+
https://github.com/jhj0517/python-project-template/blob/0c9dc95cece122815f1096607b952b1a033e2e7d/docker/docker-compose.yaml#L6-L7
5966

60-
The image is built and published automatically by the action, but you can also manually build and run the image with the following commands.
67+
The image is built and published automatically by the CI/CD pipeline, but you can also manually build and run the image with the following commands.
6168

6269
1. git clone this repository
6370
```bash
@@ -73,14 +80,12 @@ docker compose -f docker/docker-compose.yaml up
7380
```
7481

7582
## PyPI
76-
The [`setup.py`](https://github.com/jhj0517/python-project-template/tree/master/setup.py), [`pyproject.toml`](https://github.com/jhj0517/python-project-template/tree/master/setup.py) and [`publish-pypi.yml`](https://github.com/jhj0517/python-project-template/tree/master/.github/workflows/publish-dockerhub.yml) are associated with building the package and publishing to PyPI. You can remove them if you don't need them.<br>
77-
Make sure to edit dependencies & variables in the [`pyproject.toml`](https://github.com/jhj0517/python-project-template/tree/master/setup.py) as your project's needs.
83+
The [setup.py](https://github.com/jhj0517/python-project-template/tree/master/setup.py), [pyproject.toml](https://github.com/jhj0517/python-project-template/tree/master/pyproject.toml) and [publish-pypi.yml](https://github.com/jhj0517/python-project-template/tree/master/.github/workflows/publish-dockerhub.yml) are associated with the PyPI package CI/CD pipeline. You can remove them if you don't need them.
7884

85+
Make sure to edit dependencies & variables in the [pyproject.toml](https://github.com/jhj0517/python-project-template/tree/master/pyproject.toml) as your project's needs.
7986

8087
## How to start
81-
Click "Use this template" and "Create a new repository". Then git clone it and you can start your own project.
82-
83-
[image-url](URL)
84-
88+
Click "Use this template" and "Create a new repository". Then you can start your own project with `git clone`.
8589

90+
![image](https://github.com/user-attachments/assets/b628232a-09b1-4f49-9751-5ec4723d60ab)
8691

0 commit comments

Comments
 (0)