Skip to content
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

extras bug in venv check? #8405

Closed
2 tasks done
sanderr opened this issue Nov 25, 2024 · 0 comments
Closed
2 tasks done

extras bug in venv check? #8405

sanderr opened this issue Nov 25, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@sanderr
Copy link
Contributor

sanderr commented Nov 25, 2024

--- a/src/inmanta/env.py
+++ b/src/inmanta/env.py
@@ -1050,9 +1050,10 @@ class ActiveEnv(PythonEnvironment):
         for c in all_constraints:
             requirement = c.requirement
             req_name = NormalizedName(requirement.name)  # requirement is already canonical
+            if requirement.marker and not requirement.marker.evaluate():
+                continue
             if req_name not in installed_versions or (
                 not requirement.specifier.contains(installed_versions[req_name], prereleases=True)
-                and (not requirement.marker or (requirement.marker and requirement.marker.evaluate()))
             ):
                 version_conflict = VersionConflict(
                     requirement=requirement,
@@ -1126,6 +1127,7 @@ class ActiveEnv(PythonEnvironment):
         constraint_violations: set[VersionConflict] = {
             VersionConflict(constraint, installed_versions.get(constraint.name, None))
             for constraint in all_constraints
+            if not requirement.marker or requirement.marker.evaluate()
             if constraint.name not in installed_versions
             or not constraint.specifier.contains(installed_versions[constraint.name], prereleases=True)
         }
  • verify bug -> confirmed by running manual compile
  • fix. evaluate() may or may not require a parameter -> see other call to the method in env.py
@sanderr sanderr added the bug Something isn't working label Nov 25, 2024
inmantaci pushed a commit that referenced this issue Nov 27, 2024
)

# Description

closes #8405

# Self Check:

Strike through any lines that are not applicable (`~~line~~`) then check the box

- [x] Attached issue to pull request
- [x] Changelog entry
- [x] Type annotations are present
- [x] Code is clear and sufficiently documented
- [x] No (preventable) type errors (check using make mypy or make mypy-diff)
- [ ] Sufficient test cases (reproduces the bug/tests the requested feature)
- [x] Correct, in line with design
- [ ] End user documentation is included or an issue is created for end-user documentation (add ref to issue here: )
- [ ] If this PR fixes a race condition in the test suite, also push the fix to the relevant stable branche(s) (see [test-fixes](https://internal.inmanta.com/development/core/tasks/build-master.html#test-fixes) for more info)
inmantaci pushed a commit that referenced this issue Nov 27, 2024
)

Pull request opened by the merge tool on behalf of #8418
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants