Skip to content

Conversation

@ubreblanca
Copy link
Contributor

@ubreblanca ubreblanca commented Dec 26, 2025

The problem: packaging is imported in acquisition.py but not defined in pyproject.toml. This leads to a ModuleNotFoundError when trying to import bayes_opt after installing the requirements.

~/BayesianOptimization % uv sync
Using CPython 3.14.1
Creating virtual environment at: .venv
Resolved 190 packages in 79ms
      Built bayesian-optimization @ file:///Users/user/BayesianOptimization
Prepared 1 package in 449ms
Installed 7 packages in 31ms
 + bayesian-optimization==3.1.0 (from file:///Users/user/BayesianOptimization)
 + colorama==0.4.6
 + joblib==1.5.3
 + numpy==2.4.0
 + scikit-learn==1.8.0
 + scipy==1.16.3
 + threadpoolctl==3.6.0

~/BayesianOptimization % uv run python -c "import bayes_opt"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import bayes_opt
  File "/Users/user/BayesianOptimization/bayes_opt/__init__.py", line 7, in <module>
    from bayes_opt import acquisition
  File "/Users/user/BayesianOptimization/bayes_opt/acquisition.py", line 30, in <module>
    from packaging import version
ModuleNotFoundError: No module named 'packaging'

~/BayesianOptimization % uv add packaging
Resolved 190 packages in 82ms
      Built bayesian-optimization @ file:///Users/user/BayesianOptimization
Prepared 1 package in 426ms
Uninstalled 1 package in 0.86ms
Installed 2 packages in 1ms
 ~ bayesian-optimization==3.1.0 (from file:///Users/user/BayesianOptimization)
 + packaging==25.0

~/BayesianOptimization % uv sync
Resolved 190 packages in 2ms
Audited 8 packages in 0.48ms

~/BayesianOptimization % uv run python -c "import bayes_opt"

~/BayesianOptimization % 

Solution: This adds packaging to the project dependencies.

Summary by CodeRabbit

  • Chores
    • Updated project dependencies to require the Python packaging library (packaging) version >= 20.0.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 26, 2025

📝 Walkthrough

Walkthrough

A single runtime dependency packaging>=20.0 was added to the project's [project] dependencies in pyproject.toml. This is a configuration-level change with no functional or control-flow modifications.

Changes

Cohort / File(s) Summary
Dependency Addition
pyproject.toml
Added runtime dependency constraint packaging>=20.0 to the [project] dependencies section

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A tiny line hops into view,
packaging@twenty joins the crew,
No code to change, just tidy and bright,
Dependencies snug for morning and night 🌙✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the main change: adding the packaging dependency to the project.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7e005d and aff39f7.

📒 Files selected for processing (1)
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • pyproject.toml

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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)
pyproject.toml (1)

23-23: Use a more conservative version constraint for better compatibility.

The packaging>=25.0 constraint is unnecessarily restrictive. Since the code only uses packaging.version.parse() — a stable API available since v14.1 (2014) — a more conservative constraint like >=20.0 would provide broader compatibility and reduce potential dependency conflicts with other packages that specify lower version bounds.

Consider changing to:

-    "packaging>=25.0",
+    "packaging>=20.0",
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c410d51 and d7e005d.

📒 Files selected for processing (1)
  • pyproject.toml

@codecov
Copy link

codecov bot commented Dec 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.89%. Comparing base (c410d51) to head (aff39f7).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #596   +/-   ##
=======================================
  Coverage   97.89%   97.89%           
=======================================
  Files          10       10           
  Lines        1185     1185           
=======================================
  Hits         1160     1160           
  Misses         25       25           

☔ 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.

@till-m till-m merged commit 4bca224 into bayesian-optimization:master Dec 27, 2025
15 checks passed
@till-m
Copy link
Member

till-m commented Dec 27, 2025

Thanks for the contribution!

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