projectstarter-cli 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/LICENSE +2 -2
  2. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/PKG-INFO +2 -1
  3. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/projectstarter/generator.py +65 -23
  4. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/projectstarter_cli.egg-info/PKG-INFO +2 -1
  5. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/pyproject.toml +2 -1
  6. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/README.md +0 -0
  7. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/projectstarter/__init__.py +0 -0
  8. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/projectstarter/cli.py +0 -0
  9. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/projectstarter/doctor.py +0 -0
  10. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/projectstarter/registry.py +0 -0
  11. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/projectstarter/utils.py +0 -0
  12. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/projectstarter_cli.egg-info/SOURCES.txt +0 -0
  13. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/projectstarter_cli.egg-info/dependency_links.txt +0 -0
  14. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/projectstarter_cli.egg-info/entry_points.txt +0 -0
  15. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/projectstarter_cli.egg-info/top_level.txt +0 -0
  16. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/setup.cfg +0 -0
  17. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/tests/test_cli.py +0 -0
  18. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/tests/test_generator.py +0 -0
  19. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/tests/test_registry.py +0 -0
  20. {projectstarter_cli-0.1.1 → projectstarter_cli-0.1.2}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Mohamed Ali
3
+ Copyright (c) 2026 Mohamed Ali Ismail Jami
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: projectstarter-cli
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: A Python CLI tool for quickly generating Python, Django, Flask, and FastAPI projects
5
5
  Author-email: Mohamed Ali Ismail Jami <mohamedali32947@gmail.com>
6
6
  License-Expression: MIT
@@ -13,6 +13,7 @@ Classifier: Environment :: Console
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Programming Language :: Python :: 3
15
15
  Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.13
16
17
  Classifier: Topic :: Software Development :: Build Tools
17
18
  Requires-Python: >=3.9
18
19
  Description-Content-Type: text/markdown
@@ -3,9 +3,14 @@ import subprocess
3
3
  import sys
4
4
 
5
5
 
6
+ # ==============================
7
+ # Utility Functions
8
+ # ==============================
9
+
6
10
  def run_command(command, cwd=None):
