Skip to content

add pytest and types-pyyaml dev deps to Python package - #295

Open
averms wants to merge 1 commit into
apache:mainfrom
averms-forks:averms/add-pytest-and-types-pyyaml-dev-dep-ykvzuwzmytzy
Open

add pytest and types-pyyaml dev deps to Python package#295
averms wants to merge 1 commit into
apache:mainfrom
averms-forks:averms/add-pytest-and-types-pyyaml-dev-dep-ykvzuwzmytzy

Conversation

@averms

@averms averms commented Aug 2, 2026

Copy link
Copy Markdown

Summary

The former is needed to run tests and the latter is needed for type checking with mypy.

Specifically, without types-pyyaml, mypy --strict . gives the errors:

src/ossie/models.py:21: error: Library stubs not installed for "yaml"  [import-untyped]
src/ossie/models.py:21: note: Hint: "python3 -m pip install types-PyYAML"
src/ossie/models.py:21: note: (or run "mypy --install-types" to install all missing stub packages)
src/ossie/models.py:21: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
src/ossie/models.py:219: error: Returning Any from function declared to return "str"  [no-any-return]

Related Issues

Checklist

Tests

  • All existing tests pass (pytest / CI green)
  • New functionality is covered by tests

Compliance

  • ASF license headers are present on all new source files
  • No third-party dependencies are added without PMC/IPMC approval

I guess a third-party dependency was added, https://pypi.org/project/types-PyYAML/

The former is needed to run tests and the latter is needed for
type checking with mypy.
Copilot AI review requested due to automatic review settings August 2, 2026 22:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds missing Python development dependencies for the python/ package so contributors can run the existing test suite (pytest) and perform stricter type-checking around YAML usage (types-PyYAML), consistent with the repo’s broader uv-based workflow.

Changes:

  • Add a dev dependency group containing pytest and types-pyyaml to python/pyproject.toml.
  • Regenerate python/uv.lock to include the new dev dependencies and their resolved transitive packages.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
python/pyproject.toml Introduces a dev dependency group for local testing/type-checking dependencies.
python/uv.lock Updates the lockfile to include the newly added dev dependencies and their resolved tree.

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

Comment thread python/pyproject.toml
Comment on lines +43 to +47
[dependency-groups]
dev = [
"pytest>=9.1.1",
"types-pyyaml>=6.0.12.20260724",
]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i think this is incorrect. uv sync for me does install group dev

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yep, verified that uv sync works with a fresh setup:

→ uv sync
Using CPython 3.14.3
Creating virtual environment at: .venv
Resolved 14 packages in 15ms
      Built apache-ossie @ file:///Users/81045729/Documents/constant_variables/ossie/python
Prepared 2 packages in 893ms
Installed 13 packages in 32ms
 + annotated-types==0.7.0
 + apache-ossie==0.2.0.dev0 (from file:///Users/81045729/Documents/constant_variables/ossie/python)
 + iniconfig==2.3.0
 + packaging==26.2
 + pluggy==1.6.0
 + pydantic==2.13.4
 + pydantic-core==2.46.4
 + pygments==2.20.0
 + pytest==9.1.1
 + pyyaml==6.0.3
 + types-pyyaml==6.0.12.20260724
 + typing-extensions==4.16.0
 + typing-inspection==0.4.2

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