seanchatmangpt / dspygen

A Ruby on Rails style framework for the DSPy (Demonstrate, Search, Predict) project for Language Models like GPT, BERT, and LLama.
MIT License
105 stars 20 forks source link

CLI `init` command seems broken #3

Closed RamXX closed 5 months ago

RamXX commented 6 months ago

Steps to reproduce:

  1. deactivate # Just to double check I'm in no other venv.
  2. mkdir NewProject ; cd NewProject
  3. python3.11 -m venv .venv ; source .venv/bin/activate
  4. pip install dspygen -U
  5. dspygen init my_new_package email@example.com "My Name"

Message:

Creating new package named my_new_package...
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/ramirosalas/workspace/NewProject/.venv/lib/python3.11/site-packages/dspygen/cli.py:88 in  │
│ init                                                                                             │
│                                                                                                  │
│    85 │   │   # Run the command to install dspygen in the virtual environment                    │
│    86 │   │   package_dir = Path(package_name)                                                   │
│    87 │   │                                                                                      │
│ ❱  88 │   │   os.chdir(package_dir)                                                              │
│    89 │   │                                                                                      │
│    90 │   │   subprocess.check_call(["poetry", "install"])                                       │
│    91 │   │   # Create the virtual environment                                                   │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │  author_email = 'email@example.com'                                                          │ │
│ │   author_name = 'My Name'                                                                    │ │
│ │ extra_context = Munch({'package_name': 'my_new_package', 'author_email':                     │ │
│ │                 'email@example.com', 'author_name': 'My Name'})                              │ │
│ │   package_dir = PosixPath('my_new_package')                                                  │ │
│ │  package_name = 'my_new_package'                                                             │ │
│ │  template_url = 'https://github.com/radix-ai/poetry-cookiecutter'                            │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
FileNotFoundError: [Errno 2] No such file or directory: 'my_new_package'

ls reveals a new directory called my-package was created with all the proper structure underneath (but also the wrong package name). It seems the given package name was ignored. Attempting to create my_new_package manually does not solve the issue and my-package still gets created while my_new_package remains empty.

OctAg0nO commented 5 months ago

same here

seanchatmangpt commented 5 months ago

The package name needs to have - instead of _. I will have it throw an error

OctAg0nO commented 5 months ago

dspygen init my-project Project name should not contain underscores or spaces.

seanchatmangpt commented 5 months ago

Correct.

OctAg0nO commented 5 months ago

"dspygen init my-project" is returning an error stating that the project name cannot contain underscores or spaces. This happen to any name i provide.

seanchatmangpt commented 5 months ago

Fixed and test. I thanks for the help.