Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/ByronWilliamsCPA/cookiecutter-python-template",
"commit": "ed9f899a0397975176940534242f30c2ed4be152",
"commit": "53a8c49cf273409f1471c8c4363f0cf96f865336",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down Expand Up @@ -104,7 +104,7 @@
"docs_url": "https://python-libs.readthedocs.io",
"pypi_package_name": "python-libs",
"_template": "https://github.com/ByronWilliamsCPA/cookiecutter-python-template",
"_commit": "ed9f899a0397975176940534242f30c2ed4be152"
"_commit": "53a8c49cf273409f1471c8c4363f0cf96f865336"
}
},
"directory": null
Expand Down
21 changes: 21 additions & 0 deletions .darglint
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[darglint]
# Google-style docstrings (matches ruff pydocstyle convention)
docstring_style = google

# Strictness levels: short, long, full
# - short: Only documented items must exist in signature
# - long: All parameters must be documented (recommended)
# - full: Types in docstring must match annotations
strictness = long

# Ignore these error codes
# DAR101: Missing parameter(s) in Docstring
# DAR201: Missing "Returns" in Docstring
# DAR202: Excess "Returns" in Docstring (documented but not returned)
# DAR301: Missing "Yields" in Docstring
# DAR401: Missing exception(s) in Raises section
# DAR402: Excess exception(s) in Raises section (documented but not raised directly)
ignore = DAR101,DAR201,DAR202,DAR301,DAR401,DAR402

# Ignore in these directories (tests, scripts, benchmarks, tools)
ignore_regex = ^(tests|scripts|benchmarks|tools|\.claude)/.*$
8 changes: 0 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ updates:
day: "monday"
time: "03:00"
open-pull-requests-limit: 5
reviewers:
- "ByronWilliamsCPA"
assignees:
- "ByronWilliamsCPA"
commit-message:
Expand All @@ -18,10 +16,6 @@ updates:
include: "scope"
pull-request-branch-name:
separator: "/"
ignore:
# Add packages to ignore if needed
# - dependency-name: "numpy"
# versions: ["0.x"]
allow:
- dependency-type: "all"

