Skip to content

Add dependencies field to pyproject.toml to fix workflow error#849

Merged
Josverl merged 4 commits into
mainfrom
copilot/fix-workflow-error
Nov 11, 2025
Merged

Add dependencies field to pyproject.toml to fix workflow error#849
Josverl merged 4 commits into
mainfrom
copilot/fix-workflow-error

Conversation

Copilot AI commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

The test_stub_quality workflow failed with ModuleNotFoundError: No module named 'requests' because pyproject.toml was missing the required dependencies field in the [project] section.

Root Cause

When using uv pip install -r pyproject.toml --extra <name>, the pyproject.toml file must include a dependencies field in the [project] section, even if it's empty. Without this field, uv doesn't properly process the optional-dependencies.

Changes

Added to pyproject.toml:

[project]
name = "micropython-stubs"
# ... other fields ...
dependencies = []  # Added this line

This allows the existing workflow command uv pip install -r pyproject.toml --extra stubber --extra test to properly install optional dependencies including requests.

Files Updated

  • pyproject.toml - Added dependencies = [] to [project] section

The workflow syntax was already correct and remains unchanged.

Original prompt

please fix this error in the workflow

https://github.com/Josverl/micropython-stubs/actions/runs/19227708441/job/54958671437#step:9:1


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 10, 2025 19:46
Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error in workflow execution Fix uv pip install syntax in GitHub Actions workflows Nov 10, 2025
Copilot AI requested a review from Josverl November 10, 2025 19:50
@Josverl Josverl marked this pull request as ready for review November 10, 2025 20:18
@Josverl

Josverl commented Nov 10, 2025

Copy link
Copy Markdown
Owner

@copilot , it appears you have introduced even more severe errors.
The proposed changes make no sense at all.

Please revert, and redo

Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>

Copilot AI commented Nov 10, 2025

Copy link
Copy Markdown
Contributor Author

@copilot , it appears you have introduced even more severe errors.
The proposed changes make no sense at all.
...

You're absolutely right - I misunderstood the issue. I've reverted all the incorrect workflow changes.

The original syntax uv pip install -r pyproject.toml --extra stubber --extra test was actually correct. The real problem was that pyproject.toml was missing the dependencies field in the [project] section.

Fixed in commit c7c9b07 by adding dependencies = [] to pyproject.toml. This allows uv to properly install the optional dependencies when using -r pyproject.toml --extra.

Copilot AI changed the title Fix uv pip install syntax in GitHub Actions workflows Add dependencies field to pyproject.toml to fix workflow error Nov 10, 2025
Copilot AI requested a review from Josverl November 10, 2025 20:48
@Josverl

Josverl commented Nov 11, 2025

Copy link
Copy Markdown
Owner

@copilot
I think the requests module should be added to the test requirements

Copilot AI commented Nov 11, 2025

Copy link
Copy Markdown
Contributor Author

@copilot
I think the requests module should be added to the test requirements

The requests module is already in the test requirements:

  • pyproject.toml line 37 in the test = [...] optional dependencies
  • requirements-test.txt line 15

The workflow installs it with uv pip install -r pyproject.toml --extra test. Adding dependencies = [] in commit c7c9b07 allows uv to properly process these optional dependencies.

Did you mean something different, or would you like me to move requests to a different location?

@Josverl Josverl merged commit 7023688 into main Nov 11, 2025
4 of 11 checks passed
@Josverl Josverl deleted the copilot/fix-workflow-error branch November 11, 2025 08:52
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