omdev 0.0.0.dev289__py3-none-any.whl → 0.0.0.dev291__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.
omdev/ci/github/cache.py CHANGED
@@ -11,8 +11,9 @@ from ..cache import DataCache
11
11
  from ..cache import DirectoryFileCache
12
12
  from ..cache import FileCache
13
13
  from ..cache import FileCacheDataCache
14
- from .client import GithubCacheClient
15
- from .client import GithubCacheServiceV1Client
14
+ from .api.clients import GithubCacheClient
15
+ from .api.v1.client import GithubCacheServiceV1Client
16
+ from .api.v2.client import GithubCacheServiceV2Client
16
17
 
17
18
 
18
19
  ##
@@ -23,11 +24,20 @@ class GithubCache(FileCache, DataCache):
23
24
  class Config:
24
25
  pass
25
26
 
27
+ DEFAULT_CLIENT_VERSION: ta.ClassVar[int] = 2
28
+
29
+ DEFAULT_CLIENTS_BY_VERSION: ta.ClassVar[ta.Mapping[int, ta.Callable[..., GithubCacheClient]]] = {
30
+ 1: GithubCacheServiceV1Client,
31
+ 2: GithubCacheServiceV2Client,
32
+ }
33
+
26
34
  def __init__(
27
35
  self,
28
36
  config: Config = Config(),
29
37
  *,
30
38
  client: ta.Optional[GithubCacheClient] = None,
39
+ default_client_version: ta.Optional[int] = None,
40
+
31
41
  version: ta.Optional[CacheVersion] = None,
32
42
 
33
43
  local: DirectoryFileCache,
@@ -39,7 +49,8 @@ class GithubCache(FileCache, DataCache):
39
49
  self._config = config
40
50
 
41
51
  if client is None:
42
- client = GithubCacheServiceV1Client(
52
+ client_cls = self.DEFAULT_CLIENTS_BY_VERSION[default_client_version or self.DEFAULT_CLIENT_VERSION]
53
+ client = client_cls(
43
54
  cache_version=self._version,
44
55
  )
45
56
  self._client: GithubCacheClient = client
omdev/ci/github/cli.py CHANGED
@@ -10,7 +10,7 @@ from omlish.argparse.cli import argparse_arg
10
10
  from omlish.argparse.cli import argparse_cmd
11
11
  from omlish.lite.json import json_dumps_pretty
12
12
 
13
- from .client import GithubCacheServiceV1Client
13
+ from .api.v1.client import GithubCacheServiceV1Client
14
14
  from .env import GITHUB_ENV_VARS
15
15
 
16
16
 
omdev/pyproject/pkg.py CHANGED
@@ -175,8 +175,11 @@ class BasePyprojectPackageGenerator(abc.ABC):
175
175
  #
176
176
 
177
177
  _STANDARD_FILES: ta.Sequence[str] = [
178
- 'LICENSE',
179
- 'README.rst',
178
+ *[
179
+ ''.join([n, x])
180
+ for n in ('LICENSE', 'README')
181
+ for x in ('', '.txt', '.md', '.rst')
182
+ ],
180
183
  ]
181
184
 
182
185
  def _symlink_standard_files(self) -> None: