ledgered 0.7.1.dev2__py3-none-any.whl → 0.7.2.dev4__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.
ledgered/__version__.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.7.1.dev2'
16
- __version_tuple__ = version_tuple = (0, 7, 1, 'dev2')
15
+ __version__ = version = '0.7.2.dev4'
16
+ __version_tuple__ = version_tuple = (0, 7, 2, 'dev4')
ledgered/manifest/cli.py CHANGED
@@ -7,6 +7,7 @@ from pathlib import Path
7
7
  from typing import Dict
8
8
 
9
9
  from .constants import MANIFEST_FILE_NAME
10
+ from ..github import GitHubLedgerHQ
10
11
  from .manifest import Manifest
11
12
  from .utils import getLogger
12
13
 
@@ -41,7 +42,7 @@ def set_parser() -> ArgumentParser:
41
42
  "'ledger_app.toml' manifest")
42
43
 
43
44
  # generic options
44
- parser.add_argument('-v', '--verbose', action='count', default=0)
45
+ parser.add_argument("-v", "--verbose", action="count", default=0)
45
46
  parser.add_argument("-c",
46
47
  "--check",
47
48
  required=False,
@@ -52,37 +53,43 @@ def set_parser() -> ArgumentParser:
52
53
  # display options
53
54
  parser.add_argument("manifest",
54
55
  type=Path,
55
- help=f"The manifest file, generally '{MANIFEST_FILE_NAME}' at the root of "
56
- "the application's repository")
56
+ help=f"The manifest file (generally '{MANIFEST_FILE_NAME}' at the root of "
57
+ "the application's repository), or the name of the app if the `--url` "
58
+ "option is activated")
59
+ parser.add_argument("-u",
60
+ "--url",
61
+ action="store_true",
62
+ default=False,
63
+ help="Tells if the `manifest` is a repository HTTP URL rather than a file")
57
64
  parser.add_argument("-os",
58
65
  "--output-sdk",
59
66
  required=False,
60
- action='store_true',
67
+ action="store_true",
61
68
  default=False,
62
69
  help="outputs the SDK type")
63
70
  parser.add_argument("-ob",
64
71
  "--output-build-directory",
65
72
  required=False,
66
- action='store_true',
73
+ action="store_true",
67
74
  default=False,
68
75
  help="outputs the build directory (where the Makefile in C app, or the "
69
76
  "Cargo.toml in Rust app is expected to be)")
70
77
  parser.add_argument("-od",
71
78
  "--output-devices",
72
79
  required=False,
73
- action='store_true',
80
+ action="store_true",
74
81
  default=False,
75
82
  help="outputs the list of devices supported by the application")
76
83
  parser.add_argument("-otu",
77
84
  "--output-tests-unit-directory",
78
85
  required=False,
79
- action='store_true',
86
+ action="store_true",
80
87
  default=False,
81
88
  help="outputs the directory of the unit tests. Fails if none")
82
89
  parser.add_argument("-otp",
83
90
  "--output-tests-pytest-directory",
84
91
  required=False,
85
- action='store_true',
92
+ action="store_true",
86
93
  default=False,
87
94
  help="outputs the directory of the pytest (functional) tests. Fails if "
88
95
  "none")
@@ -108,11 +115,9 @@ def set_parser() -> ArgumentParser:
108
115
  return parser
109
116
 
110
117
 
111
- def main(): # pragma: no cover
118
+ def main() -> None: # pragma: no cover
112
119
  logger = getLogger()
113
120
  args = set_parser().parse_args()
114
- assert args.manifest.is_file(), f"'{args.manifest.resolve()}' does not appear to be a file."
115
- manifest = args.manifest.resolve()
116
121
 
117
122
  # verbosity
118
123
  if args.verbose == 1:
@@ -121,7 +126,14 @@ def main(): # pragma: no cover
121
126
  logger.setLevel(logging.DEBUG)
122
127
 
123
128
  logger.info("Loading the manifest")
