Skip to content

poetry lock/export wrong with sys_platform (works fine on ver 1.0.10) #3112

Closed

Description

@mozartilize
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Ubuntu 20.04
  • Poetry version: 1.1.2 & 1.0.10
  • pyproject.toml
[tool.poetry]
name = "testpoetry-pywin32"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "~3.8"
azureml-widgets = "1.15.0"
azureml-dataset-runtime = "^1.15.0"

[tool.poetry.dev-dependencies]

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

Issue

run poetry lock then poetry export --without-hashes

version 1.0.10

pywin32==228; sys_platform == "win32" and python_version >= "3.6" or platform_system == "Windows" or sys_platform == "win32"

version 1.1.0 & above

pywin32==228
pywin32==228; platform_system == "Windows"
pywin32==228; sys_platform == "win32"

Activity

  1. added a commit that references this issue on Oct 9, 2020
    9461797
  2. abn commented on Oct 9, 2020

    @abn
    Member

    Can you please try the fix at #3119.

    Using pipx

    pipx install --suffix=@3119 'poetry @ git+https://github.com/python-poetry/poetry.git@refs/pull/3119/head'

    Using a container (podman | docker)

    podman run --rm -i --entrypoint bash python:3.8 <<EOF
    set -e
    python -m pip install -q git+https://github.com/python-poetry/poetry.git@refs/pull/3119/head
    python -m poetry new foobar
    pushd foobar
    sed -i /pytest/d pyproject.toml
    python -m poetry add --python '~3.8' azureml-widgets@1.15.0 azureml-dataset-runtime@^1.15.0
    python -m poetry lock
    python -m poetry export --without-hashes | grep pywin32
    EOF

    This hould output the following.

    pywin32==228; sys_platform == "win32" and python_version >= "3.8" and python_version < "3.9" and platform_system == "Windows"
    
  3. added a commit that references this issue on Oct 9, 2020
    946393c
  4. mozartilize commented on Oct 9, 2020

    @mozartilize
    Author

    @abn Hi, I can confirm that the fix works!

  5. added 5 commits that reference this issue on Oct 12, 2020
    a63e461
    336399f
    48caa17
    e78a67b
    88b1313
  6. kichik commented on Feb 5, 2021

    @kichik

    I am still able to reproduce this issue with Poetry 1.1.4. I used the following pyproject.toml on both Windows and in the python:3.7 Docker image. After locking I can see the right data in poetry.lock. But when exporting all of a sudden it removes the platform limitations.

    [tool.poetry]
    name = "testpoetry-pywin32"
    version = "0.1.0"
    description = ""
    authors = []
    
    [tool.poetry.dependencies]
    python = "~3.7"
    azure-identity = "^1.5.0"
    
    [tool.poetry.dev-dependencies]
    
    [build-system]
    requires = ["poetry>=0.12"]
    build-backend = "poetry.masonry.api"
    

    And this is the export result:

    $ poetry export | grep pywin32
    pywin32==300 \
    

    If I revert to Poetry 1.1.3, it works fine.

  7. radiophysicist commented on Aug 18, 2021

    @radiophysicist

    The same on version 1.1.7 in docker (but not reproduced on bare linux host)

  8. elben10 commented on Dec 3, 2021

    @elben10

    Any news on this issue?

  9. matan129 commented on Jan 12, 2022

    @matan129

    Looks like this is resolved in 1.1.12 by #4686

  10. added a commit that references this issue on Feb 26, 2024
    1188b31
  11. github-actions commented on Mar 2, 2024

    @github-actions

    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.

  12. locked as resolved and limited conversation to collaborators on Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions