pyhanko-cli 0.1.1__tar.gz → 0.2.0__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 (42) hide show
  1. {pyhanko_cli-0.1.1/src/pyhanko_cli.egg-info → pyhanko_cli-0.2.0}/PKG-INFO +7 -6
  2. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/README.md +1 -1
  3. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/pyproject.toml +11 -14
  4. pyhanko_cli-0.2.0/src/pyhanko/cli/__init__.py +12 -0
  5. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/_ctx.py +1 -1
  6. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/_root.py +6 -12
  7. pyhanko_cli-0.2.0/src/pyhanko/cli/_trust.py +570 -0
  8. pyhanko_cli-0.2.0/src/pyhanko/cli/cache.py +19 -0
  9. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/commands/crypt.py +5 -7
  10. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/commands/fields.py +1 -1
  11. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/commands/signing/__init__.py +29 -15
  12. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/commands/signing/plugin.py +2 -1
  13. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/commands/signing/simple.py +4 -4
  14. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/commands/signing/utils.py +1 -2
  15. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/commands/stamp.py +28 -3
  16. pyhanko_cli-0.2.0/src/pyhanko/cli/commands/validation/__init__.py +2 -0
  17. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/commands/validation/ltv.py +28 -30
  18. pyhanko_cli-0.2.0/src/pyhanko/cli/commands/validation/validate.py +598 -0
  19. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/config.py +25 -36
  20. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/plugin_api.py +8 -6
  21. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/runtime.py +1 -4
  22. pyhanko_cli-0.2.0/src/pyhanko/cli/version.py +2 -0
  23. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0/src/pyhanko_cli.egg-info}/PKG-INFO +7 -6
  24. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko_cli.egg-info/SOURCES.txt +1 -0
  25. pyhanko_cli-0.2.0/src/pyhanko_cli.egg-info/requires.txt +6 -0
  26. pyhanko_cli-0.1.1/src/pyhanko/cli/__init__.py +0 -12
  27. pyhanko_cli-0.1.1/src/pyhanko/cli/_trust.py +0 -159
  28. pyhanko_cli-0.1.1/src/pyhanko/cli/commands/validation/__init__.py +0 -2
  29. pyhanko_cli-0.1.1/src/pyhanko/cli/commands/validation/validate.py +0 -355
  30. pyhanko_cli-0.1.1/src/pyhanko/cli/version.py +0 -2
  31. pyhanko_cli-0.1.1/src/pyhanko_cli.egg-info/requires.txt +0 -5
  32. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/LICENSE +0 -0
  33. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/MANIFEST.in +0 -0
  34. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/setup.cfg +0 -0
  35. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/__main__.py +0 -0
  36. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/commands/__init__.py +0 -0
  37. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/commands/signing/pkcs11_cli.py +0 -0
  38. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/py.typed +0 -0
  39. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko/cli/utils.py +0 -0
  40. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko_cli.egg-info/dependency_links.txt +0 -0
  41. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko_cli.egg-info/entry_points.txt +0 -0
  42. {pyhanko_cli-0.1.1 → pyhanko_cli-0.2.0}/src/pyhanko_cli.egg-info/top_level.txt +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyhanko-cli
3
- Version: 0.1.1
3
+ Version: 0.2.0
4
4
  Summary: CLI tools for stamping and signing PDF files
5
5
  Author-email: Matthias Valvekens <dev@mvalvekens.be>
6
6
  Maintainer-email: Matthias Valvekens <dev@mvalvekens.be>
7
7
  License-Expression: MIT
8
8
  Project-URL: Homepage, https://github.com/MatthiasValvekens/pyHanko
9
- Project-URL: Documentation, https://pyhanko.readthedocs.io/
10
- Project-URL: Changes, https://pyhanko.readthedocs.io/en/latest/changelog.html
9
+ Project-URL: Documentation, https://docs.pyhanko.eu/
10
+ Project-URL: Changes, https://docs.pyhanko.eu/en/latest/changelog.html
11
11
  Project-URL: Source Code, https://github.com/MatthiasValvekens/pyHanko
12
12
  Project-URL: Issue Tracker, https://github.com/MatthiasValvekens/pyHanko/issues
13
13
  Keywords: signature,pdf,pades,digital-signature,pkcs11
@@ -27,9 +27,10 @@ Description-Content-Type: text/markdown
27
27
  License-File: LICENSE
28
28
  Requires-Dist: asn1crypto>=1.5.1
29
29
  Requires-Dist: tzlocal>=4.3
30
- Requires-Dist: pyhanko<0.30,>=0.29.0
31
- Requires-Dist: pyhanko-certvalidator<0.28,>=0.27.0
30
+ Requires-Dist: pyhanko<0.32,>=0.31.0
31
+ Requires-Dist: pyhanko-certvalidator<0.30,>=0.29.0
32
32
  Requires-Dist: click!=8.2.0,>=8.1.3
33
+ Requires-Dist: platformdirs>=4.3.8
33
34
  Dynamic: license-file
34
35
 
35
36
  The lack of open-source CLI tooling to handle digitally signing and stamping PDF files was bothering me, so I went ahead and rolled my own.
@@ -45,7 +46,7 @@ pip install pyhanko-cli
45
46
 
46
47
  ### Documentation
47
48
 
48
- The [documentation for pyHanko is hosted on ReadTheDocs](https://pyhanko.readthedocs.io/en/latest/)
49
+ The [documentation for pyHanko is hosted on ReadTheDocs](https://docs.pyhanko.eu/en/latest/)
49
50
  and includes information on CLI usage, library usage, and API reference documentation derived from
50
51
  inline docstrings.
51
52
 
@@ -11,7 +11,7 @@ pip install pyhanko-cli
11
11
 
12
12
  ### Documentation
13
13
 
14
- The [documentation for pyHanko is hosted on ReadTheDocs](https://pyhanko.readthedocs.io/en/latest/)
14
+ The [documentation for pyHanko is hosted on ReadTheDocs](https://docs.pyhanko.eu/en/latest/)
15
15
  and includes information on CLI usage, library usage, and API reference documentation derived from
16
16
  inline docstrings.
17
17
 
@@ -33,11 +33,12 @@ requires-python = ">=3.9"
33
33
  dependencies = [
34
34
  "asn1crypto>=1.5.1",
35
35
  "tzlocal>=4.3",
36
- "pyhanko>=0.29.0,<0.30",
37
- "pyhanko-certvalidator>=0.27.0,<0.28",
36
+ "pyhanko>=0.31.0,<0.32",
37
+ "pyhanko-certvalidator>=0.29.0,<0.30",
38
38
  "click>=8.1.3,!=8.2.0",
39
+ "platformdirs>=4.3.8",
39
40
  ]
40
- version = "0.1.1"
41
+ version = "0.2.0"
41
42
 
42
43
 
43
44
  [project.readme]
@@ -46,8 +47,8 @@ content-type = "text/markdown"
46
47
 
47
48
  [project.urls]
48
49
  Homepage = "https://github.com/MatthiasValvekens/pyHanko"
49
- Documentation = "https://pyhanko.readthedocs.io/"
50
- Changes = "https://pyhanko.readthedocs.io/en/latest/changelog.html"
50
+ Documentation = "https://docs.pyhanko.eu/"
51
+ Changes = "https://docs.pyhanko.eu/en/latest/changelog.html"
51
52
  "Source Code" = "https://github.com/MatthiasValvekens/pyHanko"
52
53
  "Issue Tracker" = "https://github.com/MatthiasValvekens/pyHanko/issues"
53
54
 
@@ -57,17 +58,15 @@ testing-base = [
57
58
  "pytest>=6.1.1",
58
59
  "requests-mock>=1.8.0",
59
60
  "freezegun>=1.1.0",
60
- "certomancer>=0.12.3,<0.13",
61
- "pytest-cov>=4.0,<6.2",
62
- "pytest-asyncio==0.24.0;python_version<\"3.9\"",
63
- "pytest-asyncio==0.26.0;python_version>=\"3.9\"",
64
- "backports.zoneinfo[tzdata];python_version<\"3.9\"",
61
+ "certomancer>=0.13.0,<0.14",
62
+ "pytest-cov>=4.0,<7.1",
63
+ "pytest-asyncio>=1.1.0,<2.0",
65
64
  ]
66
65
  testing = [
67
66
  {include-group = "testing-base"},
68
- "aiohttp>=3.9,<3.12",
67
+ "aiohttp>=3.9,<3.13",
69
68
  "pytest-aiohttp>=1.0.4,<1.2.0",
70
- "pyhanko[pkcs11,opentype,async_http,image-support,qr]"
69
+ "pyhanko[pkcs11,opentype,async_http,image-support,qr,etsi]"
71
70
  ]
72
71
 
73
72
  [project.scripts]
@@ -83,8 +82,6 @@ pyhanko = ["py.typed"]
83
82
 
84
83
  [tool.pytest.ini_options]
85
84
  pythonpath = ["src"]
86
- log_format = "%(asctime)s %(levelname)s %(message)s"
87
- log_date_format = "%Y-%m-%d %H:%M:%S"
88
85
  asyncio_mode = "strict"
89
86
  asyncio_default_fixture_loop_scope="function"
90
87
  markers = [
@@ -0,0 +1,12 @@
1
+ from pyhanko.cli._root import cli_root
2
+ from pyhanko.cli.commands.crypt import * # noqa: F403
3
+ from pyhanko.cli.commands.fields import * # noqa: F403
4
+ from pyhanko.cli.commands.signing import * # noqa: F403
5
+ from pyhanko.cli.commands.stamp import * # noqa: F403
6
+ from pyhanko.cli.commands.validation import * # noqa: F403
7
+
8
+ __all__ = ['cli_root', 'launch']
9
+
10
+
11
+ def launch():
12
+ cli_root(prog_name='pyhanko') # pragma: nocover
@@ -2,8 +2,8 @@ from dataclasses import dataclass, field
2
2
  from typing import Optional
3
3
 
4
4
  from pyhanko.cli.config import CLIConfig
5
- from pyhanko.sign import PdfSignatureMetadata
6
5
  from pyhanko.sign.fields import SigFieldSpec
6
+ from pyhanko.sign.signers import PdfSignatureMetadata
7
7
  from pyhanko.stamp import BaseStampStyle
8
8
 
9
9
 
@@ -25,11 +25,10 @@ full_version = f"{lib_version} (CLI {cli_version})"
25
25
  @click.option(
26
26
  '--config',
27
27
  help=(
28
- 'YAML file to load configuration from'
29
- f'[default: {DEFAULT_CONFIG_FILE}]'
28
+ f'YAML file to load configuration from[default: {DEFAULT_CONFIG_FILE}]'
30
29
  ),
31
30
  required=False,
32
- type=click.File('r'),
31
+ type=str,
33
32
  )
34
33
  @click.option(
35
34
  '--verbose',
@@ -57,14 +56,15 @@ def _root(ctx: click.Context, config, verbose, no_plugins):
57
56
  pass
58
57
  except IOError as e:
59
58
  raise click.ClickException(
60
- f"Failed to read {DEFAULT_CONFIG_FILE}: {str(e)}"
59
+ f"Failed to read {DEFAULT_CONFIG_FILE}: {e!s}"
61
60
  )
62
61
  else:
63
62
  try:
64
- config_text = config.read()
63
+ with open(config, 'r') as f:
64
+ config_text = f.read()
65
65
  except IOError as e:
66
66
  raise click.ClickException(
67
- f"Failed to read configuration: {str(e)}",
67
+ f"Failed to read configuration: {e!s}",
68
68
  )
69
69
 
70
70
  ctx.ensure_object(CLIContext)
@@ -96,12 +96,6 @@ def _root(ctx: click.Context, config, verbose, no_plugins):
96
96
  log_config['pyhanko_certvalidator.fetchers'] = LogConfig(
97
97
  level=logging.WARNING, output=log_output
98
98
  )
99
- if 'fontTools.subset' not in log_config:
100
- # the fontTools subsetter has a very noisy INFO log, so
101
- # set that one to WARNING by default
102
- log_config['fontTools.subset'] = LogConfig(
103
- level=logging.WARNING, output=log_output
104
- )
105
99
 
106
100
  logging_setup(log_config, verbose)
107
101