Skip to content

poetry install with build script fails on 1.2.0 #4979

Closed

Description

@matteosantama
❯ poetry --version
Poetry (version 1.2.0a2)

I am trying to run poetry install. This configuration works on 1.1.12

# pyproject.toml
[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["Matteo Santamaria <XXX@gmail.com>"]
readme = "README.md"
build = "build.py"

[tool.poetry.dependencies]
python = "3.8"

[tool.poetry.dev-dependencies]
numpy = "^1.22.0"

[build-system]
requires = ["poetry-core", "numpy>=1.22.0,<=1.23.0"] 
build-backend = "poetry.core.masonry.api"
# build.py
import numpy as np

def build(setup_kwargs):
    return setup_kwargs

but fails on 1.2.0a2.

Tested on macOS Monterey Version 12.0.1 Apple M1 Pro

Activity

  1. matteosantama commented on Jan 4, 2022

    @matteosantama
    Author

    It's worth mentioning that I am running these commands in a virtual environment not managed by poetry

  2. finswimmer commented on Jan 4, 2022

    @finswimmer
    Member

    Hello @matteosantama,

    this is a duplicate of #2789.

    fin swimmer

  3. matteosantama commented on Jan 4, 2022

    @matteosantama
    Author

    @finswimmer I've updated my original post the better reflect the problem. What I've identified is related to your linked issue, but different in that it demonstrates a 1.1.x -> 1.2.x regression. Any project that uses a build script this way will be adversely impacted by upgrading to 1.2.x

    I think this issue should be re-opened and placed in the 1.2 milestone.

  4. hdk5 commented on Jan 28, 2022

    @hdk5

    I second this issue.

    It should be noted that this issue does not happen with build command, and is caused by --use-pep517 flag usage for pip install

  5. abn commented on May 10, 2022

    @abn
    Member

    @matteosantama can you provide a bit more detail on the error?

    EDIT: Nevermind was able to reproduce it with your provided configuration.

    The root cause here is the change in build configuration. You should configure your build script as follows.

    [tool.poetry.build]
    script = "build.py"
    generate-setup-file = false

    Additionally, if you want to generate a setup.py file for the build you are also missing setuptools in your build-system.requirees.

  6. reopened this on May 11, 2022
  7. abn commented on May 11, 2022

    @abn
    Member

    Reopening this as the issue exists when a setup.py file was generated forcefully. Do note that build scripts are still an experimental feature and breakages can occur.

    #5590 should fix the reported issue. Additionally, #5401 should improve the experience when generate-setup-file = false.

  8. nischalat commented on Sep 8, 2022

    @nischalat

    I'm still having this issue with my docker build. I get the following error "Version 1.2.0 is not supported by this installer!". However I'm using the poetry 1.20 in my local env and it works just fine. Anyone knows how I can fix this. I'm using the following
    RUN /bin/bash -ci "curl -sSLk https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python"

  9. neersighted commented on Sep 8, 2022

    @neersighted
    Member

    This issue tracks setup.py + build script support. The issue you are having is use of an unsupported, deprecated installer (#6377 for more details) -- you need to migrate to install.python-poetry.org as described in the documentation or release announcement.

  10. nischalat commented on Sep 9, 2022

    @nischalat

    Thanks for the quick response @neersighted I was able to install poetry. However, I'm running into issues with the path and unable to find poetry in my Docker file. Below is what I'm running. Apologies if I'm posting this on the wrong thread

    RUN /bin/bash -ci "curl -sSL https://install.python-poetry.org | python -"
    RUN echo "source $HOME/.local/bin" >> /root/.bashrc
    RUN /bin/bash -ci "poetry config virtualenvs.create false"
    RUN /bin/bash -ci "poetry --version"

  11. neersighted commented on Sep 9, 2022

    @neersighted
    Member

    You should set environmental variables in a Dockerfile using the ENV directive.

    RUN curl -sSL https://install.python-poetry.org/ | python3 - --version 1.2.0
    ENV PATH="$HOME/.local/bin:$PATH"
    RUN poetry --version

    Please do not turn off virtualenv creation -- you are likely to run into way more problems for no benefit. The ability to turn off virtualenv creation was intended as a "I know what I am doing" feature for very advanced users -- if you don't know why you need it off, you do not need it off -- see #6398 for a roundup issue on this topic.

    Finally, please don't use this solved issue for support -- you are sending notifications to everyone who has participated in it for something that is off-topic. Please start a Discussion on the discussion tab, or join the Discord server if you need support from the community.

  12. github-actions commented on Mar 1, 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.

  13. locked as resolved and limited conversation to collaborators on Mar 1, 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