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

Make gpt-engineer pip installable/runnable #60

Merged
merged 20 commits into from
Jun 16, 2023
Merged

Conversation

Jeadie
Copy link
Contributor

@Jeadie Jeadie commented Jun 15, 2023

Feature

Make it easy to run

pip install .  # eventually pip install gpt-engineer
gpt-engineer <PATH> # or gpt-engineer --help

Changeset

  • improve pyproject.toml with project configs
  • make gpt_engineer/ directory and move python files
  • Fix paths in source code.

@Jeadie
Copy link
Contributor Author

Jeadie commented Jun 15, 2023

Example output

(.venv) jeadie@Jacks-MBP gpt-engineer % gpt-engineer --help
Usage: gpt-engineer [OPTIONS] [PROJECT_PATH]

Arguments:
  [PROJECT_PATH]  path

Options:
  --run-prefix TEXT               run prefix, if you want to run multiple
                                  variants of the same project and later
                                  compare them
  --model TEXT                    [default: gpt-4]
  --temperature FLOAT             [default: 0.1]
  --install-completion [bash|zsh|fish|powershell|pwsh]
                                  Install completion for the specified shell.
  --show-completion [bash|zsh|fish|powershell|pwsh]
                                  Show completion for the specified shell, to
                                  copy it or customize the installation.
  --help                          Show this message and exit.

Copy link
Collaborator

@patillacode patillacode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Jeadie

this looks great, although I left a couple of comments, only one requesting a change though.

couple of notes:

  • can you make sure you get rid of all those old commits? I think you branched out in a weird state maybe?

  • can you add the corresponding documentation to the README.md file?

I'll give this a go in the meantime.

EDIT:
I tried to run it, unsuccessfully.
It seems like running via the command doesn't work.

The error is this one:

FileNotFoundError: [Errno 2] No such file or directory: '/Users/dvitto/projects/gpt-engineer-jeadie-60/venv/lib/python3.11/site-packages/identity/qa'

Running with --help gave the expected output but
I believe it could be related to what @AntonOsika mentioned here.

Also, I just noticed, the parameters are not being taken care of.
Meaning passing parameters are not taken into account at all, am I missing something?

Thanks a lot.

Comment on lines +21 to +23
def __contains__(self, key):
return (self.path / key).exists()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

Comment on lines +5 to +9
from gpt_engineer.chat_to_files import to_files
from gpt_engineer.ai import AI
from gpt_engineer.steps import STEPS
from gpt_engineer.db import DB, DBs

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also like this better, explicit and probably saving someone from a circular import dependency.

Comment on lines +50 to +55
def execute():
app()


if __name__ == "__main__":
execute()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we just call app() instead of execute() and get rid of the execute definition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is helpful for referencing it in pyproject.toml

@Jeadie
Copy link
Contributor Author

Jeadie commented Jun 15, 2023

I think it will be easier (and cleaner/best practice going forward) to squash and merge all contributions to have a more readable main branch. Making some improvements in a second PR, will QA again today.

@Jeadie
Copy link
Contributor Author

Jeadie commented Jun 16, 2023

Fixes are up. They were just due to how i was testing things initially. Having identity as a file is highly fragile. We will need to move off it soon.

@Jeadie Jeadie requested a review from patillacode June 16, 2023 00:36
Copy link
Collaborator

@patillacode patillacode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is now working, thanks for the changes.

Two more things:

  • can you squash your commits?
  • parameters (i,e --model) are not being taken care of, I believe you left that on purpose, is this something you plan on adding?

I don't feel comfortable merging something that tells the user "use me like this" (when running gpt-engineer --help) but it is not actually working unless we plan on adding it shortly.

@Jeadie
Copy link
Contributor Author

Jeadie commented Jun 16, 2023

I did not touch --model flag and --model flag seems to work on mine (passing an invalid value to --model invalid_id throws the correct error). We can squash commits at merge time, which is generally an easy approach.

@Jeadie Jeadie mentioned this pull request Jun 16, 2023
@patillacode patillacode merged commit 6f8e976 into AntonOsika:main Jun 16, 2023
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

Successfully merging this pull request may close these issues.

3 participants