Modernize Python tooling and upgrade dependencies#16
Conversation
Co-authored-by: Genaro Madrid <genaromadrid@users.noreply.github.com>
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughReplaced nose2 with pytest/Poetry in README and CI; updated pyproject.toml Python/dependencies and added pytest/coverage/ruff configs; removed Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
poetry.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
README.mdmifiel/document.pynose2.cfgpyproject.toml
💤 Files with no reviewable changes (1)
- nose2.cfg
Co-authored-by: Genaro Madrid <genaromadrid@users.noreply.github.com>
Co-authored-by: Genaro Madrid <genaromadrid@users.noreply.github.com>
There was a problem hiding this comment.
🧹 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.
Co-authored-by: Genaro Madrid <genaromadrid@users.noreply.github.com>
Co-authored-by: Genaro Madrid <genaromadrid@users.noreply.github.com>
Summary
>=3.10,<4.0poetry.locknose2topytestand removed the obsoletenose2.cfgDocumentso parent directories are created automatically before writing filesrequirements.txt/setup.py testif: type != pull_request)raise_for_status()in document download helpersidna,pytest,responses, andruffValidation
poetry show --outdated(no output)poetry run pytest(30 passed)Summary by CodeRabbit
Documentation
Bug Fixes
Tests
Chores