JRubics / poetry-publish

An action to build and publish python package to pypi (https://pypi.org/) using poetry (https://github.com/sdispater/poetry)
BSD 3-Clause "New" or "Revised" License
129 stars 17 forks source link

ChefBuildError #50

Open vadim0x60 opened 4 months ago

vadim0x60 commented 4 months ago

The build of my programlib library fails with the following

Installing collected packages: trove-classifiers, ptyprocess, fastjsonschema, distlib, urllib3, tomlkit, shellingham, rapidfuzz, pyproject-hooks, pycparser, poetry-core, platformdirs, pkginfo, pexpect, packaging, msgpack, more-itertools, jeepney, installer, idna, filelock, crashtest, charset-normalizer, certifi, virtualenv, requests, jaraco.classes, dulwich, cleo, cffi, build, requests-toolbelt, cryptography, cachecontrol, SecretStorage, keyring, poetry-plugin-export, poetry
Successfully installed SecretStorage-3.3.3 build-1.0.3 cachecontrol-0.13.1 certifi-2024.2.2 cffi-1.16.0 charset-normalizer-3.3.2 cleo-2.1.0 crashtest-0.4.1 cryptography-42.0.2 distlib-0.3.8 dulwich-0.21.7 fastjsonschema-2.19.1 filelock-3.13.1 idna-3.6 installer-0.7.0 jaraco.classes-3.3.1 jeepney-0.8.0 keyring-24.3.0 more-itertools-10.2.0 msgpack-1.0.7 packaging-23.2 pexpect-4.9.0 pkginfo-1.9.6 platformdirs-3.11.0 poetry-1.7.1 poetry-core-1.8.1 poetry-plugin-export-1.6.0 ptyprocess-0.7.0 pycparser-2.21 pyproject-hooks-1.0.0 rapidfuzz-3.6.1 requests-2.31.0 requests-toolbelt-1.0.0 shellingham-1.5.4 tomlkit-0.12.3 trove-classifiers-2024.1.31 urllib3-2.2.0 virtualenv-20.25.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Notice:  A new release of pip is available: 23.2.1 -> 24.0
Notice:  To update, run: pip install --upgrade pip
Creating virtualenv programlib-cDQ_M3T8-py3.12 in /github/home/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies...

Package operations: 5 installs, 0 updates, 0 removals

  • Installing ptyprocess (0.7.0)
  • Installing wcwidth (0.2.13)
  • Installing numpy (1.24.4)
  • Installing pexpect (4.9.0)
  • Installing pyte (0.8.2)

  ChefBuildError

  Backend 'setuptools.build_meta:__legacy__' is not available.

  Traceback (most recent call last):
    File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
      obj = import_module(mod_path)
            ^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
    File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
    File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
    File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 994, in exec_module
    File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
    File "/tmp/tmpkolr5chf/.venv/lib/python3.12/site-packages/setuptools/__init__.py", line 10, in <module>
      import distutils.core
  ModuleNotFoundError: No module named 'distutils'

  at /usr/local/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare
      160│ 
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│ 
      163│             if error is not None:
    → 164│                 raise error from None
      165│ 
      166│             return path
      167│ 
      [168](https://github.com/vadim0x60/programlib/actions/runs/7916527733/job/21610561007#step:4:169)│     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 numpy (1.24.4) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "numpy (==1.24.4)"'.

Building and publishing locally with poetry publish --build works just fine