Skip to content

Commit 970408d

Browse files
authored
Merge pull request #91 from DataFog/feature/implement-weekly-release-plan
feat(release): implement weekly release plan infrastructure
2 parents a9eaffd + a30dd74 commit 970408d

File tree

12 files changed

+912
-45
lines changed

12 files changed

+912
-45
lines changed

.bumpversion.cfg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[bumpversion]
2+
current_version = 4.1.1
3+
commit = True
4+
tag = True
5+
tag_name = v{new_version}
6+
message = Bump version: {current_version} → {new_version}
7+
8+
[bumpversion:file:datafog/__about__.py]
9+
search = __version__ = "{current_version}"
10+
replace = __version__ = "{new_version}"
11+
12+
[bumpversion:file:setup.py]
13+
search = version="{current_version}"
14+
replace = version="{new_version}"

.github/workflows/ci.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ jobs:
3838
sudo apt-get update
3939
sudo apt-get install -y tesseract-ocr libtesseract-dev
4040
41-
- name: Install dependencies
41+
- name: Install all dependencies
4242
run: |
4343
python -m pip install --upgrade pip
44-
pip install -e ".[nlp,ocr]"
44+
pip install -e ".[all]"
4545
pip install -r requirements-dev.txt
4646
47-
- name: Run tests
47+
- name: Run full test suite
4848
run: |
4949
python -m pytest tests/ --cov=datafog --cov-report=xml --cov-report=term
5050
@@ -54,6 +54,31 @@ jobs:
5454
file: ./coverage.xml
5555
token: ${{ secrets.CODECOV_TOKEN }}
5656

57+
test-core:
58+
runs-on: ubuntu-latest
59+
strategy:
60+
matrix:
61+
python-version: ["3.10", "3.11", "3.12"]
62+
steps:
63+
- uses: actions/checkout@v4
64+
- name: Set up Python ${{ matrix.python-version }}
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version: ${{ matrix.python-version }}
68+
cache: "pip"
69+
70+
- name: Install core dependencies only
71+
run: |
72+
python -m pip install --upgrade pip
73+
pip install -e .
74+
pip install pytest pytest-cov
75+
76+
- name: Test core functionality
77+
run: |
78+
python -c "from datafog import detect_pii, anonymize_text; print('Core API works')"
79+
python -c "from datafog import detect, process; print('Legacy API works')"
80+
python -m pytest tests/test_regex_annotator.py -v
81+
5782
wheel-size:
5883
runs-on: ubuntu-latest
5984
steps:

.github/workflows/weekly-release.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Weekly Release
2+
3+
on:
4+
schedule:
5+
# Every Friday at 2 PM UTC
6+
- cron: "0 14 * * 5"
7+
workflow_dispatch:
8+
inputs:
9+
release_type:
10+
description: "Release type"
11+
required: true
12+
default: "patch"
13+
type: choice
14+
options:
15+
- patch
16+
- minor
17+
- major
18+
19+
jobs:
20+
release:
21+
runs-on: ubuntu-latest
22+
if: github.ref == 'refs/heads/dev'
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.10"
34+
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install bump2version build twine
39+
pip install -e .[all]
40+
41+
- name: Run full test suite
42+
run: |
43+
python -m pytest tests/ --cov=datafog
44+
python -m pytest tests/benchmark_text_service.py
45+
46+
- name: Generate changelog
47+
run: |
48+
python scripts/generate_changelog.py
49+
50+
- name: Determine version bump
51+
id: version
52+
run: |
53+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
54+
echo "bump_type=${{ github.event.inputs.release_type }}" >> $GITHUB_OUTPUT
55+
else
56+
# Auto-determine based on commit messages
57+
if git log --oneline $(git describe --tags --abbrev=0)..HEAD | grep -q "BREAKING"; then
58+
echo "bump_type=major" >> $GITHUB_OUTPUT
59+
elif git log --oneline $(git describe --tags --abbrev=0)..HEAD | grep -q "feat:"; then
60+
echo "bump_type=minor" >> $GITHUB_OUTPUT
61+
else
62+
echo "bump_type=patch" >> $GITHUB_OUTPUT
63+
fi
64+
fi
65+
66+
- name: Bump version
67+
run: |
68+
git config --local user.email "action@github.com"
69+
git config --local user.name "GitHub Action"
70+
bump2version ${{ steps.version.outputs.bump_type }}
71+
echo "NEW_VERSION=$(python -c 'from datafog import __version__; print(__version__)')" >> $GITHUB_ENV
72+
73+
- name: Build package
74+
run: |
75+
python -m build
76+
77+
- name: Check wheel size
78+
run: |
79+
WHEEL_SIZE=$(du -m dist/*.whl | cut -f1)
80+
if [ "$WHEEL_SIZE" -ge 5 ]; then
81+
echo "❌ Wheel size too large: ${WHEEL_SIZE}MB"
82+
exit 1
83+
fi
84+
echo "✅ Wheel size OK: ${WHEEL_SIZE}MB"
85+
86+
- name: Publish to PyPI
87+
env:
88+
TWINE_USERNAME: __token__
89+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
90+
run: twine upload dist/*
91+
92+
- name: Create GitHub Release
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
run: |
96+
gh release create v${{ env.NEW_VERSION }} \
97+
--title "DataFog v${{ env.NEW_VERSION }}" \
98+
--notes-file CHANGELOG_LATEST.md \
99+
dist/*
100+
101+
- name: Push changes
102+
run: |
103+
git push origin dev --tags
104+
105+
- name: Notify Discord
106+
if: env.DISCORD_WEBHOOK
107+
env:
108+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
109+
run: |
110+
curl -X POST "$DISCORD_WEBHOOK" \
111+
-H "Content-Type: application/json" \
112+
-d "{\"content\": \"🚀 DataFog v${{ env.NEW_VERSION }} is live! Install with: \`pip install datafog==${{ env.NEW_VERSION }}\`\"}"

.github/workflows/wheel_size.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

Claude.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
- **Graceful Degradation**: Smart imports with helpful error messages for missing extras
2828
- **Fair Benchmark Analysis**: Independent performance validation scripts
2929

30-
### ✅ Critical Bug Fixes Resolved (December 2024)
30+
### ✅ Critical Bug Fixes Resolved (May 2025)
3131
- **CI/CD Stability**: Fixed GitHub Actions failures while preserving lean architecture
3232
- **Structured Output Bug**: Resolved multi-chunk text processing in TextService
3333
- **Test Suite Health**: Improved from 33% to 87% test success rate (156/180 passing)

datafog/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
from .__about__ import __version__
1212

13+
# Import core API functions
14+
from .core import anonymize_text, detect_pii, get_supported_entities, scan_text
15+
1316
# Core imports - always available
1417
from .models.annotator import AnnotationResult, AnnotatorRequest
1518
from .models.anonymizer import (
@@ -78,7 +81,7 @@ def _missing_dependency(*args, **kwargs):
7881
)
7982

8083

81-
# Simple API for core functionality
84+
# Simple API for core functionality (backward compatibility)
8285
def detect(text: str) -> list:
8386
"""
8487
Detect PII in text using regex patterns.
@@ -169,6 +172,10 @@ def process(text: str, anonymize: bool = False, method: str = "redact") -> dict:
169172
"__version__",
170173
"detect",
171174
"process",
175+
"detect_pii",
176+
"anonymize_text",
177+
"scan_text",
178+
"get_supported_entities",
172179
"AnnotationResult",
173180
"AnnotatorRequest",
174181
"AnonymizationResult",

0 commit comments

Comments
 (0)