backlogops-cli 0.9__tar.gz → 1.1__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 (44) hide show
  1. {backlogops_cli-0.9 → backlogops_cli-1.1}/PKG-INFO +5 -5
  2. {backlogops_cli-0.9 → backlogops_cli-1.1}/README_pypi.md +2 -2
  3. {backlogops_cli-0.9 → backlogops_cli-1.1}/backlogops_cli.egg-info/PKG-INFO +5 -5
  4. {backlogops_cli-0.9 → backlogops_cli-1.1}/backlogops_cli.egg-info/requires.txt +2 -2
  5. {backlogops_cli-0.9 → backlogops_cli-1.1}/setup.py +3 -3
  6. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/config_edit.py +55 -29
  7. {backlogops_cli-0.9 → backlogops_cli-1.1}/LICENSE.txt +0 -0
  8. {backlogops_cli-0.9 → backlogops_cli-1.1}/backlogops_cli.egg-info/SOURCES.txt +0 -0
  9. {backlogops_cli-0.9 → backlogops_cli-1.1}/backlogops_cli.egg-info/dependency_links.txt +0 -0
  10. {backlogops_cli-0.9 → backlogops_cli-1.1}/backlogops_cli.egg-info/top_level.txt +0 -0
  11. {backlogops_cli-0.9 → backlogops_cli-1.1}/pyproject.toml +0 -0
  12. {backlogops_cli-0.9 → backlogops_cli-1.1}/setup.cfg +0 -0
  13. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/__init__.py +0 -0
  14. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/__main__.py +0 -0
  15. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/_command_io.py +0 -0
  16. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/_migrate_warn.py +0 -0
  17. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/_wizard_io.py +0 -0
  18. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/add_releases_to_jira.py +0 -0
  19. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/add_to_jira.py +0 -0
  20. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/adjust_release_content.py +0 -0
  21. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/bloc_version_reporter.py +0 -0
  22. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/config_wizard.py +0 -0
  23. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/convert.py +0 -0
  24. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/demo_backlog.py +0 -0
  25. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/encrypt_token_file.py +0 -0
  26. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/estimate_ready_date.py +0 -0
  27. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/extract_keys.py +0 -0
  28. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/jira_fields.py +0 -0
  29. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/list.py +0 -0
  30. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/migrate_cfg.py +0 -0
  31. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/order_by_deps.py +0 -0
  32. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/order_by_keys.py +0 -0
  33. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/order_by_release.py +0 -0
  34. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/order_releases.py +0 -0
  35. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/order_releases_in_jira.py +0 -0
  36. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/plan_release_dates.py +0 -0
  37. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/preset_wizard.py +0 -0
  38. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/py.typed +0 -0
  39. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/rank_in_jira.py +0 -0
  40. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/read_jira.py +0 -0
  41. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/rename_releases_in_jira.py +0 -0
  42. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/update_backlog_in_jira.py +0 -0
  43. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/update_releases_in_jira.py +0 -0
  44. {backlogops_cli-0.9 → backlogops_cli-1.1}/src/backlogops_cli/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: backlogops-cli
3
- Version: 0.9
3
+ Version: 1.1
4
4
  Summary: Command line interface for backlog operations.
5
5
  Author: Tom Björkholm
6
6
  Author-email: Tom Björkholm <klausuler_linnet0q@icloud.com>
@@ -24,9 +24,9 @@ Requires-Python: >=3.12
24
24
  Description-Content-Type: text/markdown
25
25
  License-File: LICENSE.txt
26
26
  Requires-Dist: argcomplete>=3.7.2
27
- Requires-Dist: backlogops>=0.9
27
+ Requires-Dist: backlogops>=1.1
28
28
  Requires-Dist: wizard-ui-bridge[textual]>=1.3
29
- Requires-Dist: edit-cfg-json-textual==0.0.2
29
+ Requires-Dist: edit-cfg-json-textual>=0.1.0
30
30
  Requires-Dist: versionreporter>=0.4
31
31
  Dynamic: author
32
32
  Dynamic: license-file
@@ -322,10 +322,10 @@ backlogops_cli serves 2 purposes:
322
322
 
323
323
  ## Test summary
324
324
 
325
- - Test result: 2232 passed, 1 deselected in 44s
325
+ - Test result: 2298 passed, 1 deselected in 57s
326
326
  - No flake8 warnings.
327
327
  - No mypy errors found.
328
328
  - No pylint warnings.
329
329
  - No python layout warnings.
330
- - Built version(s): 0.9
330
+ - Built version(s): 1.1
331
331
  - Build and test using Python 3.14.7
@@ -287,10 +287,10 @@ backlogops_cli serves 2 purposes:
287
287
 
288
288
  ## Test summary
