ahupp / python-magic

A python wrapper for libmagic
Other
2.65k stars 283 forks source link

0.4.26 sdist contains accidental/broken `pyproject.toml`? #270

Closed branchvincent closed 2 years ago

branchvincent commented 2 years ago

πŸ‘‹ We're trying to build python-magic from source for a separate Homebrew package in https://github.com/Homebrew/homebrew-core/pull/102953, and we noticed the latest release contains the following misconfigured pyproject.toml:

pyproject.toml

```toml [tool.poetry] name = "python-magic" version = "0.4.26" description = "python-magic is a Python interface to the libmagic file type" authors = ["identification libra"] license = "MIT" # packages = [{ include = "magic" }] # <--- This missing piece causes the issue [tool.poetry.dependencies] python = "^3.10" [tool.poetry.dev-dependencies] [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" ```

This breaks pip, since the file takes precedence over setup.py:

pip install --no-binary=:all: python-magic==0.4.26

```console Collecting python-magic==0.4.26 Downloading python-magic-0.4.26.tar.gz (14 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error Γ— Preparing metadata (pyproject.toml) did not run successfully. β”‚ exit code: 1 ╰─> [16 lines of output] Traceback (most recent call last): File "/private/var/folders/_5/r72flrlx5bxb8sd0_3rq14c80000gq/T/tmp.OtUtfB3K/.venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in main() File "/private/var/folders/_5/r72flrlx5bxb8sd0_3rq14c80000gq/T/tmp.OtUtfB3K/.venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/private/var/folders/_5/r72flrlx5bxb8sd0_3rq14c80000gq/T/tmp.OtUtfB3K/.venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel return hook(metadata_directory, config_settings) File "/private/var/folders/_5/r72flrlx5bxb8sd0_3rq14c80000gq/T/pip-build-env-6yinl9m6/overlay/lib/python3.10/site-packages/poetry/core/masonry/api.py", line 44, in prepare_metadata_for_build_wheel builder = WheelBuilder(poetry) File "/private/var/folders/_5/r72flrlx5bxb8sd0_3rq14c80000gq/T/pip-build-env-6yinl9m6/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 58, in __init__ super(WheelBuilder, self).__init__(poetry, executable=executable) File "/private/var/folders/_5/r72flrlx5bxb8sd0_3rq14c80000gq/T/pip-build-env-6yinl9m6/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/builder.py", line 85, in __init__ self._module = Module( File "/private/var/folders/_5/r72flrlx5bxb8sd0_3rq14c80000gq/T/pip-build-env-6yinl9m6/overlay/lib/python3.10/site-packages/poetry/core/masonry/utils/module.py", line 63, in __init__ raise ModuleOrPackageNotFound( poetry.core.masonry.utils.module.ModuleOrPackageNotFound: No file/folder found for package python-magic [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed Γ— Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. ```

Assuming this was accidentally included?

ahupp commented 2 years ago

Yes, that was an accident, the pyproject.toml was an untracked file my working dir when I created the package. 0.4.27 is published with the file removed. Thanks for letting me know!