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

Poetry installer script fails on Heroku-24 with an HTTP 404 #71

Closed
edmorley opened this issue Jun 25, 2024 · 3 comments
Closed

Poetry installer script fails on Heroku-24 with an HTTP 404 #71

edmorley opened this issue Jun 25, 2024 · 3 comments

Comments

@edmorley
Copy link

Using this buildpack on Heroku-24 currently fails with:

-----> Python Poetry app detected
-----> No Poetry version specified in POETRY_VERSION config var. Defaulting to latest.
-----> Generate requirements.txt with Poetry
-----> Install Poetry
Traceback (most recent call last):
  File "<stdin>", line 314, in make
ModuleNotFoundError: No module named 'ensurepip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 945, in <module>
  File "<stdin>", line 923, in main
  File "<stdin>", line 560, in run
  File "<stdin>", line 581, in install
  File "/usr/lib/python3.12/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "<stdin>", line 653, in make_env
  File "<stdin>", line 639, in make_env
  File "<stdin>", line 340, in make
  File "/usr/lib/python3.12/urllib/request.py", line 215, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 521, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 630, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 559, in error
    return self._call_chain(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 639, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
       Retrieving Poetry metadata
       
       # Welcome to Poetry!
       
       This will download and install the latest version of Poetry,
       a dependency and package manager for Python.
       
       It will add the `poetry` command to Poetry's bin directory, located at:
       
       /app/.local/bin
       
       You can uninstall at any time by executing this script with the --uninstall option,
       and these changes will be reverted.
       
       Installing Poetry (1.8.3)
       Installing Poetry (1.8.3): Creating environment
 !     Push rejected, failed to compile Python Poetry app.

This is because:

  1. Ubuntu 24.04's system Python is now Python 3.12 (as opposed to Ubuntu 20.04's Python 3.10)
  2. The Poetry installer downloads the virtualenv package from URLs that contain the Python version like https://bootstrap.pypa.io/virtualenv/3.10/virtualenv.pyz
  3. The upstream virtualenv project hasn't published the zipapp for Python 3.12 - ie: https://bootstrap.pypa.io/virtualenv/3.12/virtualenv.pyz doesn't exist yet

See:
python-poetry/install.python-poetry.org#142
pypa/virtualenv#2744

This will be resolved by:
pypa/get-virtualenv#46

@edmorley edmorley changed the title Poetry installer script fails on Heroku-24 with HTTP 404 Poetry installer script fails on Heroku-24 with an HTTP 404 Jun 25, 2024
@mm-matthias
Copy link
Contributor

@edmorley Thanks for your issue report.

What is the conclusion for this project? Do you want to wait until pypa/get-virtualenv#46 gets resolved and then close this issue or is there something to do in this project?

@edmorley
Copy link
Author

Hi! I opened this issue mainly for awareness, and so others didn't have to spend time debugging too.

The upstream virtualenv change has just been merged, so this buildpack should now work on Heroku-24 :-)

@mm-matthias
Copy link
Contributor

@edmorley Very nice, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants