instant-python 0.6.2__py3-none-any.whl → 0.7.0__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.
- instant_python/commands/init.py +4 -0
- instant_python/formatter/__init__.py +0 -0
- instant_python/formatter/project_formatter.py +19 -0
- instant_python/templates/project_structure/clean_architecture/source.yml.j2 +4 -1
- instant_python/templates/project_structure/domain_driven_design/source.yml.j2 +5 -2
- instant_python/templates/project_structure/fastapi_domain.yml.j2 +7 -0
- instant_python/templates/project_structure/standard_project/source.yml.j2 +1 -0
- {instant_python-0.6.2.dist-info → instant_python-0.7.0.dist-info}/METADATA +1 -1
- {instant_python-0.6.2.dist-info → instant_python-0.7.0.dist-info}/RECORD +12 -9
- {instant_python-0.6.2.dist-info → instant_python-0.7.0.dist-info}/WHEEL +0 -0
- {instant_python-0.6.2.dist-info → instant_python-0.7.0.dist-info}/entry_points.txt +0 -0
- {instant_python-0.6.2.dist-info → instant_python-0.7.0.dist-info}/licenses/LICENSE +0 -0
instant_python/commands/init.py
CHANGED
|
@@ -2,6 +2,7 @@ import typer
|
|
|
2
2
|
|
|
3
3
|
from instant_python.configuration.parser.parser import Parser
|
|
4
4
|
from instant_python.dependency_manager.dependency_manager_factory import DependencyManagerFactory
|
|
5
|
+
from instant_python.formatter.project_formatter import ProjectFormatter
|
|
5
6
|
from instant_python.git.git_configurer import GitConfigurer
|
|
6
7
|
from instant_python.project_creator.file_system import FileSystem
|
|
7
8
|
from instant_python.render.custom_project_renderer import CustomProjectRenderer
|
|
@@ -44,6 +45,9 @@ def create_new_project(
|
|
|
44
45
|
dependencies=configuration.dependencies,
|
|
45
46
|
)
|
|
46
47
|
|
|
48
|
+
formatter = ProjectFormatter(project_directory=configuration.project_folder_name)
|
|
49
|
+
formatter.format()
|
|
50
|
+
|
|
47
51
|
git_configurer = GitConfigurer(project_directory=configuration.project_folder_name)
|
|
48
52
|
git_configurer.setup_repository(configuration.git)
|
|
49
53
|
configuration.save_on_project_folder()
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ProjectFormatter:
|
|
5
|
+
def __init__(self, project_directory: str) -> None:
|
|
6
|
+
self._project_directory = project_directory
|
|
7
|
+
|
|
8
|
+
def format(self) -> None:
|
|
9
|
+
self._run_command(command="uvx ruff format")
|
|
10
|
+
|
|
11
|
+
def _run_command(self, command: str) -> None:
|
|
12
|
+
subprocess.run(
|
|
13
|
+
command,
|
|
14
|
+
shell=True,
|
|
15
|
+
check=True,
|
|
16
|
+
cwd=self._project_directory,
|
|
17
|
+
stdout=subprocess.DEVNULL,
|
|
18
|
+
stderr=subprocess.PIPE,
|
|
19
|
+
)
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- name: domain
|
|
14
14
|
type: directory
|
|
15
15
|
python: True
|
|
16
|
-
{% if ["value_objects", "event_bus"] | is_in(template.built_in_features) %}
|
|
16
|
+
{% if ["value_objects", "event_bus", "fastapi_application"] | is_in(template.built_in_features) %}
|
|
17
17
|
children:
|
|
18
18
|
{% if "value_objects" in template.built_in_features %}
|
|
19
19
|
{{ macros.include_and_indent("project_structure/value_objects.yml.j2", 8) }}
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
{% if "event_bus" in template.built_in_features %}
|
|
22
22
|
{{ macros.include_and_indent("project_structure/event_bus_domain.yml.j2", 8) }}
|
|
23
23
|
{% endif %}
|
|
24
|
+
{% if "fastapi_application" in template.built_in_features %}
|
|
25
|
+
{{ macros.include_and_indent("project_structure/fastapi_domain.yml.j2", 8) }}
|
|
26
|
+
{% endif %}
|
|
24
27
|
{% endif %}
|
|
25
28
|
- name: application
|
|
26
29
|
type: directory
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
- name: shared
|
|
14
14
|
type: directory
|
|
15
15
|
python: True
|
|
16
|
-
{% if ["value_objects", "synchronous_sqlalchemy", "event_bus", "async_alembic"] | is_in(template.built_in_features) %}
|
|
16
|
+
{% if ["value_objects", "synchronous_sqlalchemy", "event_bus", "async_alembic", "fastapi_application"] | is_in(template.built_in_features) %}
|
|
17
17
|
children:
|
|
18
|
-
{% if ["value_objects", "event_bus"] | is_in(template.built_in_features) %}
|
|
18
|
+
{% if ["value_objects", "event_bus", "fastapi_application"] | is_in(template.built_in_features) %}
|
|
19
19
|
- name: domain
|
|
20
20
|
type: directory
|
|
21
21
|
python: True
|
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
{% if "event_bus" in template.built_in_features %}
|
|
27
27
|
{{ macros.include_and_indent("project_structure/event_bus_domain.yml.j2", 12) }}
|
|
28
28
|
{% endif %}
|
|
29
|
+
{% if "fastapi_application" in template.built_in_features %}
|
|
30
|
+
{{ macros.include_and_indent("project_structure/fastapi_domain.yml.j2", 12) }}
|
|
31
|
+
{% endif %}
|
|
29
32
|
{% endif %}
|
|
30
33
|
{% if ["synchronous_sqlalchemy", "event_bus", "logger", "async_sqlalchemy", "async_alembic", "fastapi_application"] | is_in(template.built_in_features) %}
|
|
31
34
|
- name: infra
|
|
@@ -26,5 +26,6 @@
|
|
|
26
26
|
{% if "fastapi_application" in template.built_in_features %}
|
|
27
27
|
{{ macros.include_and_indent("project_structure/fastapi_app.yml.j2", 4) }}
|
|
28
28
|
{{ macros.include_and_indent("project_structure/fastapi_infra.yml.j2", 4) }}
|
|
29
|
+
{{ macros.include_and_indent("project_structure/fastapi_domain.yml.j2", 4) }}
|
|
29
30
|
{% endif %}
|
|
30
31
|
{% endif %}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: instant-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Instant boilerplate generation for Python projects
|
|
5
5
|
Project-URL: documentation, https://dimanu-py.github.io/instant-python/
|
|
6
6
|
Project-URL: repository, https://github.com/dimanu-py/instant-python/
|
|
@@ -3,7 +3,7 @@ instant_python/cli.py,sha256=gjBeCHZzuG1OHw0gZ_2gBByZ9UB_yq6JPSVUz3pLo3c,804
|
|
|
3
3
|
instant_python/instant_python_typer.py,sha256=jVk2VV8O4WHbyVGGn56D8Id-oo03KriwfmxgPTQOdy4,1230
|
|
4
4
|
instant_python/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
instant_python/commands/config.py,sha256=m62zbX9A_dKaYdLmYaG89kZqRQmqtVQZyeHCyJOP9pU,1169
|
|
6
|
-
instant_python/commands/init.py,sha256=
|
|
6
|
+
instant_python/commands/init.py,sha256=jdRQufnBG-29abOOkYeVJ8FwrRarQkRSMqsYZ2CGFNw,2356
|
|
7
7
|
instant_python/configuration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
instant_python/configuration/configuration_schema.py,sha256=KjZsLgY8IQynHaNIvhdBjFfvoVrtxMonkGuPijIrJTw,2680
|
|
9
9
|
instant_python/configuration/question_wizard.py,sha256=mK_tWJ88g-wETNxlW6n9OXCmzZ32177u56TM42OdOtA,347
|
|
@@ -51,6 +51,8 @@ instant_python/dependency_manager/dependency_manager_factory.py,sha256=WRP7LwPho
|
|
|
51
51
|
instant_python/dependency_manager/pdm_dependency_manager.py,sha256=O5EjtA0QeBNU81nhFYfzzrqZnyB-hdodQ6F2R3HJqyM,2064
|
|
52
52
|
instant_python/dependency_manager/unknown_dependency_manager_error.py,sha256=WYV3MGRgzHwJ5HwSOIPBowfIxadg_L6VdbNOKHRbNTE,396
|
|
53
53
|
instant_python/dependency_manager/uv_dependency_manager.py,sha256=U9glowDvi0JA4MSoeGANKYeoeE5grTHSXdWj3Rw5GVw,2039
|
|
54
|
+
instant_python/formatter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
|
+
instant_python/formatter/project_formatter.py,sha256=EeAlb7_LA6ZaBLopzx3ZA1p3q-Fgi7gEi5sxzDkVWsU,506
|
|
54
56
|
instant_python/git/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
57
|
instant_python/git/git_configurer.py,sha256=Z6sQpvAk_BYB_eGzJuAomPY0nu2dPPxOsDh3dUPeuuA,1422
|
|
56
58
|
instant_python/project_creator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -155,6 +157,7 @@ instant_python/templates/project_structure/async_sqlalchemy.yml.j2,sha256=XaOKwR
|
|
|
155
157
|
instant_python/templates/project_structure/event_bus_domain.yml.j2,sha256=kqnY9EZaZ2O3HWaQb16jISpR287tBAKxyiq6IaPt1PA,769
|
|
156
158
|
instant_python/templates/project_structure/event_bus_infra.yml.j2,sha256=pCKtjiIfi6VSBdM7n1QL7lQgM-lRqm2_7eOXYOstwaQ,971
|
|
157
159
|
instant_python/templates/project_structure/fastapi_app.yml.j2,sha256=e3n1OXSea7LkOPlRCIbKwzyT6n-Y_YhSXwF1-TWX34Y,217
|
|
160
|
+
instant_python/templates/project_structure/fastapi_domain.yml.j2,sha256=21fFqN6Ncm_9pQ5eUH2mwZe73B8d3YGf7q4cSebBQfw,149
|
|
158
161
|
instant_python/templates/project_structure/fastapi_infra.yml.j2,sha256=VJg6fLYL20iYugnE-Q4QpZg7TfM62zKdkuAxE_gWWmI,223
|
|
159
162
|
instant_python/templates/project_structure/github_action.yml.j2,sha256=rMEddCYNUWE3kda2LhBu85FpxEWHZqQrOPBTm8mekkk,513
|
|
160
163
|
instant_python/templates/project_structure/gitignore.yml.j2,sha256=Ex3A7rvCvuIqxTVdeHxM3DPyTl73AcrHyiceHOIzFuw,43
|
|
@@ -171,17 +174,17 @@ instant_python/templates/project_structure/readme.yml.j2,sha256=Km1zSVKfGwx7GHn0
|
|
|
171
174
|
instant_python/templates/project_structure/synchronous_sqlalchemy.yml.j2,sha256=mC7WBchO0bzHcGkTw0k4woDstUvoQaJKlrCW82A96o8,467
|
|
172
175
|
instant_python/templates/project_structure/value_objects.yml.j2,sha256=X5AyyZoRllCYdvRUaXSYlcZk_EQg2OyfdCS8pejjFpc,963
|
|
173
176
|
instant_python/templates/project_structure/clean_architecture/main_structure.yml.j2,sha256=hh4bYTAmrOPWugWqDXX3qPrRJiTUG8iUNPKSo2RBwfQ,1395
|
|
174
|
-
instant_python/templates/project_structure/clean_architecture/source.yml.j2,sha256=
|
|
177
|
+
instant_python/templates/project_structure/clean_architecture/source.yml.j2,sha256=EOlKRnuYigc49LqLFhCKlCrfrdW673doyGryWnQhHhU,2505
|
|
175
178
|
instant_python/templates/project_structure/clean_architecture/test.yml.j2,sha256=q2Yqa4SXgEkg_xErGgESkObhRhPluA1fzKJgPMNIEOk,580
|
|
176
179
|
instant_python/templates/project_structure/domain_driven_design/bounded_context.yml.j2,sha256=BTuT5fQBdw4o3Ev-iN8THAr2-bLlLG8mgLpbQOcL0x4,471
|
|
177
180
|
instant_python/templates/project_structure/domain_driven_design/main_structure.yml.j2,sha256=NxA5Nw84DvJvfnag6-9jssZbe416fHXBzq4u1WeiDEY,1399
|
|
178
|
-
instant_python/templates/project_structure/domain_driven_design/source.yml.j2,sha256=
|
|
181
|
+
instant_python/templates/project_structure/domain_driven_design/source.yml.j2,sha256=L5N-C5EAQI8Nn4Nx6zEgTeaDbxHEm-zLKGEoFIcsdqA,2997
|
|
179
182
|
instant_python/templates/project_structure/domain_driven_design/test.yml.j2,sha256=sUVO0jWeDEoShMXIDSTBw-14vStjoHCcTm5DuuI9V2A,841
|
|
180
183
|
instant_python/templates/project_structure/standard_project/main_structure.yml.j2,sha256=Gy11qNOtTDzGgIbhDPmAUkipmjwJPHa33-_WL_xlR3U,1381
|
|
181
|
-
instant_python/templates/project_structure/standard_project/source.yml.j2,sha256=
|
|
184
|
+
instant_python/templates/project_structure/standard_project/source.yml.j2,sha256=8QdB1AY22BzHRCidNdEJ9a6PRzq9ZWRPKIpqyoD6tmE,1748
|
|
182
185
|
instant_python/templates/project_structure/standard_project/test.yml.j2,sha256=NxzsDeBKYzNaR3t8BY2VOuyhzwlp3Pa49OQNDF78gas,381
|
|
183
|
-
instant_python-0.
|
|
184
|
-
instant_python-0.
|
|
185
|
-
instant_python-0.
|
|
186
|
-
instant_python-0.
|
|
187
|
-
instant_python-0.
|
|
186
|
+
instant_python-0.7.0.dist-info/METADATA,sha256=xe10FPc5bRWfdm6kwwcJhBZxTwq1Phlc2cmtt8g73ew,17574
|
|
187
|
+
instant_python-0.7.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
188
|
+
instant_python-0.7.0.dist-info/entry_points.txt,sha256=EdBTj3b3N9Pa4oNzPLPivE_AnMcQIFsmRC3RsSkoLLA,47
|
|
189
|
+
instant_python-0.7.0.dist-info/licenses/LICENSE,sha256=kf7wA-1IsqXkzXjlsG95sdQJtsqUON_lNXombfPlklo,11353
|
|
190
|
+
instant_python-0.7.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|