Skip to content

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

Merged
AKB0700 merged 3 commits into
mainfrom
copilot/fix-github-actions-dependencies
May 13, 2026
Merged

Fix CI: install runtime dependencies via Poetry before lint/test#2
AKB0700 merged 3 commits into
mainfrom
copilot/fix-github-actions-dependencies

Conversation

Copy link
Copy Markdown

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
@AKB0700
Copy link
Copy Markdown
Owner

AKB0700 commented May 13, 2026

@copilot resolve the merge conflicts in this pull request

@AKB0700 AKB0700 marked this pull request as ready for review May 13, 2026 14:13
Copilot AI review requested due to automatic review settings May 13, 2026 14:13
@AKB0700
Copy link
Copy Markdown
Owner

AKB0700 commented May 13, 2026

@copilot resolve the merge conflicts in this pull request

@AKB0700
Copy link
Copy Markdown
Owner

AKB0700 commented May 13, 2026

@copilot

@AKB0700
Copy link
Copy Markdown
Owner

AKB0700 commented May 13, 2026

@copilot resolve the merge conflicts in this pull request

Copilot AI requested a review from AKB0700 May 13, 2026 14:14
Copilot stopped work on behalf of AKB0700 due to an error May 13, 2026 14:14
Co-authored-by: AKB0700 <157992575+AKB0700@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented May 13, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 04d1786. The Poetry-based CI steps are preserved, and the workflow_dispatch trigger from main is incorporated.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the GitHub Actions workflow to install the project’s runtime + dev dependencies via Poetry before running lint/tests, fixing CI failures caused by missing runtime deps (e.g., requests) during test imports.

Changes:

  • Replace pip install flake8 pytest (and requirements.txt fallback) with poetry install --with dev.
  • Run flake8 and pytest via poetry run ... to ensure they execute inside the Poetry environment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install poetry
Comment on lines +30 to +31
pip install poetry
poetry install --with dev
@AKB0700 AKB0700 merged commit bd0a55a into main May 13, 2026
0 of 6 checks passed
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.

3 participants