emcd-projects 1.17.1__py3-none-any.whl → 1.18rc0__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.
- {emcd_projects-1.17.1.dist-info → emcd_projects-1.18rc0.dist-info}/METADATA +1 -1
- {emcd_projects-1.17.1.dist-info → emcd_projects-1.18rc0.dist-info}/RECORD +10 -10
- emcdproj/__/__init__.py +0 -5
- emcdproj/__/imports.py +1 -0
- emcdproj/__init__.py +1 -1
- emcdproj/data/copier/answers-maximum.yaml +0 -2
- emcdproj/template.py +23 -6
- {emcd_projects-1.17.1.dist-info → emcd_projects-1.18rc0.dist-info}/WHEEL +0 -0
- {emcd_projects-1.17.1.dist-info → emcd_projects-1.18rc0.dist-info}/entry_points.txt +0 -0
- {emcd_projects-1.17.1.dist-info → emcd_projects-1.18rc0.dist-info}/licenses/LICENSE.txt +0 -0
@@ -1,27 +1,27 @@
|
|
1
1
|
emcdproj/data/.gitignore,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
emcdproj/data/copier/answers-default.yaml,sha256=dgdxDTcZZpHjg3-uZyDALzJ0Gc7GBcSSvQ7L_OmebWM,150
|
3
|
-
emcdproj/data/copier/answers-maximum.yaml,sha256=
|
3
|
+
emcdproj/data/copier/answers-maximum.yaml,sha256=zc0BP1zwYOdRPemq0NrY66JPmSujPkRjhD1HEtvhnhY,339
|
4
4
|
emcdproj/data/templates/coverage.svg.jinja,sha256=UWJE9I1QVoo31DB4PAcf_sYFs1oOViDbnCmhzuoVuq8,1479
|
5
5
|
emcdproj/data/templates/website.html.jinja,sha256=V958XUcGdNmvSl_RalRvPRIZ5uUcpaXgycddOLN6rfA,1513
|
6
6
|
emcdproj/README.rst,sha256=ThJlTJWDLurnGuhCXlQDRuSYexDJrAUnHIPiTGaAmww,4495
|
7
|
-
emcdproj/__init__.py,sha256=
|
7
|
+
emcdproj/__init__.py,sha256=WmRfuBDICaUBkFYm1WL0NUeX2vbL7oGnb7v7a5rIoRo,1585
|
8
8
|
emcdproj/__main__.py,sha256=KkTeK75rYgF2yVf2HpTs-L2V1jru3j7ohDSgGXWFXjQ,1409
|
9
9
|
emcdproj/cli.py,sha256=WNAF0pmAbdxtmuCcyTBkuG1CQnWixpkDSXNuQ4KwXDE,4414
|
10
10
|
emcdproj/exceptions.py,sha256=Y9n5pGh1-hMkKtOYherAjUw19af4-uWDNzUZjiqiU00,2641
|
11
11
|
emcdproj/filesystem.py,sha256=YgcX5Q52r2hTYU-7_VoW2inMC4NBTzqSTINB9eNT9Hw,1708
|
12
12
|
emcdproj/interfaces.py,sha256=PvNZb4G0EhXbK_yaAOhqcgp0uNR30FCRUf4Qn0e03M8,3185
|
13
13
|
emcdproj/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
-
emcdproj/template.py,sha256=
|
14
|
+
emcdproj/template.py,sha256=bMUt_Nm1Ks85zqYi0k2cSxFijdYLyD8deNaWzVPSI6Y,5345
|
15
15
|
emcdproj/website.py,sha256=YfIGPp2WzoL0E9nQLJgbfU6yVbipns-I7F6alkSowb0,10657
|
16
|
-
emcdproj/__/__init__.py,sha256=
|
16
|
+
emcdproj/__/__init__.py,sha256=qIdtKkPRa4WV6o4G8KVcGnLPg2aydIQzJXjrRPefRHY,1516
|
17
17
|
emcdproj/__/application.py,sha256=6uF2yTIlAsLWKadus7a7mPvr7q3pagplPrDAA1EUwlw,2316
|
18
18
|
emcdproj/__/distribution.py,sha256=9TCSm8oJtIot-MPR8Ypt72gMaUh77WXtkpuxggb6tGQ,3972
|
19
|
-
emcdproj/__/imports.py,sha256=
|
19
|
+
emcdproj/__/imports.py,sha256=0dEBJLIEEtV4aFyWo4mqEarG6yz_Y7vLKcymjmhw-VI,2377
|
20
20
|
emcdproj/__/preparation.py,sha256=rNbA8VvrspanbP_0O4GjmwaqgzgPf0SdY7WadcINJZE,3824
|
21
21
|
emcdproj/__/state.py,sha256=inChROB1WcJ_b9kZ6VfQZr-dLj56-MxWoMHrvB-yXu4,3596
|
22
22
|
emcdproj/_typedecls/__builtins__.pyi,sha256=VhJfnYgggXihUzomBHtA1xEKzG7XqEHkSjhl0Ro6qgg,153
|
23
|
-
emcd_projects-1.
|
24
|
-
emcd_projects-1.
|
25
|
-
emcd_projects-1.
|
26
|
-
emcd_projects-1.
|
27
|
-
emcd_projects-1.
|
23
|
+
emcd_projects-1.18rc0.dist-info/METADATA,sha256=20ir2UUhbTKQ2Njl1v5oqt7KMdOttugewtjTDElPzmA,6088
|
24
|
+
emcd_projects-1.18rc0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
25
|
+
emcd_projects-1.18rc0.dist-info/entry_points.txt,sha256=22Pc1xg3OboNBxpTnDM3gLYXo8QuY2E0SOv1djo0fdc,43
|
26
|
+
emcd_projects-1.18rc0.dist-info/licenses/LICENSE.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
27
|
+
emcd_projects-1.18rc0.dist-info/RECORD,,
|
emcdproj/__/__init__.py
CHANGED
@@ -21,13 +21,8 @@
|
|
21
21
|
''' Common constants, imports, and utilities. '''
|
22
22
|
|
23
23
|
|
24
|
-
# Expose everything from internal modules.
|
25
|
-
from .imports import *
|
26
24
|
from .application import Information as ApplicationInformation
|
27
25
|
from .distribution import Information as DistributionInformation
|
28
26
|
from .imports import *
|
29
27
|
from .preparation import *
|
30
28
|
from .state import Globals
|
31
|
-
|
32
|
-
|
33
|
-
__all__ = ( )
|
emcdproj/__/imports.py
CHANGED
emcdproj/__init__.py
CHANGED
emcdproj/template.py
CHANGED
@@ -24,7 +24,6 @@
|
|
24
24
|
from __future__ import annotations
|
25
25
|
|
26
26
|
import subprocess as _subprocess
|
27
|
-
import tempfile as _tempfile
|
28
27
|
|
29
28
|
from . import __
|
30
29
|
from . import interfaces as _interfaces
|
@@ -33,7 +32,7 @@ from . import interfaces as _interfaces
|
|
33
32
|
class CommandDispatcher(
|
34
33
|
_interfaces.CliCommand, decorators = ( __.standard_tyro_class, ),
|
35
34
|
):
|
36
|
-
''' Dispatches commands for
|
35
|
+
''' Dispatches commands for Copier template maintenance. '''
|
37
36
|
|
38
37
|
command: __.typx.Union[
|
39
38
|
__.typx.Annotated[
|
@@ -76,13 +75,18 @@ class ValidateCommand(
|
|
76
75
|
__.typx.Doc( ''' Configuration variant to validate. ''' ),
|
77
76
|
__.tyro.conf.Positional,
|
78
77
|
]
|
78
|
+
preserve: __.typx.Annotated[
|
79
|
+
bool,
|
80
|
+
__.typx.Doc( ''' Preserve generated project for inspection? ''' ),
|
81
|
+
] = False
|
79
82
|
|
80
83
|
async def __call__(
|
81
84
|
self, auxdata: __.Globals, display: _interfaces.ConsoleDisplay
|
82
85
|
) -> None:
|
83
86
|
''' Copies new project from template for configuration variant. '''
|
84
87
|
# TODO: Validate variant argument.
|
85
|
-
validate_variant(
|
88
|
+
validate_variant(
|
89
|
+
auxdata, self.variant, preserve = self.preserve )
|
86
90
|
|
87
91
|
|
88
92
|
def copy_template( answers_file: __.Path, projectdir: __.Path ) -> None:
|
@@ -103,7 +107,9 @@ def survey_variants( auxdata: __.Globals ) -> __.cabc.Sequence[ str ]:
|
|
103
107
|
if fsent.is_file( ) )
|
104
108
|
|
105
109
|
|
106
|
-
def validate_variant(
|
110
|
+
def validate_variant(
|
111
|
+
auxdata: __.Globals, variant: str, preserve: bool
|
112
|
+
) -> None:
|
107
113
|
''' Validates configuration variant. '''
|
108
114
|
answers_file = (
|
109
115
|
auxdata.distribution.provide_data_location(
|
@@ -111,8 +117,8 @@ def validate_variant( auxdata: __.Globals, variant: str ) -> None:
|
|
111
117
|
if not answers_file.is_file( ):
|
112
118
|
# TODO: Raise error.
|
113
119
|
return
|
114
|
-
with
|
115
|
-
projectdir =
|
120
|
+
with _manage_temporary_directory( preserve = preserve ) as tmpdir:
|
121
|
+
projectdir = tmpdir / variant
|
116
122
|
copy_template( answers_file, projectdir )
|
117
123
|
validate_variant_project( projectdir )
|
118
124
|
|
@@ -125,3 +131,14 @@ def validate_variant_project( projectdir: __.Path ) -> None:
|
|
125
131
|
'--upgrade', 'pip', 'build' ),
|
126
132
|
( 'hatch', '--env', 'develop', 'run', 'make-all' ),
|
127
133
|
): _subprocess.run( command, cwd = str( projectdir ), check = True ) # noqa: S603
|
134
|
+
|
135
|
+
|
136
|
+
@__.ctxl.contextmanager
|
137
|
+
def _manage_temporary_directory(
|
138
|
+
preserve: bool
|
139
|
+
) -> __.cabc.Iterator[ __.Path ]:
|
140
|
+
# TODO: Python 3.12: Replace with tempfile.TemporaryDirectory,
|
141
|
+
# ( delete = not preserve )
|
142
|
+
location = __.Path( __.tempfile.mkdtemp( ) )
|
143
|
+
yield location
|
144
|
+
if not preserve: __.shutil.rmtree( location )
|
File without changes
|
File without changes
|
File without changes
|