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

Issue with platform_release and platform_version markers #9792

Closed
FeodorFitsner opened this issue Oct 24, 2024 · 4 comments
Closed

Issue with platform_release and platform_version markers #9792

FeodorFitsner opened this issue Oct 24, 2024 · 4 comments
Labels
kind/question User questions (candidates for conversion to discussion)

Comments

@FeodorFitsner
Copy link

Description

I've filed #9434 and I see it was supposed to be fixed in python-poetry/poetry-core#722 and I see there are tests supposedly verifying problematic markers.

However, I'm still unable to use 'something' not in platform_version neither markers from #7418 (which is also closed as "fixed"?).

What the status of that fix? Is it included into the latest Poetry release?

Workarounds

no workarounds

Poetry Installation Method

install.python-poetry.org

Operating System

macOS 14.6.1

Poetry Version

1.8.4

Poetry Configuration

cache-dir = "/Users/feodor/Library/Caches/pypoetry"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
solver.lazy-wheel = true
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /Users/feodor/Library/Caches/pypoetry/virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true

Python Sysconfig

No response

Example pyproject.toml

[tool.poetry]
name = "3"
version = "0.1.0"
description = ""
authors = ["Feodor Fitsner <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"
oauthlib = { version = "^3.2.2", markers = "platform_system == 'Darwin' and 'arm' not in platform_version" }

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Poetry Runtime Logs

feodor@Feodors-MBP 3 % poetry -vvv install
Loading configuration file /Users/feodor/Library/Application Support/pypoetry/config.toml
Using virtualenv: /Users/feodor/Library/Caches/pypoetry/virtualenvs/3-3kB6RLQA-py3.12
Installing dependencies from lock file

Finding the necessary packages for the current system

  Stack trace:

  19  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/cleo/application.py:327 in run
       325│ 
       326│             try:
     → 327│                 exit_code = self._run(io)
       328│             except BrokenPipeError:
       329│                 # If we are piped to another process, it may close early and send a

  18  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/console/application.py:190 in _run
       188│         self._load_plugins(io)
       189│ 
     → 190│         exit_code: int = super()._run(io)
       191│         return exit_code
       192│ 

  17  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/cleo/application.py:431 in _run
       429│             io.input.interactive(interactive)
       430│ 
     → 431│         exit_code = self._run_command(command, io)
       432│         self._running_command = None
       433│ 

  16  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/cleo/application.py:473 in _run_command
       471│ 
       472│         if error is not None:
     → 473│             raise error
       474│ 
       475│         return terminate_event.exit_code

  15  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/cleo/application.py:457 in _run_command
       455│ 
       456│             if command_event.command_should_run():
     → 457│                 exit_code = command.run(io)
       458│             else:
       459│                 exit_code = ConsoleCommandEvent.RETURN_CODE_DISABLED

  14  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/cleo/commands/base_command.py:117 in run
       115│         io.input.validate()
       116│ 
     → 117│         return self.execute(io) or 0
       118│ 
       119│     def merge_application_definition(self, merge_args: bool = True) -> None:

  13  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/cleo/commands/command.py:61 in execute
        59│ 
        60│         try:
     →  61│             return self.handle()
        62│         except KeyboardInterrupt:
        63│             return 1

  12  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/console/commands/install.py:153 in handle
       151│         self.installer.verbose(self.io.is_verbose())
       152│ 
     → 153│         return_code = self.installer.run()
       154│ 
       155│         if return_code != 0:

  11  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/installer.py:104 in run
       102│             self.verbose(True)
       103│ 
     → 104│         return self._do_install()
       105│ 
       106│     def dry_run(self, dry_run: bool = True) -> Installer:

  10  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/installation/installer.py:301 in _do_install
       299│ 
       300│         with solver.use_environment(self._env):
     → 301│             ops = solver.solve(use_latest=self._whitelist).calculate_operations(
       302│                 with_uninstalls=self._requires_synchronization,
       303│                 synchronize=self._requires_synchronization,

   9  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/puzzle/solver.py:71 in solve
        69│         with self._progress(), self._provider.use_latest_for(use_latest or []):
        70│             start = time.time()
     →  71│             packages, depths = self._solve()
        72│             end = time.time()
        73│ 

   8  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/puzzle/solver.py:154 in _solve
       152│ 
       153│         try:
     → 154│             result = resolve_version(self._package, self._provider)
       155│ 
       156│             packages = result.packages

   7  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/mixology/__init__.py:18 in resolve_version
        16│     solver = VersionSolver(root, provider)
        17│ 
     →  18│     return solver.solve()
        19│ 

   6  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/mixology/version_solver.py:175 in solve
       173│             while next is not None:
       174│                 self._propagate(next)
     → 175│                 next = self._choose_package_version()
       176│ 
       177│             return self._result()

   5  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/mixology/version_solver.py:514 in _choose_package_version
       512│             package = locked
       513│ 
     → 514│         package = self._provider.complete_package(package)
       515│ 
       516│         conflict = False

   4  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/puzzle/provider.py:544 in complete_package
       542│                 continue
       543│ 
     → 544│             if self._env and not dep.marker.validate(self._env.marker_env):
       545│                 continue
       546│ 

   3  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/core/version/markers.py:649 in validate
        647│ 
        648│     def validate(self, environment: dict[str, Any] | None) -> bool:
     →  649│         return all(m.validate(environment) for m in self._markers)
        650│ 
        651│     def without_extras(self) -> BaseMarker:

   2  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/core/version/markers.py:649 in <genexpr>
        647│ 
        648│     def validate(self, environment: dict[str, Any] | None) -> bool:
     →  649│         return all(m.validate(environment) for m in self._markers)
        650│ 
        651│     def without_extras(self) -> BaseMarker:

   1  ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/core/version/markers.py:268 in validate
        266│         # to know that.
        267│         constraint = self._parser(environment[self._name])
     →  268│         return self._constraint.allows(constraint)  # type: ignore[arg-type]
        269│ 
        270│     def without_extras(self) -> BaseMarker:

  ValueError

  Unimplemented comparison of constraints

  at ~/Library/Application Support/pypoetry/venv/lib/python3.12/site-packages/poetry/core/constraints/generic/constraint.py:58 in allows
       54│         return self._operator
       55│ 
       56│     def allows(self, other: BaseConstraint) -> bool:
       57│         if not isinstance(other, Constraint):
    →  58│             raise ValueError("Unimplemented comparison of constraints")
       59│ 
       60│         is_equal_op = self._operator == "=="
       61│         is_non_equal_op = self._operator == "!="
       62│         is_other_equal_op = other.operator == "=="
@FeodorFitsner FeodorFitsner added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 24, 2024
@dimbleby
Copy link
Contributor

dimbleby commented Oct 24, 2024

What the status of that fix? Is it included into the latest Poetry release?

You can answer such questions for yourself by looking at the code. https://github.com/python-poetry/poetry-core/tree/1.9.1

@FeodorFitsner
Copy link
Author

Thanks. Alright, the fix was merged into main but didn't make it to 1.9.1 (which was mostly Python 3.13 support).
Is it going to be a part of poetry-core 2.0? Is there any info when it could be expected?

@radoering radoering added kind/question User questions (candidates for conversion to discussion) and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 27, 2024
@radoering
Copy link
Member

Answered in #9793

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/question User questions (candidates for conversion to discussion)
Projects
None yet
Development

No branches or pull requests

3 participants