itw-python-builder 0.2.6__py3-none-any.whl → 0.2.7__py3-none-any.whl

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/cli.py CHANGED
@@ -1,9 +1,35 @@
1
- from invoke import Program, Collection
1
+ from importlib.metadata import PackageNotFoundError, version as _pkg_version
2
+
3
+ from invoke import Argument, Collection, Program
2
4
 
3
5
  from itw_python_builder import tasks
4
6
 
5
7
 
8
+ def _get_version() -> str:
9
+ try:
10
+ return _pkg_version('itw_python_builder')
11
+ except PackageNotFoundError:
12
+ return 'unknown'
13
+
14
+
15
+ class ItwProgram(Program):
16
+ def core_args(self):
17
+ args = super().core_args()
18
+ result = []
19
+ for arg in args:
20
+ if 'version' in arg.names:
21
+ result.append(Argument(
22
+ names=('version', 'v'),
23
+ kind=bool,
24
+ default=False,
25
+ help='Show version and exit.',
26
+ ))
27
+ else:
28
+ result.append(arg)
29
+ return result
30
+
31
+
6
32
  def main():
7
33
  namespace = Collection.from_module(tasks)
8
- program = Program(namespace=namespace, name='itw')
34
+ program = ItwProgram(namespace=namespace, name='itw', version=_get_version())
9
35
  program.run()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: itw_python_builder
3
- Version: 0.2.6
3
+ Version: 0.2.7
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
@@ -1,6 +1,6 @@
1
1
  itw_python_builder/.pylintrc,sha256=qaFcVwZntMr-8RTj924F7WtQrTpl5x-wKSlomle0qRI,24366
2
2
  itw_python_builder/__init__.py,sha256=0HwEqonfK8w1kx80BOX80fvxSL8ov1hmUD2Zi4SU75w,119
3
- itw_python_builder/cli.py,sha256=K8ZaLtxr_i1YNlK7js1kCRCiC7tTXrybMbSVAHA3yEg,210
3
+ itw_python_builder/cli.py,sha256=UKnswr7vzLC6SnB5YgxWu8ZLbOe8WGStdUHCgkzkyqM,939
4
4
  itw_python_builder/notify.py,sha256=Rv1RA9QdDo00bvjMMSDq-oQh2pjDmjjj97yzzhgiwpM,3011
5
5
  itw_python_builder/ssr_tasks.py,sha256=TqkuGLH9XJqDkTPBuRnFAKJywYqvdf0lSlSMXtVPM5Y,15730
6
6
  itw_python_builder/task_utils.py,sha256=qsmq_XhOlg5qYuHQQIQS5XFIWcX1lAh8nRfXw2dSGUM,8004
@@ -11,9 +11,9 @@ itw_python_builder/_pyruntime/sitecustomize.py,sha256=cjTrKErMdAFI-uVuW60BNNF8X4
11
11
  itw_python_builder/templates/new_version_email.html,sha256=hdWYfL_3QCBsdrdRXu0KB75pK1uCC5eoBY9B6u5lrUw,1963
12
12
  itw_python_builder/templates/server.sitemap.snippet.ts,sha256=qjRCLiAqzDUTqsWxJLeqlr-jOluK0IE2IoN_lbSx0ec,669
13
13
  itw_python_builder/templates/sitemap.routes.ts,sha256=yOXZ8TpHq_-QKH7y_u75XpL8paCF4AEv5z5cvWeI7yY,1323
14
- itw_python_builder-0.2.6.dist-info/licenses/LICENSE,sha256=WZ75-earCxnov77gsH4vckNf7Ag8RPst-7y9dPaZTCU,1063
15
- itw_python_builder-0.2.6.dist-info/METADATA,sha256=GnTOgaNchNBPvFe1ENDUWUSDstguKQEnc9nnyB8U0TQ,4927
16
- itw_python_builder-0.2.6.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
17
- itw_python_builder-0.2.6.dist-info/entry_points.txt,sha256=Rx2zlbaCxl954YX8kF4hey3Y25fxsaxiEPXjBPw3ky0,52
18
- itw_python_builder-0.2.6.dist-info/top_level.txt,sha256=9djpWUrRa0vuSfdVrHc4-3gvAHbBvzh_lbyzgTHtkJA,19
19
- itw_python_builder-0.2.6.dist-info/RECORD,,
14
+ itw_python_builder-0.2.7.dist-info/licenses/LICENSE,sha256=WZ75-earCxnov77gsH4vckNf7Ag8RPst-7y9dPaZTCU,1063
15
+ itw_python_builder-0.2.7.dist-info/METADATA,sha256=rwOApAzb2FLE-3k648nUM4ORT3WIlVkxGFbQ-2seqvY,4927
16
+ itw_python_builder-0.2.7.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
17
+ itw_python_builder-0.2.7.dist-info/entry_points.txt,sha256=Rx2zlbaCxl954YX8kF4hey3Y25fxsaxiEPXjBPw3ky0,52
18
+ itw_python_builder-0.2.7.dist-info/top_level.txt,sha256=9djpWUrRa0vuSfdVrHc4-3gvAHbBvzh_lbyzgTHtkJA,19
19
+ itw_python_builder-0.2.7.dist-info/RECORD,,