templatepy 0.2.0__tar.gz → 0.2.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.
@@ -0,0 +1,32 @@
1
+ [bumpversion]
2
+ current_version = 0.2.3
3
+ commit = True
4
+ tag = False
5
+ tag_name = v{new_version}
6
+ sign_tags = False
7
+ message = "Upgrade: {current_version} → {new_version}"
8
+ parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<build>\d+))?
9
+ serialize =
10
+ {major}.{minor}.{patch}.{release}{build}
11
+ {major}.{minor}.{patch}
12
+
13
+ [bumpversion:part:release]
14
+ optional_value = rc
15
+ first_value = dev
16
+ values =
17
+ dev
18
+ rc
19
+
20
+ [bumpversion:part:build]
21
+
22
+ [bumpversion:file:pyproject.toml]
23
+ search = version = "{current_version}"
24
+ replace = version = "{new_version}"
25
+
26
+ [bumpversion:file:README.md]
27
+ search = Version: "{current_version}"
28
+ replace = Version: "{new_version}"
29
+
30
+ [bumpversion:file:templatepy/__init__.py]
31
+ search = __version__ = "{current_version}"
32
+ replace = __version__ = "{new_version}"
@@ -0,0 +1,139 @@
1
+ # IDE files
2
+ .idea/
3
+ .vscode/
4
+
5
+ # Ignored file types
6
+ .DS_Store
7
+
8
+ # Custom config files
9
+ *.conf.custom
10
+
11
+ # Byte-compiled / optimized / DLL files
12
+ __pycache__/
13
+ *.py[cod]
14
+ *$py.class
15
+
16
+ # C extensions
17
+ *.so
18
+
19
+ # Distribution / packaging
20
+ .Python
21
+ build/
22
+ develop-eggs/
23
+ dist/
24
+ downloads/
25
+ eggs/
26
+ .eggs/
27
+ lib/
28
+ lib64/
29
+ parts/
30
+ sdist/
31
+ var/
32
+ wheels/
33
+ pip-wheel-metadata/
34
+ share/python-wheels/
35
+ *.egg-info/
36
+ .installed.cfg
37
+ *.egg
38
+ MANIFEST
39
+
40
+ # PyInstaller
41
+ # Usually these files are written by a python script from a template
42
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
43
+ *.manifest
44
+ *.spec
45
+
46
+ # Installer logs
47
+ pip-log.txt
48
+ pip-delete-this-directory.txt
49
+
50
+ # Unit test / coverage reports
51
+ htmlcov/
52
+ .tox/
53
+ .nox/
54
+ .coverage
55
+ .coverage.*
56
+ .cache
57
+ nosetests.xml
58
+ coverage.xml
59
+ *.cover
60
+ *.py,cover
61
+ .hypothesis/
62
+ .pytest_cache/
63
+
64
+ # Translations
65
+ *.mo
66
+ *.pot
67
+
68
+ # Django stuff:
69
+ *.log
70
+ local_settings.py
71
+ db.sqlite3
72
+ db.sqlite3-journal
73
+
74
+ # Flask stuff:
75
+ instance/
76
+ .webassets-cache
77
+
78
+ # Scrapy stuff:
79
+ .scrapy
80
+
81
+ # Sphinx documentation
82
+ docs/_build/
83
+
84
+ # PyBuilder
85
+ target/
86
+
87
+ # Jupyter Notebook
88
+ .ipynb_checkpoints
89
+
90
+ # IPython
91
+ profile_default/
92
+ ipython_config.py
93
+
94
+ # pyenv
95
+ .python-version
96
+
97
+ # pipenv
98
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
99
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
100
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
101
+ # install all needed dependencies.
102
+ #Pipfile.lock
103
+
104
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
105
+ __pypackages__/
106
+
107
+ # Celery stuff
108
+ celerybeat-schedule
109
+ celerybeat.pid
110
+
111
+ # SageMath parsed files
112
+ *.sage.py
113
+
114
+ # Environments
115
+ .env
116
+ .venv
117
+ env/
118
+ venv/
119
+ ENV/
120
+ env.bak/
121
+ venv.bak/
122
+
123
+ # Spyder project settings
124
+ .spyderproject
125
+ .spyproject
126
+
127
+ # Rope project settings
128
+ .ropeproject
129
+
130
+ # mkdocs documentation
131
+ /site
132
+
133
+ # mypy
134
+ .mypy_cache/
135
+ .dmypy.json
136
+ dmypy.json
137
+
138
+ # Pyre type checker
139
+ .pyre/
@@ -0,0 +1,27 @@
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
@@ -0,0 +1,127 @@
1
+ {
2
+ "version": "1.5.0",
3
+ "plugins_used": [
4
+ {
5
+ "name": "ArtifactoryDetector"
6
+ },
7
+ {
8
+ "name": "AWSKeyDetector"
9
+ },
10
+ {
11
+ "name": "AzureStorageKeyDetector"
12
+ },
13
+ {
14
+ "name": "Base64HighEntropyString",
15
+ "limit": 4.5
16
+ },
17
+ {
18
+ "name": "BasicAuthDetector"
19
+ },
20
+ {
21
+ "name": "CloudantDetector"
22
+ },
23
+ {
24
+ "name": "DiscordBotTokenDetector"
25
+ },
26
+ {
27
+ "name": "GitHubTokenDetector"
28
+ },
29
+ {
30
+ "name": "GitLabTokenDetector"
31
+ },
32
+ {
33
+ "name": "HexHighEntropyString",
34
+ "limit": 3.0
35
+ },
36
+ {
37
+ "name": "IbmCloudIamDetector"
38
+ },
39
+ {
40
+ "name": "IbmCosHmacDetector"
41
+ },
42
+ {
43
+ "name": "IPPublicDetector"
44
+ },
45
+ {
46
+ "name": "JwtTokenDetector"
47
+ },
48
+ {
49
+ "name": "KeywordDetector",
50
+ "keyword_exclude": ""
51
+ },
52
+ {
53
+ "name": "MailchimpDetector"
54
+ },
55
+ {
56
+ "name": "NpmDetector"
57
+ },
58
+ {
59
+ "name": "OpenAIDetector"
60
+ },
61
+ {
62
+ "name": "PrivateKeyDetector"
63
+ },
64
+ {
65
+ "name": "PypiTokenDetector"
66
+ },
67
+ {
68
+ "name": "SendGridDetector"
69
+ },
70
+ {
71
+ "name": "SlackDetector"
72
+ },
73
+ {
74
+ "name": "SoftlayerDetector"
75
+ },
76
+ {
77
+ "name": "SquareOAuthDetector"
78
+ },
79
+ {
80
+ "name": "StripeDetector"
81
+ },
82
+ {
83
+ "name": "TelegramBotTokenDetector"
84
+ },
85
+ {
86
+ "name": "TwilioKeyDetector"
87
+ }
88
+ ],
89
+ "filters_used": [
90
+ {
91
+ "path": "detect_secrets.filters.allowlist.is_line_allowlisted"
92
+ },
93
+ {
94
+ "path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
95
+ "min_level": 2
96
+ },
97
+ {
98
+ "path": "detect_secrets.filters.heuristic.is_indirect_reference"
99
+ },
100
+ {
101
+ "path": "detect_secrets.filters.heuristic.is_likely_id_string"
102
+ },
103
+ {
104
+ "path": "detect_secrets.filters.heuristic.is_lock_file"
105
+ },
106
+ {
107
+ "path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
108
+ },
109
+ {
110
+ "path": "detect_secrets.filters.heuristic.is_potential_uuid"
111
+ },
112
+ {
113
+ "path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
114
+ },
115
+ {
116
+ "path": "detect_secrets.filters.heuristic.is_sequential_string"
117
+ },
118
+ {
119
+ "path": "detect_secrets.filters.heuristic.is_swagger_file"
120
+ },
121
+ {
122
+ "path": "detect_secrets.filters.heuristic.is_templated_secret"
123
+ }
124
+ ],
125
+ "results": {},
126
+ "generated_at": "2024-11-29T20:27:51Z"
127
+ }
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ L.B.Rollik@protonmail.com.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
@@ -0,0 +1,7 @@
1
+ ## Contributing
2
+
3
+ Contributions are absolutely encouraged, for bug fixes, new features, etc.
4
+
5
+ If you are not sure where to start, check out the [issues](https://github.com/larsrollik/templatepy/issues).
6
+
7
+ Please get in touch via [email](mailto:L.B.Rollik@protonmail.com) for other queries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: templatepy
3
- Version: 0.2.0
3
+ Version: 0.2.3
4
4
  Summary: templatepy: template for derivative python packages
5
5
  Author-email: "Lars B. Rollik" <L.B.Rollik@protonmail.com>
6
6
  License: BSD 3-Clause License
@@ -52,6 +52,7 @@ Requires-Dist: bump2version; extra == "dev"
52
52
  Requires-Dist: pytest-cov; extra == "dev"
53
53
  Requires-Dist: pre-commit; extra == "dev"
54
54
  Requires-Dist: flake8; extra == "dev"
55
+ Requires-Dist: toml; extra == "dev"
55
56
 
56
57
  [//]: # (Links)
57
58
  [Github-flavored markdown]: https://github.github.com/gfm
@@ -90,7 +91,7 @@ Requires-Dist: flake8; extra == "dev"
90
91
  # templatepy
91
92
  Template repo for python repositories & PyPi integration
92
93
  ---
93
- **Version: "0.2.0"**
94
+ **Version: "0.2.3"**
94
95
 
95
96
 
96
97
  ## Usage
@@ -185,10 +186,10 @@ The pipeline ensures code quality, passing tests, and automated deployment on ne
185
186
 
186
187
  - [ ] Change package name:
187
188
  - (1) Rename the `templatepy` folder.
188
- - (2) Update all occurrences in `README.md`.
189
+ - (2) Update all occurrences of `templatepy` in `README.md`.
189
190
  - (3) Update the `name` field in `pyproject.toml`.
190
- - (4) Update `.github/workflows` files.
191
- - (5) Update version references in `pyproject.toml` and `templatepy/__init__.py`.
191
+ - (4) (optional) Update `.github/workflows` files.
192
+ - (5) Reset version references in `pyproject.toml` and `templatepy/__init__.py` to `0.0.0.dev0`.
192
193
  - [ ] Update project author and metadata details in `pyproject.toml`, `README.md`, and `templatepy/__init__.py`.
193
194
  - [ ] Update the license holder in the `LICENSE` file.
194
195
  - [ ] Update `README.md` badge paths at the top.
@@ -230,18 +231,80 @@ The package will then be automatically uploaded to [PyPI](https://pypi.org/) or
230
231
  `bump2version` is used to increment version numbers based on semantic versioning. Here’s how you can use it with the current setup to trigger a release:
231
232
 
232
233
  1. **Bumping the Minor Version**:
233
- Increment the minor version (e.g., from `1.2.3` to `1.3.0`):
234
+ Increment the minor version (e.g., from `v1.2.3` to `v1.3.0`):
234
235
  ```bash
235
236
  # Bumping the minor Version:
236
237
  bump2version minor
237
238
 
238
- # Bumping the major version (e.g., from 1.2.3 to 2.0.0):
239
+ # Bumping the major version (e.g., from v1.2.3 to v2.0.0):
239
240
  bump2version major
240
241
 
241
- # Bumping for a release Version (e.g., from 1.0.0.dev to 1.0.0.rc or 1.0.0):
242
+ # Bumping for a release Version (e.g., from v1.0.0.dev to v1.0.0.rc or v1.0.0):
242
243
  bump2version release
243
244
  ```
244
245
 
246
+ ## Workflows Summary
247
+
248
+ | **Workflow** | **Triggers** | **Purpose** | **Outputs** |
249
+ |----------------------------|---------------------------------------------------|--------------------------------------------|----------------------------------------|
250
+ | **Lint and Test** | Push to any branch | Runs linting and testing for Python code | Ensures code quality and functionality |
251
+ | **Release to PyPI** | Push to `prod` branch with a tag (e.g., `v1.0.0`) | Builds and uploads the package to PyPI | Publishes a new release on PyPI |
252
+ | **Squash Merge to `prod`** | Pull requests merged into `main` | Squashes and merges commits into `prod` | Maintains clean history in `prod` |
253
+ | **AI Pull Request Review** | Pull request events (`opened`, `synchronize`) | Provides AI-generated pull request reviews | Adds review comments to the PR |
254
+
255
+
256
+ ## Required Repository Secrets
257
+
258
+ | **Secret** | **Purpose** | **How to Obtain** |
259
+ |------------------|---------------------------------------------|---------------------------------------------------------------------------------------------|
260
+ | `TWINE_API_KEY` | Authentication for publishing to PyPI | Generate from [PyPI Account Settings](https://pypi.org/manage/account/) under "API Tokens." |
261
+ | `OPENAI_API_KEY` | Required for AI Pull Request Reviewer | Generate from [OpenAI API Settings](https://platform.openai.com/account/api-keys). |
262
+ | `GITHUB_TOKEN` | Built-in token for accessing the repository | Automatically provided by GitHub (no setup needed). |
263
+
264
+
265
+ ## Github Flow overview
266
+
267
+
268
+ 1) Create a new feature branch from main using git checkout -b.
269
+ 2) Make and commit a dummy change (e.g., adding a file).
270
+ 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
+ 4) Push both the feature branch and the release tag to the remote repository.
272
+ 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.
274
+
275
+ ### Example commands for the workflow:
276
+
277
+ ```bash
278
+ # 1. Checkout a new feature branch from main
279
+ git checkout main # Ensure you are on the main branch
280
+ git pull origin main # Fetch latest changes from main
281
+ git checkout -b feature/my-new-feature # Create and switch to a new feature branch
282
+
283
+ # 2. Make a dummy commit (e.g., add a new file or change)
284
+ echo "Some feature work" > feature.txt # Add a new file or make a change
285
+ git add feature.txt # Stage the file for commit
286
+ git commit -m "Add feature.txt - dummy commit" # Commit the changes
287
+
288
+ # 3. Bump the version and automatically tag the release
289
+ # (Bumpversion will handle both version bumping and tagging)
290
+ bumpversion patch # Bumps version, e.g., from v0.1.0 to v0.1.1 (adjust based on version part you want)
291
+
292
+ # 4. Push the changes to remote (feature branch and the tag)
293
+ git push origin feature/my-new-feature # Push the feature branch
294
+ git push origin --tags # Push the new tag(s) created by bumpversion
295
+
296
+ # 5. Open a pull request from the feature branch to the main branch
297
+ # This can be done via GitHub UI, or using GitHub CLI
298
+ gh pr create --base main --head feature/my-new-feature --title "New Feature" --body "This is a new feature that adds feature.txt."
299
+
300
+ # 6. After the PR is accepted and merged, delete the feature branch locally and remotely
301
+ git checkout main # Switch back to main branch
302
+ git pull origin main # Ensure your main branch is up-to-date
303
+ git branch -d feature/my-new-feature # Delete the local feature branch
304
+ git push origin --delete feature/my-new-feature # Delete the remote feature branch
305
+
306
+ ```
307
+
245
308
  ## Notes
246
309
 
247
310
  #### New(er) Build System with `pyproject.toml` and `setup.cfg`
@@ -306,5 +369,6 @@ ssb 4096R/<KEY_SUBKEY_ID> 2024-11-22
306
369
  Contributions are very welcome!
307
370
  Please see the [contribution guidelines] or check out the [issues]
308
371
 
372
+
309
373
  ## License
310
374
  This software is released under the **[BSD 3-Clause License]**
@@ -35,7 +35,7 @@
35
35
  # templatepy
36
36
  Template repo for python repositories & PyPi integration
37
37
  ---
38
- **Version: "0.2.0"**
38
+ **Version: "0.2.3"**
39
39
 
40
40
 
41
41
  ## Usage
@@ -130,10 +130,10 @@ The pipeline ensures code quality, passing tests, and automated deployment on ne
130
130
 
131
131
  - [ ] Change package name:
132
132
  - (1) Rename the `templatepy` folder.
133
- - (2) Update all occurrences in `README.md`.
133
+ - (2) Update all occurrences of `templatepy` in `README.md`.
134
134
  - (3) Update the `name` field in `pyproject.toml`.
135
- - (4) Update `.github/workflows` files.
136
- - (5) Update version references in `pyproject.toml` and `templatepy/__init__.py`.
135
+ - (4) (optional) Update `.github/workflows` files.
136
+ - (5) Reset version references in `pyproject.toml` and `templatepy/__init__.py` to `0.0.0.dev0`.
137
137
  - [ ] Update project author and metadata details in `pyproject.toml`, `README.md`, and `templatepy/__init__.py`.
138
138
  - [ ] Update the license holder in the `LICENSE` file.
139
139
  - [ ] Update `README.md` badge paths at the top.
@@ -175,18 +175,80 @@ The package will then be automatically uploaded to [PyPI](https://pypi.org/) or
175
175
  `bump2version` is used to increment version numbers based on semantic versioning. Here’s how you can use it with the current setup to trigger a release:
176
176
 
177
177
  1. **Bumping the Minor Version**:
178
- Increment the minor version (e.g., from `1.2.3` to `1.3.0`):
178
+ Increment the minor version (e.g., from `v1.2.3` to `v1.3.0`):
179
179
  ```bash
180
180
  # Bumping the minor Version:
181
181
  bump2version minor
182
182
 
183
- # Bumping the major version (e.g., from 1.2.3 to 2.0.0):
183
+ # Bumping the major version (e.g., from v1.2.3 to v2.0.0):
184
184
  bump2version major
185
185
 
186
- # Bumping for a release Version (e.g., from 1.0.0.dev to 1.0.0.rc or 1.0.0):
186
+ # Bumping for a release Version (e.g., from v1.0.0.dev to v1.0.0.rc or v1.0.0):
187
187
  bump2version release
188
188
  ```
189
189
 
190
+ ## Workflows Summary
191
+
192
+ | **Workflow** | **Triggers** | **Purpose** | **Outputs** |
193
+ |----------------------------|---------------------------------------------------|--------------------------------------------|----------------------------------------|
194
+ | **Lint and Test** | Push to any branch | Runs linting and testing for Python code | Ensures code quality and functionality |
195
+ | **Release to PyPI** | Push to `prod` branch with a tag (e.g., `v1.0.0`) | Builds and uploads the package to PyPI | Publishes a new release on PyPI |
196
+ | **Squash Merge to `prod`** | Pull requests merged into `main` | Squashes and merges commits into `prod` | Maintains clean history in `prod` |
197
+ | **AI Pull Request Review** | Pull request events (`opened`, `synchronize`) | Provides AI-generated pull request reviews | Adds review comments to the PR |
198
+
199
+
200
+ ## Required Repository Secrets
201
+
202
+ | **Secret** | **Purpose** | **How to Obtain** |
203
+ |------------------|---------------------------------------------|---------------------------------------------------------------------------------------------|
204
+ | `TWINE_API_KEY` | Authentication for publishing to PyPI | Generate from [PyPI Account Settings](https://pypi.org/manage/account/) under "API Tokens." |
205
+ | `OPENAI_API_KEY` | Required for AI Pull Request Reviewer | Generate from [OpenAI API Settings](https://platform.openai.com/account/api-keys). |
206
+ | `GITHUB_TOKEN` | Built-in token for accessing the repository | Automatically provided by GitHub (no setup needed). |
207
+
208
+
209
+ ## Github Flow overview
210
+
211
+
212
+ 1) Create a new feature branch from main using git checkout -b.
213
+ 2) Make and commit a dummy change (e.g., adding a file).
214
+ 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.
215
+ 4) Push both the feature branch and the release tag to the remote repository.
216
+ 5) Open a pull request using GitHub CLI (gh pr create) or the GitHub UI to merge the feature branch into main.
217
+ 6) After the PR is merged, delete the feature branch both locally and remotely.
218
+
219
+ ### Example commands for the workflow:
220
+
221
+ ```bash
222
+ # 1. Checkout a new feature branch from main
223
+ git checkout main # Ensure you are on the main branch
224
+ git pull origin main # Fetch latest changes from main
225
+ git checkout -b feature/my-new-feature # Create and switch to a new feature branch
226
+
227
+ # 2. Make a dummy commit (e.g., add a new file or change)
228
+ echo "Some feature work" > feature.txt # Add a new file or make a change
229
+ git add feature.txt # Stage the file for commit
230
+ git commit -m "Add feature.txt - dummy commit" # Commit the changes
231
+
232
+ # 3. Bump the version and automatically tag the release
233
+ # (Bumpversion will handle both version bumping and tagging)
234
+ bumpversion patch # Bumps version, e.g., from v0.1.0 to v0.1.1 (adjust based on version part you want)
235
+
236
+ # 4. Push the changes to remote (feature branch and the tag)
237
+ git push origin feature/my-new-feature # Push the feature branch
238
+ git push origin --tags # Push the new tag(s) created by bumpversion
239
+
240
+ # 5. Open a pull request from the feature branch to the main branch
241
+ # This can be done via GitHub UI, or using GitHub CLI
242
+ gh pr create --base main --head feature/my-new-feature --title "New Feature" --body "This is a new feature that adds feature.txt."
243
+
244
+ # 6. After the PR is accepted and merged, delete the feature branch locally and remotely
245
+ git checkout main # Switch back to main branch
246
+ git pull origin main # Ensure your main branch is up-to-date
247
+ git branch -d feature/my-new-feature # Delete the local feature branch
248
+ git push origin --delete feature/my-new-feature # Delete the remote feature branch
249
+
250
+ ```
251
+
190
252
  ## Notes
191
253
 
192
254
  #### New(er) Build System with `pyproject.toml` and `setup.cfg`
@@ -251,5 +313,6 @@ ssb 4096R/<KEY_SUBKEY_ID> 2024-11-22
251
313
  Contributions are very welcome!
252
314
  Please see the [contribution guidelines] or check out the [issues]
253
315
 
316
+
254
317
  ## License
255
318
  This software is released under the **[BSD 3-Clause License]**
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "templatepy"
7
- version = "0.2.0"
7
+ version = "0.2.3"
8
8
  authors = [
9
9
  { name = "Lars B. Rollik", email = "L.B.Rollik@protonmail.com" }
10
10
  ]
@@ -37,7 +37,8 @@ dev = [
37
37
  "bump2version",
38
38
  "pytest-cov", # implies: pytest, coverage dependencies
39
39
  "pre-commit",
40
- "flake8"
40
+ "flake8",
41
+ "toml",
41
42
  ]
42
43
 
43
44
  [project.entry-points.console_scripts]
@@ -1,7 +1,7 @@
1
1
  __author__ = "Lars B. Rollik"
2
- __version__ = "0.2.0"
2
+ __version__ = "0.2.3"
3
3
 
4
4
 
5
5
  def run():
6
6
  """Example `run` function for entrypoint in `setup.cfg`"""
