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

Add project_metadata field to DBs class and instantiate it in main.py #712

Closed
wants to merge 6 commits into from

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Sep 17, 2023

Description

This PR adds a project_metadata field to the DBs class in gpt_engineer/db.py and instantiates it in gpt_engineer/main.py. The project_metadata field is of type DB and is used to store project-specific metadata. Additionally, the memory, archive, and file_list.txt are moved to the project_metadata directory.

Summary of Changes

  • Created a new file gpt_engineer/project_metadata.py to define the DB class.
  • Imported the DB class from gpt_engineer.project_metadata in gpt_engineer/db.py.
  • Modified the DBs class in gpt_engineer/db.py to include a project_metadata field of type DB.
  • Instantiated the project_metadata field of DBs with the path .gpteng in gpt_engineer/main.py.
  • Moved the memory, archive, and file_list.txt to the project_metadata directory.

Please review and merge this PR. Thank you!

Fixes #665.


🎉 Latest improvements to Sweep:


💡 To get Sweep to edit this pull request, you can:

  • Leave a comment below to get Sweep to edit the entire PR
  • Leave a comment in the code will only modify the file
  • Edit the original issue to get Sweep to recreate the PR from scratch

@sweep-ai sweep-ai bot added the sweep Assigns Sweep to an issue or pull request. label Sep 17, 2023
@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Sep 17, 2023

GitHub actions yielded the following error.

The command that failed is pre-commit run --show-diff-on-failure --color=always --all-files. Here are the relevant lines from the logs:

black....................................................................�[41mFailed�[m
�[2m- hook id: black�[m
�[2m- files were modified by this hook�[m

�[1mreformatted gpt_engineer/project_metadata.py�[0m

�[1mAll done! ✨ 🍰 ✨�[0m
�[34m�[1m1 file �[0m�[1mreformatted�[0m, �[34m29 files �[0mleft unchanged.

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
�[1mdiff --git a/gpt_engineer/project_metadata.py b/gpt_engineer/project_metadata.py�[m
�[1mindex b9bb331..cc57527 100644�[m
�[1m--- a/gpt_engineer/project_metadata.py�[m
�[1m+++ b/gpt_engineer/project_metadata.py�[m
�[36m@@ -1,9 +1,11 @@�[m
# gpt_engineer/project_metadata.py�[m
�[m
�[32m+�[m
class DB:�[m
def __init__(self, path):�[m
self.path = path�[m
�[m
�[32m+�[m
class ProjectMetadataDB(DB):�[m
def __init__(self, path):�[m
super().__init__(path)�[m
##[error]Process completed with exit code 1.

There are a lot of errors. This is likely due to a small parsing issue or a missing import with the files changed in the PR.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Sep 18, 2023

GitHub actions yielded the following error.

The command that failed is pre-commit run --show-diff-on-failure --color=always --all-files. Here are the relevant lines from the logs:

black....................................................................�[41mFailed�[m
�[2m- hook id: black�[m
�[2m- files were modified by this hook�[m

�[1mreformatted gpt_engineer/project_metadata.py�[0m

�[1mAll done! ✨ 🍰 ✨�[0m
�[34m�[1m1 file �[0m�[1mreformatted�[0m, �[34m29 files �[0mleft unchanged.

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
�[1mdiff --git a/gpt_engineer/project_metadata.py b/gpt_engineer/project_metadata.py�[m
�[1mindex b9bb331..cc57527 100644�[m
�[1m--- a/gpt_engineer/project_metadata.py�[m
�[1m+++ b/gpt_engineer/project_metadata.py�[m
�[36m@@ -1,9 +1,11 @@�[m
# gpt_engineer/project_metadata.py�[m
�[m
�[32m+�[m
class DB:�[m
def __init__(self, path):�[m
self.path = path�[m
�[m
�[32m+�[m
class ProjectMetadataDB(DB):�[m
def __init__(self, path):�[m
super().__init__(path)�[m
##[error]Process completed with exit code 1.

There are a lot of errors. This is likely due to a small parsing issue or a missing import with the files changed in the PR.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Sep 18, 2023

GitHub actions yielded the following error.

The command that failed is pre-commit run --show-diff-on-failure --color=always --all-files. Here are the relevant lines from the logs:

black....................................................................�[41mFailed�[m
�[2m- hook id: black�[m
�[2m- files were modified by this hook�[m

�[1mreformatted gpt_engineer/project_metadata.py�[0m

�[1mAll done! ✨ 🍰 ✨�[0m
�[34m�[1m1 file �[0m�[1mreformatted�[0m, �[34m29 files �[0mleft unchanged.

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
�[1mdiff --git a/gpt_engineer/project_metadata.py b/gpt_engineer/project_metadata.py�[m
�[1mindex b9bb331..cc57527 100644�[m
�[1m--- a/gpt_engineer/project_metadata.py�[m
�[1m+++ b/gpt_engineer/project_metadata.py�[m
�[36m@@ -1,9 +1,11 @@�[m
# gpt_engineer/project_metadata.py�[m
�[m
�[32m+�[m
class DB:�[m
def __init__(self, path):�[m
self.path = path�[m
�[m
�[32m+�[m
class ProjectMetadataDB(DB):�[m
def __init__(self, path):�[m
super().__init__(path)�[m
##[error]Process completed with exit code 1.

There are a lot of errors. This is likely due to a small parsing issue or a missing import with the files changed in the PR.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

1 similar comment
@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Sep 18, 2023

GitHub actions yielded the following error.

The command that failed is pre-commit run --show-diff-on-failure --color=always --all-files. Here are the relevant lines from the logs:

black....................................................................�[41mFailed�[m
�[2m- hook id: black�[m
�[2m- files were modified by this hook�[m

�[1mreformatted gpt_engineer/project_metadata.py�[0m

�[1mAll done! ✨ 🍰 ✨�[0m
�[34m�[1m1 file �[0m�[1mreformatted�[0m, �[34m29 files �[0mleft unchanged.

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
�[1mdiff --git a/gpt_engineer/project_metadata.py b/gpt_engineer/project_metadata.py�[m
�[1mindex b9bb331..cc57527 100644�[m
�[1m--- a/gpt_engineer/project_metadata.py�[m
�[1m+++ b/gpt_engineer/project_metadata.py�[m
�[36m@@ -1,9 +1,11 @@�[m
# gpt_engineer/project_metadata.py�[m
�[m
�[32m+�[m
class DB:�[m
def __init__(self, path):�[m
self.path = path�[m
�[m
�[32m+�[m
class ProjectMetadataDB(DB):�[m
def __init__(self, path):�[m
super().__init__(path)�[m
##[error]Process completed with exit code 1.

There are a lot of errors. This is likely due to a small parsing issue or a missing import with the files changed in the PR.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Sep 18, 2023

GitHub actions yielded the following error.

The command that failed is pre-commit run --show-diff-on-failure --color=always --all-files. Here are the relevant lines from the logs:

black....................................................................�[41mFailed�[m
�[2m- hook id: black�[m
�[2m- files were modified by this hook�[m

�[1mreformatted gpt_engineer/project_metadata.py�[0m

�[1mAll done! ✨ 🍰 ✨�[0m
�[34m�[1m1 file �[0m�[1mreformatted�[0m, �[34m29 files �[0mleft unchanged.

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
�[1mdiff --git a/gpt_engineer/project_metadata.py b/gpt_engineer/project_metadata.py�[m
�[1mindex b9bb331..cc57527 100644�[m
�[1m--- a/gpt_engineer/project_metadata.py�[m
�[1m+++ b/gpt_engineer/project_metadata.py�[m
�[36m@@ -1,9 +1,11 @@�[m
# gpt_engineer/project_metadata.py�[m
�[m
�[32m+�[m
class DB:�[m
def __init__(self, path):�[m
self.path = path�[m
�[m
�[32m+�[m
class ProjectMetadataDB(DB):�[m
def __init__(self, path):�[m
super().__init__(path)�[m
##[error]Process completed with exit code 1.

There are a lot of errors. This is likely due to a small parsing issue or a missing import with the files changed in the PR.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Sep 19, 2023

GitHub actions yielded the following error.

The command that failed is pre-commit run --show-diff-on-failure --color=always --all-files. Here are the relevant lines from the logs:

black....................................................................�[41mFailed�[m
�[2m- hook id: black�[m
�[2m- files were modified by this hook�[m

�[1mreformatted gpt_engineer/project_metadata.py�[0m

�[1mAll done! ✨ 🍰 ✨�[0m
�[34m�[1m1 file �[0m�[1mreformatted�[0m, �[34m29 files �[0mleft unchanged.

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
�[1mdiff --git a/gpt_engineer/project_metadata.py b/gpt_engineer/project_metadata.py�[m
�[1mindex b9bb331..cc57527 100644�[m
�[1m--- a/gpt_engineer/project_metadata.py�[m
�[1m+++ b/gpt_engineer/project_metadata.py�[m
�[36m@@ -1,9 +1,11 @@�[m
# gpt_engineer/project_metadata.py�[m
�[m
�[32m+�[m
class DB:�[m
def __init__(self, path):�[m
self.path = path�[m
�[m
�[32m+�[m
class ProjectMetadataDB(DB):�[m
def __init__(self, path):�[m
super().__init__(path)�[m
##[error]Process completed with exit code 1.

There are a lot of errors. This is likely due to a small parsing issue or a missing import with the files changed in the PR.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

1 similar comment
@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Sep 19, 2023

GitHub actions yielded the following error.

The command that failed is pre-commit run --show-diff-on-failure --color=always --all-files. Here are the relevant lines from the logs:

black....................................................................�[41mFailed�[m
�[2m- hook id: black�[m
�[2m- files were modified by this hook�[m

�[1mreformatted gpt_engineer/project_metadata.py�[0m

�[1mAll done! ✨ 🍰 ✨�[0m
�[34m�[1m1 file �[0m�[1mreformatted�[0m, �[34m29 files �[0mleft unchanged.

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
�[1mdiff --git a/gpt_engineer/project_metadata.py b/gpt_engineer/project_metadata.py�[m
�[1mindex b9bb331..cc57527 100644�[m
�[1m--- a/gpt_engineer/project_metadata.py�[m
�[1m+++ b/gpt_engineer/project_metadata.py�[m
�[36m@@ -1,9 +1,11 @@�[m
# gpt_engineer/project_metadata.py�[m
�[m
�[32m+�[m
class DB:�[m
def __init__(self, path):�[m
self.path = path�[m
�[m
�[32m+�[m
class ProjectMetadataDB(DB):�[m
def __init__(self, path):�[m
super().__init__(path)�[m
##[error]Process completed with exit code 1.

There are a lot of errors. This is likely due to a small parsing issue or a missing import with the files changed in the PR.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Sep 19, 2023

GitHub actions yielded the following error.

The command that failed is pre-commit run --show-diff-on-failure --color=always --all-files. Here are the relevant lines from the logs:

black....................................................................�[41mFailed�[m
�[2m- hook id: black�[m
�[2m- files were modified by this hook�[m

�[1mreformatted gpt_engineer/project_metadata.py�[0m

�[1mAll done! ✨ 🍰 ✨�[0m
�[34m�[1m1 file �[0m�[1mreformatted�[0m, �[34m29 files �[0mleft unchanged.

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
�[1mdiff --git a/gpt_engineer/project_metadata.py b/gpt_engineer/project_metadata.py�[m
�[1mindex b9bb331..cc57527 100644�[m
�[1m--- a/gpt_engineer/project_metadata.py�[m
�[1m+++ b/gpt_engineer/project_metadata.py�[m
�[36m@@ -1,9 +1,11 @@�[m
# gpt_engineer/project_metadata.py�[m
�[m
�[32m+�[m
class DB:�[m
def __init__(self, path):�[m
self.path = path�[m
�[m
�[32m+�[m
class ProjectMetadataDB(DB):�[m
def __init__(self, path):�[m
super().__init__(path)�[m
##[error]Process completed with exit code 1.

There are a lot of errors. This is likely due to a small parsing issue or a missing import with the files changed in the PR.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

@pbharrin
Copy link
Contributor

We have a fix for this here: #720
#720

@pbharrin pbharrin closed this Sep 19, 2023
@ATheorell ATheorell deleted the sweep/add-project-metadata branch December 4, 2023 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add project_metadata the DBs class. Instantiate it in main.py and let its path be .gpteng
1 participant