emcd-projects 1.17rc0__tar.gz → 1.18rc0__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 (26) hide show
  1. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/PKG-INFO +1 -1
  2. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/data/copier/answers-maximum.yaml +0 -2
  3. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/pyproject.toml +14 -10
  4. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/__/__init__.py +0 -5
  5. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/__/imports.py +1 -0
  6. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/__init__.py +1 -1
  7. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/template.py +23 -6
  8. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/.gitignore +0 -0
  9. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/LICENSE.txt +0 -0
  10. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/data/.gitignore +0 -0
  11. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/data/copier/answers-default.yaml +0 -0
  12. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/data/templates/coverage.svg.jinja +0 -0
  13. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/data/templates/website.html.jinja +0 -0
  14. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/README.rst +0 -0
  15. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/__/application.py +0 -0
  16. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/__/distribution.py +0 -0
  17. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/__/preparation.py +0 -0
  18. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/__/state.py +0 -0
  19. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/__main__.py +0 -0
  20. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/_typedecls/__builtins__.pyi +0 -0
  21. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/cli.py +0 -0
  22. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/exceptions.py +0 -0
  23. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/filesystem.py +0 -0
  24. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/interfaces.py +0 -0
  25. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/py.typed +0 -0
  26. {emcd_projects-1.17rc0 → emcd_projects-1.18rc0}/sources/emcdproj/website.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: emcd-projects
3
- Version: 1.17rc0
3
+ Version: 1.18rc0
4
4
  Summary: Project management utilities.
5
5
  Project-URL: Homepage, https://github.com/emcd/python-project-common
6
6
  Project-URL: Documentation, https://emcd.github.io/python-project-common
@@ -10,5 +10,3 @@ enable_cli: true
10
10
  enable_executables: true
11
11
  inject_foundations: true
12
12
  inject_exceptions: true
13
- inject_immutables: true
14
- inject_docstring_utils: true
@@ -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
- '''sphinx-build -E -b doctest -d .auxiliary/caches/sphinx \
141
- documentation .auxiliary/artifacts/sphinx-doctest''',
142
- '''sphinx-build -E -b linkcheck -d .auxiliary/caches/sphinx \
143
- documentation .auxiliary/artifacts/sphinx-linkcheck''',
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
- '''ruff check --quiet sources documentation tests''',
146
+ """ruff check --quiet sources documentation tests""",
149
147
  # --- BEGIN: Injected by Copier ---
150
148
  # --- END: Injected by Copier ---
151
- '''pyright sources''',
149
+ """pyright sources""",
152
150
  ]
153
151
  packagers = [
154
- '''hatch build''',
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__ = ( )
@@ -35,6 +35,7 @@ import math
35
35
  import os
36
36
  import shutil
37
37
  import sys
38
+ import tempfile
38
39
  import types
39
40
 
40
41
  from pathlib import Path
@@ -27,7 +27,7 @@ from . import exceptions
27
27
  # --- END: Injected by Copier ---
28
28
 
29
29
 
30
- __version__ = '1.17rc0'
30
+ __version__ = '1.18rc0'
31
31
 
32
32
 
33
33
  def main( ):
@@ -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 static website maintenance. '''
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( auxdata, self.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( auxdata: __.Globals, variant: str ) -> None:
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 _tempfile.TemporaryDirectory( ) as tmpdir:
115
- projectdir = __.Path( tmpdir ) / variant
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 )