Skip to content

update requirement test #647

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

Merged
merged 1 commit into from
May 9, 2025
Merged

update requirement test #647

merged 1 commit into from
May 9, 2025

Conversation

jan-janssen
Copy link
Member

@jan-janssen jan-janssen commented May 9, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Ensured that build system requirements are now included alongside optional dependencies in the dependencies list.

Copy link
Contributor

coderabbitai bot commented May 9, 2025

Walkthrough

The code was updated so that the list lst is now initialized with the existing build system requirements from data['build-system']['requires'] instead of starting as an empty list. All optional dependencies are still appended, and the logic for updating dependencies remains unchanged.

Changes

File(s) Change Summary
.ci_support/check.py Changed initialization of lst to include data['build-system']['requires'] instead of empty list

Poem

In the warren of code, a list grew anew,
Now seeded with builds, not just empty dew.
Dependencies gathered, both old and the fresh,
Hopping together in a requirements mesh.
With every new start, may your builds run true! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfb7c02 and 0f15ff0.

📒 Files selected for processing (1)
  • .ci_support/check.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .ci_support/check.py
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.ci_support/check.py (1)

4-16: Consider adding error handling and documentation.

The script lacks error handling for missing keys in the TOML structure and documentation explaining its purpose. Consider adding exception handling for potential KeyError exceptions and a docstring to explain the script's functionality.

 import tomlkit


 if __name__ == "__main__":
+    """
+    Updates project dependencies in pyproject.toml by combining build-system requirements
+    and optional dependencies, and adding them to the project.dependencies list.
+    """
     with open("pyproject.toml", "r") as f:
         data = tomlkit.load(f)

-    lst = list(data['build-system']['requires'])
+    try:
+        lst = list(data['build-system']['requires'])
+    except KeyError:
+        print("Warning: build-system.requires not found in pyproject.toml")
+        lst = []
     for sub_lst in data["project"]["optional-dependencies"].values():
         for el in sub_lst:
             lst.append(el)

-    data["project"]["dependencies"] += list(set(lst))
+    try:
+        data["project"]["dependencies"] += list(set(lst))
+    except KeyError:
+        print("Error: project.dependencies not found in pyproject.toml")
+        exit(1)

     with open("pyproject.toml", "w") as f:
         f.writelines(tomlkit.dumps(data))
🧰 Tools
🪛 Ruff (0.8.2)

5-5: Unnecessary open mode parameters

Remove open mode parameters

(UP015)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc3f18c and dfb7c02.

📒 Files selected for processing (1)
  • .ci_support/check.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: unittest_win
  • GitHub Check: unittest_old
  • GitHub Check: notebooks
  • GitHub Check: notebooks_integration
  • GitHub Check: minimal
🔇 Additional comments (1)
.ci_support/check.py (1)

8-8:

✅ Verification successful

Change enhances dependency management by including build requirements.

This change initializes lst with build system requirements instead of an empty list, ensuring build dependencies are included in the project dependencies. This makes the dependency management more comprehensive.


🏁 Script executed:

#!/bin/bash
# Check if the pyproject.toml file has both build-system.requires and project.dependencies sections
if [ -f pyproject.toml ]; then
  echo "Checking pyproject.toml structure..."
  # Check if build-system.requires exists and is not empty
  if ! grep -q "build-system" pyproject.toml || ! grep -q "requires" pyproject.toml; then
    echo "Warning: build-system.requires section might be missing in pyproject.toml"
    cat pyproject.toml | grep -A 10 "build-system"
  fi
  
  # Check if project.dependencies exists
  if ! grep -q "project" pyproject.toml || ! grep -q "dependencies" pyproject.toml; then
    echo "Warning: project.dependencies section might be missing in pyproject.toml"
    cat pyproject.toml | grep -A 10 "project"
  fi
else
  echo "pyproject.toml not found in the current directory"
fi

Length of output: 253


✅ Confirmed: Build-System Requirements Included

The initialization of lst with data['build-system']['requires'] in .ci_support/check.py correctly picks up the build dependencies. We’ve verified that pyproject.toml contains both a non-empty [build-system].requires section and a [project].dependencies section, so this change safely and comprehensively includes build requirements in the dependency checks.

Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.81%. Comparing base (90f870c) to head (0f15ff0).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #647   +/-   ##
=======================================
  Coverage   96.81%   96.81%           
=======================================
  Files          29       29           
  Lines        1288     1288           
=======================================
  Hits         1247     1247           
  Misses         41       41           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jan-janssen jan-janssen merged commit 4084bf0 into main May 9, 2025
49 of 53 checks passed
@jan-janssen jan-janssen deleted the extend_check branch May 9, 2025 17:42
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.

1 participant