itw-python-builder 0.1.36__tar.gz → 0.1.38__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. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/PKG-INFO +1 -1
  2. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder/tasks.py +16 -11
  3. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder.egg-info/PKG-INFO +1 -1
  4. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/pyproject.toml +1 -1
  5. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/LICENSE +0 -0
  6. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/README.md +0 -0
  7. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder/.pylintrc +0 -0
  8. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder/__init__.py +0 -0
  9. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder/cli.py +0 -0
  10. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder/ssr_tasks.py +0 -0
  11. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder/templates/server.sitemap.snippet.ts +0 -0
  12. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder/templates/sitemap.routes.ts +0 -0
  13. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder/utils.py +0 -0
  14. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder/version.py +0 -0
  15. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder.egg-info/SOURCES.txt +0 -0
  16. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder.egg-info/dependency_links.txt +0 -0
  17. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder.egg-info/entry_points.txt +0 -0
  18. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder.egg-info/requires.txt +0 -0
  19. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/itw_python_builder.egg-info/top_level.txt +0 -0
  20. {itw_python_builder-0.1.36 → itw_python_builder-0.1.38}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: itw_python_builder
3
- Version: 0.1.36
3
+ Version: 0.1.38
4
4
  Summary: Standardized Django deployment pipeline with Docker, testing, and SonarQube integration
5
5
  Author-email: IT-Works <contact@it-works.io>
6
6
  License: MIT
@@ -61,18 +61,9 @@ def build_frontend(ctx: Context, branch: str, ssr: bool = False) -> None:
61
61
 
62
62
  def package_dist(ctx: Context) -> None:
63
63
  """Tar the dist/ output directory into dist.tar.gz."""
64
- dist_dir = os.path.join(os.getcwd(), 'dist')
65
- if not os.path.isdir(dist_dir):
64
+ if not os.path.isdir(os.path.join(os.getcwd(), 'dist')):
66
65
  raise RuntimeError('No dist/ directory found after build — did `ng build` succeed?')
67
-
68
- target_dir = dist_dir
69
- if not is_ssr_project():
70
- for root, dirs, files in os.walk(dist_dir):
71
- if 'index.html' in files:
72
- target_dir = root
73
- break
74
-
75
- ctx.run(f'tar -czf dist.tar.gz -C "{target_dir}" .')
66
+ ctx.run('tar -czf dist.tar.gz -C dist .')
76
67
 
77
68
 
78
69
  _GITLAB_API_HOST_MAP = {
@@ -159,6 +150,15 @@ def taginit(ctx: Context) -> None:
159
150
  save_version(version)
160
151
 
161
152
 
153
+ def _ensure_unique_tag(ctx: Context, version: Version) -> None:
154
+ """If the tag already exists, auto-increment RC if it's an RC, or abort if it's a release."""
155
+ while ctx.run(f'git rev-parse -q --verify "refs/tags/{version}"', warn=True, hide=True).ok:
156
+ if version.release_candidate == 0:
157
+ raise RuntimeError(f"Tag {version} already exists! Aborting before pipeline to prevent overwrite.")
158
+ print(f"[itw] Tag {version} already exists, auto-incrementing release candidate...")
159
+ version.increment_release_candidate()
160
+
161
+
162
162
  @task
163
163
  def incrementrc(ctx: Context, skip_pipeline=False, pylintrc=None, ssr=False) -> None:
164
164
  """Increment release candidate version and deploy. Use --ssr for Angular SSR builds."""
@@ -167,6 +167,7 @@ def incrementrc(ctx: Context, skip_pipeline=False, pylintrc=None, ssr=False) ->
167
167
  project_type = detect_project_type()
168
168
  version = read_version(ctx)
169
169
  version.increment_release_candidate()
170
+ _ensure_unique_tag(ctx, version)
170
171
  if project_type == 'backend':
171
172
  lint(ctx, pylintrc=pylintrc)
172
173
  tag_build_push(ctx, version, skip_pipeline, ssr=ssr)
@@ -181,6 +182,7 @@ def incrementpatch(ctx: Context, skip_pipeline=False, ssr=False) -> None:
181
182
  production = check_branch(ctx)
182
183
  version = read_version(ctx)
183
184
  version.increment_patch(release=production)
185
+ _ensure_unique_tag(ctx, version)
184
186
  tag_build_push(ctx, version, skip_pipeline, ssr=ssr)
185
187
  save_version(version)
186
188
  commit_version(ctx, version)
@@ -193,6 +195,7 @@ def incrementminor(ctx: Context, skip_pipeline=False, ssr=False) -> None:
193
195
  production = check_branch(ctx)
194
196
  version = read_version(ctx)
195
197
  version.increment_minor(release=production)
198
+ _ensure_unique_tag(ctx, version)
196
199
  tag_build_push(ctx, version, skip_pipeline, ssr=ssr)
197
200
  save_version(version)
198
201
  commit_version(ctx, version)
@@ -205,6 +208,7 @@ def incrementmajor(ctx: Context, skip_pipeline=False, ssr=False) -> None:
205
208
  production = check_branch(ctx)
206
209
  version = read_version(ctx)
207
210
  version.increment_major(release=production)
211
+ _ensure_unique_tag(ctx, version)
208
212
  tag_build_push(ctx, version, skip_pipeline, ssr=ssr)
209
213
  save_version(version)
210
214
  commit_version(ctx, version)
@@ -218,6 +222,7 @@ def release(ctx: Context, skip_pipeline=False, ssr=False) -> None:
218
222
  login(ctx)
219
223
  version = read_version(ctx)
220
224
  version.reset_release_candidate(release=True)
225
+ _ensure_unique_tag(ctx, version)
221
226
  tag_build_push(ctx, version, skip_pipeline, ssr=ssr)
222
227
  save_version(version)
223
228
  commit_version(ctx, version)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: itw_python_builder
3
- Version: 0.1.36
3
+ Version: 0.1.38
4
4
  Summary: Standardized Django deployment pipeline with Docker, testing, and SonarQube integration
5
5
  Author-email: IT-Works <contact@it-works.io>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "itw_python_builder"
7
- version = "0.1.36"
7
+ version = "0.1.38"
8
8
  description = "Standardized Django deployment pipeline with Docker, testing, and SonarQube integration"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"