Skip to content

Dev - #19

Open
ablot wants to merge 18 commits into
mainfrom
dev
Open

Dev#19
ablot wants to merge 18 commits into
mainfrom
dev

Conversation

@ablot

@ablot ablot commented Aug 11, 2026

Copy link
Copy Markdown
Member

🚀 Pull Request: Merge dev into main

📋 Summary

This PR updates the CI/CD pipeline to use uv and ty, enables automated unit testing in CI, adds performance caching for OfflineFlexilims, and cleans up dead code and type annotations.


⚡ Performance & Improvements

  • OfflineFlexilims Caching: Added internal caching for tree lookup operations (get, get_children, _flat_data), significantly speeding up offline database operations on large datasets. Cache automatically invalidates on mutations (post, update_one, or updating json_file).

🐛 Bug Fixes & Refactoring

  • Robust Error Parsing: parse_error now safely returns raw server messages instead of raising an AttributeError when encountering non-HTML error responses.
  • Dead Code Removal: Removed unused OfflineFlexilims._format_dataframe method.
  • Type Annotations: Added explicit type hints to key classes for compatibility with ty static analysis.

🛠️ CI / CD & Tooling

  • Workflow Modernization: Switched to znamlab/python-uv-ci reusable workflow (uv-based installation, linting, and ty type checking).
  • CI Testing Enabled: Enabled unit tests in GitHub Actions (removed dummy IOError guard in test_flexilims.py).
  • Pre-commit Updates: Updated pre-commit configuration and replaced mypy with ty for local & CI consistency.
  • Release Pipeline: Updated tag release workflow to use uv build for wheels/sdist publishing.
  • Cleanup: Removed obsolete docs_build_and_deploy.yml workflow.

ablot and others added 18 commits June 4, 2025 15:39
Default to False. It is never used in our projects and therefore not tested
get(), get_children() and _find_entity() rebuilt and deepcopy()'d the
entire tree on every call. Cache the flattened views and an id->entity
index, invalidating them on post()/update_one()/json_file reassignment.

Rewrite tests/test_offline.py to fix tests that were silently broken:
filterwarnings=["error"] turned intentional warnings into crashes, and
a leftover YAML-era string assertion could never match JSON output.
Tests now isolate file-writing cases to a private tmp_path copy instead
of mutating the tracked fixture, and add coverage for the new caching
behavior.

Also add uv.lock for reproducible installs (with the check-manifest
rule to include it), and document the new caching behavior in the
README.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Code Coverage Report

Name Stmts Miss Cover
flexilims/__init__.py 2 0 100%
flexilims/main.py 170 144 15%
flexilims/offline.py 244 19 92%
flexilims/utils.py 56 10 82%
TOTAL 472 173 63%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant