tornadoapi-guard 0.0.1__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.
- tornadoapi_guard-0.0.1/.claude/settings.local.json +9 -0
- tornadoapi_guard-0.0.1/.env +7 -0
- tornadoapi_guard-0.0.1/.github/FUNDING.yml +14 -0
- tornadoapi_guard-0.0.1/.github/ISSUE_TEMPLATE/bug_report.md +76 -0
- tornadoapi_guard-0.0.1/.github/ISSUE_TEMPLATE/config.yml +8 -0
- tornadoapi_guard-0.0.1/.github/ISSUE_TEMPLATE/documentation.md +53 -0
- tornadoapi_guard-0.0.1/.github/ISSUE_TEMPLATE/feature_request.md +56 -0
- tornadoapi_guard-0.0.1/.github/PULL_REQUEST_TEMPLATE.md +66 -0
- tornadoapi_guard-0.0.1/.github/dependabot.yml +17 -0
- tornadoapi_guard-0.0.1/.github/scripts/bump_version.py +146 -0
- tornadoapi_guard-0.0.1/.github/workflows/ci.yml +178 -0
- tornadoapi_guard-0.0.1/.github/workflows/code-ql.yml +133 -0
- tornadoapi_guard-0.0.1/.github/workflows/container-release.yml +151 -0
- tornadoapi_guard-0.0.1/.github/workflows/docs.yml +136 -0
- tornadoapi_guard-0.0.1/.github/workflows/release.yml +115 -0
- tornadoapi_guard-0.0.1/.github/workflows/scheduled-lint.yml +201 -0
- tornadoapi_guard-0.0.1/.gitignore +230 -0
- tornadoapi_guard-0.0.1/.pre-commit-config.yaml +69 -0
- tornadoapi_guard-0.0.1/.python-version +7 -0
- tornadoapi_guard-0.0.1/CHANGELOG.md +16 -0
- tornadoapi_guard-0.0.1/CLAUDE.md +385 -0
- tornadoapi_guard-0.0.1/CONTRIBUTING.md +148 -0
- tornadoapi_guard-0.0.1/Dockerfile +32 -0
- tornadoapi_guard-0.0.1/LICENSE +21 -0
- tornadoapi_guard-0.0.1/Makefile +263 -0
- tornadoapi_guard-0.0.1/PKG-INFO +169 -0
- tornadoapi_guard-0.0.1/README.md +123 -0
- tornadoapi_guard-0.0.1/SECURITY.md +109 -0
- tornadoapi_guard-0.0.1/compose.yml +53 -0
- tornadoapi_guard-0.0.1/mkdocs.yml +181 -0
- tornadoapi_guard-0.0.1/pyproject.toml +237 -0
- tornadoapi_guard-0.0.1/setup.py +9 -0
- tornadoapi_guard-0.0.1/tests/__init__.py +0 -0
- tornadoapi_guard-0.0.1/tests/conftest.py +6 -0
- tornadoapi_guard-0.0.1/tornadoapi_guard/__init__.py +0 -0
- tornadoapi_guard-0.0.1/tornadoapi_guard/adapters.py +35 -0
- tornadoapi_guard-0.0.1/tornadoapi_guard/py.typed +0 -0
- tornadoapi_guard-0.0.1/uv.lock +3375 -0
- tornadoapi_guard-0.0.1/vulture_whitelist.py +147 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#[pypi]
|
|
2
|
+
# username = "__token__"
|
|
3
|
+
# password = "pypi-AgEIcHlwaS5vcmcCJDc4NTkzNjdhLTAxMmUtNDY5Yi1hY2U3LTdjOTUxNmU0NzllYwACFVsxLFsiZmFzdGFwaS1ndWFyZCJdXQACLFsyLFsiZGM2NmZlMjQtOTkxMS00OTY2LTkwYjYtMTcwYTA1MmFmYzczIl1dAAAGIN2LO-IWXJKPqxTFs5gR8MhtbxrXWA1qeeFeSMkVlGgm"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
ACC_TOKEN = "pypi-AgEIcHlwaS5vcmcCJDkzNDg2YTFkLWJhZGItNDMzYi05NjE1LTdiYzVlNTc2YWY1OAACKlszLCI5NGY2Mzg4Ni1kNTA3LTQ3NmQtYmU2ZC1hNmFmMjAyMTQxYjkiXQAABiCUeqJ2ZXW-in3fdqQ7JbADZRlI25GFaDwomTJ7KYutSA"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# These are supported funding model platforms
|
|
2
|
+
|
|
3
|
+
github: rennf93
|
|
4
|
+
# patreon: # Replace with a single Patreon username
|
|
5
|
+
# open_collective: # Replace with a single Open Collective username
|
|
6
|
+
# ko_fi: # Replace with a single Ko-fi username
|
|
7
|
+
tidelift: pypi/tornadoapi-guard
|
|
8
|
+
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
+
# liberapay: # Replace with a single Liberapay username
|
|
10
|
+
# issuehunt: # Replace with a single IssueHunt username
|
|
11
|
+
# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
|
12
|
+
# polar: # Replace with a single Polar username
|
|
13
|
+
# buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
|
14
|
+
custom: ['https://paypal.me/renzof93']
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
name: Bug report
|
|
4
|
+
about: Create a report to help us improve TornadoAPI Guard
|
|
5
|
+
title: '[BUG] '
|
|
6
|
+
labels: bug
|
|
7
|
+
assignees: ''
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Bug Description
|
|
11
|
+
===============
|
|
12
|
+
|
|
13
|
+
A clear and concise description of what the bug is.
|
|
14
|
+
|
|
15
|
+
___
|
|
16
|
+
|
|
17
|
+
Steps To Reproduce
|
|
18
|
+
------------------
|
|
19
|
+
|
|
20
|
+
Steps to reproduce the behavior:
|
|
21
|
+
|
|
22
|
+
1. Configure TornadoAPI Guard with '...'
|
|
23
|
+
2. Make request to endpoint '....'
|
|
24
|
+
3. See error
|
|
25
|
+
|
|
26
|
+
___
|
|
27
|
+
|
|
28
|
+
Expected Behavior
|
|
29
|
+
-----------------
|
|
30
|
+
|
|
31
|
+
A clear and concise description of what you expected to happen.
|
|
32
|
+
|
|
33
|
+
___
|
|
34
|
+
|
|
35
|
+
Actual Behavior
|
|
36
|
+
---------------
|
|
37
|
+
|
|
38
|
+
What actually happened, including error messages, stack traces, or logs.
|
|
39
|
+
|
|
40
|
+
___
|
|
41
|
+
|
|
42
|
+
Environment
|
|
43
|
+
-----------
|
|
44
|
+
|
|
45
|
+
- TornadoAPI Guard version: [e.g. 0.0.1]
|
|
46
|
+
- Python version: [e.g. 3.11.10]
|
|
47
|
+
- Tornado version: [e.g. 6.5.5]
|
|
48
|
+
- OS: [e.g. Ubuntu 22.04, Windows 11, MacOS 15.4]
|
|
49
|
+
- Other relevant dependencies:
|
|
50
|
+
|
|
51
|
+
___
|
|
52
|
+
|
|
53
|
+
Configuration
|
|
54
|
+
-------------
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
# Include your TornadoAPI Guard configuration here
|
|
58
|
+
import tornado.web
|
|
59
|
+
from tornadoapi_guard import SecurityConfig
|
|
60
|
+
|
|
61
|
+
# Your configuration
|
|
62
|
+
security_config = SecurityConfig(
|
|
63
|
+
# Include your config here
|
|
64
|
+
)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
___
|
|
68
|
+
|
|
69
|
+
Additional Context
|
|
70
|
+
------------------
|
|
71
|
+
|
|
72
|
+
Add any other context about the problem here. For example:
|
|
73
|
+
|
|
74
|
+
- Is this happening in production or development?
|
|
75
|
+
- Does it happen consistently or intermittently?
|
|
76
|
+
- Have you tried any workarounds?
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: TornadoAPI Guard Documentation
|
|
4
|
+
url: https://rennf93.github.io/tornadoapi-guard/
|
|
5
|
+
about: Check the documentation for usage information and tutorials
|
|
6
|
+
- name: Usage Questions
|
|
7
|
+
url: https://github.com/rennf93/tornadoapi-guard/discussions
|
|
8
|
+
about: Please ask and answer questions in GitHub Discussions
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
name: Documentation
|
|
4
|
+
about: Report issues with the TornadoAPI Guard documentation or suggest improvements
|
|
5
|
+
title: '[DOCS] '
|
|
6
|
+
labels: documentation
|
|
7
|
+
assignees: ''
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Documentation Issue
|
|
11
|
+
===================
|
|
12
|
+
|
|
13
|
+
Describe the issue or improvement needed for the documentation.
|
|
14
|
+
|
|
15
|
+
___
|
|
16
|
+
|
|
17
|
+
Current Documentation
|
|
18
|
+
---------------------
|
|
19
|
+
|
|
20
|
+
Link to the current documentation page or section that needs improvement:
|
|
21
|
+
[Link it here](https://example.com)
|
|
22
|
+
|
|
23
|
+
___
|
|
24
|
+
|
|
25
|
+
Suggested Changes
|
|
26
|
+
-----------------
|
|
27
|
+
|
|
28
|
+
Describe what changes you suggest:
|
|
29
|
+
|
|
30
|
+
- [ ] Clarify existing content
|
|
31
|
+
- [ ] Add missing information
|
|
32
|
+
- [ ] Fix incorrect information
|
|
33
|
+
- [ ] Improve examples
|
|
34
|
+
- [ ] Fix typos/grammar
|
|
35
|
+
- [ ] Other (please specify)
|
|
36
|
+
|
|
37
|
+
___
|
|
38
|
+
|
|
39
|
+
Proposed Text
|
|
40
|
+
-------------
|
|
41
|
+
|
|
42
|
+
If you have a specific suggestion for new text, please provide it here:
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
# Your proposed documentation text here
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
___
|
|
49
|
+
|
|
50
|
+
Additional Context
|
|
51
|
+
------------------
|
|
52
|
+
|
|
53
|
+
Any other information or screenshots about the documentation issue.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
name: Feature request
|
|
4
|
+
about: Suggest an idea for TornadoAPI Guard
|
|
5
|
+
title: '[FEATURE] '
|
|
6
|
+
labels: enhancement
|
|
7
|
+
assignees: ''
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Is your feature request related to a problem
|
|
11
|
+
=============================================
|
|
12
|
+
|
|
13
|
+
A clear and concise description of what the problem is. Ex. I'm always facing issues when [...]
|
|
14
|
+
|
|
15
|
+
___
|
|
16
|
+
|
|
17
|
+
Describe the solution you'd like
|
|
18
|
+
---------------------------------
|
|
19
|
+
|
|
20
|
+
A clear and concise description of what you want to happen. Include any API design ideas or examples of how you'd like to use this feature.
|
|
21
|
+
|
|
22
|
+
___
|
|
23
|
+
|
|
24
|
+
Describe alternatives you've considered
|
|
25
|
+
---------------------------------------
|
|
26
|
+
|
|
27
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
28
|
+
|
|
29
|
+
___
|
|
30
|
+
|
|
31
|
+
Example Implementation
|
|
32
|
+
----------------------
|
|
33
|
+
|
|
34
|
+
If possible, provide a pseudocode example of how this feature might be implemented or used:
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
# Example code showing how you'd like to use this feature
|
|
38
|
+
import tornado.web
|
|
39
|
+
from tornadoapi_guard import SecurityConfig
|
|
40
|
+
|
|
41
|
+
# Your feature example here
|
|
42
|
+
security_config = SecurityConfig(
|
|
43
|
+
new_feature=SomeConfiguration(...)
|
|
44
|
+
)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
___
|
|
48
|
+
|
|
49
|
+
Additional context
|
|
50
|
+
------------------
|
|
51
|
+
|
|
52
|
+
Add any other context or screenshots about the feature request here:
|
|
53
|
+
|
|
54
|
+
- How would this benefit the community?
|
|
55
|
+
- Are there similar implementations in other libraries that could be referenced?
|
|
56
|
+
- Would this require changes to existing APIs?
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Description
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
<!--- Describe your changes in detail -->
|
|
5
|
+
|
|
6
|
+
___
|
|
7
|
+
|
|
8
|
+
Related Issue
|
|
9
|
+
-------------
|
|
10
|
+
|
|
11
|
+
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
|
|
12
|
+
<!--- Please link to the issue here: -->
|
|
13
|
+
Fixes #
|
|
14
|
+
|
|
15
|
+
___
|
|
16
|
+
|
|
17
|
+
Motivation and Context
|
|
18
|
+
----------------------
|
|
19
|
+
|
|
20
|
+
<!--- Why is this change required? What problem does it solve? -->
|
|
21
|
+
<!--- If adding a new feature, please describe the motivation for it -->
|
|
22
|
+
|
|
23
|
+
___
|
|
24
|
+
|
|
25
|
+
Type of change
|
|
26
|
+
--------------
|
|
27
|
+
|
|
28
|
+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
|
|
29
|
+
|
|
30
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
31
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
32
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
|
33
|
+
- [ ] Documentation change
|
|
34
|
+
- [ ] Performance improvement
|
|
35
|
+
- [ ] Code cleanup or refactoring
|
|
36
|
+
|
|
37
|
+
___
|
|
38
|
+
|
|
39
|
+
How Has This Been Tested
|
|
40
|
+
-------------------------
|
|
41
|
+
|
|
42
|
+
<!--- Please describe in detail how you tested your changes. -->
|
|
43
|
+
<!--- Include details of your testing environment, and the tests you ran to -->
|
|
44
|
+
<!--- see how your change affects other areas of the code, etc. -->
|
|
45
|
+
|
|
46
|
+
___
|
|
47
|
+
|
|
48
|
+
Screenshots (if appropriate)
|
|
49
|
+
-----------------------------
|
|
50
|
+
|
|
51
|
+
___
|
|
52
|
+
|
|
53
|
+
Checklist
|
|
54
|
+
---------
|
|
55
|
+
|
|
56
|
+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
|
57
|
+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
|
58
|
+
|
|
59
|
+
- [ ] My code follows the code style of this project (Mypy, Ruff)
|
|
60
|
+
- [ ] I have added tests to cover my changes
|
|
61
|
+
- [ ] All new and existing tests passed
|
|
62
|
+
- [ ] My change requires a change to the documentation
|
|
63
|
+
- [ ] I have updated the documentation accordingly
|
|
64
|
+
- [ ] I have checked that my changes don't introduce any new warnings or errors
|
|
65
|
+
- [ ] I have updated the version number if necessary
|
|
66
|
+
- [ ] I have added any new dependencies to the appropriate requirements file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "github-actions"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
|
|
8
|
+
- package-ecosystem: "pip"
|
|
9
|
+
directory: "/"
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "weekly"
|
|
12
|
+
groups:
|
|
13
|
+
dependencies:
|
|
14
|
+
patterns:
|
|
15
|
+
- "*"
|
|
16
|
+
allow:
|
|
17
|
+
- dependency-type: "all"
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Version bump helper script for tornadoapi-guard.
|
|
3
|
+
|
|
4
|
+
Updates the version string across all files that reference it:
|
|
5
|
+
- pyproject.toml
|
|
6
|
+
- CHANGELOG.md
|
|
7
|
+
- docs/release-notes.md
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
python .github/scripts/bump_version.py <version>
|
|
11
|
+
make bump-version VERSION=x.y.z
|
|
12
|
+
|
|
13
|
+
No external dependencies required — stdlib only.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
import re
|
|
19
|
+
import sys
|
|
20
|
+
from collections.abc import Callable
|
|
21
|
+
from datetime import datetime, timezone
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
|
|
24
|
+
# Resolve project root relative to this script's location
|
|
25
|
+
PROJECT_ROOT = Path(__file__).resolve().parent.parent.parent
|
|
26
|
+
|
|
27
|
+
VERSION_PATTERN = re.compile(r"^\d+\.\d+\.\d+$")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def parse_semver(version: str) -> tuple[int, ...]:
|
|
31
|
+
"""Parse a semver string into a comparable tuple."""
|
|
32
|
+
return tuple(int(part) for part in version.split("."))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def update_pyproject_toml(version: str) -> bool:
|
|
36
|
+
"""Update version in pyproject.toml."""
|
|
37
|
+
path = PROJECT_ROOT / "pyproject.toml"
|
|
38
|
+
content = path.read_text()
|
|
39
|
+
pattern = re.compile(r'^(version\s*=\s*)"[^"]*"', re.MULTILINE)
|
|
40
|
+
match = pattern.search(content)
|
|
41
|
+
if not match:
|
|
42
|
+
print(" ERROR: Could not find version field in pyproject.toml")
|
|
43
|
+
return False
|
|
44
|
+
current = re.search(r'"([^"]*)"', match.group(0))
|
|
45
|
+
if current and current.group(1) == version:
|
|
46
|
+
print(f" pyproject.toml: already set to {version}")
|
|
47
|
+
return True
|
|
48
|
+
new_content = pattern.sub(f'{match.group(1)}"{version}"', content)
|
|
49
|
+
path.write_text(new_content)
|
|
50
|
+
print(f" pyproject.toml: updated to {version}")
|
|
51
|
+
return True
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _insert_changelog_scaffold(path: Path, version: str, label: str) -> bool:
|
|
55
|
+
"""Insert a version scaffold block into a changelog file."""
|
|
56
|
+
content = path.read_text()
|
|
57
|
+
today = datetime.now(tz=timezone.utc).strftime("%Y-%m-%d")
|
|
58
|
+
header = f"v{version} ({today})"
|
|
59
|
+
|
|
60
|
+
# Check if this version already has an entry
|
|
61
|
+
if f"v{version} (" in content:
|
|
62
|
+
print(f" {label}: v{version} entry already exists")
|
|
63
|
+
return True
|
|
64
|
+
|
|
65
|
+
scaffold = (
|
|
66
|
+
f"{header}\n"
|
|
67
|
+
f"-------------------\n"
|
|
68
|
+
f"\n"
|
|
69
|
+
f"TITLE (v{version})\n"
|
|
70
|
+
f"------------\n"
|
|
71
|
+
f"\n"
|
|
72
|
+
f"CONTENT\n"
|
|
73
|
+
f"\n"
|
|
74
|
+
f"___\n"
|
|
75
|
+
f"\n"
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
# Find the first existing version entry to insert before it
|
|
79
|
+
version_header_pattern = re.compile(r"^v\d+\.\d+\.\d+ \(", re.MULTILINE)
|
|
80
|
+
match = version_header_pattern.search(content)
|
|
81
|
+
if match:
|
|
82
|
+
insert_pos = match.start()
|
|
83
|
+
new_content = content[:insert_pos] + scaffold + content[insert_pos:]
|
|
84
|
+
else:
|
|
85
|
+
# No existing entries — append at end
|
|
86
|
+
new_content = content.rstrip() + "\n\n" + scaffold
|
|
87
|
+
|
|
88
|
+
path.write_text(new_content)
|
|
89
|
+
print(f" {label}: added v{version} scaffold")
|
|
90
|
+
return True
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def update_changelogs(version: str) -> bool:
|
|
94
|
+
"""Update CHANGELOG.md and docs/release-notes.md."""
|
|
95
|
+
changelog = PROJECT_ROOT / "CHANGELOG.md"
|
|
96
|
+
release_notes = PROJECT_ROOT / "docs" / "release-notes.md"
|
|
97
|
+
|
|
98
|
+
ok = True
|
|
99
|
+
ok = _insert_changelog_scaffold(changelog, version, "CHANGELOG.md") and ok
|
|
100
|
+
if release_notes.exists():
|
|
101
|
+
ok = (
|
|
102
|
+
_insert_changelog_scaffold(release_notes, version, "docs/release-notes.md")
|
|
103
|
+
and ok
|
|
104
|
+
)
|
|
105
|
+
return ok
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def main() -> int:
|
|
109
|
+
if len(sys.argv) != 2:
|
|
110
|
+
print("Usage: bump_version.py <version>")
|
|
111
|
+
print(" version must be in X.Y.Z format")
|
|
112
|
+
return 1
|
|
113
|
+
|
|
114
|
+
version = sys.argv[1]
|
|
115
|
+
|
|
116
|
+
if not VERSION_PATTERN.match(version):
|
|
117
|
+
print(f"Error: '{version}' is not a valid version. Expected format: X.Y.Z")
|
|
118
|
+
return 1
|
|
119
|
+
|
|
120
|
+
print(f"Bumping version to {version}...\n")
|
|
121
|
+
|
|
122
|
+
updaters: list[tuple[str, Callable[[str], bool]]] = [
|
|
123
|
+
("pyproject.toml", update_pyproject_toml),
|
|
124
|
+
("changelogs", update_changelogs),
|
|
125
|
+
]
|
|
126
|
+
|
|
127
|
+
all_ok = True
|
|
128
|
+
for name, updater in updaters:
|
|
129
|
+
try:
|
|
130
|
+
if not updater(version):
|
|
131
|
+
print(f"\n FAILED: {name}")
|
|
132
|
+
all_ok = False
|
|
133
|
+
except Exception as e:
|
|
134
|
+
print(f"\n ERROR updating {name}: {e}")
|
|
135
|
+
all_ok = False
|
|
136
|
+
|
|
137
|
+
print()
|
|
138
|
+
if all_ok:
|
|
139
|
+
print("Version bump complete.")
|
|
140
|
+
else:
|
|
141
|
+
print("Version bump completed with errors.")
|
|
142
|
+
return 0 if all_ok else 1
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
if __name__ == "__main__":
|
|
146
|
+
sys.exit(main())
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
paths:
|
|
8
|
+
- 'compose.yml'
|
|
9
|
+
- 'data/**'
|
|
10
|
+
- 'Dockerfile'
|
|
11
|
+
- 'examples/**'
|
|
12
|
+
- 'tornadoapi_guard/**'
|
|
13
|
+
- 'mypy.ini'
|
|
14
|
+
- '.pre-commit-config.yaml'
|
|
15
|
+
- 'pyproject.toml'
|
|
16
|
+
- 'pytest.ini'
|
|
17
|
+
- 'setup.py'
|
|
18
|
+
- 'tests/**'
|
|
19
|
+
pull_request_target:
|
|
20
|
+
branches:
|
|
21
|
+
- master
|
|
22
|
+
paths:
|
|
23
|
+
- 'compose.yml'
|
|
24
|
+
- 'data/**'
|
|
25
|
+
- 'Dockerfile'
|
|
26
|
+
- 'examples/**'
|
|
27
|
+
- 'tornadoapi_guard/**'
|
|
28
|
+
- 'mypy.ini'
|
|
29
|
+
- '.pre-commit-config.yaml'
|
|
30
|
+
- 'pyproject.toml'
|
|
31
|
+
- 'pytest.ini'
|
|
32
|
+
- 'setup.py'
|
|
33
|
+
- 'tests/**'
|
|
34
|
+
workflow_dispatch:
|
|
35
|
+
|
|
36
|
+
jobs:
|
|
37
|
+
pre-commit:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v6
|
|
41
|
+
- uses: actions/setup-python@v6
|
|
42
|
+
with:
|
|
43
|
+
python-version: '3.10'
|
|
44
|
+
- run: pip install uv
|
|
45
|
+
- run: uv sync --extra dev
|
|
46
|
+
- run: uv run pre-commit run --all-files
|
|
47
|
+
|
|
48
|
+
test:
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
|
|
51
|
+
services:
|
|
52
|
+
redis:
|
|
53
|
+
image: redis
|
|
54
|
+
ports:
|
|
55
|
+
- 6379:6379
|
|
56
|
+
options: >-
|
|
57
|
+
--health-cmd "redis-cli ping"
|
|
58
|
+
--health-interval 10s
|
|
59
|
+
--health-timeout 5s
|
|
60
|
+
--health-retries 5
|
|
61
|
+
|
|
62
|
+
permissions:
|
|
63
|
+
pull-requests: write
|
|
64
|
+
|
|
65
|
+
strategy:
|
|
66
|
+
matrix:
|
|
67
|
+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
|
|
68
|
+
|
|
69
|
+
steps:
|
|
70
|
+
- name: Checkout code
|
|
71
|
+
uses: actions/checkout@v6
|
|
72
|
+
|
|
73
|
+
- name: Send Initial Slack Message
|
|
74
|
+
id: send_initial_slack_ci
|
|
75
|
+
uses: rennf93/good-comms@master
|
|
76
|
+
with:
|
|
77
|
+
SLACK_WEBHOOK: '${{ secrets.SLACK_WEBHOOK }}'
|
|
78
|
+
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
|
|
79
|
+
STATUS: 'Started'
|
|
80
|
+
CHANNEL_ID: '${{ secrets.SLACK_CHANNEL }}'
|
|
81
|
+
AUTHOR_NAME: 'TornadoAPI Guard - CI & Tests - Py${{ matrix.python-version }}'
|
|
82
|
+
AUTHOR_LINK: 'https://github.com/rennf93/tornadoapi-guard'
|
|
83
|
+
AUTHOR_ICON: ':test_tube:'
|
|
84
|
+
TITLE: 'CI & Tests Started - Py${{ matrix.python-version }}'
|
|
85
|
+
TITLE_LINK: 'https://github.com/rennf93/tornadoapi-guard/actions'
|
|
86
|
+
MESSAGE: |
|
|
87
|
+
.
|
|
88
|
+
*CI & TESTS TRIGGERED!*
|
|
89
|
+
|
|
90
|
+
.
|
|
91
|
+
Matrix:
|
|
92
|
+
Python: ${{ matrix.python-version }}
|
|
93
|
+
|
|
94
|
+
Docs version:
|
|
95
|
+
${{ secrets.DOCS_VERSION }}
|
|
96
|
+
|
|
97
|
+
Commit:
|
|
98
|
+
${{ github.event.head_commit.message }}
|
|
99
|
+
.
|
|
100
|
+
COLOR: warning
|
|
101
|
+
|
|
102
|
+
- name: Set up Python
|
|
103
|
+
uses: actions/setup-python@v6
|
|
104
|
+
with:
|
|
105
|
+
python-version: ${{ matrix.python-version }}
|
|
106
|
+
|
|
107
|
+
- name: Install uv
|
|
108
|
+
run: |
|
|
109
|
+
pip install uv
|
|
110
|
+
|
|
111
|
+
- name: Install dependencies
|
|
112
|
+
run: |
|
|
113
|
+
uv sync --extra dev
|
|
114
|
+
|
|
115
|
+
- name: Run tests
|
|
116
|
+
run: |
|
|
117
|
+
IPINFO_TOKEN='${{ secrets.IPINFO_TOKEN }}' REDIS_URL='redis://localhost:6379' REDIS_PREFIX='test:tornadoapi_guard:' uv run pytest -v --cov=tornadoapi_guard
|
|
118
|
+
|
|
119
|
+
- name: Notify Success on Slack Channel
|
|
120
|
+
uses: rennf93/good-comms@master
|
|
121
|
+
with:
|
|
122
|
+
SLACK_WEBHOOK: '${{ secrets.SLACK_WEBHOOK }}'
|
|
123
|
+
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
|
|
124
|
+
STATUS: 'Success'
|
|
125
|
+
CHANNEL_ID: '${{ secrets.SLACK_CHANNEL }}'
|
|
126
|
+
AUTHOR_NAME: 'TornadoAPI Guard - CI & Tests - Py${{ matrix.python-version }}'
|
|
127
|
+
AUTHOR_LINK: 'https://github.com/rennf93/tornadoapi-guard'
|
|
128
|
+
AUTHOR_ICON: ':gem:'
|
|
129
|
+
TITLE: 'CI & Tests Successful - Py${{ matrix.python-version }}'
|
|
130
|
+
TITLE_LINK: 'https://github.com/rennf93/tornadoapi-guard/actions'
|
|
131
|
+
MESSAGE: |
|
|
132
|
+
.
|
|
133
|
+
Matrix:
|
|
134
|
+
Python: ${{ matrix.python-version }}
|
|
135
|
+
|
|
136
|
+
Docs version:
|
|
137
|
+
${{ secrets.DOCS_VERSION }}
|
|
138
|
+
|
|
139
|
+
Commit message:
|
|
140
|
+
${{ github.event.head_commit.message }}
|
|
141
|
+
|
|
142
|
+
Commit URL:
|
|
143
|
+
${{ github.event.head_commit.url }}
|
|
144
|
+
.
|
|
145
|
+
COLOR: good
|
|
146
|
+
SLACK_THREAD_TS: ${{ steps.send_initial_slack_ci.outputs.SLACK_THREAD_TS }}
|
|
147
|
+
|
|
148
|
+
- name: Send Failure Notification to Slack
|
|
149
|
+
if: failure()
|
|
150
|
+
uses: rennf93/good-comms@master
|
|
151
|
+
with:
|
|
152
|
+
SLACK_WEBHOOK: '${{ secrets.SLACK_WEBHOOK }}'
|
|
153
|
+
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
|
|
154
|
+
STATUS: 'Failed'
|
|
155
|
+
CHANNEL_ID: '${{ secrets.SLACK_CHANNEL }}'
|
|
156
|
+
AUTHOR_NAME: 'TornadoAPI Guard - CI & Tests - Py${{ matrix.python-version }}'
|
|
157
|
+
AUTHOR_LINK: 'https://github.com/rennf93/tornadoapi-guard'
|
|
158
|
+
AUTHOR_ICON: ':skull:'
|
|
159
|
+
TITLE: 'CI & Tests Failed - Py${{ matrix.python-version }}'
|
|
160
|
+
TITLE_LINK: 'https://github.com/rennf93/tornadoapi-guard/actions'
|
|
161
|
+
MESSAGE: |
|
|
162
|
+
.
|
|
163
|
+
Matrix:
|
|
164
|
+
Python: ${{ matrix.python-version }}
|
|
165
|
+
|
|
166
|
+
Docs version:
|
|
167
|
+
${{ secrets.DOCS_VERSION }}
|
|
168
|
+
|
|
169
|
+
CI & Tests failed for commit:
|
|
170
|
+
${{ github.event.head_commit.message }}
|
|
171
|
+
|
|
172
|
+
Commit URL:
|
|
173
|
+
${{ github.event.head_commit.url }}
|
|
174
|
+
|
|
175
|
+
Please check the logs for more details.
|
|
176
|
+
.
|
|
177
|
+
COLOR: danger
|
|
178
|
+
SLACK_THREAD_TS: ${{ steps.send_initial_slack_ci.outputs.SLACK_THREAD_TS }}
|