Expand All @@ -33,8 +27,6 @@ updates:
day: "monday"
time: "04:00"
open-pull-requests-limit: 5
reviewers:
- "ByronWilliamsCPA"
assignees:
- "ByronWilliamsCPA"
commit-message:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ jobs:
cloudflare-auth: ${{ steps.filter.outputs.cloudflare-auth }}
gcs-utilities: ${{ steps.filter.outputs.gcs-utilities }}
shared: ${{ steps.filter.outputs.shared }}
any-package: ${{ steps.filter.outputs.cloudflare-auth == 'true' || steps.filter.outputs.gcs-utilities == 'true' || steps.filter.outputs.shared == 'true' }}
any-package: >-
${{ steps.filter.outputs.cloudflare-auth == 'true' ||
steps.filter.outputs.gcs-utilities == 'true' ||
steps.filter.outputs.shared == 'true' }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -87,6 +90,8 @@ jobs:
--cov=packages/cloudflare-auth/src/cloudflare_auth \
--cov-report=xml:coverage-cloudflare-auth.xml \
--cov-report=term-missing \
--no-cov-on-fail \
--cov-fail-under=0 \
Comment on lines +93 to +94
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, explore the repository structure
git ls-files | head -20

Repository: ByronWilliamsCPA/python-libs

Length of output: 766


🏁 Script executed:

# Examine the workflow file at lines 93-94 and surrounding context
cat -n .github/workflows/ci.yml | sed -n '85,150p'

Repository: ByronWilliamsCPA/python-libs

Length of output: 2711


🏁 Script executed:

# Check pyproject.toml for coverage configuration
cat -n pyproject.toml | head -100

Repository: ByronWilliamsCPA/python-libs

Length of output: 4755


🏁 Script executed:

# Check for pytest-cov in dependencies
rg -n "pytest-cov" --type toml

Repository: ByronWilliamsCPA/python-libs

Length of output: 313


🏁 Script executed:

# Check for pytest configuration and coverage settings
cat -n pytest.ini 2>/dev/null || cat -n setup.cfg 2>/dev/null || echo "No pytest.ini or setup.cfg found"

Repository: ByronWilliamsCPA/python-libs

Length of output: 104


🏁 Script executed:

# Try to get pytest-cov version info from requirements or lock files
fd -e "requirements*.txt" -e "poetry.lock" -e "uv.lock" -e "setup.py" | head -5

Repository: ByronWilliamsCPA/python-libs

Length of output: 54


🏁 Script executed:

# Get the full workflow file to see all test jobs
cat .github/workflows/ci.yml

Repository: ByronWilliamsCPA/python-libs

Length of output: 6791


🏁 Script executed:

# Search for any root-level test job or coverage threshold of 80
rg -n "cov-fail-under" .github/workflows/ci.yml

Repository: ByronWilliamsCPA/python-libs

Length of output: 144


🌐 Web query:

pytest-cov --no-cov-on-fail flag documentation

💡 Result:

--no-cov-on-fail is a pytest-cov CLI flag that prevents printing/generating the coverage report when the test run fails. Default: False (coverage report is shown unless you pass the flag). See the pytest-cov options reference. [1][2]

Example: pytest --cov=myproj --cov-report=term --no-cov-on-fail

Sources:

  • pytest-cov configuration/options reference. [1]
  • pytest-cov project README/GitHub. [2]

Critical issue: Missing root-level coverage threshold enforcement

The --no-cov-on-fail flag is valid and supported by pytest-cov>=4.1.0, and --cov-fail-under=0 correctly allows package tests to pass without coverage requirements. However, the workflow lacks the complementary root-level or workspace-level test job that enforces the 80% coverage threshold. Per project learnings, a minimum 80% coverage requirement must be enforced by the CI/CD pipeline, but the current workflow has no such enforcement anywhere—package jobs use --cov-fail-under=0 and there is no root test job to maintain coverage discipline.

Add a root-level test job that runs with --cov-fail-under=80 to preserve overall coverage standards, or document why the 80% enforcement has been removed.

🤖 Prompt for AI Agents
In .github/workflows/ci.yml around lines 93-94, the workflow uses package-level
pytest invocations with --cov-fail-under=0 and lacks a root/workspace-level test
job enforcing the required 80% coverage; add a new top-level CI job (e.g.,
"root-tests" or "coverage-enforcement") that runs on the same triggers
(push/PR), executes tests across the whole repo or aggregates package coverage,
and invokes pytest with --cov-fail-under=80 (optionally keeping
--no-cov-on-fail) so the pipeline fails if overall coverage is below 80%, or
alternatively add a clear documented comment in the workflow explaining why the
80% enforcement was intentionally removed.

-v

- name: Run type checker
Expand Down Expand Up @@ -133,6 +138,8 @@ jobs:
--cov=packages/gcs-utilities/src/gcs_utilities \
--cov-report=xml:coverage-gcs-utilities.xml \
--cov-report=term-missing \
--no-cov-on-fail \
--cov-fail-under=0 \
-v

- name: Run type checker
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# - Quality gate enforcement
# - Pull request decoration
#
# SonarCloud Dashboard: https://sonarcloud.io/dashboard?id=ByronWilliamsCPA_python_libs
# SonarCloud Dashboard: https://sonarcloud.io/dashboard?id=ByronWilliamsCPA_python-libs
# Documentation: https://docs.sonarsource.com/sonarqube-cloud/
#
# Note: This workflow requires SONAR_TOKEN secret to be configured.
Expand Down Expand Up @@ -106,17 +106,31 @@ jobs:
fi

- name: SonarCloud Scan
id: sonar-scan
uses: SonarSource/sonarqube-scan-action@884b79409bbd464b2a59edc326a4b77dc56b2195 # v4.0.0
continue-on-error: true # Don't fail if project not yet configured in SonarCloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for PR decoration
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # SonarCloud authentication
with:
args: >
-Dsonar.organization=ByronWilliamsCPA
-Dsonar.projectKey=ByronWilliamsCPA_python_libs
-Dsonar.projectKey=ByronWilliamsCPA_python-libs
-Dsonar.python.version=3.12

- name: SonarCloud Setup Notice
if: steps.sonar-scan.outcome == 'failure'
run: |
echo "::warning::SonarCloud scan failed. This may indicate the project needs to be created."
echo ""
echo "To set up SonarCloud:"
echo "1. Go to https://sonarcloud.io and sign in with GitHub"
echo "2. Import the ByronWilliamsCPA/python-libs repository"
echo "3. The project key should be: ByronWilliamsCPA_python-libs"
echo "4. Re-run this workflow after project creation"

- name: Check Quality Gate
if: steps.sonar-scan.outcome == 'success'
uses: sonarsource/sonarqube-quality-gate-action@master
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, locate and read the sonarcloud.yml file around line 134
find . -path "./.github/workflows/sonarcloud.yml" -type f | head -1 | xargs -I {} sh -c 'wc -l {} && echo "---" && sed -n "130,140p" {} | cat -n'

Repository: ByronWilliamsCPA/python-libs

Length of output: 603


🏁 Script executed:

# Also check all actions in the workflow to see pinning patterns
find . -path "./.github/workflows/sonarcloud.yml" -type f | xargs -I {} grep -n "uses:" {}

Repository: ByronWilliamsCPA/python-libs

Length of output: 504


🌐 Web query:

sonarsource/sonarqube-quality-gate-action latest version releases github

💡 Result:

Latest release: v1.2.0 — published June 5, 2025. [1][2]

Sources:
[1] GitHub Releases for SonarSource/sonarqube-quality-gate-action.
[2] SonarSource Community announcement confirming v1.2.0.


Pin the SonarCloud quality gate action to a specific version.

The action currently references @master, which is inconsistent with the security pattern used for other actions in this workflow (all use pinned commit hashes with version tags). Master branch references are not reproducible and leave the workflow vulnerable to upstream changes. Update to the latest available version.

-        uses: sonarsource/sonarqube-quality-gate-action@master
+        uses: sonarsource/sonarqube-quality-gate-action@v1.2.0
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: sonarsource/sonarqube-quality-gate-action@master
uses: sonarsource/sonarqube-quality-gate-action@v1.2.0
🤖 Prompt for AI Agents
.github/workflows/sonarcloud.yml around line 134: the workflow uses the
SonarCloud quality gate action pinned to @master which is non-reproducible and
risky; update the action reference to a specific released version or commit SHA
(replace the @master tag with the latest stable version tag or exact commit hash
used elsewhere in the file) to ensure reproducible, secure runs and keep it
consistent with the other pinned actions in this workflow.

timeout-minutes: 5
env:
Expand All @@ -128,7 +142,7 @@ jobs:
run: |
echo "### SonarCloud Quality Gate" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "View detailed results: https://sonarcloud.io/dashboard?id=ByronWilliamsCPA_python_libs" >> $GITHUB_STEP_SUMMARY
echo "View detailed results: https://sonarcloud.io/dashboard?id=ByronWilliamsCPA_python-libs" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Metrics analyzed:**" >> $GITHUB_STEP_SUMMARY
echo "- Code Quality (bugs, code smells, maintainability)" >> $GITHUB_STEP_SUMMARY
Expand Down
7 changes: 5 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ repos:
name: TruffleHog Secret Scanner
description: Detect secrets in your data before committing
entry: >-
bash -c 'command -v trufflehog >/dev/null 2>&1 && trufflehog git file://. --since-commit HEAD --results=verified,unknown --fail || echo "TruffleHog not installed - skipping"'
bash -c 'command -v trufflehog >/dev/null 2>&1 &&
trufflehog git file://. --since-commit HEAD --results=verified,unknown --fail ||
echo "TruffleHog not installed - skipping"'
language: system
pass_filenames: false
stages: [pre-commit]
Expand Down Expand Up @@ -144,7 +146,8 @@ repos:
- id: qlty-check
name: Qlty Code Quality Check (changed files)
entry: >-
bash -c "command -v qlty >/dev/null 2>&1 && qlty check --filter=diff || echo 'Qlty not installed - skipping (install: curl https://qlty.sh | bash)'"
bash -c "command -v qlty >/dev/null 2>&1 && qlty check --filter=diff ||
echo 'Qlty not installed - skipping (install: curl https://qlty.sh | bash)'"
language: system
types: [file]
pass_filenames: false
Expand Down
23 changes: 22 additions & 1 deletion .qlty/qlty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
config_version = "0"

# File patterns to completely exclude from all analysis
# Note: gemini_image/generator.py has intentional complexity for comprehensive
# API response handling - complexity warnings are documented in the file header
exclude_patterns = [
"*_min.*",
"*-min.*",
Expand Down Expand Up @@ -71,6 +73,17 @@ default = true
# Mode: comment (add PR comments) vs block (fail CI)
mode = "comment"

# Ignore complexity warnings for files with documented intentional complexity
[[smells.ignore]]
rules = [
"function-complexity",
"function-parameters",
"nested-control-flow",
]
file_patterns = [
"**/gemini_image/generator.py",
]

# Boolean logic complexity
[smells.boolean_logic]
enabled = true
Expand Down Expand Up @@ -127,12 +140,20 @@ name = "ruff"
drivers = ["lint"]

# Python security with Bandit (comment mode - subprocess use is intentional for validation)
# Note: B101 (assert) warnings in tests are expected and run in comment mode
# Note: Bandit configured in pyproject.toml to skip tests directory
[[plugin]]
name = "bandit"
mode = "comment"

# Ignore B101 (assert_used) in test files - pytest uses assert statements
[[plugin.ignore]]
rule = "bandit:B101"
file_patterns = [
"**/tests/**",
"**/test_*.py",
"**/*_test.py",
]

# Shell script linting (comment mode - script styling preferences)
[[plugin]]
name = "shellcheck"
Expand Down
1 change: 1 addition & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ path = [
".cruft.json", # Cruft template tracking
".env.example", # Environment example file
".markdownlint.json", # Markdownlint configuration
".darglint", # Darglint docstring linter configuration
".mutmut_config", # Mutation testing configuration
".prettierrc", # Prettier configuration
".shellcheckrc", # ShellCheck configuration
Expand Down
32 changes: 16 additions & 16 deletions docs/ADRs/adr-template.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
---
schema_type: adr
schema_type: common
title: "ADR-NNN: Short Descriptive Title of the Decision"
description: "Brief one-sentence description of what decision this ADR documents"
tags:
- architecture
- decision
- your-topic
- relevant-area
status: proposed
owner: "Your Team Role or Name"
- adr
- decisions
status: draft
owner: core-maintainer
authors:
- name: "Author Name"
email: "author@example.com"
purpose: "Document the decision to [choose X approach] for [problem area], with rationale for alternatives considered"
purpose: "Document the decision to [choose X approach] for [problem area], with rationale for alternatives considered."
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Line length exceeds 120 character limit for YAML configuration.

Line 13 contains a purpose string that exceeds the 120 character line length guideline for YAML files (approximately 130 characters). Consider refactoring to a multi-line YAML string for compliance.

Apply this refactor:

-purpose: "Document the decision to [choose X approach] for [problem area], with rationale for alternatives considered."
+purpose: |
+  Document the decision to [choose X approach] for [problem area], with
+  rationale for alternatives considered.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
purpose: "Document the decision to [choose X approach] for [problem area], with rationale for alternatives considered."
purpose: |
Document the decision to [choose X approach] for [problem area], with
rationale for alternatives considered.
🤖 Prompt for AI Agents
In docs/ADRs/adr-template.md around line 13, the purpose value is a single
quoted string exceeding the 120-char YAML line-length rule; replace the long
inline quoted string with a YAML folded block scalar (">") or literal block
("|") and break the sentence across wrapped lines (properly indented under the
key) so the resulting YAML value remains the same but no single line exceeds 120
characters; remove the surrounding quotes when using the block scalar and
validate the YAML after the change.

---

> **Status**: `proposed` → Change to `published` once approved, or `deprecated`/`superseded` if no longer valid
Expand Down Expand Up @@ -258,20 +256,22 @@ How will we validate that this decision achieved its goals?

### Related ADRs

- [ADR-001: Previous Decision](0001-previous-decision.md) - Related context
- [ADR-005: Future Decision](0005-future-decision.md) - Builds on this ADR
<!-- Replace with actual ADR links when available -->
- ADR-NNN: Previous Decision - Related context
- ADR-NNN: Future Decision - Builds on this ADR

### External References

- [Technology/Framework Documentation](https://example.com/docs)
- [Research Paper or Article](https://example.com/research)
- [Related GitHub Issues](https://github.com/yourusername/yourrepo/issues/123)
- Technology/Framework Documentation: `https://example.com/docs`
- Research Paper or Article: `https://example.com/research`
- Related GitHub Issues: `https://github.com/org/repo/issues/NNN`

### Implementation References

- [Implementation File](../../src/component.py)
- [Test Coverage](../../tests/test_component.py)
- [Configuration](../../config.yaml)
<!-- Replace with actual file paths when implementing -->
- Implementation File: `src/your_component.py`
- Test Coverage: `tests/test_your_component.py`
- Configuration: `config.yaml`

## Questions & Discussion

Expand Down
4 changes: 4 additions & 0 deletions docs/_data/tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ allowed:
- framework
- utilities
- helpers
- project
- strategy
- feedback
- template

# Development & Tooling
- testing
Expand Down
7 changes: 5 additions & 2 deletions docs/planning/adr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ tags:
- planning
- architecture
- decisions
component: Context
source: "project-planning skill"
---

This directory contains Architecture Decision Records (ADRs) for Python Libs.
Expand Down Expand Up @@ -83,5 +85,6 @@ See `.claude/skills/project-planning/templates/adr-template.md` for the full tem

## More Information

- [Document Guide](../.claude/skills/project-planning/reference/document-guide.md)
- [Prompting Patterns](../.claude/skills/project-planning/reference/prompting-patterns.md)
<!-- Reference files are in the .claude/skills directory at the project root -->
- Document Guide: `.claude/skills/project-planning/reference/document-guide.md`
- Prompting Patterns: `.claude/skills/project-planning/reference/prompting-patterns.md`
20 changes: 11 additions & 9 deletions docs/planning/project-plan-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ tags:
- project
- strategy
status: published
owner: "core-maintainer"
owner: core-maintainer
authors:
- name: "Byron Williams"
purpose: "Document the complete implementation roadmap for Python Libs with detailed phases, milestones, and technical strategy"
component: "Strategy"
purpose: "Document the complete implementation roadmap for Python Libs with detailed phases, milestones, and technical strategy."
component: Strategy
source: "project-planning skill"
---

**Project**: Python Libs
Expand Down Expand Up @@ -99,19 +100,19 @@ Python Libs is a [brief description of what the project does]. This document out

### Module Responsibilities

**[Module 1 Name](relative/path/to/module.py)**
**Module 1 Name** (`src/module1.py`)

- Core functionality description
- Key features and capabilities
- Dependencies and integration points

**[Module 2 Name](relative/path/to/module.py)**
**Module 2 Name** (`src/module2.py`)

- Core functionality description
- Key features and capabilities
- Dependencies and integration points

**[Module 3 Name](relative/path/to/module.py)**
**Module 3 Name** (`src/module3.py`)

- Core functionality description
- Key features and capabilities
Expand Down Expand Up @@ -531,9 +532,10 @@ git checkout -b feat/phase-1-core

## Related Documentation

- **[CONTRIBUTING.md](../CONTRIBUTING.md)**: How to contribute to the project
- **[ADRs/README.md](../ADRs/README.md)**: Architecture Decision Records
- **[README.md](../../README.md)**: Project overview
<!-- Update these paths to match your project structure -->
- **CONTRIBUTING.md**: How to contribute to the project
- **ADRs/README.md**: Architecture Decision Records
- **README.md**: Project overview
- **[Code of Conduct](https://github.com/ByronWilliamsCPA/.github/blob/main/CODE_OF_CONDUCT.md)**: Community guidelines (org-level)

---
Expand Down
7 changes: 4 additions & 3 deletions packages/cloudflare-auth/src/cloudflare_auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
from cloudflare_auth.middleware_enhanced import (
CloudflareAuthMiddlewareEnhanced,
require_admin,
require_tier,

Check warning on line 46 in packages/cloudflare-auth/src/cloudflare_auth/__init__.py

View workflow job for this annotation

GitHub Actions / Test cloudflare-auth (Python 3.11)

Type of "require_tier" is partially unknown   Type of "require_tier" is "(minimum_tier: UserTier) -> ((...) -> Unknown)" (reportUnknownVariableType)

Check warning on line 46 in packages/cloudflare-auth/src/cloudflare_auth/__init__.py

View workflow job for this annotation

GitHub Actions / Test cloudflare-auth (Python 3.13)

Type of "require_tier" is partially unknown   Type of "require_tier" is "(minimum_tier: UserTier) -> ((...) -> Unknown)" (reportUnknownVariableType)

Check warning on line 46 in packages/cloudflare-auth/src/cloudflare_auth/__init__.py

View workflow job for this annotation

GitHub Actions / Test cloudflare-auth (Python 3.10)

Type of "require_tier" is partially unknown   Type of "require_tier" is "(minimum_tier: UserTier) -> ((...) -> Unknown)" (reportUnknownVariableType)

Check warning on line 46 in packages/cloudflare-auth/src/cloudflare_auth/__init__.py

View workflow job for this annotation

GitHub Actions / Test cloudflare-auth (Python 3.12)

Type of "require_tier" is partially unknown   Type of "require_tier" is "(minimum_tier: UserTier) -> ((...) -> Unknown)" (reportUnknownVariableType)
setup_cloudflare_auth_enhanced,
)
from cloudflare_auth.models import CloudflareJWTClaims, CloudflareUser
from cloudflare_auth.security_helpers import (
AuditLogger,
SecurityHeadersMiddleware,
create_session_cleanup_task,

Check warning on line 53 in packages/cloudflare-auth/src/cloudflare_auth/__init__.py

View workflow job for this annotation

GitHub Actions / Test cloudflare-auth (Python 3.11)

Type of "create_session_cleanup_task" is partially unknown   Type of "create_session_cleanup_task" is "(session_manager: SimpleSessionManager, cleanup_interval: int = 300) -> Task[Unknown]" (reportUnknownVariableType)

Check warning on line 53 in packages/cloudflare-auth/src/cloudflare_auth/__init__.py

View workflow job for this annotation

GitHub Actions / Test cloudflare-auth (Python 3.13)

Type of "create_session_cleanup_task" is partially unknown   Type of "create_session_cleanup_task" is "(session_manager: SimpleSessionManager, cleanup_interval: int = 300) -> Task[Unknown]" (reportUnknownVariableType)

Check warning on line 53 in packages/cloudflare-auth/src/cloudflare_auth/__init__.py

View workflow job for this annotation

GitHub Actions / Test cloudflare-auth (Python 3.10)

Type of "create_session_cleanup_task" is partially unknown   Type of "create_session_cleanup_task" is "(session_manager: SimpleSessionManager, cleanup_interval: int = 300) -> Task[Unknown]" (reportUnknownVariableType)

Check warning on line 53 in packages/cloudflare-auth/src/cloudflare_auth/__init__.py

View workflow job for this annotation

GitHub Actions / Test cloudflare-auth (Python 3.12)

Type of "create_session_cleanup_task" is partially unknown   Type of "create_session_cleanup_task" is "(session_manager: SimpleSessionManager, cleanup_interval: int = 300) -> Task[Unknown]" (reportUnknownVariableType)
get_audit_logger,
)
from cloudflare_auth.sessions import SimpleSessionManager
Expand All @@ -63,13 +63,14 @@
)

# Optional Redis session manager (requires redis package)
_redis_available: bool
try:
from cloudflare_auth.redis_sessions import RedisSessionManager

_REDIS_AVAILABLE = True
_redis_available = True
except ImportError:
RedisSessionManager = None # type: ignore[assignment]
_REDIS_AVAILABLE = False
_redis_available = False

__all__ = [
"AuditLogger",
Expand Down Expand Up @@ -101,5 +102,5 @@
]

# Add RedisSessionManager if available
if _REDIS_AVAILABLE and RedisSessionManager is not None:
if _redis_available:
__all__.append("RedisSessionManager")
Loading
Loading