emcd-projects 1.17rc0__tar.gz → 1.18__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.
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/PKG-INFO +1 -1
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/data/copier/answers-maximum.yaml +0 -2
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/pyproject.toml +14 -10
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/__/__init__.py +0 -5
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/__/imports.py +1 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/__init__.py +1 -1
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/template.py +23 -6
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/.gitignore +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/LICENSE.txt +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/data/.gitignore +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/data/copier/answers-default.yaml +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/data/templates/coverage.svg.jinja +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/data/templates/website.html.jinja +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/README.rst +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/__/application.py +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/__/distribution.py +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/__/preparation.py +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/__/state.py +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/__main__.py +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/_typedecls/__builtins__.pyi +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/cli.py +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/exceptions.py +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/filesystem.py +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/interfaces.py +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/py.typed +0 -0
- {emcd_projects-1.17rc0 → emcd_projects-1.18}/sources/emcdproj/website.py +0 -0
@@ -137,27 +137,31 @@ PYTHONUNBUFFERED = 'TRUE' # TODO: Only for coverage/pytest.
|
|
137
137
|
# --- END: Injected by Copier ---
|
138
138
|
[tool.hatch.envs.develop.scripts]
|
139
139
|
docsgen = [
|
140
|
-
|
141
|
-
documentation .auxiliary/artifacts/sphinx-
|
142
|
-
|
143
|
-
documentation .auxiliary/artifacts/sphinx-
|
144
|
-
'''sphinx-build -a -d .auxiliary/caches/sphinx \
|
145
|
-
documentation .auxiliary/artifacts/sphinx-html''',
|
140
|
+
"""sphinx-build -E -b linkcheck -d .auxiliary/caches/sphinx \
|
141
|
+
documentation .auxiliary/artifacts/sphinx-linkcheck""",
|
142
|
+
"""sphinx-build -a -d .auxiliary/caches/sphinx \
|
143
|
+
documentation .auxiliary/artifacts/sphinx-html""",
|
146
144
|
]
|
147
145
|
linters = [
|
148
|
-
|
146
|
+
"""ruff check --quiet sources documentation tests""",
|
149
147
|
# --- BEGIN: Injected by Copier ---
|
150
148
|
# --- END: Injected by Copier ---
|
151
|
-
|
149
|
+
"""pyright sources""",
|
152
150
|
]
|
153
151
|
packagers = [
|
154
|
-
|
152
|
+
"""hatch build""",
|
155
153
|
# --- BEGIN: Injected by Copier ---
|
156
154
|
# --- END: Injected by Copier ---
|
157
155
|
]
|
158
|
-
testers = [
|
156
|
+
testers-no-reports = [
|
159
157
|
'coverage erase',
|
160
158
|
'coverage run',
|
159
|
+
"""coverage run -m sphinx.cmd.build \
|
160
|
+
-E -b doctest -d .auxiliary/caches/sphinx \
|
161
|
+
documentation .auxiliary/artifacts/sphinx-doctest""",
|
162
|
+
]
|
163
|
+
testers = [
|
164
|
+
'testers-no-reports',
|
161
165
|
'coverage combine',
|
162
166
|
'coverage report --skip-covered',
|
163
167
|
'coverage html',
|
@@ -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__ = ( )
|
@@ -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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|