daktari 0.0.236__tar.gz → 0.0.254__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.

Potentially problematic release.


This version of daktari might be problematic. Click here for more details.

Files changed (75) hide show
  1. {daktari-0.0.236/daktari.egg-info → daktari-0.0.254}/PKG-INFO +35 -10
  2. {daktari-0.0.236 → daktari-0.0.254}/README.md +2 -2
  3. daktari-0.0.254/daktari/__init__.py +1 -0
  4. {daktari-0.0.236 → daktari-0.0.254/daktari.egg-info}/PKG-INFO +35 -10
  5. {daktari-0.0.236 → daktari-0.0.254}/daktari.egg-info/SOURCES.txt +0 -30
  6. {daktari-0.0.236 → daktari-0.0.254}/daktari.egg-info/requires.txt +13 -17
  7. daktari-0.0.254/pyproject.toml +34 -0
  8. daktari-0.0.254/requirements.txt +22 -0
  9. daktari-0.0.236/daktari/__init__.py +0 -1
  10. daktari-0.0.236/daktari/checks/android.py +0 -26
  11. daktari-0.0.236/daktari/checks/aws.py +0 -34
  12. daktari-0.0.236/daktari/checks/certs.py +0 -34
  13. daktari-0.0.236/daktari/checks/conan.py +0 -96
  14. daktari-0.0.236/daktari/checks/direnv.py +0 -59
  15. daktari-0.0.236/daktari/checks/docker.py +0 -50
  16. daktari-0.0.236/daktari/checks/files.py +0 -72
  17. daktari-0.0.236/daktari/checks/flutter.py +0 -46
  18. daktari-0.0.236/daktari/checks/git.py +0 -198
  19. daktari-0.0.236/daktari/checks/google.py +0 -113
  20. daktari-0.0.236/daktari/checks/intellij_idea.py +0 -248
  21. daktari-0.0.236/daktari/checks/java.py +0 -104
  22. daktari-0.0.236/daktari/checks/kubernetes.py +0 -154
  23. daktari-0.0.236/daktari/checks/misc.py +0 -302
  24. daktari-0.0.236/daktari/checks/nodejs.py +0 -92
  25. daktari-0.0.236/daktari/checks/onepassword.py +0 -105
  26. daktari-0.0.236/daktari/checks/python.py +0 -16
  27. daktari-0.0.236/daktari/checks/ssh.py +0 -33
  28. daktari-0.0.236/daktari/checks/terraform.py +0 -70
  29. daktari-0.0.236/daktari/checks/test_certs.py +0 -32
  30. daktari-0.0.236/daktari/checks/test_intellij_idea.py +0 -66
  31. daktari-0.0.236/daktari/checks/test_java.py +0 -88
  32. daktari-0.0.236/daktari/checks/test_misc.py +0 -18
  33. daktari-0.0.236/daktari/checks/test_onepassword.py +0 -31
  34. daktari-0.0.236/daktari/checks/test_ssh.py +0 -22
  35. daktari-0.0.236/daktari/checks/test_yarn.py +0 -86
  36. daktari-0.0.236/daktari/checks/xml.py +0 -33
  37. daktari-0.0.236/daktari/checks/yarn.py +0 -156
  38. daktari-0.0.236/daktari/resources/__init__.py +0 -0
  39. daktari-0.0.236/pyproject.toml +0 -8
  40. daktari-0.0.236/requirements.txt +0 -24
  41. daktari-0.0.236/setup.py +0 -34
  42. {daktari-0.0.236 → daktari-0.0.254}/LICENSE.txt +0 -0
  43. {daktari-0.0.236 → daktari-0.0.254}/MANIFEST.in +0 -0
  44. {daktari-0.0.236 → daktari-0.0.254}/daktari/__main__.py +0 -0
  45. {daktari-0.0.236 → daktari-0.0.254}/daktari/asdf.py +0 -0
  46. {daktari-0.0.236 → daktari-0.0.254}/daktari/check.py +0 -0
  47. {daktari-0.0.236 → daktari-0.0.254}/daktari/check_runner.py +0 -0
  48. {daktari-0.0.236 → daktari-0.0.254}/daktari/check_sorter.py +0 -0
  49. {daktari-0.0.236 → daktari-0.0.254}/daktari/check_utils.py +0 -0
  50. {daktari-0.0.236 → daktari-0.0.254}/daktari/collection_utils.py +0 -0
  51. {daktari-0.0.236 → daktari-0.0.254}/daktari/command_utils.py +0 -0
  52. {daktari-0.0.236 → daktari-0.0.254}/daktari/config.py +0 -0
  53. {daktari-0.0.236 → daktari-0.0.254}/daktari/file_utils.py +0 -0
  54. {daktari-0.0.236 → daktari-0.0.254}/daktari/options.py +0 -0
  55. {daktari-0.0.236 → daktari-0.0.254}/daktari/os.py +0 -0
  56. {daktari-0.0.236 → daktari-0.0.254}/daktari/resource_utils.py +0 -0
  57. {daktari-0.0.236/daktari/checks → daktari-0.0.254/daktari/resources}/__init__.py +0 -0
  58. {daktari-0.0.236 → daktari-0.0.254}/daktari/resources/daktari-local-template.yaml +0 -0
  59. {daktari-0.0.236 → daktari-0.0.254}/daktari/resources/mock_cert.pem +0 -0
  60. {daktari-0.0.236 → daktari-0.0.254}/daktari/result_printer.py +0 -0
  61. {daktari-0.0.236 → daktari-0.0.254}/daktari/test_asdf.py +0 -0
  62. {daktari-0.0.236 → daktari-0.0.254}/daktari/test_check.py +0 -0
  63. {daktari-0.0.236 → daktari-0.0.254}/daktari/test_check_factory.py +0 -0
  64. {daktari-0.0.236 → daktari-0.0.254}/daktari/test_check_runner.py +0 -0
  65. {daktari-0.0.236 → daktari-0.0.254}/daktari/test_check_sorter.py +0 -0
  66. {daktari-0.0.236 → daktari-0.0.254}/daktari/test_check_utils.py +0 -0
  67. {daktari-0.0.236 → daktari-0.0.254}/daktari/test_collection_utils.py +0 -0
  68. {daktari-0.0.236 → daktari-0.0.254}/daktari/test_config.py +0 -0
  69. {daktari-0.0.236 → daktari-0.0.254}/daktari/test_result_printer.py +0 -0
  70. {daktari-0.0.236 → daktari-0.0.254}/daktari/test_version_utils.py +0 -0
  71. {daktari-0.0.236 → daktari-0.0.254}/daktari/version_utils.py +0 -0
  72. {daktari-0.0.236 → daktari-0.0.254}/daktari.egg-info/dependency_links.txt +0 -0
  73. {daktari-0.0.236 → daktari-0.0.254}/daktari.egg-info/entry_points.txt +0 -0
  74. {daktari-0.0.236 → daktari-0.0.254}/daktari.egg-info/top_level.txt +0 -0
  75. {daktari-0.0.236 → daktari-0.0.254}/setup.cfg +0 -0
