Metadata-Version: 2.4
Name: repairshopr-api
Version: 0.4.3
Author-email: Chris Busillo <info@shinycomputers.com>
Requires-Python: >=3.14
Requires-Dist: pytz>=2023.3.post1
Requires-Dist: requests>=2.31.0
Requires-Dist: tenacity>=8.2.3
Requires-Dist: toml>=0.10.2
Provides-Extra: mysql
Requires-Dist: mysqlclient>=2.2.1; extra == 'mysql'
Provides-Extra: sync
Requires-Dist: django>=5.0.1; extra == 'sync'
Requires-Dist: mysqlclient>=2.2.1; extra == 'sync'
Description-Content-Type: text/markdown

# repairshopr-api

Python client and sync utilities for RepairShopr.

- `repairshopr_api`: API models and helpers
- `repairshopr_sync`: Django-based sync service (optional)

## Development

- Python version: `3.14`
- Install runtime dependencies: `uv sync`
- Install development dependencies: `uv sync --group dev`
- Build package: `uv build`

## Lockfile Guardrails

This repo treats `uv.lock` as a committed artifact and enforces lockfile
consistency with local checks and CI.

- Check lockfile consistency: `./scripts/check-lockfile.sh`
- Refresh lockfile after dependency/version changes: `uv lock`
- Ensure both files are committed together when needed:
  `git add pyproject.toml uv.lock`

## Tests

The repository uses `pytest` with coverage gates.

- Install test dependencies: `uv sync --group dev`
- Run the full suite: `uv run pytest -q`
- Run with explicit coverage output: `uv run pytest --cov --cov-report=term-missing`
- Run MySQL integration tests:

  ```bash
  uv sync --group dev --extra sync
  uv run python -m django migrate --noinput --settings=tests.django_settings_mysql
  uv run pytest -q -m integration --ds=tests.django_settings_mysql --no-cov
  ```

Notes:

- Tests do not call the live RepairShopr API.
- Shell tests for `scripts/repairshopr-sync-entrypoint.sh` run with command stubs.
- The default coverage threshold is enforced at `80%`.
- A dedicated CI job runs MySQL-backed integration checks for schema/migrations.

## Release (PyPI)

Releases are tag-driven. The GitHub Actions workflow publishes to PyPI only
when a tag matching `v*` is pushed.

1. Bump the version in `pyproject.toml`.
2. Refresh lockfile: `uv lock`.
3. Confirm lockfile is clean: `./scripts/check-lockfile.sh`.
4. Commit the changes on `main`.
5. Create a tag `vX.Y.Z` at that commit.
6. Push the commit and tag: `git push origin main --follow-tags`.

Pushing to `main` without a tag does not publish.
