ae-shell 0.3.3__tar.gz → 0.3.5__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.
@@ -1,4 +1,4 @@
1
- <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.56 -->
1
+ <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.58 -->
2
2
  ### GNU GENERAL PUBLIC LICENSE
3
3
 
4
4
  Version 3, 29 June 2007
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ae_shell
3
- Version: 0.3.3
3
+ Version: 0.3.5
4
4
  Summary: ae namespace module portion shell: shell execution and environment helpers
5
5
  Home-page: https://gitlab.com/ae-group/ae_shell
6
6
  Author: AndiEcker
@@ -27,7 +27,7 @@ Requires-Dist: aedev_project_tpls; extra == "dev"
27
27
  Requires-Dist: ae_ae; extra == "dev"
28
28
  Requires-Dist: anybadge; extra == "dev"
29
29
  Requires-Dist: coverage-badge; extra == "dev"
30
- Requires-Dist: aedev_git_repo_manager; extra == "dev"
30
+ Requires-Dist: aedev_project_manager; extra == "dev"
31
31
  Requires-Dist: flake8; extra == "dev"
32
32
  Requires-Dist: mypy; extra == "dev"
33
33
  Requires-Dist: pylint; extra == "dev"
@@ -40,7 +40,7 @@ Provides-Extra: docs
40
40
  Provides-Extra: tests
41
41
  Requires-Dist: anybadge; extra == "tests"
42
42
  Requires-Dist: coverage-badge; extra == "tests"
43
- Requires-Dist: aedev_git_repo_manager; extra == "tests"
43
+ Requires-Dist: aedev_project_manager; extra == "tests"
44
44
  Requires-Dist: flake8; extra == "tests"
45
45
  Requires-Dist: mypy; extra == "tests"
46
46
  Requires-Dist: pylint; extra == "tests"
@@ -63,15 +63,15 @@ Dynamic: provides-extra
63
63
  Dynamic: requires-python
64
64
  Dynamic: summary
65
65
 
66
- <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.97 -->
67
- <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.19 -->
68
- # shell 0.3.3
66
+ <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.100 -->
67
+ <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.21 -->
68
+ # shell 0.3.5
69
69
 
70
70
  [![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/develop?logo=python)](
71
71
  https://gitlab.com/ae-group/ae_shell)
72
72
  [![LatestPyPIrelease](
73
- https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.3?logo=python)](
74
- https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.3)
73
+ https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.5?logo=python)](
74
+ https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.5)
75
75
  [![PyPIVersions](https://img.shields.io/pypi/v/ae_shell)](
76
76
  https://pypi.org/project/ae-shell/#history)
77
77
 
@@ -1,12 +1,12 @@
1
- <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.97 -->
2
- <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.19 -->
3
- # shell 0.3.3
1
+ <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.100 -->
2
+ <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.21 -->
3
+ # shell 0.3.5
4
4
 
5
5
  [![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/develop?logo=python)](
6
6
  https://gitlab.com/ae-group/ae_shell)
7
7
  [![LatestPyPIrelease](
8
- https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.3?logo=python)](
9
- https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.3)
8
+ https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.5?logo=python)](
9
+ https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.5)
10
10
  [![PyPIVersions](https://img.shields.io/pypi/v/ae_shell)](
11
11
  https://pypi.org/project/ae-shell/#history)
12
12
 
@@ -204,7 +204,7 @@ from ae.core import main_app_instance
204
204
  from ae.console import MAIN_SECTION_NAME, ConsoleApp # type: ignore
205
205
 
206
206
 
207
- __version__ = '0.3.3'
207
+ __version__ = '0.3.5'
208
208
 
209
209
 
210
210
  COMMIT_MSG_FILE_NAME = '.commit_msg.txt' #: name of the file containing the commit message
@@ -1033,14 +1033,6 @@ def in_venv(name: str = "") -> Iterator[None]:
1033
1033
  activate_venv(old_venv)
1034
1034
 
1035
1035
 
1036
- def on_ci_host() -> bool:
1037
- """ check and return True if this tool is running on the GitLab/GitHub CI host/server.
1038
-
1039
- :return: True if running on CI host, else False
1040
- """
1041
- return 'CI' in os.environ or 'CI_PROJECT_ID' in os.environ
1042
-
1043
-
1044
1036
  def owner_project_from_url(remote_url: str) -> str:
1045
1037
  """ determine the owner and project name path from the specified git remote repository url.
1046
1038
 
@@ -1258,10 +1250,11 @@ def sh_log(comment_or_command: str, extra_args: Iterable[str] = (), cl_err: int
1258
1250
  (f" * {cl_err=}" + sep if cl_err else "") +
1259
1251
  (" " + (sep + " ").join(lines_output) + sep if lines_output else ""))
1260
1252
 
1261
- while "glpat-" in log_lines: # hide the gitlab private token, e.g. from git-push-urls with authentication
1262
- start = log_lines.index("glpat-")
1263
- end = log_lines.index("@gitlab.com", start)
1264
- log_lines = log_lines[:start] + "private-token-" + log_lines[end - 3:]
1253
+ for tok_beg, tok_end in (('glpat-', '@gitlab.com'), ('ghp_', '@github.com')):
1254
+ while tok_beg in log_lines: # hide the gitlab private token, e.g. from git-push-urls with authentication
1255
+ start = log_lines.index(tok_beg)
1256
+ end = log_lines.index(tok_end, start)
1257
+ log_lines = log_lines[:start] + "private-token-" + log_lines[end - 3:]
1265
1258
 
1266
1259
  for log_path in log_file_paths or sh_logs(log_name_prefix=log_name_prefix):
1267
1260
  write_file(log_path, log_lines, extra_mode='a')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ae_shell
3
- Version: 0.3.3
3
+ Version: 0.3.5
4
4
  Summary: ae namespace module portion shell: shell execution and environment helpers
5
5
  Home-page: https://gitlab.com/ae-group/ae_shell
6
6
  Author: AndiEcker
@@ -27,7 +27,7 @@ Requires-Dist: aedev_project_tpls; extra == "dev"
27
27
  Requires-Dist: ae_ae; extra == "dev"
28
28
  Requires-Dist: anybadge; extra == "dev"
29
29
  Requires-Dist: coverage-badge; extra == "dev"
30
- Requires-Dist: aedev_git_repo_manager; extra == "dev"
30
+ Requires-Dist: aedev_project_manager; extra == "dev"
31
31
  Requires-Dist: flake8; extra == "dev"
32
32
  Requires-Dist: mypy; extra == "dev"
33
33
  Requires-Dist: pylint; extra == "dev"
@@ -40,7 +40,7 @@ Provides-Extra: docs
40
40
  Provides-Extra: tests
41
41
  Requires-Dist: anybadge; extra == "tests"
42
42
  Requires-Dist: coverage-badge; extra == "tests"
43
- Requires-Dist: aedev_git_repo_manager; extra == "tests"
43
+ Requires-Dist: aedev_project_manager; extra == "tests"
44
44
  Requires-Dist: flake8; extra == "tests"
45
45
  Requires-Dist: mypy; extra == "tests"
46
46
  Requires-Dist: pylint; extra == "tests"
@@ -63,15 +63,15 @@ Dynamic: provides-extra
63
63
  Dynamic: requires-python
64
64
  Dynamic: summary
65
65
 
66
- <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.97 -->
67
- <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.19 -->
68
- # shell 0.3.3
66
+ <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.100 -->
67
+ <!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.21 -->
68
+ # shell 0.3.5
69
69
 
70
70
  [![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/develop?logo=python)](
71
71
  https://gitlab.com/ae-group/ae_shell)
72
72
  [![LatestPyPIrelease](
73
- https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.3?logo=python)](
74
- https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.3)
73
+ https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.5?logo=python)](
74
+ https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.5)
75
75
  [![PyPIVersions](https://img.shields.io/pypi/v/ae_shell)](
76
76
  https://pypi.org/project/ae-shell/#history)
77
77
 
@@ -4,7 +4,7 @@ aedev_project_tpls
4
4
  ae_ae
5
5
  anybadge
6
6
  coverage-badge
7
- aedev_git_repo_manager
7
+ aedev_project_manager
8
8
  flake8
9
9
  mypy
10
10
  pylint
@@ -19,7 +19,7 @@ types-setuptools
19
19
  [tests]
20
20
  anybadge
21
21
  coverage-badge
22
- aedev_git_repo_manager
22
+ aedev_project_manager
23
23
  flake8
24
24
  mypy
25
25
  pylint
@@ -1,4 +1,4 @@
1
- # THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.56
1
+ # THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.58
2
2
  [build-system]
3
3
  requires = ["setuptools>=42", "wheel"]
4
4
  build-backend = "setuptools.build_meta"
@@ -1,4 +1,4 @@
1
- # THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.56
1
+ # THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.58
2
2
  """ setup of ae namespace module portion shell: shell execution and environment helpers. """
3
3
  # noinspection PyUnresolvedReferences
4
4
  import sys
@@ -15,23 +15,23 @@ setup_kwargs = {
15
15
  'Programming Language :: Python :: 3.9', 'Topic :: Software Development :: Libraries :: Python Modules',
16
16
  'Typing :: Typed'],
17
17
  'description': 'ae namespace module portion shell: shell execution and environment helpers',
18
- 'extras_require': { 'dev': [ 'aedev_project_tpls', 'ae_ae', 'anybadge', 'coverage-badge', 'aedev_git_repo_manager', 'flake8',
18
+ 'extras_require': { 'dev': [ 'aedev_project_tpls', 'ae_ae', 'anybadge', 'coverage-badge', 'aedev_project_manager', 'flake8',
19
19
  'mypy', 'pylint', 'pytest', 'pytest-cov', 'pytest-django', 'typing', 'types-setuptools'],
20
20
  'docs': [],
21
- 'tests': [ 'anybadge', 'coverage-badge', 'aedev_git_repo_manager', 'flake8', 'mypy', 'pylint', 'pytest',
21
+ 'tests': [ 'anybadge', 'coverage-badge', 'aedev_project_manager', 'flake8', 'mypy', 'pylint', 'pytest',
22
22
  'pytest-cov', 'pytest-django', 'typing', 'types-setuptools']},
23
23
  'install_requires': [],
24
24
  'keywords': ['configuration', 'development', 'environment', 'productivity'],
25
25
  'license': 'GPL-3.0-or-later',
26
- 'long_description': ('<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.97 -->\n'
27
- '<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.19 -->\n'
28
- '# shell 0.3.3\n'
26
+ 'long_description': ('<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.100 -->\n'
27
+ '<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.21 -->\n'
28
+ '# shell 0.3.5\n'
29
29
  '\n'
30
30
  '[![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/develop?logo=python)](\n'
31
31
  ' https://gitlab.com/ae-group/ae_shell)\n'
32
32
  '[![LatestPyPIrelease](\n'
33
- ' https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.3?logo=python)](\n'
34
- ' https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.3)\n'
33
+ ' https://img.shields.io/gitlab/pipeline/ae-group/ae_shell/release0.3.5?logo=python)](\n'
34
+ ' https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.5)\n'
35
35
  '[![PyPIVersions](https://img.shields.io/pypi/v/ae_shell)](\n'
36
36
  ' https://pypi.org/project/ae-shell/#history)\n'
37
37
  '\n'
@@ -108,7 +108,7 @@ setup_kwargs = {
108
108
  'Source': 'https://ae.readthedocs.io/en/latest/_modules/ae/shell.html'},
109
109
  'python_requires': '>=3.9',
110
110
  'url': 'https://gitlab.com/ae-group/ae_shell',
111
- 'version': '0.3.3',
111
+ 'version': '0.3.5',
112
112
  'zip_safe': True,
113
113
  }
114
114
 
@@ -18,7 +18,7 @@ from tests.conftest import skip_gitlab_ci
18
18
 
19
19
  from ae.base import (
20
20
  DEF_PROJECT_PARENT_FOLDER, PY_CACHE_FOLDER,
21
- camel_to_snake, in_wd, load_dotenvs, load_env_var_defaults, norm_name, norm_path,
21
+ camel_to_snake, in_wd, load_dotenvs, load_env_var_defaults, norm_name, norm_path, on_ci_host,
22
22
  os_path_basename, os_path_dirname, os_path_isdir, os_path_isfile, os_path_join, os_path_relpath,
23
23
  project_main_file, read_file, write_file, UNSET)
24
24
  from ae.core import DEBUG_LEVEL_DISABLED, DEBUG_LEVEL_ENABLED, DEBUG_LEVEL_VERBOSE
@@ -39,7 +39,7 @@ from ae.shell import (
39
39
  git_current_branch, git_diff, git_fetch, git_init_if_needed, git_merge, git_push,
40
40
  git_remote_domain_group, git_remotes, git_renew_remotes, git_status,
41
41
  git_tag_add, git_ref_in_branch, git_tag_list, git_tag_remotes, git_uncommitted,
42
- hint, in_os_env, in_prj_dir_venv, in_venv, on_ci_host, owner_project_from_url, project_name_version,
42
+ hint, in_os_env, in_prj_dir_venv, in_venv, owner_project_from_url, project_name_version,
43
43
  sh_exec, sh_exit_if_exec_err, sh_exit_if_git_err, sh_log, sh_logs,
44
44
  temp_context_cleanup, temp_context_folders, temp_context_get_or_create, _temp_folders, venv_bin_path,
45
45
  MockedMainApp)
@@ -465,90 +465,45 @@ class TestGitCommands:
465
465
 
466
466
  @skip_gitlab_ci
467
467
  def test_git_branch_files_between_versions(self):
468
- prj_path = norm_path("../aedev_git_repo_manager") # ?!?!? CHANGE to pjm after switch: prj_path->"" version..v
469
- exp = last_exp = {
470
- 'README.md',
471
- 'aedev/git_repo_manager.py',
472
- 'tests/test_git_repo_manager.py',
473
- }
474
-
475
- assert git_branch_files(prj_path, branch_or_tag="v0.3.59..v0.3.60") == exp
476
-
477
- extra_61 = {'requirements.txt'}
478
- exp = extra_61 | {
479
- 'README.md',
480
- 'aedev/git_repo_manager.py',
481
- }
482
-
483
- assert git_branch_files(prj_path, branch_or_tag="v0.3.60..v0.3.61") == exp
484
-
485
- assert git_branch_files(prj_path, branch_or_tag="v0.3.59..v0.3.61") == exp | last_exp
486
-
468
+ prj_path = norm_path("../ae_base")
487
469
  exp = {
488
470
  'README.md',
489
- 'aedev/git_repo_manager/__init__.py',
490
- 'aedev/git_repo_manager/__main__.py',
491
- 'tests/test_git_repo_manager.py',
471
+ 'ae/base.py',
472
+ 'setup.py',
473
+ 'tests/test_base.py',
492
474
  }
493
475
 
494
- assert git_branch_files(prj_path, branch_or_tag="v0.3.65..v0.3.66") == exp
476
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.69..v0.3.70") == exp
477
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.70..v0.3.71") == exp
478
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.71..v0.3.72") == exp
479
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.69..v0.3.72") == exp
480
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.69..v0.3.71") == exp
481
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.70..v0.3.72") == exp
495
482
 
496
- assert git_branch_files(prj_path, branch_or_tag="v0.3.65...v0.3.66") == exp
497
-
498
- most = git_branch_files(prj_path, branch_or_tag="v0.3.65...v0.3.66", untracked=True,
499
- skip_file_path=lambda _:
500
- PY_CACHE_FOLDER in _
501
- or _.startswith(".idea")
502
- or _.startswith(".mypy_cache")
503
- or _.startswith(".pylint")
504
- or _.startswith(".pytest_cache")
505
- or _.startswith("htmlcov")
506
- or _.startswith("mypy_report")
507
- or _.startswith("aedev_git_repo_manager.egg-info")
508
- )
509
- assert all(_ in most for _ in exp)
510
-
511
- exp = big_exp = {
483
+ exp = {
512
484
  '.gitignore',
513
485
  '.gitlab-ci.yml',
514
486
  'CONTRIBUTING.rst',
515
487
  'LICENSE.md',
516
488
  'README.md',
517
489
  'SECURITY.md',
518
- 'aedev/git_repo_manager/__init__.py',
519
- 'aedev/git_repo_manager/__main__.py',
490
+ 'ae/base.py',
520
491
  'dev_requirements.txt',
521
492
  'setup.py',
522
493
  'tests/conftest.py',
523
494
  'tests/requirements.txt',
495
+ 'tests/test_base.py',
524
496
  }
525
497
 
526
- assert git_branch_files(prj_path, branch_or_tag="v0.3.66..v0.3.67") == exp
527
-
528
- assert git_branch_files(prj_path, branch_or_tag="v0.3.66...v0.3.67") == exp
529
-
530
- extra_62 = {'pev.updates', 'tests/test_git_repo_manager.py'}
531
-
532
- assert git_branch_files(prj_path, branch_or_tag="v0.3.61...v0.3.62") == exp | extra_62 # pkg __init__/__main__
533
-
534
- assert git_branch_files(prj_path, branch_or_tag="v0.3.62...v0.3.63") == exp # changed in v0.3.63
535
-
536
- assert git_branch_files(prj_path, branch_or_tag="v0.3.66...v0.3.69") == exp # 3 versions
537
-
538
- exp = {
539
- 'README.md',
540
- 'aedev/git_repo_manager/__init__.py',
541
- 'aedev/git_repo_manager/__main__.py',
542
- }
543
- assert git_branch_files(prj_path, branch_or_tag="v0.3.67..v0.3.68") == exp
544
-
545
- assert git_branch_files(prj_path, branch_or_tag="v0.3.67..v0.3.68") == exp
546
-
547
- assert git_branch_files(prj_path, branch_or_tag="v0.3.68..v0.3.69") == exp
548
-
549
- assert git_branch_files(prj_path, branch_or_tag="v0.3.68...v0.3.69") == exp
498
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.64..v0.3.65") == exp
499
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.65..v0.3.66") == exp
500
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.66..v0.3.67") == exp | {'pyproject.toml'}
501
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.67..v0.3.68") == exp | {'pyproject.toml'}
502
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.68..v0.3.69") == (
503
+ exp | {'pyproject.toml'}) - {'tests/test_base.py'}
550
504
 
551
- assert git_branch_files(prj_path, branch_or_tag="v0.3.59...v0.3.69") == extra_61 | extra_62 | big_exp
505
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.64..v0.3.69") == exp | {'pyproject.toml'}
506
+ assert git_branch_files(prj_path, branch_or_tag="v0.3.64..v0.3.72") == exp | {'pyproject.toml'}
552
507
 
553
508
  def test_git_branch_files_excludes(self, changed_repo_path):
554
509
  assert git_branch_files(changed_repo_path) == {'ChangeD.y', 'deleteD.x', 'rename.it'}
@@ -1497,27 +1452,6 @@ class TestHelpers:
1497
1452
  assert not hint("hint command", _hint_tst_callable, "extra message")
1498
1453
  assert not hint("hint command", _hint_tst_callable.__name__, "extra message")
1499
1454
 
1500
- @skip_gitlab_ci
1501
- def test_on_ci_host_local(self):
1502
- assert not on_ci_host()
1503
-
1504
- def test_on_ci_host_on_gitlab(self):
1505
- assert on_ci_host() == ('CI_PROJECT_ID' in os.environ)
1506
-
1507
- @skip_gitlab_ci
1508
- def test_on_ci_host_with_ci_var(self, monkeypatch):
1509
- assert not on_ci_host()
1510
-
1511
- monkeypatch.setenv('CI', "any value")
1512
- assert on_ci_host()
1513
-
1514
- @skip_gitlab_ci
1515
- def test_on_ci_host_with_ci_project_id(self, monkeypatch):
1516
- assert not on_ci_host()
1517
-
1518
- monkeypatch.setenv('CI_PROJECT_ID', "any value")
1519
- assert on_ci_host()
1520
-
1521
1455
  def test_owner_project_from_url(self):
1522
1456
  assert owner_project_from_url("owner/project") == "owner/project"
1523
1457
  assert owner_project_from_url("owner/project.git") == "owner/project"
File without changes