@@ -1,16 +1,41 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: daktari
3
- Version: 0.0.236
3
+ Version: 0.0.254
4
4
  Summary: Assist in setting up and maintaining developer environments
5
- Home-page: https://github.com/sonocent/daktari
6
- Author: Matt Russell
7
- Author-email: matthew.russell@sonocent.com
8
- License: MIT
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Programming Language :: Python
5
+ Author-email: Matt Russell <matthew.russell@sonocent.com>
6
+ License: Copyright 2021 Sonocent Ltd
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+ Project-URL: Homepage, https://github.com/sonocent/daktari
11
14
  Requires-Python: >=3.9
12
15
  Description-Content-Type: text/markdown
13
16
  License-File: LICENSE.txt
17
+ Requires-Dist: ansicolors==1.1.8
18
+ Requires-Dist: distro==1.9.0
19
+ Requires-Dist: pyfiglet==1.0.2
20
+ Requires-Dist: importlib_resources==6.5.2
21
+ Requires-Dist: packaging==24.2
22
+ Requires-Dist: setuptools==76.0.0
23
+ Requires-Dist: requests==2.32.3
24
+ Requires-Dist: responses==0.25.6
25
+ Requires-Dist: semver==3.0.4
26
+ Requires-Dist: python-hosts==1.0.7
27
+ Requires-Dist: tabulate==0.9.0
28
+ Requires-Dist: types-tabulate==0.9.0.20241207
29
+ Requires-Dist: PyYAML==6.0.2
30
+ Requires-Dist: types-PyYAML==6.0.12.20241230
31
+ Requires-Dist: pyobjc-core==11.0; sys_platform == "darwin"
32
+ Requires-Dist: pyobjc-framework-Cocoa==11.0; sys_platform == "darwin"
33
+ Requires-Dist: requests-unixsocket==0.4.1
34
+ Requires-Dist: dpath==2.2.0
35
+ Requires-Dist: pyOpenSSL==25.0.0
36
+ Requires-Dist: types-pyOpenSSL==24.1.0.20240722
37
+ Requires-Dist: pyclip==0.7.0
38
+ Requires-Dist: urllib3==2.3.0
14
39
 
