Simplify archiving process (#469)

* simplify args

* Fix tests

* Black format
This commit is contained in:
Anton Osika
2023-07-02 16:43:13 +02:00
committed by GitHub
parent 60e0a7e1dd
commit 20ea0c126a
6 changed files with 40 additions and 45 deletions

View File

@@ -1,8 +1,5 @@
import datetime
import json
import os
import re
import shutil
import subprocess
from enum import Enum
@@ -261,16 +258,6 @@ def fix_code(ai: AI, dbs: DBs):
return messages
def archive(ai: AI, dbs: DBs):
os.makedirs(dbs.archive.path, exist_ok=True)
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
shutil.move(dbs.memory.path, dbs.archive.path / timestamp / dbs.memory.path.name)
shutil.move(
dbs.workspace.path, dbs.archive.path / timestamp / dbs.workspace.path.name
)
return []
def human_review(ai: AI, dbs: DBs):
review = human_input()
dbs.memory["review"] = review.to_json() # type: ignore
@@ -293,17 +280,15 @@ class Config(str, Enum):
# Different configs of what steps to run
STEPS = {
Config.DEFAULT: [
archive,
clarify,
gen_clarified_code,
gen_entrypoint,
execute_entrypoint,
human_review,
],
Config.BENCHMARK: [archive, simple_gen, gen_entrypoint],
Config.SIMPLE: [archive, simple_gen, gen_entrypoint, execute_entrypoint],
Config.BENCHMARK: [simple_gen, gen_entrypoint],
Config.SIMPLE: [simple_gen, gen_entrypoint, execute_entrypoint],
Config.TDD: [
archive,
gen_spec,
gen_unit_tests,
gen_code,
@@ -312,7 +297,6 @@ STEPS = {
human_review,
],
Config.TDD_PLUS: [
archive,
gen_spec,
gen_unit_tests,
gen_code,
@@ -322,7 +306,6 @@ STEPS = {
human_review,
],
Config.CLARIFY: [
archive,
clarify,
gen_clarified_code,
gen_entrypoint,
@@ -330,7 +313,6 @@ STEPS = {
human_review,
],
Config.RESPEC: [
archive,
gen_spec,
respec,
gen_unit_tests,