289
289
 
290
- - Test result: 2232 passed, 1 deselected in 44s
290
+ - Test result: 2298 passed, 1 deselected in 57s
291
291
  - No flake8 warnings.
292
292
  - No mypy errors found.
293
293
  - No pylint warnings.
294
294
  - No python layout warnings.
295
- - Built version(s): 0.9
295
+ - Built version(s): 1.1
296
296
  - Build and test using Python 3.14.7
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: backlogops-cli
3
- Version: 0.9
3
+ Version: 1.1
4
4
  Summary: Command line interface for backlog operations.
5
5
  Author: Tom Björkholm
6
6
  Author-email: Tom Björkholm <klausuler_linnet0q@icloud.com>
@@ -24,9 +24,9 @@ Requires-Python: >=3.12
24
24
  Description-Content-Type: text/markdown
25
25
  License-File: LICENSE.txt
26
26
  Requires-Dist: argcomplete>=3.7.2
27
- Requires-Dist: backlogops>=0.9
27
+ Requires-Dist: backlogops>=1.1
28
28
  Requires-Dist: wizard-ui-bridge[textual]>=1.3
29
- Requires-Dist: edit-cfg-json-textual==0.0.2
29
+ Requires-Dist: edit-cfg-json-textual>=0.1.0
30
30
  Requires-Dist: versionreporter>=0.4
31
31
  Dynamic: author
32
32
  Dynamic: license-file
@@ -322,10 +322,10 @@ backlogops_cli serves 2 purposes:
322
322
 
323
323
  ## Test summary
324
324
 
325
- - Test result: 2232 passed, 1 deselected in 44s
325
+ - Test result: 2298 passed, 1 deselected in 57s
326
326
  - No flake8 warnings.
327
327
  - No mypy errors found.
328
328
  - No pylint warnings.
329
329
  - No python layout warnings.
330
- - Built version(s): 0.9
330
+ - Built version(s): 1.1
331
331
  - Build and test using Python 3.14.7
@@ -1,5 +1,5 @@
1
1
  argcomplete>=3.7.2
2
- backlogops>=0.9
2
+ backlogops>=1.1
3
3
  wizard-ui-bridge[textual]>=1.3
4
- edit-cfg-json-textual==0.0.2
4
+ edit-cfg-json-textual>=0.1.0
5
5
  versionreporter>=0.4
@@ -5,7 +5,7 @@ from setuptools import setup
5
5
 
6
6
  setup(
7
7
  name='backlogops-cli',
8
- version='0.9',
8
+ version='1.1',
9
9
  description='Command line interface for backlog operations.',
10
10
  author='Tom Björkholm',
11
11
  author_email='klausuler_linnet0q@icloud.com',
@@ -15,9 +15,9 @@ setup(
15
15
  package_data={'backlogops_cli': ['src/py.typed']},
16
16
  install_requires=[
17
17
  'argcomplete >= 3.7.2',
18
- 'backlogops >= 0.9',
18
+ 'backlogops >= 1.1',
19
19
  'wizard-ui-bridge[textual] >= 1.3',
20
- 'edit-cfg-json-textual == 0.0.2',
20
+ 'edit-cfg-json-textual >= 0.1.0',
21
21
  'versionreporter >= 0.4'
22
22
  ]
23
23
  )
@@ -3,8 +3,13 @@
3
3
 
4
4
  The whole configuration is shown at once, folded where it is deep, so a
5
5
  single value can be changed without walking through every question the
6
- wizard asks. The editor is the one of ``edit-cfg-json-textual``, so it needs
7
- a terminal; where the input is redirected, the wizard command is the way in.
6
+ wizard asks, and how many things a member holds is editable as well: a
7
+ preset, a person, a team, a level and an entry of a map can each be added
8
+ beside the ones that are there and taken out again. The editor is the one of
9
+ ``edit-cfg-json-textual``, so it needs a terminal; where the input is
10
+ redirected, the wizard command is the way in.
11
+ One call runs the whole session: ``edit`` reads the file, shows it until the
12
+ user is done, and answers with the configuration that was saved.
8
13
 
9
14
  ``-i`` says which file to edit and ``-k``/``--kind`` what kind of file it
10
15
  is: the backlog-ops configuration, or a stand-alone input or output preset.
@@ -23,16 +28,16 @@ import argparse
23
28
  import sys
24
29
  from pathlib import Path
25
30
  from typing import Optional
31
+ from config_as_json import Config
26
32
  from config_as_json.file_extension import fix_file_extension
27
- from edit_cfg_json import EditModel
28
- from edit_cfg_json_textual import TextualEditor
29
- from backlogops import (
30
- CONFIG_EXTENSION, default_edit_config, edit_model_for)
33
+ from edit_cfg_json import ConfigLoadError, default_config
34
+ from edit_cfg_json_textual import edit
35
+ from backlogops import CONFIG_EXTENSION, EDIT_SETTINGS, descriptions_for
31
36
  from backlogops_cli._command_io import add_kind_arg, kind_class, parsed_args
32
37
 
33
38
  DESCRIPTION = 'Edit a configuration file in a full-screen editor'
34
39
 
35
- EDIT_ERRORS = (ValueError, TypeError, KeyError, OSError)
40
+ EDIT_ERRORS = (ConfigLoadError, ValueError, TypeError, KeyError, OSError)
36
41
  """Errors raised when the file to edit cannot be opened."""
37
42
 
38
43
 
@@ -64,36 +69,54 @@ def _input_file(parsed: argparse.Namespace) -> str:
64
69
  return path
65
70
 
66
71
 
67
- def _model_to_edit(parsed: argparse.Namespace) -> EditModel:
68
- """Return the edit model for the file and kind that were asked for.
72
+ def _out_file(output: Optional[str], in_file: str) -> str:
73
+ """Return the file a save writes, naming it as the editor will.
69
74
 
70
- Raises:
71
- ValueError: The file cannot be found or cannot be opened for
72
- editing, or the class cannot be constructed.
75
+ Without ``-o`` that is the file that was read. A destination named on
76
+ the command line is one this run chose, so it is given the
77
+ configuration extension when it has none, which is what the editor
78
+ would do with it; naming it here as well is what lets this command say
79
+ afterwards which file was written.
80
+
81
+ Args:
82
+ output: The ``-o`` value, or None when there is none.
83
+ in_file: The file that is being edited.
84
+
85
+ Returns:
86
+ The file that a save of this session writes.
73
87
  """
74
- return edit_model_for(default_edit_config(kind_class(parsed)),
75
- in_file=_input_file(parsed), out_file=parsed.output,
76
- stderr_file=sys.stderr)
88
+ if output is None:
89
+ return in_file
90
+ return output if Path(output).suffix else output + CONFIG_EXTENSION
77
91
 
78
92
 
79
- def _report(model: EditModel) -> int:
80
- """Print what the session wrote, and answer with the exit code.
93
+ def _edited(parsed: argparse.Namespace, in_file: str,
94
+ out_file: str) -> Optional[Config]:
95
+ """Run one editing session and return the configuration it saved.
81
96
 
82
- Closing an editor is not a failure, so a session that saved nothing
83
- still succeeds; it says so, because a user who meant to save would
84
- otherwise be told nothing at all. What a save did is the editor's own
85
- message, which names the file it wrote and where what it wrote over is.
97
+ Args:
98
+ parsed: The parsed command line, naming the kind of file to edit.
99
+ in_file: The configuration file the editor reads.
100
+ out_file: The configuration file a save writes.
101
+
102
+ Returns:
103
+ What the session saved, or None when it saved nothing.
104
+
105
+ Raises:
106
+ ConfigLoadError: The input file cannot be opened for editing.
86
107
  """
87
- if model.saved_config is None:
88
- print('Closed without saving.')
89
- return 0
90
- print(model.save_message)
91
- return 0
108
+ config = default_config(kind_class(parsed))
109
+ return edit(config, descriptions=descriptions_for(config), in_file=in_file,
110
+ out_file=out_file, settings=EDIT_SETTINGS)
92
111
 
93
112
 
94
113
  def main(args: Optional[list[str]] = None) -> int:
95
114
  """Open the configuration file in the editor and report what was saved.
96
115
 
116
+ Closing an editor is not a failure, so a session that saved nothing
117
+ still succeeds; it says so, because a user who meant to save would
118
+ otherwise be told nothing at all.
119
+
97
120
  Args:
98
121
  args: Optional replacement for ``sys.argv[1:]``, mainly for tests.
99
122
 
@@ -103,12 +126,15 @@ def main(args: Optional[list[str]] = None) -> int:
103
126
  """
104
127
  parsed = parsed_args(build_parser(), args)
105
128
  try:
106
- model = _model_to_edit(parsed)
129
+ in_file = _input_file(parsed)
130
+ out_file = _out_file(parsed.output, in_file)
131
+ saved = _edited(parsed, in_file, out_file)
107
132
  except EDIT_ERRORS as error:
108
133
  print(f'Could not open the configuration: {error}', file=sys.stderr)
109
134
  return 1
110
- TextualEditor().run_editor(model)
111
- return _report(model)
135
+ print('Closed without saving.' if saved is None
136
+ else f'Saved to {out_file}')
137
+ return 0
112
138
 
113
139
 
114
140
  if __name__ == '__main__': # pragma: no cover
File without changes
File without changes