itw-python-builder 0.1.23__tar.gz → 0.1.24__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.
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/PKG-INFO +1 -1
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder/tasks.py +36 -0
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder.egg-info/PKG-INFO +1 -1
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/pyproject.toml +1 -1
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/LICENSE +0 -0
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/README.md +0 -0
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder/.pylintrc +0 -0
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder/__init__.py +0 -0
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder/cli.py +0 -0
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder/version.py +0 -0
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder.egg-info/SOURCES.txt +0 -0
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder.egg-info/dependency_links.txt +0 -0
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder.egg-info/entry_points.txt +0 -0
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder.egg-info/requires.txt +0 -0
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder.egg-info/top_level.txt +0 -0
- {itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/setup.cfg +0 -0
|
@@ -9,6 +9,42 @@ from pathlib import Path
|
|
|
9
9
|
PYLINTRC = Path(__file__).parent / ".pylintrc"
|
|
10
10
|
_venv_activated = False
|
|
11
11
|
|
|
12
|
+
def detect_project_type() -> str:
|
|
13
|
+
"""Detect whether the current directory is a 'frontend' or 'backend' project."""
|
|
14
|
+
cwd = os.getcwd()
|
|
15
|
+
has_package_json = os.path.isfile(os.path.join(cwd, 'package.json'))
|
|
16
|
+
has_manage_py = os.path.isfile(os.path.join(cwd, 'manage.py'))
|
|
17
|
+
|
|
18
|
+
if has_package_json and has_manage_py:
|
|
19
|
+
raise RuntimeError(
|
|
20
|
+
'Ambiguous project: both package.json and manage.py found in current directory.'
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
if has_package_json:
|
|
24
|
+
if not os.path.isdir(os.path.join(cwd, 'node_modules')):
|
|
25
|
+
raise RuntimeError(
|
|
26
|
+
'Found package.json but no node_modules/ directory.\n'
|
|
27
|
+
'Install dependencies with: npm install'
|
|
28
|
+
)
|
|
29
|
+
return 'frontend'
|
|
30
|
+
|
|
31
|
+
if has_manage_py:
|
|
32
|
+
has_venv = (
|
|
33
|
+
os.path.isdir(os.path.join(cwd, '.venv'))
|
|
34
|
+
or os.path.isdir(os.path.join(cwd, 'venv'))
|
|
35
|
+
)
|
|
36
|
+
if not has_venv:
|
|
37
|
+
raise RuntimeError(
|
|
38
|
+
'Found manage.py but no virtual environment (venv or .venv) in current directory.\n'
|
|
39
|
+
'Create one with: python -m venv .venv'
|
|
40
|
+
)
|
|
41
|
+
return 'backend'
|
|
42
|
+
|
|
43
|
+
raise RuntimeError(
|
|
44
|
+
'Could not detect project type: no package.json or manage.py in current directory.'
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
12
48
|
def detect_and_activate_venv():
|
|
13
49
|
"""Detect venv in current directory and prepend to PATH. Runs only once."""
|
|
14
50
|
global _venv_activated
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "itw_python_builder"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.24"
|
|
8
8
|
description = "Standardized Django deployment pipeline with Docker, testing, and SonarQube integration"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder.egg-info/requires.txt
RENAMED
|
File without changes
|
{itw_python_builder-0.1.23 → itw_python_builder-0.1.24}/itw_python_builder.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|