15
40
  **Daktari** is a tool to help the initial setup and ongoing maintenance of developer environments. It runs a series of checks (for example, that required software is installed) and provides suggestions on how to fix the issue if the check fails.
16
41
 
@@ -21,7 +46,7 @@ In the root of the project repository, create a `.daktari.py` configuration file
21
46
  ```python
22
47
  from daktari.checks.git import *
23
48
 
24
- version = "0.0.236"
49
+ version = "0.0.254"
25
50
  title = "My Project"
26
51
 
27
52
  checks = [
@@ -83,7 +108,7 @@ In case of a need to manually release, the steps are:
83
108
 
84
109
  ```
85
110
  bumpversion --verbose patch
86
- python setup.py sdist bdist_wheel
111
+ python -m build
87
112
  twine check dist/*
88
113
  twine upload dist/*
89
114
  ```
@@ -7,7 +7,7 @@ In the root of the project repository, create a `.daktari.py` configuration file
7
7
  ```python
8
8
  from daktari.checks.git import *
9
9
 
10
- version = "0.0.236"
10
+ version = "0.0.254"
11
11
  title = "My Project"
12
12
 
13
13
  checks = [
@@ -69,7 +69,7 @@ In case of a need to manually release, the steps are:
69
69
 
70
70
  ```
71
71
  bumpversion --verbose patch
72
- python setup.py sdist bdist_wheel
72
+ python -m build
73
73
  twine check dist/*
74
74
  twine upload dist/*
75
75
  ```
@@ -0,0 +1 @@
1
+ __version__ = "0.0.254"
@@ -1,16 +1,41 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: daktari
3
- Version: 0.0.236
3
+ Version: 0.0.254
4
4
  Summary: Assist in setting up and maintaining developer environments
5
- Home-page: https://github.com/sonocent/daktari
6
- Author: Matt Russell
7
- Author-email: matthew.russell@sonocent.com
8
- License: MIT
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Programming Language :: Python
5
+ Author-email: Matt Russell <matthew.russell@sonocent.com>
6
+ License: Copyright 2021 Sonocent Ltd
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+ Project-URL: Homepage, https://github.com/sonocent/daktari
11
14
  Requires-Python: >=3.9
12
15
  Description-Content-Type: text/markdown
13
16
  License-File: LICENSE.txt
17
+ Requires-Dist: ansicolors==1.1.8
18
+ Requires-Dist: distro==1.9.0
19
+ Requires-Dist: pyfiglet==1.0.2
20
+ Requires-Dist: importlib_resources==6.5.2
21
+ Requires-Dist: packaging==24.2
22
+ Requires-Dist: setuptools==76.0.0
23
+ Requires-Dist: requests==2.32.3
24
+ Requires-Dist: responses==0.25.6
25
+ Requires-Dist: semver==3.0.4
26
+ Requires-Dist: python-hosts==1.0.7
27
+ Requires-Dist: tabulate==0.9.0
28
+ Requires-Dist: types-tabulate==0.9.0.20241207
29
+ Requires-Dist: PyYAML==6.0.2
30
+ Requires-Dist: types-PyYAML==6.0.12.20241230
31
+ Requires-Dist: pyobjc-core==11.0; sys_platform == "darwin"
32
+ Requires-Dist: pyobjc-framework-Cocoa==11.0; sys_platform == "darwin"
33
+ Requires-Dist: requests-unixsocket==0.4.1
34
+ Requires-Dist: dpath==2.2.0
35
+ Requires-Dist: pyOpenSSL==25.0.0
36
+ Requires-Dist: types-pyOpenSSL==24.1.0.20240722
37
+ Requires-Dist: pyclip==0.7.0
38
+ Requires-Dist: urllib3==2.3.0
14
39
 
15
40
  **Daktari** is a tool to help the initial setup and ongoing maintenance of developer environments. It runs a series of checks (for example, that required software is installed) and provides suggestions on how to fix the issue if the check fails.
16
41
 
@@ -21,7 +46,7 @@ In the root of the project repository, create a `.daktari.py` configuration file
21
46
  ```python
22
47
  from daktari.checks.git import *
23
48
 
24
- version = "0.0.236"
49
+ version = "0.0.254"
25
50
  title = "My Project"
26
51
 
27
52
  checks = [
@@ -83,7 +108,7 @@ In case of a need to manually release, the steps are:
83
108
 
84
109
  ```
85
110
  bumpversion --verbose patch
86
- python setup.py sdist bdist_wheel
111
+ python -m build
87
112
  twine check dist/*
88
113
  twine upload dist/*
89
114
  ```
@@ -3,7 +3,6 @@ MANIFEST.in
3
3
  README.md
4
4
  pyproject.toml
5
5
  requirements.txt
6
- setup.py
7
6
  daktari/__init__.py
8
7
  daktari/__main__.py
9
8
  daktari/asdf.py
@@ -36,35 +35,6 @@ daktari.egg-info/dependency_links.txt
36
35
  daktari.egg-info/entry_points.txt
37
36
  daktari.egg-info/requires.txt
38
37
  daktari.egg-info/top_level.txt
39
- daktari/checks/__init__.py
40
- daktari/checks/android.py
41
- daktari/checks/aws.py
42
- daktari/checks/certs.py
43
- daktari/checks/conan.py
44
- daktari/checks/direnv.py
45
- daktari/checks/docker.py
46
- daktari/checks/files.py
47
- daktari/checks/flutter.py
48
- daktari/checks/git.py
49
- daktari/checks/google.py
50
- daktari/checks/intellij_idea.py
51
- daktari/checks/java.py
52
- daktari/checks/kubernetes.py
53
- daktari/checks/misc.py
54
- daktari/checks/nodejs.py
55
- daktari/checks/onepassword.py
56
- daktari/checks/python.py
57
- daktari/checks/ssh.py
58
- daktari/checks/terraform.py
59
- daktari/checks/test_certs.py
60
- daktari/checks/test_intellij_idea.py
61
- daktari/checks/test_java.py
62
- daktari/checks/test_misc.py
63
- daktari/checks/test_onepassword.py
64
- daktari/checks/test_ssh.py
65
- daktari/checks/test_yarn.py
66
- daktari/checks/xml.py
67
- daktari/checks/yarn.py
68
38
  daktari/resources/__init__.py
69
39
  daktari/resources/daktari-local-template.yaml
70
40
  daktari/resources/mock_cert.pem
@@ -1,28 +1,24 @@
1
- PyYAML==5.3.1
2
1
  ansicolors==1.1.8
3
2
  distro==1.9.0
4
- dpath==2.2.0
3
+ pyfiglet==1.0.2
5
4
  importlib_resources==6.5.2
6
- packaging==20.9
7
- pyOpenSSL==25.0.0
8
- pyclip==0.7.0
9
- pyfiglet==0.8.post1
10
- python-hosts==1.0.7
11
- requests-unixsocket==0.3.0
5
+ packaging==24.2
6
+ setuptools==76.0.0
12
7
  requests==2.32.3
13
8
  responses==0.25.6
14
- semver==3.0.2
15
- setuptools==70.3.0
9
+ semver==3.0.4
10
+ python-hosts==1.0.7
16
11
  tabulate==0.9.0
12
+ types-tabulate==0.9.0.20241207
13
+ PyYAML==6.0.2
17
14
  types-PyYAML==6.0.12.20241230
15
+ requests-unixsocket==0.4.1
16
+ dpath==2.2.0
17
+ pyOpenSSL==25.0.0
18
18
  types-pyOpenSSL==24.1.0.20240722
19
- types-tabulate==0.9.0.20241207
20
- urllib3<1.27
21
-
22
- [:python_version < "3.7"]
23
- dataclasses==0.8
24
- types-dataclasses==0.1.5
19
+ pyclip==0.7.0
20
+ urllib3==2.3.0
25
21
 
26
22
  [:sys_platform == "darwin"]
27
- pyobjc-core==10.3.2
23
+ pyobjc-core==11.0
28
24
  pyobjc-framework-Cocoa==11.0
@@ -0,0 +1,34 @@
1
+ [build-system]
2
+ requires = ["setuptools", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "daktari"
7
+ version = "0.0.254"
8
+ description = "Assist in setting up and maintaining developer environments"
9
+ readme = "README.md"
10
+ license = { file = "LICENSE.txt" }
11
+ authors = [
12
+ { name = "Matt Russell", email = "matthew.russell@sonocent.com" }
13
+ ]
14
+ requires-python = ">=3.9"
15
+ dynamic = ["dependencies"]
16
+
17
+ [project.urls]
18
+ Homepage = "https://github.com/sonocent/daktari"
19
+
20
+ [project.scripts]
21
+ daktari = "daktari.__main__:main"
22
+
23
+ [tool.setuptools.packages.find]
24
+ where = ["."]
25
+ include = ["daktari"]
26
+
27
+ [tool.setuptools.package-data]
28
+ "daktari" = ["*"]
29
+
30
+ [tool.setuptools.dynamic]
31
+ dependencies = {file = ["requirements.txt"]}
32
+
33
+ [tool.black]
34
+ line-length = 120
@@ -0,0 +1,22 @@
1
+ ansicolors==1.1.8
2
+ distro==1.9.0
3
+ pyfiglet==1.0.2
4
+ importlib_resources==6.5.2
5
+ packaging==24.2
6
+ setuptools==76.0.0
7
+ requests==2.32.3
8
+ responses==0.25.6
9
+ semver==3.0.4
10
+ python-hosts==1.0.7
11
+ tabulate==0.9.0
12
+ types-tabulate==0.9.0.20241207
13
+ PyYAML==6.0.2
14
+ types-PyYAML==6.0.12.20241230
15
+ pyobjc-core==11.0; sys_platform == 'darwin'
16
+ pyobjc-framework-Cocoa==11.0; sys_platform == 'darwin'
17
+ requests-unixsocket==0.4.1
18
+ dpath==2.2.0
19
+ pyOpenSSL==25.0.0
20
+ types-pyOpenSSL==24.1.0.20240722
21
+ pyclip==0.7.0
22
+ urllib3==2.3.0
@@ -1 +0,0 @@
1
- __version__ = "0.0.236"
@@ -1,26 +0,0 @@
1
- from daktari.check import Check, CheckResult
2
- from daktari.os import OS, get_env_var_value
3
-
4
-
5
- class AndroidNdkHomeSet(Check):
6
- name = "android.ndkHomeSet"
7
-
8
- def __init__(self, expected_version):
9
- self.variable_name = "ANDROID_NDK_HOME"
10
- self.expected_version = expected_version
11
- self.suggestions = {
12
- OS.GENERIC: f"""
13
- Export {self.variable_name} in your shell config.
14
- The expected value is ANDROID_SDK_HOME/ndk/{self.expected_version}.
15
- If you manage your android sdk using Android Studio, you can find your ANDROID_SDK_HOME by going to
16
- Tools > SDK Manager and copying the Android SDK location.
17
- You may need to check under SDK Tools that you have the NDK installed.
18
- """
19
- }
20
-
21
- def check(self) -> CheckResult:
22
- expected_substring = f"ndk/{self.expected_version}"
23
- return self.verify(
24
- expected_substring in get_env_var_value(self.variable_name),
25
- f"{self.variable_name} is <not/> set with expected version {self.expected_version}",
26
- )
@@ -1,34 +0,0 @@
1
- from daktari.check import Check, CheckResult
2
- from daktari.command_utils import can_run_command, get_stdout
3
- from daktari.os import OS
4
-
5
-
6
- class AWSCLIInstalled(Check):
7
- name = "aws.cliInstalled"
8
-
9
- suggestions = {
10
- OS.OS_X: """<cmd>curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" && \
11
- sudo installer -pkg AWSCLIV2.pkg -target /</cmd>""",
12
- OS.UBUNTU: """"<cmd>curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
13
- unzip awscliv2.zip && \
14
- sudo ./aws/install</cmd>""",
15
- }
16
-
17
- def check(self) -> CheckResult:
18
- return self.verify(can_run_command("aws --version"), "AWS CLI is <not/> installed and on $PATH")
19
-
20
-
21
- class AWSProfileExists(Check):
22
- depends_on = [AWSCLIInstalled]
23
-
24
- def __init__(self, profile_name: str, suggestions: dict[str, str]):
25
- self.profile_name = profile_name
26
- self.name = f"aws.profileExists.{profile_name}"
27
- self.suggestions = suggestions
28
-
29
- def check(self) -> CheckResult:
30
- output = get_stdout("aws configure list-profiles")
31
- passed = bool(output and self.profile_name in output)
32
- if not passed:
33
- return self.failed(f"{self.profile_name} is not configured for the current user")
34
- return self.passed(f"{self.profile_name} is configured for the current user")
@@ -1,34 +0,0 @@
1
- import logging
2
- import os
3
- from datetime import datetime
4
- from OpenSSL import crypto
5
-
6
- from daktari.check import Check, CheckResult
7
- from daktari.os import OS
8
-
9
-
10
- class CertificateIsNotExpired(Check):
11
- name = "certificate.isNotExpired"
12
-
13
- def __init__(self, certificate_path: str):
14
- self.certificate_path = certificate_path
15
- self.suggestions = {
16
- OS.GENERIC: f"Regenerate the certificate at {certificate_path}",
17
- }
18
-
19
- def check(self) -> CheckResult:
20
- with open(self.certificate_path, "rb") as f:
21
- cert = crypto.load_certificate(crypto.FILETYPE_PEM, f.read())
22
- logging.debug(f"Raw expiry: {cert.get_notAfter()!r}")
23
-
24
- expiry_bytes = cert.get_notAfter()
25
- if expiry_bytes is None:
26
- return self.passed_with_warning(
27
- f"Unable to determine expiry date of {os.path.basename(self.certificate_path)}"
28
- )
29
-
30
- expiry = datetime.strptime(expiry_bytes.decode(), "%Y%m%d%H%M%SZ")
31
- if expiry > datetime.now():
32
- return self.passed(f"{os.path.basename(self.certificate_path)} is not expired")
33
- else:
34
- return self.failed(f"{os.path.basename(self.certificate_path)} expired on {expiry}")
@@ -1,96 +0,0 @@
1
- import json
2
- import logging
3
- from typing import Optional
4
-
5
- from daktari.check import Check, CheckResult
6
- from daktari.command_utils import get_stdout
7
- from daktari.os import OS
8
-
9
-
10
- class ConanInstalled(Check):
11
- name = "conan.installed"
12
-
13
- def __init__(self, required_version: Optional[str] = None, recommended_version: Optional[str] = None):
14
- self.required_version = required_version
15
- self.recommended_version = recommended_version
16
- self.suggestions = {OS.GENERIC: "Install conan: <cmd>pip install conan</cmd>"}
17
-
18
- def check(self) -> CheckResult:
19
- return self.verify_install("conan")
20
-
21
-
22
- class ConanProfileDetected(Check):
23
- name = "conan.profileDetected"
24
-
25
- def __init__(self, expected_string: str):
26
- self.suggestions = {OS.GENERIC: "<cmd>conan profile detect</cmd>"}
27
- self.expected_string = expected_string
28
- self.depends_on = [ConanInstalled]
29
-
30
- def check(self) -> CheckResult:
31
- output = get_stdout("conan profile list")
32
- expected_profile_detected = output is not None and self.expected_string in output
33
- return self.verify(expected_profile_detected, f"conan profile {self.expected_string} <not/> detected")
34
-
35
-
36
- class ConanRemoteDetected(Check):
37
- name = "conan.remoteDetected"
38
-
39
- def __init__(self, remote_name: str, remote_url: str):
40
- self.suggestions = {OS.GENERIC: f"<cmd>conan remote add {remote_name} {remote_url}</cmd>"}
41
- self.remote_name = remote_name
42
- self.remote_url = remote_url
43
- self.depends_on = [ConanInstalled]
44
-
45
- def check(self) -> CheckResult:
46
- output = get_stdout("conan remote list -f json")
47
- if output is None:
48
- return self.failed("No conan remotes configured for the current user.")
49
- remote_json = json.loads(output)
50
- remote = next(filter(lambda remote_details: remote_details.get("name") == self.remote_name, remote_json), None)
51
- if remote is None:
52
- return self.failed(f"{self.remote_name} conan remote is not configured for the current user.")
53
-
54
- configured_url = remote["url"].strip("/")
55
- logging.debug(f"{self.remote_name} conan remote is configured with URL {configured_url}.")
56
-
57
- if configured_url != self.remote_url:
58
- self.suggestions = {
59
- OS.GENERIC: f"<cmd>conan remote update --url {self.remote_url} {self.remote_name}</cmd>"
60
- }
61
- return self.failed(
62
- f"{self.remote_name} conan remote is configured with URL {configured_url}, expected {self.remote_url}"
63
- )
64
-
65
- if not remote["enabled"]:
66
- self.suggestions = {OS.GENERIC: f"<cmd>conan remote enable {self.remote_name}</cmd>"}
67
- return self.failed(f"{self.remote_name} conan remote is not enabled.")
68
-
69
- return self.passed(f"{self.remote_name} conan remote is configured for the current user.")
70
-
71
-
72
- class ConanRemoteAuthenticated(Check):
73
- name = "conan.remoteAuthenticated"
74
-
75
- def __init__(self, remote_name: str, authentication_command: Optional[str] = None):
76
- self.suggestions = (
77
- {OS.GENERIC: authentication_command}
78
- if authentication_command
79
- else {OS.GENERIC: f"<cmd>conan remote login {remote_name}</cmd>"}
80
- )
81
- self.remote_name = remote_name
82
- self.depends_on = [ConanRemoteDetected]
83
-
84
- def check(self) -> CheckResult:
85
- output = get_stdout("conan remote list-users -f json")
86
- if output is None:
87
- return self.failed("No conan remotes configured for the current user.")
88
- remote_json = json.loads(output)
89
- remote = next(filter(lambda remote_details: remote_details.get("name") == self.remote_name, remote_json), None)
90
- if remote is None:
91
- return self.failed(f"{self.remote_name} conan remote is not configured for the current user.")
92
-
93
- if not remote["authenticated"]:
94
- return self.failed(f"{self.remote_name} conan remote is not authenticated.")
95
-
96
- return self.passed(f"{self.remote_name} conan remote is authenticated for the current user.")
@@ -1,59 +0,0 @@
1
- import re
2
-
3
- from daktari.command_utils import get_stdout
4
-
5
- from daktari.os import OS
6
- from daktari.check import Check, CheckResult
7
- from daktari.version_utils import get_simple_cli_version
8
- from daktari.file_utils import file_contains_text
9
- from typing import Optional
10
- from os import getcwd
11
-
12
-
13
- class DirenvInstalled(Check):
14
- name = "direnv.installed"
15
-
16
- def __init__(self, required_version: Optional[str] = None, recommended_version: Optional[str] = None):
17
- self.required_version = required_version
18
- self.recommended_version = recommended_version
19
- self.suggestions = {
20
- OS.GENERIC: "Install direnv: https://direnv.net/#getting-started",
21
- OS.OS_X: "Install direnv using brew: <cmd>brew install direnv</cmd>",
22
- OS.UBUNTU: "Install direnv using apt-get: <cmd>sudo apt-get install direnv</cmd>",
23
- }
24
-
25
- def check(self) -> CheckResult:
26
- installed_version = get_simple_cli_version("direnv")
27
- return self.validate_semver_expression(
28
- "direnv", installed_version, self.required_version, self.recommended_version
29
- )
30
-
31
-
32
- class EnvrcContainsText(Check):
33
- name = "direnv.envrc.containsText"
34
-
35
- def __init__(self, expected_string: str, suggestion: str):
36
- self.file_path = f"{getcwd()}/.envrc"
37
- self.expected_string = expected_string
38
- self.pass_fail_message = f"{self.file_path} does <not/> contain '{expected_string}'"
39
- self.suggestions = {OS.GENERIC: suggestion}
40
-
41
- def check(self) -> CheckResult:
42
- return self.verify(file_contains_text(self.file_path, self.expected_string), self.pass_fail_message)
43
-
44
-
45
- class DirenvAllowed(Check):
46
- name = "direnv.allowed"
47
- depends_on = [DirenvInstalled, EnvrcContainsText]
48
-
49
- def __init__(self):
50
- self.suggestions = {OS.GENERIC: "<cmd>direnv allow .</cmd>"}
51
-
52
- def check(self) -> CheckResult:
53
- direnv_status = get_stdout("direnv status")
54
- if direnv_status is None:
55
- return self.failed("direnv status returned no output")
56
- cwd = getcwd()
57
- query = f"Found RC path {cwd}/.envrc(\n.*)*Found RC allowed (true|0)"
58
- direnv_allowed = re.search(query, direnv_status) is not None
59
- return self.verify(direnv_allowed, f"{cwd} is <not/> allowed to use direnv")
@@ -1,50 +0,0 @@
1
- import logging
2
- import re
3
- from typing import Optional
4
-
5
- from semver import VersionInfo
6
-
7
- from daktari.check import Check, CheckResult
8
- from daktari.command_utils import get_stdout
9
- from daktari.os import OS
10
- from daktari.version_utils import try_parse_semver
11
-
12
-
13
- class DockerInstalled(Check):
14
- name = "docker.installed"
15
-
16
- suggestions = {
17
- OS.GENERIC: "Install docker: https://docs.docker.com/get-docker/",
18
- OS.OS_X: "Install docker: https://docs.docker.com/docker-for-mac/install/",
19
- }
20
-
21
- def __init__(self, required_version: Optional[str] = None):
22
- self.required_version = required_version
23
-
24
- def check(self) -> CheckResult:
25
- installed_version = get_docker_version()
26
- return self.validate_semver_expression("Docker", installed_version, self.required_version)
27
-
28
-
29
- major_version_pattern = re.compile("Docker version ([0-9.]+)")
30
-
31
-
32
- def get_docker_version() -> Optional[VersionInfo]:
33
- raw_version = get_stdout("docker --version")
34
- if raw_version:
35
- match = major_version_pattern.search(raw_version)
36
- if match:
37
- version_string = match.group(1)
38
- version = try_parse_semver(version_string)
39
- logging.debug(f"Docker version - raw: {version_string}, parsed: {version}")
40
- return version
41
- return None
42
-
43
-
44
- class DockerComposeInstalled(Check):
45
- name = "docker-compose.installed"
46
-
47
- suggestions = {OS.GENERIC: "Install docker-compose: https://docs.docker.com/compose/install/"}
48
-
49
- def check(self) -> CheckResult:
50
- return self.verify_install("docker-compose")