From 8852a7bdea6087fab6fcd0ed48e238592f42b8e6 Mon Sep 17 00:00:00 2001 From: ASHOK KUMAR P Date: Thu, 9 Oct 2025 18:43:51 +0530 Subject: [PATCH 1/2] fix: resolve pyperclip installation issue with setuptools compatibility - Pin setuptools to <66.0 and pyperclip to 1.8.2 in requirements - Add installation scripts for Linux/Mac and Windows - Create installation fix documentation - Update README with troubleshooting section --- .gitignore | 17 +++++++++++++++++ README.md | 18 ++++++++++++++++++ scripts/install_fixed.ps1 | 20 ++++++++++++++++++++ scripts/install_fixed.sh | 22 ++++++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 scripts/install_fixed.ps1 create mode 100644 scripts/install_fixed.sh diff --git a/.gitignore b/.gitignore index c0c793b88e..74fe68e919 100644 --- a/.gitignore +++ b/.gitignore @@ -96,3 +96,20 @@ gpt_engineer/benchmark/benchmarks/mbpp/dataset gpt_engineer/benchmark/minimal_bench_config.toml test.json +[tool.poetry.dependencies] +python = "^3.10" +rudder-sdk-python = ">=2.0.2" +black = "23.3.0" +datasets = ">=2.17.1,<3.0.0" +openai = ">=1.0,<2.0" +pillow = ">=10.2.0,<11.0.0" +toml = ">=0.10.2" +regex = ">=2023.12.25,<2024.0.0" +langchain-openai = ">=0.1.22" +dataclasses-json = "0.5.7" +typer = ">=0.3.2" +langchain-community = ">=0.2.0,<0.3.0" +tiktoken = ">=0.0.4" +python-dotenv = ">=0.21.0" +pyperclip = ">=1.8.2,<1.9.0" +setuptools = ">=45.0,<66.0" \ No newline at end of file diff --git a/README.md b/README.md index 172210af7f..d43603cdff 100644 --- a/README.md +++ b/README.md @@ -127,3 +127,21 @@ gpt-engineer is [governed](https://github.com/gpt-engineer-org/gpt-engineer/blob https://github.com/gpt-engineer-org/gpt-engineer/assets/4467025/40d0a9a8-82d0-4432-9376-136df0d57c99 + + + +### 6. Update README.md + +Add a troubleshooting section to **`README.md`**: + +```markdown +## Troubleshooting + +### Installation Error: `canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'` + +If you encounter this error during installation, it's due to compatibility issues with setuptools and pyperclip. + +**Quick fix:** +```bash +pip install "setuptools<66.0" "pyperclip==1.8.2" +pip install gpt-engineer \ No newline at end of file diff --git a/scripts/install_fixed.ps1 b/scripts/install_fixed.ps1 new file mode 100644 index 0000000000..377800ba0a --- /dev/null +++ b/scripts/install_fixed.ps1 @@ -0,0 +1,20 @@ +Write-Host "Fixing pyperclip installation issue for gpt-engineer..." -ForegroundColor Green + +# Update pip to latest version +Write-Host "Upgrading pip..." +python -m pip install --upgrade pip + +# Install compatible setuptools version first +Write-Host "Installing compatible setuptools version..." +python -m pip install "setuptools>=45.0,<66.0" + +# Install pyperclip 1.8.2 specifically to avoid canonicalize_version error +Write-Host "Installing pyperclip 1.8.2..." +python -m pip install "pyperclip>=1.8.2,<1.9.0" + +# Install gpt-engineer in development mode +Write-Host "Installing gpt-engineer..." +python -m pip install -e . + +Write-Host "✅ Installation completed successfully!" -ForegroundColor Green +Write-Host "You can now run: gpte projects/example" \ No newline at end of file diff --git a/scripts/install_fixed.sh b/scripts/install_fixed.sh new file mode 100644 index 0000000000..b250e8ddd8 --- /dev/null +++ b/scripts/install_fixed.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +echo "Fixing pyperclip installation issue for gpt-engineer..." + +# Update pip to latest version +echo "Upgrading pip..." +pip install --upgrade pip + +# Install compatible setuptools version first +echo "Installing compatible setuptools version..." +pip install "setuptools>=45.0,<66.0" + +# Install pyperclip 1.8.2 specifically to avoid canonicalize_version error +echo "Installing pyperclip 1.8.2..." +pip install "pyperclip>=1.8.2,<1.9.0" + +# Install gpt-engineer in development mode +echo "Installing gpt-engineer..." +pip install -e . + +echo "✅ Installation completed successfully!" +echo "You can now run: gpte projects/example" \ No newline at end of file From 8079cf7f06f3ade9cb6cdc6a103749598e436cc0 Mon Sep 17 00:00:00 2001 From: sivamurgan90428 Date: Fri, 10 Oct 2025 05:54:43 +0530 Subject: [PATCH 2/2] the updated and bug fixed one --- .../gpt_engineer/phone_lookup.py | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 tests/core/improve_function_test_cases/gpt_engineer/phone_lookup.py diff --git a/tests/core/improve_function_test_cases/gpt_engineer/phone_lookup.py b/tests/core/improve_function_test_cases/gpt_engineer/phone_lookup.py new file mode 100644 index 0000000000..a3aa43e3c8 --- /dev/null +++ b/tests/core/improve_function_test_cases/gpt_engineer/phone_lookup.py @@ -0,0 +1,63 @@ +import phonenumbers +from phonenumbers import geocoder, carrier + +def get_phone_info(phone_number): + """ + Get location and carrier information for a phone number. + + Args: + phone_number (str): Phone number in international format (e.g., "+923000087356") + + Returns: + dict: Dictionary containing phone number details + """ + try: + # Parse phone number + parsed_number = phonenumbers.parse(phone_number) + + # Validate phone number + if not phonenumbers.is_valid_number(parsed_number): + return { + "phone_number": phone_number, + "valid": False, + "error": "Invalid phone number" + } + + # Get location + location = geocoder.description_for_number(parsed_number, "en") + + # Get carrier + service_provider = carrier.name_for_number(parsed_number, "en") + + # Return results + return { + "phone_number": phone_number, + "valid": True, + "location": location if location else "Unknown", + "service_provider": service_provider if service_provider else "Unknown", + "country_code": parsed_number.country_code, + "national_number": parsed_number.national_number + } + + except phonenumbers.phonenumberutil.NumberParseException as e: + return { + "phone_number": phone_number, + "valid": False, + "error": str(e) + } + +if __name__ == "__main__": + # Example usage + phone_number = "+923000087356" + + result = get_phone_info(phone_number) + + # Output results + print(f"Phone Number: {result['phone_number']}") + if result['valid']: + print(f"Location: {result['location']}") + print(f"Service Provider: {result['service_provider']}") + print(f"Country Code: +{result['country_code']}") + print(f"National Number: {result['national_number']}") + else: + print(f"Error: {result['error']}") \ No newline at end of file