Skip to content

fix: entry point and pytest config#694

Merged
ssbarnea merged 1 commit intomainfrom
chore/x
Mar 4, 2026
Merged

fix: entry point and pytest config#694
ssbarnea merged 1 commit intomainfrom
chore/x

Conversation

@ssbarnea
Copy link
Copy Markdown
Member

  • avoid unnecessary dual module entry point
  • avoids premature import that can have undesired side effects,
    especially with coverage
  • bump coverage requirements to 100% for src but include tests in
    total coverage reporting from now on. (75%)
  • configure pytest to treat warnings as errors
  • address problematic verbosity_assertions config option
  • update lint hooks

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

This PR updates the CLI entrypoint strategy and test/tooling configuration to reduce redundant entrypoints, avoid early-import side effects, and tighten pytest behavior while adjusting coverage reporting policy.

Changes:

  • Switch console script entrypoint from ansible_dev_tools.cli:main to ansible_dev_tools.__main__:main and remove the redundant __main__ guard from cli.py.
  • Update coverage configuration to include tests in coverage reporting (and lower the global fail_under threshold), and mark some branches as no cover.
  • Configure pytest to treat warnings as errors and adjust pre-commit hook versions/priorities.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/ansible_dev_tools/tests/unit/test_basic.py Removes the unit test that executed ansible_dev_tools.cli as a module entrypoint.
src/ansible_dev_tools/tests/integration/conftest.py Removes an unused session_params fixture.
src/ansible_dev_tools/tests/conftest.py Removes an explicit package import to avoid premature import side effects.
src/ansible_dev_tools/subcommands/server.py Marks the debug branch as excluded from coverage.
src/ansible_dev_tools/cli.py Removes if __name__ == "__main__": main() to avoid a dual entrypoint.
src/ansible_dev_tools/main.py Marks the module execution guard as excluded from coverage.
pyproject.toml Changes console script entrypoint, adjusts coverage thresholds/omit rules, and sets pytest warnings to errors.
.pre-commit-config.yaml Updates the ansible/actions hook repo revision and adjusts hook priorities.
Comments suppressed due to low confidence (2)

pyproject.toml:110

  • PR description mentions enforcing 100% coverage for src, but [tool.coverage.report] fail_under is reduced to 75%. If the intent is 100% for production code while allowing lower overall coverage when including tests, consider implementing separate coverage gates (e.g., a second coverage report --include=src/ansible_dev_tools/** --omit=src/ansible_dev_tools/tests/** --fail-under=100 step in CI) or update the PR description to match the actual policy change.
[tool.coverage.report]
exclude_also = ["if TYPE_CHECKING:", "pragma: no cover"]
fail_under = 75
ignore_errors = true

pyproject.toml:122

  • Removing */tests/* from [tool.coverage.run].omit means test files under src/ now contribute to the single fail_under threshold. If you still want 100% enforcement for non-test code, you’ll likely need a separate coverage report/check that omits src/ansible_dev_tools/tests/**, otherwise the overall threshold will primarily reflect test-file coverage.
# branch is more reliable than lines, protects against false positives
branch = true
concurrency = ["multiprocessing", "thread"]
omit = ["_version.py"]
parallel = true
relative_files = true
source = ["src"]

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

- avoid unnecessary dual module entry point
- avoids premature import that can have undesired side effects,
  especially with coverage
- bump coverage requirements to 100% for src but include tests in
  total coverage reporting from now on. (75%)
- configure pytest to treat warnings as errors
- address problematic verbosity_assertions config option
- update lint hooks
@github-actions github-actions bot added fix and removed fix labels Mar 4, 2026
@ssbarnea ssbarnea disabled auto-merge March 4, 2026 18:13
@ssbarnea ssbarnea merged commit bddf680 into main Mar 4, 2026
29 of 30 checks passed
@ssbarnea ssbarnea deleted the chore/x branch March 4, 2026 18:13
renovate bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Mar 21, 2026
##### [\`26.3.1\`](https://github.com/ansible/ansible-dev-tools/releases/tag/v26.3.1)

#### Features

- feat: replace kubedock with native container-in-container support ([#709](ansible/ansible-dev-tools#709)) [@cidrblock](https://github.com/cidrblock)

---
##### [\`26.3.0\`](https://github.com/ansible/ansible-dev-tools/releases/tag/v26.3.0)

#### Fixes

- fix: update devtools tools to 26.3.0 ([#701](ansible/ansible-dev-tools#701)) [@ssbarnea](https://github.com/ssbarnea)
- fix: entry point and pytest config ([#694](ansible/ansible-dev-tools#694)) [@ssbarnea](https://github.com/ssbarnea)
- fix: compatibility with newer tox releases ([#700](ansible/ansible-dev-tools#700)) [@ssbarnea](https://github.com/ssbarnea)
- fix: selenium container ([#698](ansible/ansible-dev-tools#698)) [@ssbarnea](https://github.com/ssbarnea)
- fix: selenium container arm64 ([#695](ansible/ansible-dev-tools#695)) [@ssbarnea](https://github.com/ssbarnea)

#### Maintenance

- chore(deps): update pep621 ([#708](ansible/ansible-dev-tools#708)) @[renovate\[bot\]](https://github.com/apps/renovate)
- chore(deps): update all dependencies ([#707](ansible/ansible-dev-tools#707)) @[renovate\[bot\]](https://github.com/apps/renovate)
- chore(deps-dev): bump black from 26.3.0 to 26.3.1 in the uv group across 1 directory ([#705](ansible/ansible-dev-tools#705)) @[dependabot\[bot\]](https://github.com/apps/dependabot)
- chore: update mkdocs ([#703](ansible/ansible-dev-tools#703)) [@ssbarnea](https://github.com/ssbarnea)
- chore(deps): update all dependencies ([#702](ansible/ansible-dev-tools#702)) @[renovate\[bot\]](https://github.com/apps/renovate)
- chore(deps): update all dependencies ([#696](ansible/ansible-dev-tools#696)) @[renovate\[bot\]](https://github.com/apps/renovate)
- chore: improve test robustness for devspaces environment ([#697](ansible/ansible-dev-tools#697)) [@VedantMadane](https://github.com/VedantMadane)
- chore: add adt and python extension to selenium container ([#699](ansible/ansible-dev-tools#699)) [@ssbarnea](https://github.com/ssbarnea)
sdwilsh pushed a commit to sdwilsh/ansible-playbooks that referenced this pull request Mar 21, 2026
##### [\`26.3.1\`](https://github.com/ansible/ansible-dev-tools/releases/tag/v26.3.1)

#### Features

- feat: replace kubedock with native container-in-container support ([#709](ansible/ansible-dev-tools#709)) [@cidrblock](https://github.com/cidrblock)

---
##### [\`26.3.0\`](https://github.com/ansible/ansible-dev-tools/releases/tag/v26.3.0)

#### Fixes

- fix: update devtools tools to 26.3.0 ([#701](ansible/ansible-dev-tools#701)) [@ssbarnea](https://github.com/ssbarnea)
- fix: entry point and pytest config ([#694](ansible/ansible-dev-tools#694)) [@ssbarnea](https://github.com/ssbarnea)
- fix: compatibility with newer tox releases ([#700](ansible/ansible-dev-tools#700)) [@ssbarnea](https://github.com/ssbarnea)
- fix: selenium container ([#698](ansible/ansible-dev-tools#698)) [@ssbarnea](https://github.com/ssbarnea)
- fix: selenium container arm64 ([#695](ansible/ansible-dev-tools#695)) [@ssbarnea](https://github.com/ssbarnea)

#### Maintenance

- chore(deps): update pep621 ([#708](ansible/ansible-dev-tools#708)) @[renovate\[bot\]](https://github.com/apps/renovate)
- chore(deps): update all dependencies ([#707](ansible/ansible-dev-tools#707)) @[renovate\[bot\]](https://github.com/apps/renovate)
- chore(deps-dev): bump black from 26.3.0 to 26.3.1 in the uv group across 1 directory ([#705](ansible/ansible-dev-tools#705)) @[dependabot\[bot\]](https://github.com/apps/dependabot)
- chore: update mkdocs ([#703](ansible/ansible-dev-tools#703)) [@ssbarnea](https://github.com/ssbarnea)
- chore(deps): update all dependencies ([#702](ansible/ansible-dev-tools#702)) @[renovate\[bot\]](https://github.com/apps/renovate)
- chore(deps): update all dependencies ([#696](ansible/ansible-dev-tools#696)) @[renovate\[bot\]](https://github.com/apps/renovate)
- chore: improve test robustness for devspaces environment ([#697](ansible/ansible-dev-tools#697)) [@VedantMadane](https://github.com/VedantMadane)
- chore: add adt and python extension to selenium container ([#699](ansible/ansible-dev-tools#699)) [@ssbarnea](https://github.com/ssbarnea)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants