Skip to content

Commit 5763568

Browse files
authored
The fourth revision (#3)
1 parent 9c9c8cb commit 5763568

31 files changed

Lines changed: 488 additions & 288 deletions

.coveragerc

Lines changed: 0 additions & 16 deletions
This file was deleted.

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ indent_size = 4 # Default indentation size
1212
insert_final_newline = true # Make sure files end with a newline
1313
trim_trailing_whitespace = true # Remove trailing whitespace
1414

15-
# Python specific settings, complying with PEP 8 style guide, except for the line length
1615
[*.py]
1716
max_line_length = 100
1817

.github/workflows/docs.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build and Deploy Docs
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
pages: write
9+
id-token: write
10+
11+
# Only allow one deployment at a time running
12+
concurrency:
13+
group: "pages"
14+
cancel-in-progress: false
15+
16+
jobs:
17+
deploy:
18+
environment:
19+
name: github-pages
20+
url: ${{ steps.deployment.outputs.page_url }}
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout Repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.11'
30+
31+
- name: Install Poetry
32+
uses: snok/install-poetry@v1
33+
with:
34+
virtualenvs-create: true
35+
virtualenvs-in-project: true
36+
37+
- name: Load cached venv
38+
id: cached-poetry-dependencies
39+
uses: actions/cache@v4
40+
with:
41+
path: .venv
42+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
43+
44+
- name: Install Dependencies
45+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
46+
run: |
47+
make setup
48+
make install
49+
50+
- name: Build Documentation
51+
run: make docs
52+
53+
- name: Setup Pages
54+
uses: actions/configure-pages@v5
55+
56+
- name: Upload Documentation as Artifact
57+
uses: actions/upload-pages-artifact@v3
58+
with:
59+
path: './site'
60+
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
name: Run Linting
1+
name: Run Linter Checks
22

33
on:
4-
workflow_dispatch: # Only enable manual runs for now
5-
workflow_call: # Make this workflow available to be called by other workflows
4+
workflow_dispatch:
65
push:
76
tags:
8-
- 'v*' # Trigger on version tags
7+
- 'v*'
8+
9+
permissions:
10+
contents: read
911

1012
jobs:
1113
build:

.github/workflows/publish.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
name: Publish to PyPI
22

33
on:
4-
workflow_dispatch: # Enable manual runs
4+
workflow_dispatch:
55
push:
66
tags:
7-
- 'v*' # Trigger on version tags
7+
- 'v*'
8+
9+
permissions:
10+
contents: read
811

912
jobs:
1013

@@ -24,14 +27,11 @@ jobs:
2427
- name: Set Up Python
2528
uses: actions/setup-python@v4
2629
with:
27-
python-version: "3.10"
30+
python-version: "3.11"
2831

29-
- name: Install Poetry
32+
- name: Install Dependencies
3033
run: |
3134
make setup
32-
33-
- name: Install Python Dependencies
34-
run: |
3535
make install
3636
3737
- name: Build and Publish Package

.github/workflows/tests.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
name: Tests
1+
name: Run Tests
22

33
on:
4-
workflow_dispatch: # Only enable manual runs for now
5-
workflow_call: # Make this workflow available to be called by other workflows
4+
workflow_dispatch:
5+
workflow_call:
6+
pull_request:
7+
branches:
8+
- main
9+
- develop
10+
11+
permissions:
12+
contents: read
613

714
jobs:
815
build:
@@ -29,12 +36,9 @@ jobs:
2936
3037
- name: Run Tests with Coverage
3138
run: |
32-
# make coverage
33-
make codecov
34-
continue-on-error: false
39+
make test
3540
3641
- name: Upload coverage reports to Codecov
3742
uses: codecov/codecov-action@v5
3843
with:
3944
token: ${{ secrets.CODECOV_TOKEN }}
40-
continue-on-error: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,8 @@ out2/
7272
# Dependency lock files (uncomment to ignore)
7373
poetry.lock
7474

75+
# Documentation files
76+
site/
77+
7578
# Miscellaneous files and directories to ignore
7679
# Add any additional file patterns a directory names that should be ignored down here

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-toml
9+
- id: check-added-large-files
10+
- id: check-merge-conflict

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
We adhere to the [Python Software Foundation Code of Conduct](https://policies.python.org/python.org/code-of-conduct).

CONTRIBUTING.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Contribution Guidelines
2+
3+
Thank you for considering contributing to this project!
4+
Contributions are always welcome and appreciated.
5+
6+
## How to Contribute
7+
8+
Please check the [issue tracker](https://github.com/habedi/template-python-library/issues) to see if there is an issue
9+
you
10+
would like to work on or if it has already been resolved.
11+
12+
### Reporting Bugs
13+
14+
1. Open an issue on the [issue tracker](https://github.com/habedi/template-python-library/issues).
15+
2. Include information such as steps to reproduce the observed behavior and relevant logs or screenshots.
16+
17+
### Suggesting Features
18+
19+
1. Open an issue on the [issue tracker](https://github.com/habedi/template-python-library/issues).
20+
2. Provide details about the feature, its purpose, and potential implementation ideas.
21+
22+
## Submitting Pull Requests
23+
24+
- Make sure all tests pass before submitting a pull request.
25+
- Write a clear description of the changes you made and the reasons behind them.
26+
27+
> [!IMPORTANT]
28+
> It's assumed that by submitting a pull request, you agree to license your contributions under the project's license.
29+
30+
## Development Workflow
31+
32+
### Prerequisites
33+
34+
Install GNU Make if it's not already installed on your system.
35+
36+
```shell
37+
# For Debian-based systems like Debian, Ubuntu, etc.
38+
sudo apt-get install make
39+
```
40+
41+
- Use the `make setup` command to install the development dependencies.
42+
- Use the `make install` command to install the Python dependencies.
43+
44+
### Code Style
45+
46+
- Use the `make format` command to format the code.
47+
48+
### Running Tests
49+
50+
- Use the `make test` command to run the tests.
51+
52+
### Running Linter Checks
53+
54+
- Use the `make lint` command to run the linter checks.
55+
56+
### See Available Commands
57+
58+
- Run `make help` to see all available commands for managing different tasks.
59+
60+
## Code of Conduct
61+
62+
We adhere to the [Python Software Foundation Code of Conduct](https://policies.python.org/python.org/code-of-conduct).

0 commit comments

Comments
 (0)