diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1c7f02b..aeff382 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,8 +12,6 @@ jobs: strategy: matrix: python-version: - - "3.8" - - "3.9" - "3.10" steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..30f61d2 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,52 @@ +name: Build and publish Python packages to PyPI + +on: + workflow_dispatch: + release: + types: + - published + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.10" + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: pip + + - name: Install build tool + run: pip install build + + - name: Build package + run: python -m build + + - name: Upload package as build artifact + uses: actions/upload-artifact@v3 + with: + name: package + path: dist/ + + publish: + runs-on: ubuntu-latest + needs: build + environment: + name: pypi + url: https://pypi.org/p/gpt-engineer + permissions: + id-token: write + steps: + - name: Collect packages to release + uses: actions/download-artifact@v3 + with: + name: package + path: dist/ + + - name: Publish packages to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore index 32c67cc..2d408f3 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,11 @@ ENV/ *.pyo *.pyd +# Python testing +.pytest_cache/ +.ruff_cache/ +.coverage + # macOS specific files .DS_Store @@ -41,4 +46,4 @@ todo # Ignore GPT Engineer files projects -my-new-project/ +!projects/example diff --git a/gpt_engineer/main.py b/gpt_engineer/main.py index 09faa46..059f754 100644 --- a/gpt_engineer/main.py +++ b/gpt_engineer/main.py @@ -20,7 +20,7 @@ def chat( "", help=( "run prefix, if you want to run multiple variants of the same project and " - "later compare them", + "later compare them" ), ), model: str = "gpt-4", diff --git a/identity/generate b/identity/generate index 4e3f2bc..1c1ac62 100644 --- a/identity/generate +++ b/identity/generate @@ -2,14 +2,15 @@ You will get instructions for code to write. Following best practices and formatting for a README.md file, you will write a very long answer, make sure to provide the instructions on how to run the code. Make sure that every detail of the architecture is, in the end, implemented as code. -You will first lay out the names of the core classes, functions, methods that will be necessary, As well as a quick comment on their purpose. +You will first lay out the names of the core classes, functions, methods that will be necessary, as well as a quick comment on their purpose. Before you start outputting the code, you will output a seperator in the form of a line containing "*CODEBLOCKSBELOW*" Make sure to create any appropriate module dependency or package manager dependency definition file. -Then you will reformat and output the content of each file strictly following a markdown code block format, where the following tokens should be replaced such that [FILENAME] is the lowercase file name including the file extension, [LANG] is the markup code block language for the code's language, and [CODE] is the comments and code: +Then you will format and output the content, including ALL code, of each file strictly following a markdown code block format, where the following tokens should be replaced such that [FILENAME] is the lowercase file name including the file extension, [LANG] is the markup code block language for the code's language, and [CODE] is the code: [FILENAME] ```[LANG] [CODE] ``` +Please note that the code should be fully functional. No placeholders. You will start with the "entrypoint" file, then go to the ones that are imported by that file, and so on. Follow a language and framework appropriate best practice file naming convention. diff --git a/identity/use_qa b/identity/use_qa index 47a5b3b..c1bac29 100644 --- a/identity/use_qa +++ b/identity/use_qa @@ -4,11 +4,12 @@ First lay out the names of the core classes, functions, methods that will be nec Make sure to provide instructions for running the code. Before you start outputting the code, you will output a seperator in the form of a line containing "*CODEBLOCKSBELOW*" Make sure to create any appropriate module dependency or package manager dependency definition file. -Then you will reformat and output the content of each file strictly following a markdown code block format, where the following tokens should be replaced such that [FILENAME] is the lowercase file name including the file extension, [LANG] is the markup code block language for the code's language, and [CODE] is the comments and code: +Then you will reformat and output the content of each file strictly following a markdown code block format, where the following tokens should be replaced such that [FILENAME] is the lowercase file name including the file extension, [LANG] is the markup code block language for the code's language, and [CODE] is the code: [FILENAME] ```[LANG] [CODE] ``` +Please note that the code should be fully functional. No placeholders. You will start with the "entrypoint" file, then go to the ones that are imported by that file, and so on. Follow a language and framework appropriate best practice file naming convention. diff --git a/scripts/benchmark.py b/scripts/benchmark.py index 3ff4b23..c07c9f2 100644 --- a/scripts/benchmark.py +++ b/scripts/benchmark.py @@ -30,7 +30,7 @@ def main( process = subprocess.Popen( [ "python", - "-u", # Unbuffered output + "-u", # Unbuffered output "-m", "gpt_engineer.main", bench_folder, @@ -50,7 +50,7 @@ def main( file.close() print("process", bench_folder.name, "finished with code", process.returncode) - print('Running it. Original benchmark prompt:') + print("Running it. Original benchmark prompt:") print() with open(bench_folder / "main_prompt") as f: print(f.read()) @@ -58,10 +58,18 @@ def main( try: subprocess.run( - ['python', "-m", "gpt_engineer.main", bench_folder, "--steps-config", "execute_only"], + [ + "python", + "-m", + "gpt_engineer.main", + bench_folder, + "--steps-config", + "execute_only", + ], ) except KeyboardInterrupt: pass + if __name__ == "__main__": run(main)