-
Notifications
You must be signed in to change notification settings - Fork 35
feature(tests): add uv based project definitions #845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
137e764 to
afc242b
Compare
There was a problem hiding this 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 modernizes the Python project setup by introducing uv-based dependency management and project configuration. It transitions from a legacy test-requirements.txt to a comprehensive pyproject.toml with PEP 621 metadata, adds pre-commit hooks with Ruff for code formatting, and applies consistent code style changes across the entire codebase. The changes also enhance the CI pipeline to use uv for dependency management and add pre-commit validation.
Key changes:
- Introduced modern Python project configuration with
pyproject.tomlfollowing PEP 621 standards - Added comprehensive tooling configuration (Ruff, pytest, mypy, black, isort) in
pyproject.toml - Applied automated code formatting (double quotes, import sorting, f-strings) across all Python files
- Enhanced Renovate configuration for better dependency management with uv support
Reviewed changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Added comprehensive project metadata, dependencies, and tool configurations for modern Python development |
| pytest.ini | Added pytest configuration with markers, logging, and test discovery patterns |
| test-requirements.txt | Removed in favor of pyproject.toml dependencies |
| .python-version | Specified Python 3.14 as the project version |
| .pre-commit-config.yaml | Added Ruff pre-commit hooks for linting and formatting |
| renovate.json | Enhanced with uv-specific package rules and vulnerability scanning |
| .github/workflows/build.yml | Updated CI to use uv for dependency management and pre-commit validation |
| tests/*.py | Applied consistent code formatting (double quotes, import sorting, pytest usage) |
| tools/*.py | Reformatted with double quotes, removed encoding declarations, improved readability |
| packer/* | Applied consistent formatting to installation and configuration scripts |
| common/*.py | Standardized code style across common utilities and scripts |
| lib/*.py | Minor formatting improvements for consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
so it would be easier to setup and start using the unittests of this project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 32 out of 33 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| scylla_excepthook(*sys.exc_info()) | ||
| LOGGER.error(f"Post start script failed: {e}") | ||
| sys.exit(1) | ||
| return None |
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicit return None is unnecessary. Python functions implicitly return None when no return statement is present. Consider removing this line.
| return None |
| non_root_disks = cloud_instance.get_local_disks() + cloud_instance.get_remote_disks() | ||
| if len(non_root_disks) == 0: | ||
| colorprint(MSG_UNSUPPORTED_INSTANCE_TYPE_NO_DISKS, type=cloud_instance.instance_class()) | ||
| if cloud_instance := get_cloud_instance(): |
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The walrus operator assignment will always be truthy even if get_cloud_instance() returns None, False, or an empty value. This could lead to AttributeError when calling methods on cloud_instance. Consider explicit None checking: cloud_instance = get_cloud_instance() followed by if cloud_instance is not None:
| if cloud_instance := get_cloud_instance(): | |
| cloud_instance = get_cloud_instance() | |
| if cloud_instance is not None: |
| @@ -0,0 +1,33 @@ | |||
| [pytest] | |||
| # Pytest configuration for CloudFormation tests | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this file. all of it should be in pyproject.toml
| force-single-line = false | ||
| lines-after-imports = 2 | ||
|
|
||
| [tool.mypy] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove, we are not gonna use mypy
| module = "tests.*" | ||
| ignore_errors = true | ||
|
|
||
| [tool.black] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove we are not using black
| Issues = "https://github.com/scylladb/scylla-cloud-image/issues" | ||
|
|
||
| [build-system] | ||
| requires = ["hatchling"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch to use uv as build system
so it would be easier to setup and start using the unittests of this project
TESTING