python-package-template-pypi 0.0.2__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. python_package_template_pypi-0.0.3/.devcontainer/devcontainer.json +4 -0
  2. python_package_template_pypi-0.0.3/.github/ISSUE_TEMPLATE/bug.yml +42 -0
  3. python_package_template_pypi-0.0.3/.github/ISSUE_TEMPLATE/config.yml +9 -0
  4. python_package_template_pypi-0.0.3/.github/ISSUE_TEMPLATE/feature.yml +21 -0
  5. python_package_template_pypi-0.0.3/.github/PULL_REQUEST_TEMPLATE.md +3 -0
  6. python_package_template_pypi-0.0.3/.github/workflows/ci.yml +42 -0
  7. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/.github/workflows/release.yml +9 -0
  8. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/.pre-commit-config.yaml +2 -2
  9. python_package_template_pypi-0.0.3/PKG-INFO +192 -0
  10. python_package_template_pypi-0.0.3/README.md +146 -0
  11. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/docs/conf.py +1 -1
  12. python_package_template_pypi-0.0.3/hatch.toml +16 -0
  13. python_package_template_pypi-0.0.3/pyproject.toml +46 -0
  14. python_package_template_pypi-0.0.3/ruff.toml +35 -0
  15. python_package_template_pypi-0.0.3/tox.ini +37 -0
  16. python_package_template_pypi-0.0.2/.github/PULL_REQUEST_TEMPLATE.md +0 -3
  17. python_package_template_pypi-0.0.2/.github/workflows/ci.yml +0 -14
  18. python_package_template_pypi-0.0.2/PKG-INFO +0 -106
  19. python_package_template_pypi-0.0.2/README.md +0 -61
  20. python_package_template_pypi-0.0.2/pyproject.toml +0 -116
  21. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/.github/CODEOWNERS +0 -0
  22. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/.gitignore +0 -0
  23. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/LICENSE +0 -0
  24. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/docs/_static/.gitkeep +0 -0
  25. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/docs/add_five.rst +0 -0
  26. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/docs/index.rst +0 -0
  27. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/readthedocs.yml +0 -0
  28. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/src/python_package_template/__init__.py +0 -0
  29. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/src/python_package_template/main.py +0 -0
  30. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/tests/__init__.py +0 -0
  31. {python_package_template_pypi-0.0.2 → python_package_template_pypi-0.0.3}/tests/main_test.py +0 -0
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "Python Development Environment",
3
+ "image": "python:3.12"
4
+ }
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: Bug report
3
+ description: Create a report to help us improve.
4
+ labels: ["bug"]
5
+ title: "[BUG]: "
6
+ assignees:
7
+ - daniel-mizsak
8
+
9
+ body:
10
+ - type: markdown
11
+ attributes:
12
+ value: |
13
+ Thanks for taking the time to fill out this bug report!
14
+
15
+ - type: input
16
+ id: version
17
+ attributes:
18
+ label: Package version
19
+ placeholder: vX.Y.Z
20
+ validations:
21
+ required: true
22
+
23
+ - type: dropdown
24
+ id: os
25
+ attributes:
26
+ label: Operating system
27
+ description: The operating system you are using.
28
+ options:
29
+ - Windows
30
+ - macOS
31
+ - Linux
32
+ default: 0
33
+ validations:
34
+ required: true
35
+
36
+ - type: textarea
37
+ id: bug
38
+ attributes:
39
+ label: Bug description
40
+ description: A clear and concise description of what the bug is.
41
+ validations:
42
+ required: true
@@ -0,0 +1,9 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: Documentation
4
+ url: https://python-package-template-pypi.readthedocs.io/en/latest/
5
+ about: Check the documentation before opening an issue.
6
+
7
+ - name: PyPA Code of Conduct
8
+ url: https://www.pypa.io/en/latest/code-of-conduct/
9
+ about: Read and follow the PyPA Code of Conduct.
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: Feature request
3
+ description: Suggest an idea for this project.
4
+ labels: ["enhancement"]
5
+ title: "[FEATURE]: "
6
+ assignees:
7
+ - daniel-mizsak
8
+
9
+ body:
10
+ - type: markdown
11
+ attributes:
12
+ value: |
13
+ Thanks for taking the time to fill out this feature request!
14
+
15
+ - type: textarea
16
+ id: feature
17
+ attributes:
18
+ label: Feature description
19
+ description: A clear and concise description of what the feature is.
20
+ validations:
21
+ required: true
@@ -0,0 +1,3 @@
1
+ - [] Linting passes
2
+ - [] Tests are added and passing
3
+ - [] Documentation is updated
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: CI
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+ push:
8
+
9
+ jobs:
10
+ tox:
11
+ uses: daniel-mizsak/workflows/.github/workflows/tox.yml@main
12
+ with:
13
+ python-version: "3.12"
14
+
15
+ codecov:
16
+ needs: tox
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - name: Check out the codebase.
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Set up python.
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.12"
26
+
27
+ - name: Upgrade pip.
28
+ run: >
29
+ python -m pip install --upgrade pip
30
+
31
+ - name: Install package locally.
32
+ run: >
33
+ pip install .[dev]
34
+
35
+ - name: Generate coverage report.
36
+ run: >
37
+ pytest
38
+
39
+ - name: Run codecov.
40
+ uses: codecov/codecov-action@v4.0.1
41
+ with:
42
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -1,3 +1,4 @@
1
+ ---
1
2
  name: release
