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

project is not pip installable #6

Closed
hvgazula opened this issue Feb 6, 2025 · 2 comments
Closed

project is not pip installable #6

hvgazula opened this issue Feb 6, 2025 · 2 comments

Comments

@hvgazula
Copy link

hvgazula commented Feb 6, 2025

I added the following lines to the toml file to configure an entry point

[project.scripts]
bbqs-model-zoo = "bbqs-model-zoo.cli:hello_world"

following which running pip install -e . returned the following error

Obtaining file:///Users/harsha/Documents/bbqs-model-zoo
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      Traceback (most recent call last):
        File "/opt/homebrew/Caskroom/miniconda/base/envs/bbqs/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
          ~~~~^^
        File "/opt/homebrew/Caskroom/miniconda/base/envs/bbqs/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Caskroom/miniconda/base/envs/bbqs/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 181, in prepare_metadata_for_build_editable
          return hook(metadata_directory, config_settings)
        File "/private/var/folders/72/p603zl956c383bp1s1v5r0zc0000gn/T/pip-build-env-d9qmkgee/overlay/lib/python3.13/site-packages/poetry/core/masonry/api.py", line 42, in prepare_metadata_for_build_wheel
          poetry = Factory().create_poetry(Path().resolve(), with_groups=False)
        File "/private/var/folders/72/p603zl956c383bp1s1v5r0zc0000gn/T/pip-build-env-d9qmkgee/overlay/lib/python3.13/site-packages/poetry_dynamic_versioning/patch.py", line 23, in alt_poetry_create
          instance = original_poetry_create(cls, *args, **kwargs)
        File "/private/var/folders/72/p603zl956c383bp1s1v5r0zc0000gn/T/pip-build-env-d9qmkgee/overlay/lib/python3.13/site-packages/poetry/core/factory.py", line 59, in create_poetry
          raise RuntimeError("The Poetry configuration is invalid:\n" + message)
      RuntimeError: The Poetry configuration is invalid:
        - project must contain ['name'] properties
      
      [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.

found a similar error here HumanSignal/label-studio#6851

@hvgazula
Copy link
Author

hvgazula commented Feb 6, 2025

@fabiocat93 thoughts?

@hvgazula
Copy link
Author

hvgazula commented Feb 6, 2025

never mind there's a lot to unpack here...

  1. as the error suggests one has to add
[project]
name = "your name here"
  1. however, the story doesn't end there. clearly, hyphens are not allowed in package/module names in python, which was the source of another error. so, the correct way to describe the entry point is as follows
[project.scripts]
bbqs-model-zoo = "bbqs_model_zoo.cli:hello_world"

This was confirmed by nobrainer-zoo (my reference repo)..which uses nobrainerzoo as the name of the module instead of nobrainer-zoo. underscores are allowed..just not hyphens.

@hvgazula hvgazula closed this as completed Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant