Skip to content

Conversation

@fruch
Copy link
Collaborator

@fruch fruch commented Dec 9, 2025

so it would be easier to setup and start using the unittests of this project

TESTING

  • 🟢 repo - https://jenkins.scylladb.com/job/releng-testing/job/unified-deb/78/
  • 🟢 AWS image (ami-010317e6c6e365641)
  • GCE image (debug-scylla-2026-1-0-x86-64-2025-12-29t00-23-41)
  • Azure image (/subscriptions/6c268694-47ab-43ab-b306-3c5514bc4112/resourceGroups/scylla-images/providers/Microsoft.Compute/virtualMachines/pkrvmqpo5oowtw9)

Copy link

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 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.toml following 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
@fruch fruch marked this pull request as ready for review December 28, 2025 22:08
@fruch fruch requested a review from Copilot December 28, 2025 22:18
Copy link

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

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
Copy link

Copilot AI Dec 28, 2025

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.

Suggested change
return None

Copilot uses AI. Check for mistakes.
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():
Copy link

Copilot AI Dec 28, 2025

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:

Suggested change
if cloud_instance := get_cloud_instance():
cloud_instance = get_cloud_instance()
if cloud_instance is not None:

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,33 @@
[pytest]
# Pytest configuration for CloudFormation tests
Copy link
Collaborator Author

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]
Copy link
Collaborator Author

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]
Copy link
Collaborator Author

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"]
Copy link
Collaborator Author

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

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