templatepy 0.2.6.dev0__tar.gz → 0.2.8.dev0__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 (26) hide show
  1. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/.bumpversion.cfg +1 -1
  2. templatepy-0.2.8.dev0/.pre-commit-config.yaml +20 -0
  3. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/PKG-INFO +25 -12
  4. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/README.md +23 -10
  5. templatepy-0.2.8.dev0/pyproject.toml +114 -0
  6. templatepy-0.2.8.dev0/templatepy/__init__.py +13 -0
  7. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/templatepy.egg-info/PKG-INFO +25 -12
  8. templatepy-0.2.6.dev0/.pre-commit-config.yaml +0 -27
  9. templatepy-0.2.6.dev0/pyproject.toml +0 -86
  10. templatepy-0.2.6.dev0/templatepy/__init__.py +0 -7
  11. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/.gitignore +0 -0
  12. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/.secrets.baseline +0 -0
  13. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/CODE_OF_CONDUCT.md +0 -0
  14. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/CONTRIBUTING.md +0 -0
  15. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/LICENSE +0 -0
  16. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/MANIFEST.in +0 -0
  17. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/setup.cfg +0 -0
  18. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/setup.py +0 -0
  19. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/templatepy/example.data.file.config +0 -0
  20. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/templatepy/example.data.file.test-extension-yu48 +0 -0
  21. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/templatepy.egg-info/SOURCES.txt +0 -0
  22. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/templatepy.egg-info/dependency_links.txt +0 -0
  23. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/templatepy.egg-info/entry_points.txt +0 -0
  24. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/templatepy.egg-info/not-zip-safe +0 -0
  25. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/templatepy.egg-info/requires.txt +0 -0
  26. {templatepy-0.2.6.dev0 → templatepy-0.2.8.dev0}/templatepy.egg-info/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 0.2.6.dev0
2
+ current_version = 0.2.8.dev0
3
3
  commit = True
4
4
  tag = False
5
5
  tag_name = v{new_version}
@@ -0,0 +1,20 @@
1
+ # Update versions with: pre-commit autoupdate
2
+ repos:
3
+ - repo: https://github.com/astral-sh/ruff-pre-commit
4
+ # Ruff version.
5
+ rev: v0.8.3
6
+ hooks:
7
+ # Run the linter.
8
+ - id: ruff
9
+ args:
10
+ - "--fix"
11
+ - "--show-fixes"
12
+ # Run the formatter.
13
+ - id: ruff-format
14
+
15
+ # Add mypy for static type checking
16
+ - repo: https://github.com/pre-commit/mirrors-mypy
17
+ rev: v1.13.0
18
+ hooks:
19
+ - id: mypy
20
+ additional_dependencies: ["types-toml"]
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: templatepy
3
- Version: 0.2.6.dev0
3
+ Version: 0.2.8.dev0
4
4
  Summary: templatepy: Template repo for python repositories & PyPi integration
5
5
  Author-email: "Lars B. Rollik" <L.B.Rollik@protonmail.com>
6
6
  License: BSD 3-Clause License
@@ -64,7 +64,10 @@ Requires-Dist: toml; extra == "dev"
64
64
 
65
65
  [bump2version]: (https://github.com/c4urself/bump2version
66
66
  [pre-commit]: https://pre-commit.com
67
- [black]: https://github.com/psf/black
67
+
68
+ [//]: # ([black]: https://github.com/psf/black)
69
+ [ruff]: https://docs.astral.sh/ruff
70
+ [mypy]: https://mypy.readthedocs.io
68
71
 
69
72
  [pypi]: pypi.org
70
73
  [test.pypi]: test.pypi.org
@@ -85,14 +88,13 @@ Requires-Dist: toml; extra == "dev"
85
88
  [![PyPI](https://img.shields.io/pypi/v/templatepy.svg)](https://pypi.org/project/templatepy)
86
89
  [![Wheel](https://img.shields.io/pypi/wheel/templatepy.svg)](https://pypi.org/project/templatepy)
87
90
  ![CI](https://github.com/larsrollik/templatepy/workflows/tests/badge.svg)
88
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
89
91
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
90
92
 
91
93
 
92
94
  # templatepy
93
95
  Template repo for python repositories & PyPi integration
94
96
  ---
95
- **Version: "0.2.6.dev0"**
97
+ **Version: "0.2.8.dev0"**
96
98
 
97
99
 
98
100
  ## Usage
@@ -133,7 +135,7 @@ Template repo for python repositories & PyPi integration
133
135
  Central configuration file that replaces the traditional `setup.cfg` and `setup.py` files:
134
136
  - **Build System**: Specifies the build system requirements and configuration, as defined in [PEP 518](https://peps.python.org/pep-0518/) and [PEP 621](https://peps.python.org/pep-0621/).
135
137
  - **Package Metadata**: Includes the project's metadata (name, version, dependencies, etc.).
136
- - **Code Formatting**: Configuration for tools like [black] and [flake8] (if used).
138
+ - **Code Formatting**: Configuration for tools like [ruff] and [mypy] (if used).
137
139
  - **Optional Dependencies**: Organizes extra dependencies for development or other environments.
138
140
 
139
141
  - **`setup.py`**:
@@ -270,7 +272,8 @@ The package will then be automatically uploaded to [PyPI](https://pypi.org/) or
270
272
  3) Use bumpversion to bump the version (you can adjust patch, minor, or major based on what change you want), and create a release tag.
271
273
  4) Push both the feature branch and the release tag to the remote repository.
272
274
  5) Open a pull request using GitHub CLI (gh pr create) or the GitHub UI to merge the feature branch into main.
273
- 6) After the PR is merged, delete the feature branch both locally and remotely.
275
+ 6) Review the pull request online or in the CLI (e.g.: `gh pr list`, `gh pr view <nr>`, `gh pr merge <nr> --merge --delete-branch`)
276
+ 7) After the PR is merged, delete the feature branch both locally and remotely.
274
277
 
275
278
 
276
279
  ### Example commands for the workflow:
@@ -302,7 +305,13 @@ gh pr create \
302
305
  --title "pr_title" \
303
306
  --body "pr_body"
304
307
 
305
- # 6. After the PR is accepted and merged, delete the feature branch locally and remotely
308
+ # 6.
309
+ gh pr list # -> shows PRs and their IDs
310
+ gh pr view <id>
311
+
312
+ gh pr merge <id> --merge --delete-branch
313
+
314
+ # 7. After the PR is accepted and merged, delete the feature branch locally and remotely
306
315
  git checkout main # Switch back to main branch
307
316
  git pull origin main # Ensure your main branch is up-to-date
308
317
  git branch -d feature/my-new-feature # Delete the local feature branch
@@ -336,9 +345,11 @@ For further reading on the transition to `pyproject.toml` and the removal of `se
336
345
  - [PEP-518](https://peps.python.org/pep-0518/)
337
346
  - [Discussion on Setup.cfg Deprecation](https://stackoverflow.com/questions/44878600/is-setup-cfg-deprecated)
338
347
 
339
- #### Using Github CLI in actions workflows
348
+ #### Using GitHub CLI in Workflow Actions
340
349
 
341
- [CLI in actions (docs)](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-github-cli-in-workflows)
350
+ Easily integrate GitHub CLI into workflows to perform repository tasks. See the [GitHub CLI in workflows documentation](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-github-cli-in-workflows).
351
+
352
+ **Example: Create a pull request**
342
353
 
343
354
  ```yaml
344
355
  - name: Create a pull request
@@ -347,6 +358,7 @@ For further reading on the transition to `pyproject.toml` and the removal of `se
347
358
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
348
359
  ```
349
360
 
361
+
350
362
  ## Common issues
351
363
 
352
364
  ### `bump2version` fails on git tag with exit status 128
@@ -356,8 +368,9 @@ For further reading on the transition to `pyproject.toml` and the removal of `se
356
368
  - there are changes that need to be committed? `git commit -am "commit message"`
357
369
  - tag already exists? `git tag` to list tags, `git tag -d <tag>` to delete a tag
358
370
 
359
- ### no gpg key for signing commits
371
+ ### No gpg key for signing commits
360
372
  - generate a key with `gpg --full-generate-key`
373
+ - standard options for keys: "(9) ECC (sign and encrypt) *default*" -> Curve 25519 -> expiry 2 years: "2y" -> name/email
361
374
  - list keys with `gpg --list-secret-keys --keyid-format LONG`
362
375
  - set the key for signing commits with `git config --global user.signingkey <key-id>`
363
376
  - enable signing commits with `git config --global commit.gpgsign true`
@@ -367,7 +380,7 @@ For further reading on the transition to `pyproject.toml` and the removal of `se
367
380
 
368
381
  Which one is the key id you might ask?
369
382
  ```
370
- /home/user/.gnupg/secring.gpg
383
+ /home/$USER/.gnupg/secring.gpg
371
384
  ------------------------------
372
385
  sec 4096R/<KEY_ID> 2024-11-22 [expires: 2025-11-22]
373
386
  uid Your Name <youremail@example.com>
@@ -7,7 +7,10 @@
7
7
 
8
8
  [bump2version]: (https://github.com/c4urself/bump2version
9
9
  [pre-commit]: https://pre-commit.com
10
- [black]: https://github.com/psf/black
10
+
11
+ [//]: # ([black]: https://github.com/psf/black)
12
+ [ruff]: https://docs.astral.sh/ruff
13
+ [mypy]: https://mypy.readthedocs.io
11
14
 
12
15
  [pypi]: pypi.org
13
16
  [test.pypi]: test.pypi.org
@@ -28,14 +31,13 @@
28
31
  [![PyPI](https://img.shields.io/pypi/v/templatepy.svg)](https://pypi.org/project/templatepy)
29
32
  [![Wheel](https://img.shields.io/pypi/wheel/templatepy.svg)](https://pypi.org/project/templatepy)
30
33
  ![CI](https://github.com/larsrollik/templatepy/workflows/tests/badge.svg)
31
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
32
34
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
33
35
 
34
36
 
35
37
  # templatepy
36
38
  Template repo for python repositories & PyPi integration
37
39
  ---
38
- **Version: "0.2.6.dev0"**
40
+ **Version: "0.2.8.dev0"**
39
41
 
40
42
 
41
43
  ## Usage
@@ -76,7 +78,7 @@ Template repo for python repositories & PyPi integration
76
78
  Central configuration file that replaces the traditional `setup.cfg` and `setup.py` files:
77
79
  - **Build System**: Specifies the build system requirements and configuration, as defined in [PEP 518](https://peps.python.org/pep-0518/) and [PEP 621](https://peps.python.org/pep-0621/).
78
80
  - **Package Metadata**: Includes the project's metadata (name, version, dependencies, etc.).
79
- - **Code Formatting**: Configuration for tools like [black] and [flake8] (if used).
81
+ - **Code Formatting**: Configuration for tools like [ruff] and [mypy] (if used).
80
82
  - **Optional Dependencies**: Organizes extra dependencies for development or other environments.
81
83
 
82
84
  - **`setup.py`**:
@@ -213,7 +215,8 @@ The package will then be automatically uploaded to [PyPI](https://pypi.org/) or
213
215
  3) Use bumpversion to bump the version (you can adjust patch, minor, or major based on what change you want), and create a release tag.
214
216
  4) Push both the feature branch and the release tag to the remote repository.
215
217
  5) Open a pull request using GitHub CLI (gh pr create) or the GitHub UI to merge the feature branch into main.
216
- 6) After the PR is merged, delete the feature branch both locally and remotely.
218
+ 6) Review the pull request online or in the CLI (e.g.: `gh pr list`, `gh pr view <nr>`, `gh pr merge <nr> --merge --delete-branch`)
219
+ 7) After the PR is merged, delete the feature branch both locally and remotely.
217
220
 
218
221
 
219
222
  ### Example commands for the workflow:
@@ -245,7 +248,13 @@ gh pr create \
245
248
  --title "pr_title" \
246
249
  --body "pr_body"
247
250
 
248
- # 6. After the PR is accepted and merged, delete the feature branch locally and remotely
251
+ # 6.
252
+ gh pr list # -> shows PRs and their IDs
253
+ gh pr view <id>
254
+
255
+ gh pr merge <id> --merge --delete-branch
256
+
257
+ # 7. After the PR is accepted and merged, delete the feature branch locally and remotely
249
258
  git checkout main # Switch back to main branch
250
259
  git pull origin main # Ensure your main branch is up-to-date
251
260
  git branch -d feature/my-new-feature # Delete the local feature branch
@@ -279,9 +288,11 @@ For further reading on the transition to `pyproject.toml` and the removal of `se
279
288
  - [PEP-518](https://peps.python.org/pep-0518/)
280
289
  - [Discussion on Setup.cfg Deprecation](https://stackoverflow.com/questions/44878600/is-setup-cfg-deprecated)
281
290
 
282
- #### Using Github CLI in actions workflows
291
+ #### Using GitHub CLI in Workflow Actions
283
292
 
284
- [CLI in actions (docs)](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-github-cli-in-workflows)
293
+ Easily integrate GitHub CLI into workflows to perform repository tasks. See the [GitHub CLI in workflows documentation](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-github-cli-in-workflows).
294
+
295
+ **Example: Create a pull request**
285
296
 
286
297
  ```yaml
287
298
  - name: Create a pull request
@@ -290,6 +301,7 @@ For further reading on the transition to `pyproject.toml` and the removal of `se
290
301
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
291
302
  ```
292
303
 
304
+
293
305
  ## Common issues
294
306
 
295
307
  ### `bump2version` fails on git tag with exit status 128
@@ -299,8 +311,9 @@ For further reading on the transition to `pyproject.toml` and the removal of `se
299
311
  - there are changes that need to be committed? `git commit -am "commit message"`
300
312
  - tag already exists? `git tag` to list tags, `git tag -d <tag>` to delete a tag
301
313
 
302
- ### no gpg key for signing commits
314
+ ### No gpg key for signing commits
303
315
  - generate a key with `gpg --full-generate-key`
316
+ - standard options for keys: "(9) ECC (sign and encrypt) *default*" -> Curve 25519 -> expiry 2 years: "2y" -> name/email
304
317
  - list keys with `gpg --list-secret-keys --keyid-format LONG`
305
318
  - set the key for signing commits with `git config --global user.signingkey <key-id>`
306
319
  - enable signing commits with `git config --global commit.gpgsign true`
@@ -310,7 +323,7 @@ For further reading on the transition to `pyproject.toml` and the removal of `se
310
323
 
311
324
  Which one is the key id you might ask?
312
325
  ```
313
- /home/user/.gnupg/secring.gpg
326
+ /home/$USER/.gnupg/secring.gpg
314
327
  ------------------------------
315
328
  sec 4096R/<KEY_ID> 2024-11-22 [expires: 2025-11-22]
316
329
  uid Your Name <youremail@example.com>
@@ -0,0 +1,114 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "templatepy"
7
+ version = "0.2.8.dev0"
8
+ authors = [
9
+ { name = "Lars B. Rollik", email = "L.B.Rollik@protonmail.com" }
10
+ ]
11
+ license = { file = "LICENSE" }
12
+ description = "templatepy: Template repo for python repositories & PyPi integration"
13
+ readme = { file = "README.md", content-type = "text/markdown" }
14
+ classifiers = [
15
+ "Intended Audience :: Developers",
16
+ "Topic :: Software Development :: Libraries :: Python Modules",
17
+ "License :: OSI Approved :: BSD License",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ # "Programming Language :: Python :: 3.12",
24
+ ]
25
+ requires-python = ">=3.10"
26
+ dependencies = [
27
+ "black"
28
+ ]
29
+
30
+ [project.urls]
31
+ Repository = "https://github.com/larsrollik/templatepy"
32
+ "Issue Tracker" = "https://github.com/larsrollik/templatepy/issues"
33
+
34
+
35
+ [project.optional-dependencies]
36
+ dev = [
37
+ "black",
38
+ "bump2version",
39
+ "pytest-cov", # implies: pytest, coverage dependencies
40
+ "pre-commit",
41
+ "flake8",
42
+ "toml",
43
+ ]
44
+
45
+ [project.entry-points.console_scripts]
46
+ templatepy-entrypoint = "templatepy.__init__:run"
47
+
48
+ [tool.setuptools]
49
+ zip-safe = false
50
+ include-package-data = true
51
+
52
+ [tool.setuptools.packages.find]
53
+ where = [""]
54
+
55
+ [tool.setuptools.package-data]
56
+ "*" = ["*.config"]
57
+
58
+ [tool.pytest.ini_options]
59
+ addopts = "--cov=templatepy --cov-report=term-missing --maxfail=5"
60
+
61
+ [tool.ruff]
62
+ line-length = 88
63
+ indent-width = 4
64
+ include = ["*.pyi"]
65
+ extend-exclude = ["*.eggs", "*.git", "*.hg", "*.mypy_cache", "*.tox", "*.venv", "*_build", "*buck-out", "*build", "*dist"]
66
+
67
+ [tool.ruff.lint]
68
+ select = [
69
+ "E", # Pyflakes (general errors)
70
+ "W", # Pycodestyle warnings
71
+ "F", # Pyflakes checks (includes unused imports)
72
+ "I", # isort (import sorting)
73
+ "UP", # pyupgrade (Python syntax upgrades)
74
+ "YTT", # check for YAML issues
75
+ "SIM", # detect unnecessary comprehensions, loops, etc.
76
+ "PTH", # checks for pathlib best practices
77
+ "TCH",
78
+ "PYI",
79
+ ]
80
+ ignore = []
81
+
82
+ # Allow fix for all enabled rules (when `--fix`) is provided.
83
+ fixable = ["ALL"]
84
+ unfixable = []
85
+
86
+ [tool.ruff.format]
87
+ # Like Black, use double quotes for strings.
88
+ quote-style = "double"
89
+ # Like Black, indent with spaces, rather than tabs.
90
+ indent-style = "space"
91
+ # Like Black, respect magic trailing commas.
92
+ skip-magic-trailing-comma = false
93
+ # Like Black, automatically detect the appropriate line ending.
94
+ line-ending = "auto"
95
+
96
+ # Enable auto-formatting of code examples in docstrings. Markdown,
97
+ # reStructuredText code/literal blocks and doctests are all supported.
98
+ #
99
+ # This is currently disabled by default, but it is planned for this
100
+ # to be opt-out in the future.
101
+ docstring-code-format = true
102
+ docstring-code-line-length = "dynamic"
103
+
104
+ [tool.ruff.lint.pydocstyle]
105
+ convention = "numpy" # Accepts: "google", "numpy", or "pep257".
106
+
107
+ [tool.ruff.lint.per-file-ignores]
108
+ ".bumpversion.cfg" = ["E501", "W291", "W292"] # Equivalent to excluding it from whitespace checks
109
+
110
+ [tool.mypy]
111
+ # strict = true
112
+ # follow_imports = "silent"
113
+ warn_return_any = false
114
+ ignore_missing_imports = true
@@ -0,0 +1,13 @@
1
+ __author__ = "Lars B. Rollik"
2
+
3
+ from importlib.metadata import PackageNotFoundError, version
4
+
5
+ try:
6
+ __version__ = version("subject_weight_db")
7
+ except PackageNotFoundError:
8
+ __version__ = "0.2.8.dev0"
9
+
10
+
11
+ def run():
12
+ """Example `run` function for entrypoint defined in `pyproject.toml`."""
13
+ print("Hello, world!")
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: templatepy
3
- Version: 0.2.6.dev0
3
+ Version: 0.2.8.dev0
4
4
  Summary: templatepy: Template repo for python repositories & PyPi integration
5
5
  Author-email: "Lars B. Rollik" <L.B.Rollik@protonmail.com>
6
6
  License: BSD 3-Clause License
@@ -64,7 +64,10 @@ Requires-Dist: toml; extra == "dev"
64
64
 
65
65
  [bump2version]: (https://github.com/c4urself/bump2version
66
66
  [pre-commit]: https://pre-commit.com
67
- [black]: https://github.com/psf/black
67
+
68
+ [//]: # ([black]: https://github.com/psf/black)
69
+ [ruff]: https://docs.astral.sh/ruff
70
+ [mypy]: https://mypy.readthedocs.io
68
71
 
69
72
  [pypi]: pypi.org
70
73
  [test.pypi]: test.pypi.org
@@ -85,14 +88,13 @@ Requires-Dist: toml; extra == "dev"
85
88
  [![PyPI](https://img.shields.io/pypi/v/templatepy.svg)](https://pypi.org/project/templatepy)
86
89
  [![Wheel](https://img.shields.io/pypi/wheel/templatepy.svg)](https://pypi.org/project/templatepy)
87
90
  ![CI](https://github.com/larsrollik/templatepy/workflows/tests/badge.svg)
88
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
89
91
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
90
92
 
91
93
 
92
94
  # templatepy
93
95
  Template repo for python repositories & PyPi integration
94
96
  ---
95
- **Version: "0.2.6.dev0"**
97
+ **Version: "0.2.8.dev0"**
96
98
 
97
99
 
98
100
  ## Usage
@@ -133,7 +135,7 @@ Template repo for python repositories & PyPi integration
133
135
  Central configuration file that replaces the traditional `setup.cfg` and `setup.py` files:
134
136
  - **Build System**: Specifies the build system requirements and configuration, as defined in [PEP 518](https://peps.python.org/pep-0518/) and [PEP 621](https://peps.python.org/pep-0621/).
135
137
  - **Package Metadata**: Includes the project's metadata (name, version, dependencies, etc.).
136
- - **Code Formatting**: Configuration for tools like [black] and [flake8] (if used).
138
+ - **Code Formatting**: Configuration for tools like [ruff] and [mypy] (if used).
137
139
  - **Optional Dependencies**: Organizes extra dependencies for development or other environments.
138
140
 
139
141
  - **`setup.py`**:
@@ -270,7 +272,8 @@ The package will then be automatically uploaded to [PyPI](https://pypi.org/) or
270
272
  3) Use bumpversion to bump the version (you can adjust patch, minor, or major based on what change you want), and create a release tag.
271
273
  4) Push both the feature branch and the release tag to the remote repository.
272
274
  5) Open a pull request using GitHub CLI (gh pr create) or the GitHub UI to merge the feature branch into main.
273
- 6) After the PR is merged, delete the feature branch both locally and remotely.
275
+ 6) Review the pull request online or in the CLI (e.g.: `gh pr list`, `gh pr view <nr>`, `gh pr merge <nr> --merge --delete-branch`)
276
+ 7) After the PR is merged, delete the feature branch both locally and remotely.
274
277
 
275
278
 
276
279
  ### Example commands for the workflow:
@@ -302,7 +305,13 @@ gh pr create \
302
305
  --title "pr_title" \
303
306
  --body "pr_body"
304
307
 
305
- # 6. After the PR is accepted and merged, delete the feature branch locally and remotely
308
+ # 6.
309
+ gh pr list # -> shows PRs and their IDs
310
+ gh pr view <id>
311
+
312
+ gh pr merge <id> --merge --delete-branch
313
+
314
+ # 7. After the PR is accepted and merged, delete the feature branch locally and remotely
306
315
  git checkout main # Switch back to main branch
307
316
  git pull origin main # Ensure your main branch is up-to-date
308
317
  git branch -d feature/my-new-feature # Delete the local feature branch
@@ -336,9 +345,11 @@ For further reading on the transition to `pyproject.toml` and the removal of `se
336
345
  - [PEP-518](https://peps.python.org/pep-0518/)
337
346
  - [Discussion on Setup.cfg Deprecation](https://stackoverflow.com/questions/44878600/is-setup-cfg-deprecated)
338
347
 
339
- #### Using Github CLI in actions workflows
348
+ #### Using GitHub CLI in Workflow Actions
340
349
 
341
- [CLI in actions (docs)](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-github-cli-in-workflows)
350
+ Easily integrate GitHub CLI into workflows to perform repository tasks. See the [GitHub CLI in workflows documentation](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-github-cli-in-workflows).
351
+
352
+ **Example: Create a pull request**
342
353
 
343
354
  ```yaml
344
355
  - name: Create a pull request
@@ -347,6 +358,7 @@ For further reading on the transition to `pyproject.toml` and the removal of `se
347
358
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
348
359
  ```
349
360
 
361
+
350
362
  ## Common issues
351
363
 
352
364
  ### `bump2version` fails on git tag with exit status 128
@@ -356,8 +368,9 @@ For further reading on the transition to `pyproject.toml` and the removal of `se
356
368
  - there are changes that need to be committed? `git commit -am "commit message"`
357
369
  - tag already exists? `git tag` to list tags, `git tag -d <tag>` to delete a tag
358
370
 
359
- ### no gpg key for signing commits
371
+ ### No gpg key for signing commits
360
372
  - generate a key with `gpg --full-generate-key`
373
+ - standard options for keys: "(9) ECC (sign and encrypt) *default*" -> Curve 25519 -> expiry 2 years: "2y" -> name/email
361
374
  - list keys with `gpg --list-secret-keys --keyid-format LONG`
362
375
  - set the key for signing commits with `git config --global user.signingkey <key-id>`
363
376
  - enable signing commits with `git config --global commit.gpgsign true`
@@ -367,7 +380,7 @@ For further reading on the transition to `pyproject.toml` and the removal of `se
367
380
 
368
381
  Which one is the key id you might ask?
369
382
  ```
370
- /home/user/.gnupg/secring.gpg
383
+ /home/$USER/.gnupg/secring.gpg
371
384
  ------------------------------
372
385
  sec 4096R/<KEY_ID> 2024-11-22 [expires: 2025-11-22]
373
386
  uid Your Name <youremail@example.com>
@@ -1,27 +0,0 @@
1
- repos:
2
- - repo: https://github.com/asottile/reorder_python_imports
3
- rev: v2.6.0
4
- hooks:
5
- - id: reorder-python-imports
6
- - repo: https://github.com/ambv/black
7
- rev: 22.6.0
8
- hooks:
9
- - id: black
10
- - repo: https://github.com/pre-commit/pre-commit-hooks
11
- rev: v2.3.0
12
- hooks:
13
- - id: end-of-file-fixer
14
- exclude: '.bumpversion.cfg'
15
- - id: trailing-whitespace
16
- exclude: '.bumpversion.cfg'
17
- - id: check-case-conflict
18
- - id: check-merge-conflict
19
- - id: check-yaml
20
- args: [ '--unsafe' ]
21
- - id: detect-private-key
22
- - id: forbid-new-submodules
23
- - id: check-json
24
- - id: pretty-format-json
25
- args: ['--autofix', '--indent=4', '--no-ensure-ascii', ]
26
- - id: check-added-large-files
27
- - id: flake8
@@ -1,86 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools>=42", "wheel"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "templatepy"
7
- version = "0.2.6.dev0"
8
- authors = [
9
- { name = "Lars B. Rollik", email = "L.B.Rollik@protonmail.com" }
10
- ]
11
- license = { file = "LICENSE" }
12
- description = "templatepy: Template repo for python repositories & PyPi integration"
13
- readme = { file = "README.md", content-type = "text/markdown" }
14
- classifiers = [
15
- "Intended Audience :: Developers",
16
- "Topic :: Software Development :: Libraries :: Python Modules",
17
- "License :: OSI Approved :: BSD License",
18
- "Operating System :: OS Independent",
19
- "Programming Language :: Python",
20
- "Programming Language :: Python :: 3",
21
- "Programming Language :: Python :: 3.10",
22
- "Programming Language :: Python :: 3.11",
23
- # "Programming Language :: Python :: 3.12",
24
- ]
25
- requires-python = ">=3.10"
26
- dependencies = [
27
- "black"
28
- ]
29
-
30
- [project.urls]
31
- Repository = "https://github.com/larsrollik/templatepy"
32
- "Issue Tracker" = "https://github.com/larsrollik/templatepy/issues"
33
-
34
-
35
- [project.optional-dependencies]
36
- dev = [
37
- "black",
38
- "bump2version",
39
- "pytest-cov", # implies: pytest, coverage dependencies
40
- "pre-commit",
41
- "flake8",
42
- "toml",
43
- ]
44
-
45
- [project.entry-points.console_scripts]
46
- templatepy-entrypoint = "templatepy.__init__:run"
47
-
48
- [tool.setuptools]
49
- zip-safe = false
50
- include-package-data = true
51
-
52
- [tool.setuptools.packages.find]
53
- where = [""]
54
-
55
- [tool.setuptools.package-data]
56
- "*" = ["*.config"]
57
-
58
- [tool.pytest.ini_options]
59
- addopts = "--cov=templatepy --cov-report=term-missing --maxfail=5"
60
-
61
- [tool.black]
62
- target-version = ["py310", "py311"] #, "py312"
63
- skip-string-normalization = false
64
- line-length = 79
65
- include = '\\.pyi?$'
66
- exclude = '''
67
- /(
68
- \.eggs
69
- | \.git
70
- | \.hg
71
- | \.mypy_cache
72
- | \.tox
73
- | \.venv
74
- | _build
75
- | buck-out
76
- | build
77
- | dist
78
- )/
79
- '''
80
-
81
- [tool.flake8]
82
- ignore = ["E203", "E266", "E501", "W503", "F403", "F401"]
83
- max-line-length = 79
84
- max-complexity = 18
85
- select = ["B", "C", "E", "F", "W", "T4", "B9"]
86
- exclude = ["__init__.py", "build", "__pycache__", ".git", "tests"]
@@ -1,7 +0,0 @@
1
- __author__ = "Lars B. Rollik"
2
- __version__ = "0.2.6.dev0"
3
-
4
-
5
- def run():
6
- """Example `run` function for entrypoint in `setup.cfg`"""
7
- print("Hello, world!")
File without changes