Skip to content

Commit 38ddc50

Browse files
committed
added packeger
1 parent 210f3dd commit 38ddc50

File tree

5 files changed

+79
-14
lines changed

5 files changed

+79
-14
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22
__pycache__
33
code
44
.venv
5-
thoughts
5+
thoughts
6+
dist
7+
build
8+
.DS_Store
9+
*.egg-info

lazydev/__init__.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import argparse
2+
from . import develop
3+
4+
# Create the top-level parser
5+
parser = argparse.ArgumentParser()
6+
7+
# Create subparsers for the different subcommands
8+
subparsers = parser.add_subparsers(title='Subcommands', dest='subcommand')
9+
10+
# Import and execute the subcommand modules
11+
develop.setup_parser(subparsers)
12+
13+
# Parse the command-line arguments
14+
args = parser.parse_args()
15+
16+
# Execute the appropriate subcommand
17+
def run():
18+
if hasattr(args, 'func'):
19+
args.func(args)
20+
21+
22+
23+
24+
25+
26+
27+

lazydev/develop.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
1-
2-
1+
from argparse import _SubParsersAction, ArgumentParser
32
import os
43
from dotenv import load_dotenv
5-
64
from .modules.developer import Developer
75

86

9-
10-
def parse_args():
7+
def setup_parser(sub_parsers:_SubParsersAction):
118
# putting import inside so that code can be moved to saperate files and we dont keep the import at top of this file
12-
import argparse
139
# Create the argument parser
14-
parser = argparse.ArgumentParser(description='Lazy Dev Argguments')
10+
parser = sub_parsers.add_parser(name='develop', help='develop command for new project creation')
11+
1512

1613
# Add the "--requirements" argument with the "-r" shortcut
1714
parser.add_argument('--requirement', '-r', required=True, type=str, help='The initial requirement')
1815

1916
# Add the "--directory" argument with the "-d" shortcut
2017
parser.add_argument('--directory', '-d', default="./code", type=str, help='The directory path to put generated files')
2118

19+
parser.add_argument('--model', '-m', default="gpt-3.5-turbo", type=str, help='GPT Mode to use. options: gpt-3.5-turbo, gpt-4')
20+
21+
parser.set_defaults(func=run)
2222

23-
args = parser.parse_args()
23+
return parser
2424

25-
return args
25+
def run(args):
2626

27-
if __name__ == "__main__":
28-
# print(PrompBook.design_folder_structure("","",""))
29-
args=parse_args()
3027
requirement = args.requirement
3128
directory= args.directory
3229
load_dotenv()

lazydev/modules/prompts.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@ def prioritise_file_list(filelist:List[str])->List[str]:
9595
Begin!
9696
"""
9797
@staticmethod
98-
def write_file(question,clarifications:str,plan:str,files_written:List[List[str]], file_path_to_write:str)->str:
98+
def write_file(question,clarifications:str,plan:str,files_written:List[List[str]], file_path_to_write:str,file_paths:List[str])->str:
9999
file_with_conent="\n\n".join([f"File:{file_path}\nContent:\n{content}" for file_path,content in files_written])
100+
all_files_list="\n".join(file_paths)
100101
return f"""
101102
you are a senior programmer below is what your client have asked you to do:
102103
---
@@ -110,6 +111,10 @@ def write_file(question,clarifications:str,plan:str,files_written:List[List[str]
110111
---
111112
{plan}
112113
---
114+
Below are the full files list that already has been or will be written
115+
--
116+
{all_files_list}
117+
--
113118
114119
you are now writing the code below are the files that already written with content as follows:
115120
---
@@ -123,6 +128,7 @@ def write_file(question,clarifications:str,plan:str,files_written:List[List[str]
123128
* follow the exact format provided above without fail
124129
* only write the file content, no expiation, no pretext.
125130
* always add comments at the begening, which expains what you are about to do
131+
* keep in mind there wont be any additional files other then the full files list given above, only use files that are mentioned in that list
126132
Begin!
127133
"""
128134

setup.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from setuptools import find_packages, setup
2+
3+
with open('requirements.txt') as f:
4+
requirements = f.read().splitlines()
5+
6+
setup(
7+
name="lazydev",
8+
version='0.0.2',
9+
description='AI developer for lazy programmer',
10+
packages=find_packages(),
11+
install_requires=requirements,
12+
author='Anirban Kat',
13+
author_email='thecodacus@gmail.com',
14+
entry_points={
15+
'console_scripts': [
16+
'lazydev = lazydev:run',
17+
],
18+
},
19+
# other relevant information
20+
21+
# # You can specify package data if needed
22+
# package_data={
23+
# 'lazydev': ['*.txt', '*.csv'], # Include any additional files here
24+
# },
25+
26+
# # You can also specify additional non-package data files
27+
# data_files=[
28+
# ('config', ['config.ini']),
29+
# ],
30+
31+
)

0 commit comments

Comments
 (0)