Skip to content

Commit 78e3912

Browse files
committed
Remove @logger.catch decorators, make loguru optional, migrate to uv workflow, bump to v0.2.0
- Remove all @logger.catch decorators from a_sync.py, sync.py, and utils.py - Make loguru an optional/dev-only dependency in pyproject.toml - Delete legacy requirements files (core/dev .in/.txt); use uv dependency groups - Update release.yml: use `uv sync --group dev`, `uv build`, clean up redundant steps - Move loguru to dev dependency group; add aiosqlite for async testing - Bump project version to 0.2.0 https://claude.ai/code/session_01G7xKgBPQia81rZHBU6BxCG
1 parent 2bdf00e commit 78e3912

9 files changed

Lines changed: 42 additions & 207 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ permissions:
1717
contents: read
1818

1919
jobs:
20-
# --------------------------------------------------
21-
# Job 1: Linting and Testing (Runs on push and PR)
22-
# --------------------------------------------------
2320
# --------------------------------------------------
2421
# Job 1: Linting and Testing (Runs on push and PR)
2522
# --------------------------------------------------
@@ -35,38 +32,21 @@ jobs:
3532
- name: Set up Python
3633
uses: actions/setup-python@v5
3734
with:
38-
python-version: '3.13' # Specify your desired Python version
35+
python-version: '3.13'
3936

40-
# Install uv
4137
- name: Install uv
4238
uses: astral-sh/setup-uv@v5
4339

44-
# Add uv to the PATH
45-
- name: Add uv to PATH
46-
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
47-
shell: bash
48-
- name: Create virtual environment
49-
run: uv venv
50-
- name: Activate virtual environment
51-
run: |
52-
echo "PATH=$PATH:$PWD/.venv/bin" >> $GITHUB_PATH
53-
echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
5440
- name: Install dependencies with uv
5541
run: |
56-
# Install packages from requirements.txt and additional tools
57-
uv pip install -r core_requirements.txt
58-
uv pip install -r dev_requirements.txt
42+
uv sync --group dev
5943
6044
- name: Run pre-commit hooks
6145
uses: pre-commit/action@v3.0.1
62-
# pre-commit might internally use pip/virtualenv, uv installation
63-
# primarily affects the main dependency installation step.
6446

6547
- name: Run tests with coverage
6648
run: |
67-
uv pip install pytest-cov
68-
69-
uv run pytest --cov=sqlmodel_crud_utils --cov-report=xml --cov-report=term # Generate XML and terminal reports
49+
uv run pytest --cov=sqlmodel_crud_utils --cov-report=xml --cov-report=term
7050
7151
- name: Upload coverage report
7252
uses: actions/upload-artifact@v4
@@ -91,15 +71,13 @@ jobs:
9171
- name: Set up Python
9272
uses: actions/setup-python@v5
9373
with:
94-
python-version: '3.11' # Match the version used for testing
74+
python-version: '3.13'
9575

96-
- name: Install build dependencies
97-
run: |
98-
python -m pip install --upgrade pip
99-
pip install build
76+
- name: Install uv
77+
uses: astral-sh/setup-uv@v5
10078

10179
- name: Build source distribution and wheel
102-
run: python -m build
80+
run: uv build
10381

10482
- name: Upload build artifacts
10583
uses: actions/upload-artifact@v4
@@ -140,13 +118,9 @@ jobs:
140118
with:
141119
tag_name: ${{ steps.get_version.outputs.TAG_NAME }}
142120
name: Release ${{ steps.get_version.outputs.TAG_NAME }}
143-
# body: | # Optional: Add release notes here
144-
# Release notes for version ${{ steps.get_version.outputs.TAG_NAME }}
145-
# - Feature A
146-
# - Bugfix B
147121
draft: false
148-
prerelease: false # Set to true if it's a pre-release
149-
files: dist/* # Upload all files from the dist directory
122+
prerelease: false
123+
files: dist/*
150124

151125
# --------------------------------------------------
152126
# Job 4: Publish to PyPI (Runs only on push to release/*)
@@ -157,9 +131,9 @@ jobs:
157131
# Only run this job on direct pushes to release/* branches
158132
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/')
159133
runs-on: ubuntu-latest
160-
environment: # Optional: Define environment for PyPI publishing rules/secrets
134+
environment:
161135
name: pypi
162-
url: https://pypi.org/p/sqlmodel-crud-utils # Replace with your actual PyPI package URL
136+
url: https://pypi.org/p/sqlmodel-crud-utils
163137
permissions:
164138
id-token: write # Required for trusted publishing
165139
steps:
@@ -171,7 +145,6 @@ jobs:
171145

172146
- name: Publish package to PyPI
173147
uses: pypa/gh-action-pypi-publish@release/v1
174-
# No need for secrets.PYPI_API_TOKEN if using trusted publishing
175148
with:
176149
user: __token__
177150
password: ${{ secrets.PYPI_API_TOKEN }}

core_requirements.in

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

core_requirements.txt

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

dev_requirements.in

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

dev_requirements.txt

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

pyproject.toml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ line_length = 80
5858

5959
[project]
6060
name = "sqlmodel_crud_utilities"
61-
version = "0.1.0"
61+
version = "0.2.0"
6262
authors = [
6363
{ name="Francis Secada", email = "francis.secada@gmail.com" }
6464
]
@@ -71,19 +71,27 @@ classifiers = [
7171
"Operating System :: OS Independent",
7272
]
7373
dependencies = [
74-
"loguru>=0.7.3",
7574
"python-dateutil>=2.9.0.post0",
7675
"python-dotenv>=1.1.0",
7776
"sqlmodel>=0.0.24",
7877
]
7978

79+
[project.optional-dependencies]
80+
loguru = ["loguru>=0.7.3"]
81+
[project.urls]
82+
"Homepage" = "https://fsecada01.github.io/SQLModel-CRUD-Utilities/sqlmodel_crud_utils.html"
83+
"Repository" = "https://github.com/fsecada01/sqlmodel_crud_utils"
84+
"Bug Tracker" = "https://github.com/fsecada01/sqlmodel_crud_utils/issues"
85+
86+
8087
[dependency-groups]
8188
dev = [
8289
"aiosqlite>=0.21.0",
8390
"black>=25.1.0",
8491
"build>=1.2.2.post1",
8592
"factory-boy>=3.3.3",
8693
"isort>=6.0.1",
94+
"loguru>=0.7.3",
8795
"pre-commit>=4.2.0",
8896
"pytest>=8.3.5",
8997
"pytest-asyncio>=0.26.0",
@@ -93,6 +101,9 @@ dev = [
93101
"ruff>=0.11.10",
94102
]
95103

104+
doc = [
105+
"pdoc>=15.0.1",
106+
]
96107

97108
[tool.setuptools]
98109
packages = ['sqlmodel_crud_utils']

0 commit comments

Comments
 (0)