Skip to content

Fix CI: install runtime dependencies via Poetry before lint/test#2

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-github-actions-dependencies
Draft

Fix CI: install runtime dependencies via Poetry before lint/test#2
Copilot wants to merge 2 commits intomainfrom
copilot/fix-github-actions-dependencies

Conversation

Copy link

Copilot AI commented Mar 2, 2026

Tests were failing at import time with ModuleNotFoundError: No module named 'requests' because the workflow only installed flake8 and pytest — never the project's runtime dependencies declared in pyproject.toml.

Changes

  • Dependency installation: Replace bare pip install flake8 pytest with Poetry-based install (pip install poetrypoetry install --with dev), pulling in both runtime deps (requests) and dev deps in one step.
  • Lint/test invocation: Run flake8 and pytest via poetry run ... so they execute inside the Poetry-managed environment.
  • Removed: The now-redundant requirements.txt fallback install.
Original prompt

Fix GitHub Actions failing job due to missing runtime dependencies during tests.

Context:

  • Failing job logs show: deepl/http_client.py imports requests and tests fail with ModuleNotFoundError: No module named 'requests'.
  • Workflow currently installs only flake8 and pytest, and optionally requirements.txt, but does not install the project dependencies declared in pyproject.toml (Poetry).
  • Workflow file: .github/workflows/python-package.yml.
  • Failing job URL: https://github.com/AKB0700/deepl-python/actions/runs/22592189871/job/65456583363#step:6:30

Required changes:

  1. Update .github/workflows/python-package.yml to install project dependencies before lint/test.
    • Prefer using Poetry because dependency metadata is in pyproject.toml under [tool.poetry.dependencies] and dev deps under [tool.poetry.group.dev.dependencies].
    • Install Poetry via pip, then run poetry install --with dev.
  2. Run flake8 and pytest through Poetry (poetry run ...) so the same environment is used.
  3. Keep the matrix Python versions (3.9, 3.10, 3.11) and ensure steps work across them.
  4. Ensure the workflow remains simple and reliable.

Acceptance criteria:

  • CI installs requests (and other dependencies) implicitly via Poetry install.
  • pytest no longer fails at import time for missing requests.
  • Lint and tests run successfully in CI.

Files to modify:

  • .github/workflows/python-package.yml

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: AKB0700 <157992575+AKB0700@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix GitHub Actions failing job due to missing runtime dependencies Fix CI: install runtime dependencies via Poetry before lint/test Mar 2, 2026
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