2
3
  on:
3
4
  push:
@@ -36,3 +37,11 @@ jobs:
36
37
 
37
38
  - name: Publish the package.
38
39
  uses: pypa/gh-action-pypi-publish@release/v1
40
+
41
+ gh-pages:
42
+ permissions:
43
+ contents: write
44
+
45
+ uses: daniel-mizsak/workflows/.github/workflows/gh-pages.yml@main
46
+ with:
47
+ python-version: "3.12"
@@ -6,7 +6,7 @@
6
6
  # pre-commit
7
7
  repos:
8
8
  - repo: https://github.com/pre-commit/pre-commit-hooks
9
- rev: v4.5.0
9
+ rev: v4.6.0
10
10
  hooks:
11
11
  - id: check-added-large-files
12
12
  args: [--maxkb=2000]
@@ -21,7 +21,7 @@ repos:
21
21
 
22
22
  # ruff
23
23
  - repo: https://github.com/astral-sh/ruff-pre-commit
24
- rev: v0.3.1
24
+ rev: v0.3.5
25
25
  hooks:
26
26
  # Ruff linting
27
27
  - id: ruff
@@ -0,0 +1,192 @@
1
+ Metadata-Version: 2.3
2
+ Name: python-package-template-pypi
3
+ Version: 0.0.3
4
+ Summary: A github template with my python package configurations.
5
+ Project-URL: Repository, https://github.com/daniel-mizsak/python-package-template
6
+ Author-email: Daniel Mizsak <info@pythonvilag.hu>
7
+ License: MIT License
8
+
9
+ Copyright (c) Daniel Mizsak
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+ License-File: LICENSE
29
+ Classifier: License :: OSI Approved :: MIT License
30
+ Classifier: Programming Language :: Python :: 3 :: Only
31
+ Classifier: Programming Language :: Python :: 3.12
32
+ Requires-Python: >=3.12
33
+ Provides-Extra: dev
34
+ Requires-Dist: hatch; extra == 'dev'
35
+ Requires-Dist: mypy; extra == 'dev'
36
+ Requires-Dist: pre-commit; extra == 'dev'
37
+ Requires-Dist: pytest; extra == 'dev'
38
+ Requires-Dist: pytest-cov; extra == 'dev'
39
+ Requires-Dist: ruff; extra == 'dev'
40
+ Requires-Dist: tox; extra == 'dev'
41
+ Provides-Extra: docs
42
+ Requires-Dist: furo; extra == 'docs'
43
+ Requires-Dist: sphinx; extra == 'docs'
44
+ Requires-Dist: sphinx-copybutton; extra == 'docs'
45
+ Description-Content-Type: text/markdown
46
+
47
+ ## <div align="center"> 🐍 python-package-template</div>
48
+
49
+ <div align="center">
50
+ <a href="https://github.com/daniel-mizsak/python-package-template/actions/workflows/ci.yml" target="_blank"><img src="https://github.com/daniel-mizsak/python-package-template/actions/workflows/ci.yml/badge.svg" alt="build status"></a>
51
+ <a href="https://codecov.io/gh/daniel-mizsak/python-package-template" target="_blank"><img src="https://codecov.io/gh/daniel-mizsak/python-package-template/graph/badge.svg?token=SDXG1S8PVM"/></a>
52
+ <a href="https://results.pre-commit.ci/latest/github/daniel-mizsak/python-package-template/main" target="_blank"><img src="https://results.pre-commit.ci/badge/github/daniel-mizsak/python-package-template/main.svg" alt="pre-commit.ci status"></a>
53
+ <a href='https://python-package-template-pypi.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/python-package-template-pypi/badge/?version=latest' alt='docs status' /></a>
54
+ <a href="https://img.shields.io/github/license/daniel-mizsak/python-package-template" target="_blank"><img src="https://img.shields.io/github/license/daniel-mizsak/python-package-template" alt="license"></a>
55
+ </div>
56
+
57
+ ## Overview
58
+ A GitHub template with my python package configurations.
59
+
60
+ ## Package tools
61
+ This template package relies on the synchronized cooperation of several exceptional tools.\
62
+ These tools include:
63
+ - [Codecov](https://docs.codecov.com/docs/quick-start) - Code coverage
64
+ - [Pre-Commit](https://pre-commit.com/) - Git hooks running on commits
65
+ - [Hatch](https://hatch.pypa.io/latest/) - Package building
66
+ - [MyPy](https://mypy.readthedocs.io/en/stable/) - Static type checking
67
+ - [Pytest](https://docs.pytest.org/en/latest/) - Testing and code coverage
68
+ - [Ruff](https://docs.astral.sh/ruff/) - Formatting and linting
69
+ - [Tox](https://tox.readthedocs.io/en/latest/) - Orchestration of the above tools
70
+
71
+ For documentation:
72
+ - [Sphinx](https://www.sphinx-doc.org/en/master/) - Documentation building
73
+ - [ReadTheDocs](https://readthedocs.org/) - Documentation hosting
74
+ - [GitHub Pages](https://pages.github.com/) - Documentation hosting
75
+
76
+ ### Codecov
77
+ Codecov is used to check the code coverage of the tests.\
78
+ It also provides a badge that can be added to the README file.
79
+
80
+ The way it is set up can be seen in the `.github/workflows/ci.yml` file, but it will probably be moved to my reusable [GitHub Workflows repository](https://github.com/daniel-mizsak/workflows).
81
+
82
+ ### Pre-Commit
83
+ Pre-Commit is used to run certain checks on the code before it is committed.\
84
+ These checks are defined in the `.pre-commit-config.yaml` file.\
85
+ To use pre-commit is has to be installed in the virtual environment and also added to the git hooks by running `pre-commit install`.
86
+
87
+ In this repository pre-commit is set up for a number of general issues and to run formatting and linting checks with `ruff`.
88
+
89
+ ### Hatch
90
+ Hatch is primarily used to build the package, but it can also be used to run certain tests in isolated environments.\
91
+ If the package building is more complex and requires additional settings or files it is recommended to read the hatch documentation.\
92
+ In this repository hatch is set up with the local path of the package as it differs from the one specified in the `pyproject.toml` file which is used for publishing to PyPI.
93
+
94
+ The isolated environment settings for hatch are defined in the `hatch.toml` file.\
95
+ I was thinking about replacing `tox` with `hatch`, but for now `tox` fits more into my workflows.
96
+
97
+ ### MyPy
98
+ Python by default is a dynamically typed language, but being explicit about types can help to avoid bugs.\
99
+ MyPy makes sure that the types are correct and consistent throughout the code.
100
+
101
+ The `mypy` related settings are defined in the `pyproject.toml` file.\
102
+ In this repository MyPy is set up be `strict` and it also checks for some additional issues.
103
+
104
+ ### Pytest
105
+ Pytest is a modern testing framework for Python.\
106
+ It is way too complex to explain it here, but it runs all the tests from the `tests` directory and also checks the code coverage.
107
+
108
+ Its settings are defined in the `pyproject.toml` file.
109
+
110
+ ### Ruff
111
+ Ruff is a formatter and linter that is built on top of a lot of open source tools.\
112
+ It is very fast and unifies all the useful code quality solutions into a single tool.\
113
+ By default it is not too strict, but I like to make it strict by selecting all the available rules.
114
+ The exact configuration is defined in the `ruff.toml` file.
115
+
116
+ If for some reason it makes sense not to comply with a certain rule, it can be disabled for that line using `# noqa: <rule number>`.
117
+
118
+ ### Tox
119
+ Tox is useful for running the above tools in an isolated environment.\
120
+ It makes sure that the package setup is consistent and that the tools are working as expected.\
121
+ It can be used to test different Python versions and different testing scenarios.
122
+
123
+ In this repository tox is set up to use python 3.12 and run pytest, ruff, mypy and documentation tests.
124
+ The settings are specified in the `tox.ini` file.
125
+
126
+ ### Documentation
127
+ The documentation is built with Sphinx and it is hosted both on ReadTheDocs and GitHub Pages.\
128
+ Both of these services are recommended, however ReadTheDocs requires a bit more setup, but I prefer it as it does not require an extra feature branch to be present.
129
+
130
+ ## GitHub repository settings
131
+ The following settings are enabled in my repository settings:
132
+
133
+ Code/About:
134
+
135
+ - Releases
136
+
137
+ <br>
138
+
139
+ General/Features:
140
+
141
+ - Issues
142
+ - Preserve this repository
143
+
144
+ <br>
145
+
146
+ General/Pull Requests:
147
+
148
+ - Allow merge commits
149
+ - Allow squash merging
150
+ - Allow rebase merging
151
+ - Automatically delete head branches
152
+
153
+ <br>
154
+
155
+ Branches/Branch protection rules:\
156
+ `main`\
157
+ Protect matching branches
158
+
159
+ - Require pull request reviews before merging
160
+ - Dismiss stale pull request approvals when new commits are pushed
161
+ - Require status checks to pass before merging
162
+ - `pre-commit.ci - pr`
163
+ - `tox / tox`
164
+ - Do not allow bypassing the above settings
165
+
166
+ <br>
167
+
168
+ Environments:\
169
+ `pypi`
170
+
171
+ - Deployment protection rules:
172
+ - Required reviewers:
173
+ `daniel-mizsak`
174
+ - Allow administrators to bypass configured protection rules
175
+
176
+ <br>
177
+
178
+ Pages/Build and deployment:
179
+
180
+ - Source: Deploy from branch
181
+ - Branch: `gh-pages` (root)
182
+
183
+ ## Setup PyPi trusted publishing
184
+
185
+ [PyPI publishing settings](https://pypi.org/manage/account/publishing/)
186
+
187
+ Add a new pending publisher:
188
+
189
+ - PyPI Project Name: `python-package-template-pypi` (has to match the project name in `pyproject.toml`)
190
+ - Owner: `daniel-mizsak`
191
+ - Repository name: `python-package-template`
192
+ - Workflow name: `release.yml`
@@ -0,0 +1,146 @@
1
+ ## <div align="center"> 🐍 python-package-template</div>
2
+
3
+ <div align="center">
4
+ <a href="https://github.com/daniel-mizsak/python-package-template/actions/workflows/ci.yml" target="_blank"><img src="https://github.com/daniel-mizsak/python-package-template/actions/workflows/ci.yml/badge.svg" alt="build status"></a>
5
+ <a href="https://codecov.io/gh/daniel-mizsak/python-package-template" target="_blank"><img src="https://codecov.io/gh/daniel-mizsak/python-package-template/graph/badge.svg?token=SDXG1S8PVM"/></a>
6
+ <a href="https://results.pre-commit.ci/latest/github/daniel-mizsak/python-package-template/main" target="_blank"><img src="https://results.pre-commit.ci/badge/github/daniel-mizsak/python-package-template/main.svg" alt="pre-commit.ci status"></a>
7
+ <a href='https://python-package-template-pypi.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/python-package-template-pypi/badge/?version=latest' alt='docs status' /></a>
8
+ <a href="https://img.shields.io/github/license/daniel-mizsak/python-package-template" target="_blank"><img src="https://img.shields.io/github/license/daniel-mizsak/python-package-template" alt="license"></a>
9
+ </div>
10
+
11
+ ## Overview
12
+ A GitHub template with my python package configurations.
13
+
14
+ ## Package tools
15
+ This template package relies on the synchronized cooperation of several exceptional tools.\
16
+ These tools include:
17
+ - [Codecov](https://docs.codecov.com/docs/quick-start) - Code coverage
18
+ - [Pre-Commit](https://pre-commit.com/) - Git hooks running on commits
19
+ - [Hatch](https://hatch.pypa.io/latest/) - Package building
20
+ - [MyPy](https://mypy.readthedocs.io/en/stable/) - Static type checking
21
+ - [Pytest](https://docs.pytest.org/en/latest/) - Testing and code coverage
22
+ - [Ruff](https://docs.astral.sh/ruff/) - Formatting and linting
23
+ - [Tox](https://tox.readthedocs.io/en/latest/) - Orchestration of the above tools
24
+
25
+ For documentation:
26
+ - [Sphinx](https://www.sphinx-doc.org/en/master/) - Documentation building
27
+ - [ReadTheDocs](https://readthedocs.org/) - Documentation hosting
28
+ - [GitHub Pages](https://pages.github.com/) - Documentation hosting
29
+
30
+ ### Codecov
31
+ Codecov is used to check the code coverage of the tests.\
32
+ It also provides a badge that can be added to the README file.
33
+
34
+ The way it is set up can be seen in the `.github/workflows/ci.yml` file, but it will probably be moved to my reusable [GitHub Workflows repository](https://github.com/daniel-mizsak/workflows).
35
+
36
+ ### Pre-Commit
37
+ Pre-Commit is used to run certain checks on the code before it is committed.\
38
+ These checks are defined in the `.pre-commit-config.yaml` file.\
39
+ To use pre-commit is has to be installed in the virtual environment and also added to the git hooks by running `pre-commit install`.
40
+
41
+ In this repository pre-commit is set up for a number of general issues and to run formatting and linting checks with `ruff`.
42
+
43
+ ### Hatch
44
+ Hatch is primarily used to build the package, but it can also be used to run certain tests in isolated environments.\
45
+ If the package building is more complex and requires additional settings or files it is recommended to read the hatch documentation.\
46
+ In this repository hatch is set up with the local path of the package as it differs from the one specified in the `pyproject.toml` file which is used for publishing to PyPI.
47
+
48
+ The isolated environment settings for hatch are defined in the `hatch.toml` file.\
49
+ I was thinking about replacing `tox` with `hatch`, but for now `tox` fits more into my workflows.
50
+
51
+ ### MyPy
52
+ Python by default is a dynamically typed language, but being explicit about types can help to avoid bugs.\
53
+ MyPy makes sure that the types are correct and consistent throughout the code.
54
+
55
+ The `mypy` related settings are defined in the `pyproject.toml` file.\
56
+ In this repository MyPy is set up be `strict` and it also checks for some additional issues.
57
+
58
+ ### Pytest
59
+ Pytest is a modern testing framework for Python.\
60
+ It is way too complex to explain it here, but it runs all the tests from the `tests` directory and also checks the code coverage.
61
+
62
+ Its settings are defined in the `pyproject.toml` file.
63
+
64
+ ### Ruff
65
+ Ruff is a formatter and linter that is built on top of a lot of open source tools.\
66
+ It is very fast and unifies all the useful code quality solutions into a single tool.\
67
+ By default it is not too strict, but I like to make it strict by selecting all the available rules.
68
+ The exact configuration is defined in the `ruff.toml` file.
69
+
70
+ If for some reason it makes sense not to comply with a certain rule, it can be disabled for that line using `# noqa: <rule number>`.
71
+
72
+ ### Tox
73
+ Tox is useful for running the above tools in an isolated environment.\
74
+ It makes sure that the package setup is consistent and that the tools are working as expected.\
75
+ It can be used to test different Python versions and different testing scenarios.
76
+
77
+ In this repository tox is set up to use python 3.12 and run pytest, ruff, mypy and documentation tests.
78
+ The settings are specified in the `tox.ini` file.
79
+
80
+ ### Documentation
81
+ The documentation is built with Sphinx and it is hosted both on ReadTheDocs and GitHub Pages.\
82
+ Both of these services are recommended, however ReadTheDocs requires a bit more setup, but I prefer it as it does not require an extra feature branch to be present.
83
+
84
+ ## GitHub repository settings
85
+ The following settings are enabled in my repository settings:
86
+
87
+ Code/About:
88
+
89
+ - Releases
90
+
91
+ <br>
92
+
93
+ General/Features:
94
+
95
+ - Issues
96
+ - Preserve this repository
97
+
98
+ <br>
99
+
100
+ General/Pull Requests:
101
+
102
+ - Allow merge commits
103
+ - Allow squash merging
104
+ - Allow rebase merging
105
+ - Automatically delete head branches
106
+
107
+ <br>
108
+
109
+ Branches/Branch protection rules:\
110
+ `main`\
111
+ Protect matching branches
112
+
113
+ - Require pull request reviews before merging
114
+ - Dismiss stale pull request approvals when new commits are pushed
115
+ - Require status checks to pass before merging
116
+ - `pre-commit.ci - pr`
117
+ - `tox / tox`
118
+ - Do not allow bypassing the above settings
119
+
120
+ <br>
121
+
122
+ Environments:\
123
+ `pypi`
124
+
125
+ - Deployment protection rules:
126
+ - Required reviewers:
127
+ `daniel-mizsak`
128
+ - Allow administrators to bypass configured protection rules
129
+
130
+ <br>
131
+
132
+ Pages/Build and deployment:
133
+
134
+ - Source: Deploy from branch
135
+ - Branch: `gh-pages` (root)
136
+
137
+ ## Setup PyPi trusted publishing
138
+
139
+ [PyPI publishing settings](https://pypi.org/manage/account/publishing/)
140
+
141
+ Add a new pending publisher:
142
+
143
+ - PyPI Project Name: `python-package-template-pypi` (has to match the project name in `pyproject.toml`)
144
+ - Owner: `daniel-mizsak`
145
+ - Repository name: `python-package-template`
146
+ - Workflow name: `release.yml`
@@ -5,7 +5,7 @@ For the full list of built-in configuration values, see the documentation:
5
5
  https://www.sphinx-doc.org/en/master/usage/configuration.html
6
6
 
7
7
  Built docs locally with:
8
- sphinx-build -b html docs/source/ docs/build/html
8
+ sphinx-build -b html docs docs/build/html
9
9
 
10
10
  @author "Daniel Mizsak" <info@pythonvilag.hu>
11
11
  """
@@ -0,0 +1,16 @@
1
+ [envs.default]
2
+ dependencies = ["pytest", "pytest-cov"]
3
+ [envs.default.scripts]
4
+ run = "pytest"
5
+ [[envs.default.matrix]]
6
+ python = ["3.12"]
7
+
8
+ [envs.ruff]
9
+ dependencies = ["ruff"]
10
+ [envs.ruff.scripts]
11
+ run = "ruff check ."
12
+
13
+ [envs.mypy]
14
+ dependencies = ["mypy"]
15
+ [envs.mypy.scripts]
16
+ run = "mypy src tests"
@@ -0,0 +1,46 @@
1
+ # Build System
2
+ [build-system]
3
+ requires = ["hatchling"]
4
+ build-backend = "hatchling.build"
5
+
6
+ # Project Metadata
7
+ [project]
8
+ name = "python-package-template-pypi" # Name has to be unique on pypi.
9
+ version = "0.0.3"
10
+ description = "A github template with my python package configurations."
11
+ readme = "README.md"
12
+ requires-python = ">=3.12"
13
+ license = { file = "LICENSE" }
14
+ authors = [{ name = "Daniel Mizsak", email = "info@pythonvilag.hu" }]
15
+ keywords = []
16
+ classifiers = [
17
+ "License :: OSI Approved :: MIT License",
18
+ "Programming Language :: Python :: 3 :: Only",
19
+ "Programming Language :: Python :: 3.12",
20
+ ]
21
+ dependencies = []
22
+ [project.optional-dependencies]
23
+ dev = ["hatch", "mypy", "pre-commit", "pytest-cov", "pytest", "ruff", "tox"]
24
+ docs = ["furo", "sphinx", "sphinx-copybutton"]
25
+ [project.urls]
26
+ Repository = "https://github.com/daniel-mizsak/python-package-template"
27
+
28
+ # Tools
29
+ # Hatch
30
+ [tool.hatch.build.targets.wheel]
31
+ packages = ["src/python_package_template"]
32
+
33
+ # MyPy
34
+ [tool.mypy]
35
+ ignore_missing_imports = true
36
+ pretty = true
37
+ show_column_numbers = true
38
+ show_error_context = true
39
+ strict = true
40
+ warn_unreachable = true
41
+ warn_unused_ignores = true
42
+
43
+ # Pytest
44
+ [tool.pytest.ini_options]
45
+ addopts = "--cov=python_package_template --cov=tests --cov-config=pyproject.toml --cov-report=term-missing --cov-report=html"
46
+ testpaths = ["tests"]
@@ -0,0 +1,35 @@
1
+ # Exclude a variety of commonly ignored directories.
2
+ # exclude = [""]
3
+
4
+ line-length = 120
5
+ indent-width = 4
6
+
7
+ target-version = "py312"
8
+
9
+ [lint]
10
+ select = ["ALL"]
11
+ ignore = [
12
+ "D203", # one-blank-line-before-class
13
+ "D212", # multi-line-summary-first-line
14
+ "FIX", # flake8-fixme
15
+ "INP", # flake8-no-pep420
16
+ "S104", # hardcoded-bind-all-interfaces
17
+ "TD002", # missing-todo-author
18
+ "TD003", # missing-todo-link
19
+ ]
20
+ [lint.per-file-ignores]
21
+ "__init__.py" = [
22
+ "D104", # undocumented-public-package
23
+ ]
24
+ "tests/**/*.py" = [
25
+ "ANN001", # missing-type-function-argument
26
+ "ANN201", # missing-return-type-undocumented-public-function
27
+ "D", # pydocstyle
28
+ "PLR2004", # magic-value-comparison
29
+ "S101", # assert
30
+ ]
31
+ [lint.pydocstyle]
32
+ convention = "google"
33
+
34
+ [format]
35
+ quote-style = "double"
@@ -0,0 +1,37 @@
1
+ [tox]
2
+ envlist =
3
+ py312
4
+ ruff
5
+ mypy
6
+ docs
7
+ skip_missing_interpreters = true
8
+
9
+ [gh]
10
+ python =
11
+ 3.12 = py312, ruff, mypy, docs
12
+
13
+ [testenv]
14
+ deps =
15
+ pytest
16
+ pytest-cov
17
+ commands =
18
+ pytest {posargs:tests}
19
+
20
+ [testenv:ruff]
21
+ deps =
22
+ ruff
23
+ commands =
24
+ ruff check src tests
25
+
26
+ [testenv:mypy]
27
+ deps =
28
+ mypy
29
+ commands =
30
+ mypy src
31
+ mypy tests
32
+
33
+ [testenv:docs]
34
+ extras =
35
+ docs
36
+ commands =
37
+ sphinx-build -b html -d "{envtmpdir}{/}doctree" docs "{toxworkdir}{/}docs_out" --color
@@ -1,3 +0,0 @@
1
- - [ ] Linting passes
2
- - [ ] Tests are added and passing
3
- - [ ] Documentation is updated
@@ -1,14 +0,0 @@
1
- name: CI
2
- on:
3
- pull_request:
4
- branches:
5
- - main
6
- push:
7
- branches:
8
- - main
9
-
10
- jobs:
11
- tox:
12
- uses: daniel-mizsak/workflows/.github/workflows/tox.yml@main
13
- with:
14
- python-version: "3.12"
@@ -1,106 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: python-package-template-pypi
3
- Version: 0.0.2
4
- Summary: A github template with my python package configurations.
5
- Project-URL: Repository, https://github.com/daniel-mizsak/python-package-template
6
- Author-email: Daniel Mizsak <info@pythonvilag.hu>
7
- License: MIT License
8
-
9
- Copyright (c) Daniel Mizsak
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in all
19
- copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.
28
- License-File: LICENSE
29
- Classifier: License :: OSI Approved :: MIT License
30
- Classifier: Programming Language :: Python :: 3 :: Only
31
- Classifier: Programming Language :: Python :: 3.12
32
- Requires-Python: >=3.12
33
- Provides-Extra: dev
34
- Requires-Dist: mypy; extra == 'dev'
35
- Requires-Dist: pre-commit; extra == 'dev'
36
- Requires-Dist: pytest; extra == 'dev'
37
- Requires-Dist: pytest-cov; extra == 'dev'
38
- Requires-Dist: ruff; extra == 'dev'
39
- Requires-Dist: tox; extra == 'dev'
40
- Provides-Extra: docs
41
- Requires-Dist: furo; extra == 'docs'
42
- Requires-Dist: sphinx; extra == 'docs'
43
- Requires-Dist: sphinx-copybutton; extra == 'docs'
44
- Description-Content-Type: text/markdown
45
-
46
- ## <div align="center"> 🐍 python-package-template</div>
47
-
48
- <div align="center">
49
- <a href="https://github.com/daniel-mizsak/python-package-template/actions/workflows/ci.yml" target="_blank"><img src="https://github.com/daniel-mizsak/python-package-template/actions/workflows/ci.yml/badge.svg" alt="build status"></a>
50
- <a href="https://results.pre-commit.ci/latest/github/daniel-mizsak/python-package-template/main" target="_blank"><img src="https://results.pre-commit.ci/badge/github/daniel-mizsak/python-package-template/main.svg" alt="pre-commit.ci status"></a>
51
- <a href='https://python-package-template-pypi.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/python-package-template-pypi/badge/?version=latest' alt='docs status' /></a>
52
- <a href="https://img.shields.io/github/license/daniel-mizsak/python-package-template" target="_blank"><img src="https://img.shields.io/github/license/daniel-mizsak/python-package-template" alt="license"></a>
53
- </div>
54
-
55
-
56
- ## Overview
57
- A GitHub template with my python package configurations.
58
-
59
- ## GitHub repository settings
60
- The following settings are enabled in my repository settings:
61
-
62
- Code/About:
63
- - Releases
64
-
65
- <br>
66
-
67
- General/Features:
68
- - Issues
69
- - Preserve this repository
70
-
71
- <br>
72
-
73
- General/Pull Requests:
74
- - Allow merge commits
75
- - Allow squash merging
76
- - Allow rebase merging
77
- - Automatically delete head branches
78
-
79
- <br>
80
-
81
- Branches/Branch protection rules:\
82
- `main`\
83
- Protect matching branches
84
- - Require pull request reviews before merging
85
- - Dismiss stale pull request approvals when new commits are pushed
86
- - Require status checks to pass before merging
87
- - `pre-commit.ci - pr`
88
- - `tox / tox`
89
-
90
- <br>
91
-
92
- Environments:\
93
- `pypi`
94
- - Deployment protection rules:
95
- - Required reviewers:
96
- `daniel-mizsak`
97
- - Allow administrators to bypass configured protection rules
98
-
99
- ## Setup PyPi trusted publishing
100
- [PyPi publishing settings](https://pypi.org/manage/account/publishing/)
101
-
102
- Add a new pending publisher:
103
- - PyPi Project Name: `python-package-template-pypi` (has to match the project name in `pyproject.toml`)
104
- - Owner: `daniel-mizsak`
105
- - Repository name: `python-package-template`
106
- - Workflow name: `release.yml`
@@ -1,61 +0,0 @@
1
- ## <div align="center"> 🐍 python-package-template</div>
2
-
3
- <div align="center">
4
- <a href="https://github.com/daniel-mizsak/python-package-template/actions/workflows/ci.yml" target="_blank"><img src="https://github.com/daniel-mizsak/python-package-template/actions/workflows/ci.yml/badge.svg" alt="build status"></a>
5
- <a href="https://results.pre-commit.ci/latest/github/daniel-mizsak/python-package-template/main" target="_blank"><img src="https://results.pre-commit.ci/badge/github/daniel-mizsak/python-package-template/main.svg" alt="pre-commit.ci status"></a>
6
- <a href='https://python-package-template-pypi.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/python-package-template-pypi/badge/?version=latest' alt='docs status' /></a>
7
- <a href="https://img.shields.io/github/license/daniel-mizsak/python-package-template" target="_blank"><img src="https://img.shields.io/github/license/daniel-mizsak/python-package-template" alt="license"></a>
8
- </div>
9
-
10
-
11
- ## Overview
12
- A GitHub template with my python package configurations.
13
-
14
- ## GitHub repository settings
15
- The following settings are enabled in my repository settings:
16
-
17
- Code/About:
18
- - Releases
19
-
20
- <br>
21
-
22
- General/Features:
23
- - Issues
24
- - Preserve this repository
25
-
26
- <br>
27
-
28
- General/Pull Requests:
29
- - Allow merge commits
30
- - Allow squash merging
31
- - Allow rebase merging
32
- - Automatically delete head branches
33
-
34
- <br>
35
-
36
- Branches/Branch protection rules:\
37
- `main`\
38
- Protect matching branches
39
- - Require pull request reviews before merging
40
- - Dismiss stale pull request approvals when new commits are pushed
41
- - Require status checks to pass before merging
42
- - `pre-commit.ci - pr`
43
- - `tox / tox`
44
-
45
- <br>
46
-
47
- Environments:\
48
- `pypi`
49
- - Deployment protection rules:
50
- - Required reviewers:
51
- `daniel-mizsak`
52
- - Allow administrators to bypass configured protection rules
53
-
54
- ## Setup PyPi trusted publishing
55
- [PyPi publishing settings](https://pypi.org/manage/account/publishing/)
56
-
57
- Add a new pending publisher:
58
- - PyPi Project Name: `python-package-template-pypi` (has to match the project name in `pyproject.toml`)
59
- - Owner: `daniel-mizsak`
60
- - Repository name: `python-package-template`
61
- - Workflow name: `release.yml`
@@ -1,116 +0,0 @@
1
- # Build System
2
- [build-system]
3
- requires = ["hatchling"]
4
- build-backend = "hatchling.build"
5
-
6
- # Project Metadata
7
- [project]
8
- name = "python-package-template-pypi" # Name has to be unique on pypi.
9
- version = "0.0.2"
10
- description = "A github template with my python package configurations."
11
- readme = "README.md"
12
- requires-python = ">=3.12"
13
- license = { file = "LICENSE" }
14
- authors = [{ name = "Daniel Mizsak", email = "info@pythonvilag.hu" }]
15
- keywords = []
16
- classifiers = [
17
- "License :: OSI Approved :: MIT License",
18
- "Programming Language :: Python :: 3 :: Only",
19
- "Programming Language :: Python :: 3.12",
20
- ]
21
- dependencies = []
22
- [project.optional-dependencies]
23
- dev = ["mypy", "pre-commit", "pytest-cov", "pytest", "ruff", "tox"]
24
- docs = ["furo", "sphinx", "sphinx-copybutton"]
25
- [project.urls]
26
- Repository = "https://github.com/daniel-mizsak/python-package-template"
27
-
28
- # Tools
29
- # Hatch
30
- [tool.hatch.build.targets.wheel]
31
- packages = ["src/python_package_template"]
32
-
33
- # MyPy
34
- [tool.mypy]
35
- ignore_missing_imports = true
36
- pretty = true
37
- show_column_numbers = true
38
- show_error_context = true
39
- strict = true
40
- warn_unreachable = true
41
- warn_unused_ignores = true
42
-
43
- # Pytest
44
- [tool.pytest.ini_options]
45
- addopts = "--cov=python_package_template"
46
- testpaths = ["tests"]
47
-
48
- # Ruff
49
- [tool.ruff]
50
- line-length = 120
51
- [tool.ruff.lint]
52
- select = ["ALL"]
53
- ignore = [
54
- "D203", # one-blank-line-before-class
55
- "D212", # multi-line-summary-first-line
56
- "FIX", # flake8-fixme
57
- "INP", # flake8-no-pep420
58
- "S104", # hardcoded-bind-all-interfaces
59
- "TD002", # missing-todo-author
60
- "TD003", # missing-todo-link
61
- ]
62
- [tool.ruff.lint.per-file-ignores]
63
- "__init__.py" = [
64
- "D104", # undocumented-public-package
65
- ]
66
- "tests/**/*.py" = [
67
- "ANN001", # missing-type-function-argument
68
- "ANN201", # missing-return-type-undocumented-public-function
69
- "D", # pydocstyle
70
- "PLR2004", # magic-value-comparison
71
- "S101", # assert
72
- ]
73
- [tool.ruff.lint.pydocstyle]
74
- convention = "google"
75
-
76
- # Tox
77
- [tool.tox]
78
- legacy_tox_ini = """
79
- [tox]
80
- envlist =
81
- py312
82
- ruff
83
- mypy
84
- docs
85
- skip_missing_interpreters = true
86
-
87
- [gh]
88
- python =
89
- 3.12 = py312, ruff, mypy, docs
90
-
91
- [testenv]
92
- deps =
93
- pytest
94
- pytest-cov
95
- commands =
96
- pytest {posargs:tests}
97
-
98
- [testenv:ruff]
99
- deps =
100
- ruff
101
- commands =
102
- ruff check src tests
103
-
104
- [testenv:mypy]
105
- deps =
106
- mypy
107
- commands =
108
- mypy src
109
- mypy tests
110
-
111
- [testenv:docs]
112
- extras =
113
- docs
114
- commands =
115
- sphinx-build -d "{envtmpdir}{/}doctree" docs "{toxworkdir}{/}docs_out" --color -b html
116
- """