0

I need to install a version of poetry that has the poetry add --group support (currently version 1.2.0a2) but I need it to have this change in the poetry-core but I can't seem to change the poetry-core that is used by poetry even if I perform a pip install of poetry core on a specific commit probably because this is a PEP517 build backend module. I need to be able to recreate this "poetry hybrid build" in a docker container so I can build my project so I'm trying to find a nice way of doing it.

I've tried this but the poetry-core fix isn't there as expected.

    pip install git+https://github.com/python-poetry/poetry-core.git@af08f1ce720da467c9bf3d43eed3d9ebaf4ad7fb
    curl -sSL https://install.python-poetry.org | python3 - --preview

Does anyone know a way of doing this?

DelboyJay
  • 2,799
  • 1
  • 13
  • 18

1 Answers1

0

In case anyone else needs to do this I have this solution that works but it's hacky! I can only pray that the poetry team releases 1.2.0 with the poetry-core fix I need soon! ;-)

# TODO: Remove this block when poetry 1.2.0 official is released    
# Copy the fixed poetry-core code over the top of poetry's version  
# The destination folder is something like  
# ~/.poetry/venv/lib/python3.8/site-packages/poetry/core/   
pip install --no-deps -t /tmp/poetry-core git+https://github.com/python-poetry/poetry-core.git@af08f1ce720da467c9bf3d43eed3d9ebaf4ad7fb
    
# TODO: move to the proper 1.2.0 official version when it is released.  
curl -sSL https://install.python-poetry.org | POETRY_HOME=~/.poetry python3 - --version '1.2.0a2'
    
cp -aPrf /tmp/poetry-core/poetry/core/ $$(dirname $$(find ~/.poetry -name helpers.py | grep semver))/../..  ~/.poetry/bin/poetry --version  

# Add a symlink to poetry. This assumes ~/.local/bin is already in your path.   
if [ -d ~/.local/bin/ ] && [ ! -f ~/.local/bin/poetry ]; then ln -s ~/.poetry/bin/poetry ~/.local/bin/poetry ;fi
DelboyJay
  • 2,799
  • 1
  • 13
  • 18