Skip to content

Commit ae00c28

Browse files
committed
Removed not working function to install packages.
1 parent 4bd4ab3 commit ae00c28

File tree

1 file changed

+11
-22
lines changed

1 file changed

+11
-22
lines changed

main.py

+11-22
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,26 @@
88
import pip
99

1010

11-
class ProjectInitAutomator:
12-
def __init__(self, repo_name, is_private):
13-
self.repo_name = repo_name
14-
self.is_private = is_private
11+
class ProjectInitializer:
12+
def __init__(self):
13+
self.repo_name = input("Insert the new repo name:")
14+
if (_ := input("Should the repo be private? [Y/N]").lower()[0]) == "y":
15+
self.is_private = True
16+
else:
17+
self.is_private = False
1518
self.repo_path = project_path + self.repo_name
1619

20+
def run(self):
1721
self.repo_full_name = self.create_github_repo(
1822
self.repo_name, self.is_private)
1923
self.clone_repo(self.repo_full_name, self.repo_path)
2024
self.create_venv(self.repo_path)
21-
self.repo_config(self.repo_path)
2225
self.gitignore_modifier(self.repo_path)
2326
self.file_creator(self.repo_path)
2427

2528
# Command to open the folder in VS Code
2629
subprocess.run(code_path + " -a " + self.repo_path)
27-
print("All done! Enjoi :)")
30+
print("All done! Enjoy :)")
2831

2932
def create_github_repo(self, repo_name, is_private):
3033
""" This function creates a new Github repo(public or private), with its own .gitignore for Python and a Readme.md file """
@@ -66,21 +69,6 @@ def create_venv(self, repo_path):
6669
except Exception as e:
6770
print(e)
6871

69-
def repo_config(self, repo_path):
70-
""" Functions that updates pip and installs autopep8 and pylint inside
71-
the virual environment"""
72-
env = os.environ
73-
virtual_env = repo_path + "\\.venv"
74-
env.update({"VIRTUAL_ENV": virtual_env})
75-
76-
path = virtual_env + "\\Scripts;" + env["PATH"]
77-
env.update({"PATH": path})
78-
79-
subprocess.run("pip install --upgrade pip",
80-
env=env, stdout=subprocess.DEVNULL)
81-
subprocess.run("pip install autopep8 pylint",
82-
env=env, stdout=subprocess.DEVNULL)
83-
8472
def gitignore_modifier(self, repo_path):
8573
""" Function that excludes the VS Code folder and the secrets.py from
8674
being tracked by git """
@@ -103,4 +91,5 @@ def file_creator(self, repo_path):
10391

10492

10593
if __name__ == '__main__':
106-
pia = ProjectInitAutomator("repo_new_final", True)
94+
pi = ProjectInitializer()
95+
pi.run()

0 commit comments

Comments
 (0)