7
- pass
7
+ print("Hello, world!")
@@ -0,0 +1,2 @@
1
+ [unused-config-file-2]
2
+ attribute2 = 2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: templatepy
3
- Version: 0.2.0
3
+ Version: 0.2.3
4
4
  Summary: templatepy: template for derivative python packages
5
5
  Author-email: "Lars B. Rollik" <L.B.Rollik@protonmail.com>
6
6
  License: BSD 3-Clause License
@@ -52,6 +52,7 @@ Requires-Dist: bump2version; extra == "dev"
52
52
  Requires-Dist: pytest-cov; extra == "dev"
53
53
  Requires-Dist: pre-commit; extra == "dev"
54
54
  Requires-Dist: flake8; extra == "dev"
55
+ Requires-Dist: toml; extra == "dev"
55
56
 
56
57
  [//]: # (Links)
57
58
  [Github-flavored markdown]: https://github.github.com/gfm
@@ -90,7 +91,7 @@ Requires-Dist: flake8; extra == "dev"
90
91
  # templatepy
91
92
  Template repo for python repositories & PyPi integration
92
93
  ---
93
- **Version: "0.2.0"**
94
+ **Version: "0.2.3"**
94
95
 
95
96
 
96
97
  ## Usage
@@ -185,10 +186,10 @@ The pipeline ensures code quality, passing tests, and automated deployment on ne
185
186
 
186
187
  - [ ] Change package name:
187
188
  - (1) Rename the `templatepy` folder.
188
- - (2) Update all occurrences in `README.md`.
189
+ - (2) Update all occurrences of `templatepy` in `README.md`.
189
190
  - (3) Update the `name` field in `pyproject.toml`.
190
- - (4) Update `.github/workflows` files.
191
- - (5) Update version references in `pyproject.toml` and `templatepy/__init__.py`.
191
+ - (4) (optional) Update `.github/workflows` files.
192
+ - (5) Reset version references in `pyproject.toml` and `templatepy/__init__.py` to `0.0.0.dev0`.
192
193
  - [ ] Update project author and metadata details in `pyproject.toml`, `README.md`, and `templatepy/__init__.py`.
193
194
  - [ ] Update the license holder in the `LICENSE` file.
194
195
  - [ ] Update `README.md` badge paths at the top.
@@ -230,18 +231,80 @@ The package will then be automatically uploaded to [PyPI](https://pypi.org/) or
230
231
  `bump2version` is used to increment version numbers based on semantic versioning. Here’s how you can use it with the current setup to trigger a release:
231
232
 
232
233
  1. **Bumping the Minor Version**:
233
- Increment the minor version (e.g., from `1.2.3` to `1.3.0`):
234
+ Increment the minor version (e.g., from `v1.2.3` to `v1.3.0`):
234
235
  ```bash
235
236
  # Bumping the minor Version:
236
237
  bump2version minor
237
238
 
238
- # Bumping the major version (e.g., from 1.2.3 to 2.0.0):
239
+ # Bumping the major version (e.g., from v1.2.3 to v2.0.0):
239
240
  bump2version major
240
241
 
241
- # Bumping for a release Version (e.g., from 1.0.0.dev to 1.0.0.rc or 1.0.0):
242
+ # Bumping for a release Version (e.g., from v1.0.0.dev to v1.0.0.rc or v1.0.0):
242
243
  bump2version release
243
244
  ```
244
245
 
246
+ ## Workflows Summary
247
+
248
+ | **Workflow** | **Triggers** | **Purpose** | **Outputs** |
249
+ |----------------------------|---------------------------------------------------|--------------------------------------------|----------------------------------------|
250
+ | **Lint and Test** | Push to any branch | Runs linting and testing for Python code | Ensures code quality and functionality |
251
+ | **Release to PyPI** | Push to `prod` branch with a tag (e.g., `v1.0.0`) | Builds and uploads the package to PyPI | Publishes a new release on PyPI |
252
+ | **Squash Merge to `prod`** | Pull requests merged into `main` | Squashes and merges commits into `prod` | Maintains clean history in `prod` |
253
+ | **AI Pull Request Review** | Pull request events (`opened`, `synchronize`) | Provides AI-generated pull request reviews | Adds review comments to the PR |
254
+
255
+
256
+ ## Required Repository Secrets
257
+
258
+ | **Secret** | **Purpose** | **How to Obtain** |
259
+ |------------------|---------------------------------------------|---------------------------------------------------------------------------------------------|
260
+ | `TWINE_API_KEY` | Authentication for publishing to PyPI | Generate from [PyPI Account Settings](https://pypi.org/manage/account/) under "API Tokens." |
261
+ | `OPENAI_API_KEY` | Required for AI Pull Request Reviewer | Generate from [OpenAI API Settings](https://platform.openai.com/account/api-keys). |
262
+ | `GITHUB_TOKEN` | Built-in token for accessing the repository | Automatically provided by GitHub (no setup needed). |
263
+
264
+
265
+ ## Github Flow overview
266
+
267
+
268
+ 1) Create a new feature branch from main using git checkout -b.
269
+ 2) Make and commit a dummy change (e.g., adding a file).
270
+ 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
+ 4) Push both the feature branch and the release tag to the remote repository.
272
+ 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.
274
+
275
+ ### Example commands for the workflow:
276
+
277
+ ```bash
278
+ # 1. Checkout a new feature branch from main
279
+ git checkout main # Ensure you are on the main branch
280
+ git pull origin main # Fetch latest changes from main
281
+ git checkout -b feature/my-new-feature # Create and switch to a new feature branch
282
+
283
+ # 2. Make a dummy commit (e.g., add a new file or change)
284
+ echo "Some feature work" > feature.txt # Add a new file or make a change
285
+ git add feature.txt # Stage the file for commit
286
+ git commit -m "Add feature.txt - dummy commit" # Commit the changes
287
+
288
+ # 3. Bump the version and automatically tag the release
289
+ # (Bumpversion will handle both version bumping and tagging)
290
+ bumpversion patch # Bumps version, e.g., from v0.1.0 to v0.1.1 (adjust based on version part you want)
291
+
292
+ # 4. Push the changes to remote (feature branch and the tag)
293
+ git push origin feature/my-new-feature # Push the feature branch
294
+ git push origin --tags # Push the new tag(s) created by bumpversion
295
+
296
+ # 5. Open a pull request from the feature branch to the main branch
297
+ # This can be done via GitHub UI, or using GitHub CLI
298
+ gh pr create --base main --head feature/my-new-feature --title "New Feature" --body "This is a new feature that adds feature.txt."
299
+
300
+ # 6. After the PR is accepted and merged, delete the feature branch locally and remotely
301
+ git checkout main # Switch back to main branch
302
+ git pull origin main # Ensure your main branch is up-to-date
303
+ git branch -d feature/my-new-feature # Delete the local feature branch
304
+ git push origin --delete feature/my-new-feature # Delete the remote feature branch
305
+
306
+ ```
307
+
245
308
  ## Notes
246
309
 
247
310
  #### New(er) Build System with `pyproject.toml` and `setup.cfg`
@@ -306,5 +369,6 @@ ssb 4096R/<KEY_SUBKEY_ID> 2024-11-22
306
369
  Contributions are very welcome!
307
370
  Please see the [contribution guidelines] or check out the [issues]
308
371
 
372
+
309
373
  ## License
310
374
  This software is released under the **[BSD 3-Clause License]**
@@ -1,3 +1,9 @@
1
+ .bumpversion.cfg
2
+ .gitignore
3
+ .pre-commit-config.yaml
4
+ .secrets.baseline
5
+ CODE_OF_CONDUCT.md
6
+ CONTRIBUTING.md
1
7
  LICENSE
2
8
  MANIFEST.in
3
9
  README.md
@@ -5,6 +11,7 @@ pyproject.toml
5
11
  setup.py
6
12
  templatepy/__init__.py
7
13
  templatepy/example.data.file.config
14
+ templatepy/example.data.file.test-extension-yu48
8
15
  templatepy.egg-info/PKG-INFO
9
16
  templatepy.egg-info/SOURCES.txt
10
17
  templatepy.egg-info/dependency_links.txt
@@ -6,3 +6,4 @@ bump2version
6
6
  pytest-cov
7
7
  pre-commit
8
8
  flake8
9
+ toml
@@ -1,4 +1,2 @@
1
- build
2
- dist
3
1
  templatepy
4
2
  tests
File without changes
File without changes
File without changes
File without changes