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

aeneas build fails in Poetry, succeeds with pip wheel --use-pep517 #8462

Closed
4 tasks done
itsjamie opened this issue Sep 22, 2023 · 5 comments · Fixed by #8463
Closed
4 tasks done

aeneas build fails in Poetry, succeeds with pip wheel --use-pep517 #8462

itsjamie opened this issue Sep 22, 2023 · 5 comments · Fixed by #8463
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@itsjamie
Copy link
Contributor

itsjamie commented Sep 22, 2023

  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.
Package operations: 5 installs, 0 updates, 0 removals, 126 skipped

  • Installing aeneas (1.7.3.0): Pending...
  • Installing aeneas (1.7.3.0): Preparing...
  • Installing aeneas (1.7.3.0): Failed

  Stack trace:

  8  ~/Library/Application Support/pypoetry/lib/python3.11/site-packages/poetry/installation/executor.py:286 in _execute_operation
      284│ 
      285│             try:
    → 286│                 result = self._do_execute_operation(operation)
      287│             except EnvCommandError as e:
      288│                 if e.e.returncode == -2:

  7  ~/Library/Application Support/pypoetry/lib/python3.11/site-packages/poetry/installation/executor.py:386 in _do_execute_operation
      384│             return 0
      385│ 
    → 386│         result: int = getattr(self, f"_execute_{method}")(operation)
      387│ 
      388│         if result != 0:

  6  ~/Library/Application Support/pypoetry/lib/python3.11/site-packages/poetry/installation/executor.py:511 in _execute_install
      509│ 
      510│     def _execute_install(self, operation: Install | Update) -> int:
    → 511│         status_code = self._install(operation)
      512│ 
      513│         self._save_url_reference(operation)

  5  ~/Library/Application Support/pypoetry/lib/python3.11/site-packages/poetry/installation/executor.py:549 in _install
      547│             archive = self._download_link(operation, Link(package.source_url))
      548│         else:
    → 549│             archive = self._download(operation)
      550│ 
      551│         operation_message = self.get_operation_message(operation)

  4  ~/Library/Application Support/pypoetry/lib/python3.11/site-packages/poetry/installation/executor.py:753 in _download
      751│             self._yanked_warnings.append(message)
      752│ 
    → 753│         return self._download_link(operation, link)
      754│ 
      755│     def _download_link(self, operation: Install | Update, link: Link) -> Path:

  3  ~/Library/Application Support/pypoetry/lib/python3.11/site-packages/poetry/installation/executor.py:800 in _download_link
      798│             self._write(operation, message)
      799│ 
    → 800│             archive = self._chef.prepare(archive, output_dir=output_dir)
      801│ 
      802│         # Use the original archive to provide the correct hash.

  2  ~/Library/Application Support/pypoetry/lib/python3.11/site-packages/poetry/installation/chef.py:101 in prepare
       99│             return self._prepare(archive, destination=destination, editable=editable)
      100│ 
    → 101│         return self._prepare_sdist(archive, destination=output_dir)
      102│ 
      103│     def _prepare(

  1  ~/Library/Application Support/pypoetry/lib/python3.11/site-packages/poetry/installation/chef.py:185 in _prepare_sdist
      183│             destination.mkdir(parents=True, exist_ok=True)
      184│ 
    → 185│             return self._prepare(
      186│                 sdist_dir,
      187│                 destination,

  ChefBuildError

  Backend subprocess exited when trying to invoke get_requires_for_build_wheel
  
  [ERRO] You must install numpy before installing aeneas
  [INFO] Try the following command:
  [INFO] $ sudo pip install numpy
  

  at ~/Library/Application Support/pypoetry/lib/python3.11/site-packages/poetry/installation/chef.py:147 in _prepare
      143│ 
      144│                 error = ChefBuildError("\n\n".join(message_parts))
      145│ 
      146│             if error is not None:
    → 147│                 raise error from None
      148│ 
      149│             return path
      150│ 
      151│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with aeneas (1.7.3.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "aeneas (==1.7.3.0)"'.

Issue

As indicated above, I found that setting LIBRARY_PATH=/opt/homebrew/lib was a requirement for pip wheel --use-pep517 "aeneas (==1.7.3.0)"' to succeed due to /opt/homebrew/lib not being passed via the aeneas build.

However, setting that here, building this still doesn't succeed.

The error comes from the following:
https://github.com/readbeyond/aeneas/blob/v1.7.3/setup.py#L188-L195

@itsjamie itsjamie added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 22, 2023
@dimbleby
Copy link
Contributor

per the error message you'll need to report this to aeneas: that package does not support pep517 builds

since their last release was in 2017 I don't much like your chances, but there's nothing that poetry can do about that.

@itsjamie
Copy link
Contributor Author

Thanks for the response. I imagine the earlier issue I found with the homebrew path I would hit after this.

Looks like someone else has already hit this numpy issue and submitted a PR to fix.
https://github.com/readbeyond/aeneas/pull/272/files

Thanks for reading it.

The only confusing part about your message is that with the provided environment variable it did build with pep517 in a completely new virtualenv. But I imagine what I'm hitting is part of https://peps.python.org/pep-0518/#build-system-table

Because the use of setuptools and wheel are so expansive in the community at the moment, build tools are expected to use the example configuration file above as their default semantics when a pyproject.toml file is not present.

Not sure why it's different than what Poetry is doing. My only thought is that numpy isn't available for some reason in the Poetry install version compared to the pip build?

 LD_LIBRARY_PATH=/opt/homebrew/lib pip wheel --use-pep517 "aeneas (==1.7.3.0)"
Collecting aeneas==1.7.3.0
  Using cached aeneas-1.7.3.0-cp311-cp311-macosx_13_0_arm64.whl
Collecting BeautifulSoup4>=4.5.1 (from aeneas==1.7.3.0)
  Using cached beautifulsoup4-4.12.2-py3-none-any.whl (142 kB)
Collecting lxml>=3.6.0 (from aeneas==1.7.3.0)
  Obtaining dependency information for lxml>=3.6.0 from https://files.pythonhosted.org/packages/d6/56/9d5cb3438143a5aebad59088ca392950d74a531e1b96d0959144370b3b59/lxml-4.9.3-cp311-cp311-macosx_11_0_universal2.whl.metadata
  Using cached lxml-4.9.3-cp311-cp311-macosx_11_0_universal2.whl.metadata (3.8 kB)
Collecting numpy>=1.9 (from aeneas==1.7.3.0)
  Obtaining dependency information for numpy>=1.9 from https://files.pythonhosted.org/packages/35/21/9e150d654da358beb29fe216f339dc17f2b2ac13fff2a89669401a910550/numpy-1.26.0-cp311-cp311-macosx_11_0_arm64.whl.metadata
  Using cached numpy-1.26.0-cp311-cp311-macosx_11_0_arm64.whl.metadata (99 kB)
Collecting soupsieve>1.2 (from BeautifulSoup4>=4.5.1->aeneas==1.7.3.0)
  Obtaining dependency information for soupsieve>1.2 from https://files.pythonhosted.org/packages/4c/f3/038b302fdfbe3be7da016777069f26ceefe11a681055ea1f7817546508e3/soupsieve-2.5-py3-none-any.whl.metadata
  Using cached soupsieve-2.5-py3-none-any.whl.metadata (4.7 kB)
Using cached lxml-4.9.3-cp311-cp311-macosx_11_0_universal2.whl (8.6 MB)
Using cached numpy-1.26.0-cp311-cp311-macosx_11_0_arm64.whl (14.0 MB)
Using cached soupsieve-2.5-py3-none-any.whl (36 kB)
Saved ./aeneas-1.7.3.0-cp311-cp311-macosx_13_0_arm64.whl
Saved ./beautifulsoup4-4.12.2-py3-none-any.whl
Saved ./lxml-4.9.3-cp311-cp311-macosx_11_0_universal2.whl
Saved ./numpy-1.26.0-cp311-cp311-macosx_11_0_arm64.whl
Saved ./soupsieve-2.5-py3-none-any.whl

@itsjamie
Copy link
Contributor Author

itsjamie commented Sep 22, 2023

Nevermind!

It was because pip already had a cached variant of numpy that it succeeded using pip wheel.

Do you think a PR adding --no-cache-dir to the pip wheel recommended command might help?

@dimbleby
Copy link
Contributor

(it's the cached aeneas wheel that pip is using, the cached numpy wheel is irrelevant.)

sure, a merge request adding that parameter sounds sensible: it would have saved you and me some time today, it can save someone else some time tomorrow

itsjamie added a commit to itsjamie/poetry that referenced this issue Sep 22, 2023
When trying to determine if the issue was because of Poetry or the package not supporting PEP-517 mode, it is possible that the pip cache can result in false positives of packages that support PEP-517. An example of this is the issue python-poetry#8462. 

This PR adds to the error output and recommended command to prevent this from happening in the future.

As a new user to Python, it wasn't immediately obvious to me when running on the command line why it succeeded, and simply took that it did as enough confirmation that opening an issue was valid.
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 Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants