Skip to content

Modernize Python tooling and upgrade dependencies#16

Merged
genaromadrid merged 5 commits intomasterfrom
cursor/upgrade-deps-modernize-tools-b697
Apr 22, 2026
Merged

Modernize Python tooling and upgrade dependencies#16
genaromadrid merged 5 commits intomasterfrom
cursor/upgrade-deps-modernize-tools-b697

Conversation

@genaromadrid
Copy link
Copy Markdown
Member

@genaromadrid genaromadrid commented Apr 22, 2026

Summary

  • modernized Poetry metadata by moving to dependency groups and updating the supported Python runtime to >=3.10,<4.0
  • upgraded runtime and development dependencies to current releases and regenerated poetry.lock
  • migrated test documentation from nose2 to pytest and removed the obsolete nose2.cfg
  • improved file-saving robustness in Document so parent directories are created automatically before writing files
  • updated Travis CI config to use modern Python versions and run Poetry + pytest instead of legacy requirements.txt / setup.py test
  • added top-level Travis condition to skip all jobs for pull request events (if: type != pull_request)
  • addressed CodeRabbit feedback by adding explicit request timeouts + raise_for_status() in document download helpers
  • hardened Travis install by pinning Poetry and running non-interactive install commands
  • completed full dependency refresh to latest available versions under current constraints, including updates to idna, pytest, responses, and ruff

Validation

  • poetry show --outdated (no output)
  • poetry run pytest (30 passed)
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Documentation

    • Updated test instructions to use pytest with an explicit command.
  • Bug Fixes

    • File save/download now ensure parent directories exist, enforce request timeouts, and fail on non-successful HTTP responses.
  • Tests

    • Migrated test suite from nose2 to pytest; added pytest discovery and coverage configuration; removed old nose2 config.
  • Chores

    • Raised minimum Python to 3.10+, updated runtime/dev dependencies and tooling.
    • CI updated to use Poetry and run pytest.

Co-authored-by: Genaro Madrid <genaromadrid@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Replaced nose2 with pytest/Poetry in README and CI; updated pyproject.toml Python/dependencies and added pytest/coverage/ruff configs; removed nose2.cfg; updated mifiel/document.py to ensure parent directories, apply request timeouts, and call response.raise_for_status().

Changes

Cohort / File(s) Summary
Docs / README
README.md
Updated test instructions to use poetry run pytest (replaced nose2 invocation).
CI
.travis.yml
Switched CI base image to Ubuntu focal, Python matrix to 3.10–3.12, removed sudo, and changed install/test flow to use Poetry and poetry run pytest.
Removed test config
nose2.cfg
Deleted nose2.cfg and its unittest/coverage configuration.
Project metadata & tooling
pyproject.toml
Raised Python requirement to >=3.10,<4.0; tightened requests version; migrated dev deps to [tool.poetry.group.dev.dependencies]; removed nose2/unittest2; added pytest, pytest-cov, responses, ruff; updated coverage, pypandoc; added pytest, coverage, and ruff tool configs.
Document save behavior
mifiel/document.py
Added Document._request_timeout() and Document._ensure_parent_dir(path) (static); save_file, save_file_signed, and save_xml now ensure parent dirs exist, use request timeouts, and call response.raise_for_status(); added os import.

Sequence Diagram(s)

sequenceDiagram
  participant Doc as Document
  participant HTTP as Remote API
  participant FS as Filesystem

  Doc->>Doc: _request_timeout()
  Doc->>Doc: _ensure_parent_dir(path)
  Doc->>HTTP: GET/POST (with timeout)
  HTTP-->>Doc: Response (status, body)
  Doc->>Doc: response.raise_for_status()
  Doc->>FS: open(path) and write file
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I swapped my nose2 cap for pytest bright,
Poetry tucked my tests in order tight.
I dug a path so files may safely stay,
Timeouts set — no more lost hops astray.
CI hums along while I nibble moonlight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the primary changes: modernizing Python tooling (pytest, poetry groups, ruff, travis config) and upgrading dependencies (Python 3.10+, requests, coverage, etc.)
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/upgrade-deps-modernize-tools-b697

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@mifiel/document.py`:
- Around line 109-127: The three download helpers save_file, save_file_signed,
and save_xml must pass an explicit timeout to requests.get (use
self.client.timeout if set, otherwise a sensible default like 30 seconds) and
call response.raise_for_status() immediately after the request to fail on
non-2xx responses; update each requests.get(...) call to include
timeout=self.client.timeout or fallback and add response.raise_for_status()
before writing the file (preserve existing _ensure_parent_dir and file write
logic).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 80bba75a-5cf2-4884-8f1b-a91bf92b5bb5

📥 Commits

Reviewing files that changed from the base of the PR and between f925c3c and a48f0ef.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • README.md
  • mifiel/document.py
  • nose2.cfg
  • pyproject.toml
💤 Files with no reviewable changes (1)
  • nose2.cfg

Comment thread mifiel/document.py
cursoragent and others added 2 commits April 22, 2026 15:53
Co-authored-by: Genaro Madrid <genaromadrid@users.noreply.github.com>
Co-authored-by: Genaro Madrid <genaromadrid@users.noreply.github.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.travis.yml (1)

10-12: Pin Poetry in CI for reproducible builds.

Lines 10–12 currently install Poetry unpinned, which can introduce sudden CI breakage on upstream releases. Consider pinning Poetry and running install in non-interactive mode.

Suggested CI hardening diff
 install:
   - python -m pip install --upgrade pip
-  - python -m pip install poetry
-  - poetry install
+  - python -m pip install "poetry==<PINNED_VERSION>"
+  - poetry install --no-interaction --no-ansi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.travis.yml around lines 10 - 12, Replace the unpinned Poetry installation
and interactive install step in CI: instead of "python -m pip install poetry"
install a pinned Poetry release (use a fixed version like poetry==X.Y.Z) and run
the installer non-interactively; also invoke "poetry install" with its
non-interactive flag so dependency installation is reproducible and won't prompt
in CI. Update the .travis.yml commands referencing "python -m pip install
poetry" and "poetry install" accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.travis.yml:
- Around line 10-12: Replace the unpinned Poetry installation and interactive
install step in CI: instead of "python -m pip install poetry" install a pinned
Poetry release (use a fixed version like poetry==X.Y.Z) and run the installer
non-interactively; also invoke "poetry install" with its non-interactive flag so
dependency installation is reproducible and won't prompt in CI. Update the
.travis.yml commands referencing "python -m pip install poetry" and "poetry
install" accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 13e0555d-8aaa-4eea-9b85-2746bb1df78b

📥 Commits

Reviewing files that changed from the base of the PR and between a48f0ef and a52ef5b.

📒 Files selected for processing (1)
  • .travis.yml

Co-authored-by: Genaro Madrid <genaromadrid@users.noreply.github.com>
Co-authored-by: Genaro Madrid <genaromadrid@users.noreply.github.com>
@genaromadrid genaromadrid marked this pull request as ready for review April 22, 2026 16:15
@genaromadrid genaromadrid changed the base branch from develop to master April 22, 2026 16:19
@genaromadrid genaromadrid merged commit 6fb45a0 into master Apr 22, 2026
2 checks passed
@genaromadrid genaromadrid deleted the cursor/upgrade-deps-modernize-tools-b697 branch April 22, 2026 16:21
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.

2 participants