7
- """Run a command."""
8
- subprocess.run(
11
+ """Run a shell command safely."""
12
+
13
+ return subprocess.run(
9
14
  command,
10
15
  cwd=cwd,
11
16
  check=True
@@ -13,8 +18,9 @@ def run_command(command, cwd=None):
13
18
 
14
19
 
15
20
  def create_virtual_environment(project_path):
16
- """Create a virtual environment."""
21
+ """Create a cross-platform virtual environment."""
17
22
 
23
+ project_path = Path(project_path).resolve()
18
24
  venv_path = project_path / ".venv"
19
25
 
20
26
  print("Creating virtual environment...")
@@ -25,13 +31,23 @@ def create_virtual_environment(project_path):
25
31
  )
26
32
 
27
33
  if sys.platform == "win32":
28
- return venv_path / "Scripts" / "python.exe"
34
+ python_exe = venv_path / "Scripts" / "python.exe"
35
+ else:
36
+ python_exe = venv_path / "bin" / "python"
37
+
38
+ # Return an absolute path to avoid cwd-related issues.
39
+ python_exe = python_exe.resolve()
29
40
 
30
- return venv_path / "bin" / "python"
41
+ if not python_exe.exists():
42
+ raise FileNotFoundError(
43
+ f"Virtual environment Python not found: {python_exe}"
44
+ )
45
+
46
+ return python_exe
31
47
 
32
48
 
33
49
  def upgrade_pip(python_exe):
34
- """Upgrade pip."""
50
+ """Upgrade pip inside the virtual environment."""
35
51
 
36
52
  print("Upgrading pip...")
37
53
 
@@ -48,7 +64,7 @@ def upgrade_pip(python_exe):
48
64
 
49
65
 
50
66
  def install_package(python_exe, package):
51
- """Install a package."""
67
+ """Install a package inside the virtual environment."""
52
68
 
53
69
  print(f"Installing {package}...")
54
70
 
@@ -64,7 +80,9 @@ def install_package(python_exe, package):
64
80
 
65
81
 
66
82
  def save_requirements(python_exe, project_path):
67
- """Create requirements.txt."""
83
+ """Generate requirements.txt using pip freeze."""
84
+
85
+ project_path = Path(project_path).resolve()
68
86
 
69
87
  result = subprocess.run(
70
88
  [
@@ -85,7 +103,7 @@ def save_requirements(python_exe, project_path):
85
103
 
86
104
 
87
105
  def create_gitignore(project_path, django=False):
88
- """Create .gitignore."""
106
+ """Create a .gitignore file."""
89
107
 
90
108
  content = """__pycache__/
91
109
  *.py[cod]
@@ -108,6 +126,26 @@ venv/
108
126
  )
109
127
 
110
128
 
129
+ def activation_instructions():
130
+ """Return cross-platform virtual environment instructions."""
131
+
132
+ return """## Activate virtual environment
133
+
134
+ Windows:
135
+
136
+ .venv\\Scripts\\activate
137
+
138
+ Linux / macOS:
139
+
140
+ source .venv/bin/activate
141
+
142
+ """
143
+
144
+
145
+ # ==============================
146
+ # Python Project Generator
147
+ # ==============================
148
+
111
149
  def create_python_project(project_name):
112
150
  """Create a basic Python project."""
113
151
 
@@ -160,11 +198,8 @@ if __name__ == "__main__":
160
198
  f"# {project_name}\n\n"
161
199
  "A Python project created with ProjectStarter.\n\n"
162
200
  "## Run\n\n"
163
- "Activate the virtual environment on Windows:\n\n"
164
- ".venv\\Scripts\\activate\n\n"
165
201
  "Run the application:\n\n"
166
- "python src/"
167
- f"{project_name}/main.py\n"
202
+ f"python src/{project_name}/main.py\n"
168
203
  )
169
204
 
170
205
  (project_path / "README.md").write_text(
@@ -177,6 +212,10 @@ if __name__ == "__main__":
177
212
  )
178
213
 
179
214
 
215
+ # ==============================
216
+ # Django Project Generator
217
+ # ==============================
218
+
180
219
  def create_django_project(project_name):
181
220
  """Create a Django project."""
182
221
 
@@ -213,7 +252,7 @@ def create_django_project(project_name):
213
252
  "config",
214
253
  "."
215
254
  ],
216
- cwd=project_path
255
+ cwd=project_path.resolve()
217
256
  )
218
257
 
219
258
  save_requirements(
@@ -229,9 +268,7 @@ def create_django_project(project_name):
229
268
  readme = (
230
269
  f"# {project_name}\n\n"
231
270
  "A Django project created with ProjectStarter.\n\n"
232
- "## Activate virtual environment\n\n"
233
- "Windows:\n\n"
234
- ".venv\\Scripts\\activate\n\n"
271
+ f"{activation_instructions()}"
235
272
  "## Run the project\n\n"
236
273
  "python manage.py runserver\n\n"
237
274
  "## Project URL\n\n"
@@ -249,6 +286,10 @@ def create_django_project(project_name):
249
286
  )
250
287
 
251
288
 
289
+ # ==============================
290
+ # Flask Project Generator
291
+ # ==============================
292
+
252
293
  def create_flask_project(project_name):
253
294
  """Create a Flask project."""
254
295
 
@@ -322,9 +363,7 @@ if __name__ == "__main__":
322
363
  readme = (
323
364
  f"# {project_name}\n\n"
324
365
  "A Flask project created with ProjectStarter.\n\n"
325
- "## Activate virtual environment\n\n"
326
- "Windows:\n\n"
327
- ".venv\\Scripts\\activate\n\n"
366
+ f"{activation_instructions()}"
328
367
  "## Run the project\n\n"
329
368
  "python run.py\n\n"
330
369
  "## Project URL\n\n"
@@ -341,6 +380,11 @@ if __name__ == "__main__":
341
380
  "created successfully!"
342
381
  )
343
382
 
383
+
384
+ # ==============================
385
+ # FastAPI Project Generator
386
+ # ==============================
387
+
344
388
  def create_fastapi_project(project_name):
345
389
  """Create a FastAPI project."""
346
390
 
@@ -405,9 +449,7 @@ def home():
405
449
  readme = (
406
450
  f"# {project_name}\n\n"
407
451
  "A FastAPI project created with ProjectStarter.\n\n"
408
- "## Activate virtual environment\n\n"
409
- "Windows:\n\n"
410
- ".venv\\Scripts\\activate\n\n"
452
+ f"{activation_instructions()}"
411
453
  "## Run\n\n"
412
454
  "uvicorn app.main:app --reload\n\n"
413
455
  "## API\n\n"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: projectstarter-cli
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: A Python CLI tool for quickly generating Python, Django, Flask, and FastAPI projects
5
5
  Author-email: Mohamed Ali Ismail Jami <mohamedali32947@gmail.com>
6
6
  License-Expression: MIT
@@ -13,6 +13,7 @@ Classifier: Environment :: Console
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Programming Language :: Python :: 3
15
15
  Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.13
16
17
  Classifier: Topic :: Software Development :: Build Tools
17
18
  Requires-Python: >=3.9
18
19
  Description-Content-Type: text/markdown
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "projectstarter-cli"
8
- version = "0.1.1"
8
+ version = "0.1.2"
9
9
  description = "A Python CLI tool for quickly generating Python, Django, Flask, and FastAPI projects"
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.9"
@@ -33,6 +33,7 @@ classifiers = [
33
33
  "Intended Audience :: Developers",
34
34
  "Programming Language :: Python :: 3",
35
35
  "Programming Language :: Python :: 3 :: Only",
36
+ "Programming Language :: Python :: 3.13",
36
37
  "Topic :: Software Development :: Build Tools",
37
38
  ]
38
39