124
- repo_manifest = Manifest.from_path(manifest)
129
+ repo_manifest: Manifest
130
+ if args.url:
131
+ repo_manifest = GitHubLedgerHQ().get_app(str(args.manifest)).manifest
132
+ else:
133
+ assert args.manifest.is_file(), f"'{args.manifest.resolve()}' does not appear to be a file."
134
+ manifest = args.manifest.resolve()
135
+
136
+ repo_manifest = Manifest.from_path(manifest)
125
137
 
126
138
  # check directory path against manifest data
127
139
  if args.check is not None:
@@ -131,7 +143,7 @@ def main(): # pragma: no cover
131
143
 
132
144
  # no check
133
145
  logger.info("Displaying manifest info")
134
- display_content = defaultdict(dict)
146
+ display_content: Dict = defaultdict(dict)
135
147
 
136
148
  if args.output_build_directory:
137
149
  display_content["build_directory"] = str(repo_manifest.app.build_directory)
@@ -142,7 +154,7 @@ def main(): # pragma: no cover
142
154
  display_content["devices"] = list(repo_manifest.app.devices)
143
155
 
144
156
  if args.output_use_cases is not None:
145
- use_cases = repo_manifest.use_cases.json
157
+ use_cases = repo_manifest.use_cases.json if repo_manifest.use_cases else dict()
146
158
  non_empty = len(use_cases) > 0
147
159
  if len(args.output_use_cases) != 0:
148
160
  use_cases = {k: v for (k, v) in use_cases.items() if k in args.output_use_cases}
@@ -152,7 +164,9 @@ def main(): # pragma: no cover
152
164
  display_content["use_cases"] = use_cases
153
165
 
154
166
  if args.output_tests_dependencies is not None:
155
- dependencies = repo_manifest.tests.dependencies.json
167
+ dependencies = dict()
168
+ if repo_manifest.tests is not None and repo_manifest.tests.dependencies is not None:
169
+ dependencies = repo_manifest.tests.dependencies.json
156
170
  non_empty = len(dependencies) > 0
157
171
  if len(args.output_tests_dependencies) != 0:
158
172
  dependencies = {
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: ledgered
3
- Version: 0.7.1.dev2
3
+ Version: 0.7.2.dev4
4
4
  Summary: Python tools, utils, libraries, to be used with Ledger cryptodevices
5
5
  Author-email: Ledger <hello@ledger.fr>
6
6
  License: MIT License
@@ -27,22 +27,24 @@ License: MIT License
27
27
 
28
28
  Project-URL: Home, https://github.com/LedgerHQ/ledgered
29
29
  Classifier: License :: OSI Approved :: MIT License
30
- Classifier: Programming Language :: Python :: 3.8
31
- Classifier: Programming Language :: Python :: 3.9
30
+ Classifier: Programming Language :: Python :: 3
32
31
  Classifier: Programming Language :: Python :: 3.10
33
32
  Classifier: Programming Language :: Python :: 3.11
33
+ Classifier: Programming Language :: Python :: 3.12
34
+ Classifier: Programming Language :: Python :: 3.13
34
35
  Classifier: Operating System :: POSIX :: Linux
35
36
  Classifier: Operating System :: Microsoft :: Windows
36
37
  Classifier: Operating System :: MacOS :: MacOS X
37
- Requires-Python: >=3.7
38
+ Classifier: Typing :: Typed
39
+ Requires-Python: >=3.10
38
40
  Description-Content-Type: text/markdown
39
41
  License-File: LICENSE
40
42
  Requires-Dist: toml
41
43
  Requires-Dist: pyelftools
42
44
  Requires-Dist: pygithub
43
45
  Provides-Extra: dev
44
- Requires-Dist: pytest ; extra == 'dev'
45
- Requires-Dist: pytest-cov ; extra == 'dev'
46
+ Requires-Dist: pytest; extra == "dev"
47
+ Requires-Dist: pytest-cov; extra == "dev"
46
48
 
47
49
  # Ledgered
48
50
 
@@ -1,11 +1,11 @@
1
1
  ledgered/__init__.py,sha256=aRY9b0H6CrS8gUFvdWHz-IPvyBm0i8i8paMzmE1BuK4,126
2
- ledgered/__version__.py,sha256=DV5iMrIdbuetPRzfK3MhFOvjsHPrg8YKG_O6dwwGSiI,424
2
+ ledgered/__version__.py,sha256=aFUWG2MF64H-fRSEF43gU5MjQjYaiabR5nGIMdfevRY,424
3
3
  ledgered/binary.py,sha256=J49o5kDwmvo_hBsHfl88qxRteo6AqleoUJcjBDHp-Os,2664
4
4
  ledgered/github.py,sha256=99jwcSz6XNagsbj1XgdwMPzESOkh-VUUaoaxhUgN1rI,5217
5
5
  ledgered/serializers.py,sha256=DKcz7X3hz3Qoumv9neoqK4xLh13ZBE5rOJv0KdZxZes,1624
6
6
  ledgered/manifest/__init__.py,sha256=YbsDtjHJsUO0T37GQKoMSrC44sfcSq0JTSjDN6xrc64,243
7
7
  ledgered/manifest/app.py,sha256=xK9vW7nABsuxPNzj1wpeZd5T9y3PVBhwSAw3LlHdtGQ,1084
8
- ledgered/manifest/cli.py,sha256=WKk_ohJuDKDzUrY-fSoger2LsyygwsrwhbgzqQZbKQI,7890
8
+ ledgered/manifest/cli.py,sha256=vPXIHyCAX0SDmUK1ntuNU5ZKJlse7im_Y-j_bH3Uuk0,8586
9
9
  ledgered/manifest/constants.py,sha256=GjI7Q0V8EAyQNZcD8T6nQnU5IJbRJfkKbOBXQcA29qo,132
10
10
  ledgered/manifest/errors.py,sha256=VxP5p-wyN8Tp-3gg2dSAywbDD8vP7CXh_2E2vlRHMOA,41
11
11
  ledgered/manifest/manifest.py,sha256=dSsxOJGimzpptVqNJPdJ6VoM7nSYKRLAxQWnMc4hCjM,1860
@@ -13,9 +13,9 @@ ledgered/manifest/tests.py,sha256=Zh-c_pZ4XzMKU7Pp7P-iltBnfrG8iRjO9drRtyJIUW8,33
13
13
  ledgered/manifest/use_cases.py,sha256=Zu5ufX29iBlFEWYAQhx3YDY_ajd0539F5pW8aULMyEw,898
14
14
  ledgered/manifest/utils.py,sha256=HnqQVH6MTNGjs6JAEGVjs6IUcywio6mCNlMrp7xhUu4,509
15
15
  ledgered/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- ledgered-0.7.1.dev2.dist-info/LICENSE,sha256=rcYmKw35vfzxANXv5w2DgsSVXV8LXcOnTDo6lslFYp0,1063
17
- ledgered-0.7.1.dev2.dist-info/METADATA,sha256=_ljLlWj2ZJvAVyltZWrI1UjAWe0U12J7K_o2PlU_C3w,2950
18
- ledgered-0.7.1.dev2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
19
- ledgered-0.7.1.dev2.dist-info/entry_points.txt,sha256=absOELBtJLqnlB9NdfOQCh1RLDPVbCNgnPXX8fSUw_8,100
20
- ledgered-0.7.1.dev2.dist-info/top_level.txt,sha256=LWTGn6fYa3YI2253y1orMdCyI1DcSMp86wOJ-rj_RQE,9
21
- ledgered-0.7.1.dev2.dist-info/RECORD,,
16
+ ledgered-0.7.2.dev4.dist-info/LICENSE,sha256=rcYmKw35vfzxANXv5w2DgsSVXV8LXcOnTDo6lslFYp0,1063
17
+ ledgered-0.7.2.dev4.dist-info/METADATA,sha256=u06BsY1P_iBUpGOKoDp-JthT4bTxkOBQyUS0GtHj3BU,3027
18
+ ledgered-0.7.2.dev4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
19
+ ledgered-0.7.2.dev4.dist-info/entry_points.txt,sha256=absOELBtJLqnlB9NdfOQCh1RLDPVbCNgnPXX8fSUw_8,100
20
+ ledgered-0.7.2.dev4.dist-info/top_level.txt,sha256=LWTGn6fYa3YI2253y1orMdCyI1DcSMp86wOJ-rj_RQE,9
21
+ ledgered-0.7.2.dev4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5