Skip to content

Commit d2d7bc1

Browse files
committed
Check in pypi
1 parent f8744eb commit d2d7bc1

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

code_it/task_executor.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from code_it.models import HTTPBaseLLM
1010
from typing import Callable
1111
from pylint import epylint as lint
12-
12+
import requests
1313

1414
logger = logging.getLogger(__name__)
1515

@@ -29,6 +29,7 @@ class TaskExecutionConfig:
2929
execute_code = True
3030
install_dependencies = True
3131
apply_linter = True
32+
check_package_is_in_pypi = True
3233
dependency_samples = 3
3334
max_refactor_attempts = 5
3435
dependency_install_attempts = 5
@@ -93,8 +94,15 @@ def execute(self, task: str):
9394
if " " in d:
9495
d = d.split(" ")[0]
9596

97+
if self.config.check_package_is_in_pypi:
98+
url = f'https://pypi.org/project/{d}'
99+
res = requests.get(url)
100+
if res.status_code != 200:
101+
pass
102+
96103
if len(d) < 2 or d in DEPENDENCY_BLACKLIST:
97104
continue
105+
98106
dependencies.append(d)
99107

100108
if not dependencies:

task.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
Your job is to generate cat jokes and save in a file called 'cat_jokes.txt'. Be creative!
1+
Your job is to plot an example chart using matplotlib. Create your own random data.
2+
Run this code only when you're finished.
3+
DO NOT add code and run into a single step.

task_plot.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)