Skip to content

Commit ac74658

Browse files
authored
Fix errors
1 parent 55812ee commit ac74658

File tree

7 files changed

+30
-29
lines changed

7 files changed

+30
-29
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/** @amrabed

.github/workflows/check.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name: Format, Lint, and Test
33
on:
44
workflow_call:
55
push:
6-
paths:
7-
- "!docs/**"
86

97
jobs:
108
check:

Makefile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@ DESCRIPTION ?= Python Project Template
44
AUTHOR ?= Amr Abed
55
EMAIL ?= amrabed
66
GITHUB ?= amrabed
7+
SOURCE ?= $(shell echo ${NAME} | tr '-' '_' | tr '[:upper:]' '[:lower:]')
78

89
.PHONY: project
910
project: # Rename project (run once)
10-
@if [ -d project ]; then mv project ${NAME}; fi
11-
@sed -i '' 's/^::: project\.app/::: ${NAME}\.app/' docs/reference/app.md
12-
@sed -i '' 's/^repo_name: "Project"/repo_name: "${NAME}"/' mkdocs.yml
13-
@sed -i '' 's/^repo_url: ".*"/repo_url: "https:\/\/github.com\/${GITHUB}\/${NAME}"/' mkdocs.yml
14-
@sed -i '' 's/^source = \[.*\]/source = \["${NAME}"\]/' pyproject.toml
15-
@sed -i '' 's/^app = "project\.app:main"/app = "${NAME}\.app:main"/' pyproject.toml
16-
@sed -i '' 's/^name = ".*"/name = "${NAME}"/' pyproject.toml
11+
@if [ -d project ]; then mv project ${SOURCE}; fi
12+
@sed -i '' 's/^::: project\.app/::: ${SOURCE}\.app/' docs/reference/app.md
13+
@sed -i '' 's/^repo_name: .*/repo_name: ${GITHUB}\/${NAME}/' mkdocs.yml
14+
@sed -i '' 's/^repo_url: .*/repo_url: https:\/\/github.com\/${GITHUB}\/${NAME}/' mkdocs.yml
15+
@sed -i '' 's/^source = \[.*\]/source = \["${SOURCE}"\]/' pyproject.toml
16+
@sed -i '' 's/^app = "project\.app:main"/app = "${SOURCE}\.app:main"/' pyproject.toml
17+
@sed -i '' 's/^name = ".*"/name = "${SOURCE}"/' pyproject.toml
1718
@sed -i '' 's/^description = ".*"/description = "${DESCRIPTION}"/' pyproject.toml
1819
@sed -i '' 's/^authors = \[.*\]/authors = \["${AUTHOR} <${EMAIL}>"\]/' pyproject.toml
1920
@sed -i '' 's/^# .*/# ${DESCRIPTION}/' docs/README.md
21+
@sed -i '' 's/@.*/@${GITHUB}/' .github/CODEOWNERS
2022
@sed -i '' 's/^github: \[.*\]/github: \[${GITHUB}\]/' .github/FUNDING.yml
2123
@sed -i '' 's/^patreon: .*/patreon: # Put your Patreon username here/' .github/FUNDING.yml
2224

docs/CONTRIBUTING.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,32 @@ You'll need the following prerequisites:
3636

3737
### How to contribute
3838

39-
1. Fork the repository on GitHub
40-
2. Clone your fork locally.
41-
3. Install the project dependencies:
39+
- Fork the repository on GitHub
40+
- Clone your fork locally.
41+
- Install the project dependencies:
4242

4343
```bash
4444
make poetry install pre-commit
4545
```
46-
4. Create a new branch (wit a descriptive name) for your changes:
46+
- Create a new branch (with a descriptive name) for your changes:
4747

4848
```bash
4949
git checkout -b my-new-feature # use descriptive branch name
5050
```
51-
5. Make your code changes
52-
53-
6. Run tests and linting locally to make sure everything is working as expected.
51+
- Make your code changes
52+
- Run tests and linting locally to make sure everything is working as expected.
5453

5554
```bash
5655
make lint test
5756
```
58-
7. Commit your changes and push your branch to GitHub
59-
57+
- Commit your changes and push your branch to GitHub
6058
```bash
6159
git add .
6260
git commit -m "My new feature" # use descriptive commit message
63-
git push origin my-new-feature-branch
61+
git push origin my-new-feature
6462
```
63+
- Create a pull request, and request review from the team
6564

66-
8. Create a pull request, and request review from the team
6765
> Please follow the pull request template and fill in as much information as possible. Link to any relevant issues and include a description of your changes.
6866
6967

docs/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ The repository also comes pre-loaded with these GitHub files:
2323

2424
- Pull request template
2525
- Issue templates
26-
- Bug report
27-
- Feature request
28-
- Question
26+
+ Bug report
27+
+ Feature request
28+
+ Question
2929
- Contributing guidelines
3030
- Funding file
3131
- Code owners
@@ -39,14 +39,15 @@ Click this button to create a new repository for your project, then clone the ne
3939
### Rename the project
4040
After cloning the repository, rename the project by running:
4141
```bash
42-
make project NAME="" DESCRIPTION="" AUTHOR="" EMAIL="" GITHUB=""
42+
make project NAME="" DESCRIPTION="" AUTHOR="" EMAIL="" GITHUB="" SOURCE=""
4343
```
4444
Pass the following parameters:
4545

4646
Parameter | Description
4747
--- | ---
4848
`NAME` | Project new name
4949
`DESCRIPTION` | Project short description
50+
`SOURCE` | (optional) Source folder name
5051
`AUTHOR` | Author name
5152
`EMAIL`| Author email
5253
`GITHUB`| GitHub username (for GitHub funding)

mkdocs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
site_name: Project Documentation
2-
repo_url: "https://github.com/amrabed/python-project-template"
3-
repo_name: "Project"
2+
repo_url: https://github.com/amrabed/python-project-template
3+
repo_name: amrabed/python-project-template
4+
edit_uri: edit/main/docs/
45
# copyright: Copyright &copy; 2024
56

67
theme:

project/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
@command(context_settings={"help_option_names": ["-h", "--help"]}, help="Say hello")
55
@option("-n", "--name", default="World", help="Name", show_default=True)
6-
def hello(name: str = "World"):
6+
def main(name: str = "World"):
77
"""
8-
Say hello to the given name
8+
Say hello to the given name.
99
1010
Args:
1111
name: the name to be greeted
@@ -14,4 +14,4 @@ def hello(name: str = "World"):
1414

1515

1616
if __name__ == "__main__":
17-
hello()
17+
main()

0 commit comments

Comments
 (0)