xmipp3-installer 1.0.1__tar.gz → 2.0.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.
- xmipp3_installer-2.0.0/PKG-INFO +86 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/README.md +21 -2
- xmipp3_installer-2.0.0/pyproject.toml +50 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/__main__.py +1 -1
- xmipp3_installer-2.0.0/src/xmipp3_installer/api_client/api_client.py +51 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/api_client/assembler/installation_info_assembler.py +174 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/application/cli/arguments/__init__.py +3 -2
- xmipp3_installer-2.0.0/src/xmipp3_installer/application/cli/arguments/modes.py +147 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/application/cli/arguments/params.py +86 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/application/cli/cli.py +252 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/application/cli/parsers/base_help_formatter.py +265 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/application/cli/parsers/error_handler_parser.py +68 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/application/cli/parsers/format.py +35 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/application/cli/parsers/general_help_formatter.py +110 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/application/cli/parsers/mode_help_formatter.py +154 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/application/logger/__init__.py +5 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/application/logger/errors.py +28 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/application/logger/logger.py +233 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/application/logger/predefined_messages.py +73 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/application/user_interactions.py +6 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/constants/__init__.py +1 -2
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/constants/paths.py +6 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/handlers/cmake/cmake_handler.py +65 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/handlers/conda_handler.py +13 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/handlers/generic_package_handler.py +18 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/handlers/git_handler.py +184 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/handlers/shell_handler.py +113 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/handlers/versions_manager.py +20 -6
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/installer_service.py +22 -8
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_all_executor.py +73 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_clean/mode_clean_all_executor.py +52 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_clean/mode_clean_bin_executor.py +104 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_clean/mode_clean_executor.py +59 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_cmake/mode_cmake_executor.py +68 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_cmake/mode_compile_and_install_executor.py +62 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_cmake/mode_config_build_executor.py +83 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_config_executor.py +57 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/modes/mode_executor.py +14 -13
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_get_sources_executor.py +138 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_git_executor.py +53 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/modes/mode_selector.py +6 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_sync/mode_add_model_executor.py +118 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_sync/mode_get_models_executor.py +63 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_sync/mode_sync_executor.py +54 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_sync/mode_test_executor.py +158 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/modes/mode_version_executor.py +175 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/installer/orquestrator.py +37 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/urls.py +4 -3
- xmipp3_installer-2.0.0/src/xmipp3_installer/repository/config.py +239 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/repository/config_vars/__init__.py +5 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/repository/config_vars/config_values_adapter.py +113 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/repository/config_vars/default_values.py +36 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/repository/config_vars/variables.py +9 -9
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/repository/invalid_config_line.py +17 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/shared/file_operations.py +20 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer/shared/singleton.py +24 -0
- xmipp3_installer-2.0.0/src/xmipp3_installer.egg-info/PKG-INFO +86 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer.egg-info/SOURCES.txt +1 -1
- xmipp3_installer-2.0.0/src/xmipp3_installer.egg-info/requires.txt +16 -0
- xmipp3_installer-1.0.1/PKG-INFO +0 -729
- xmipp3_installer-1.0.1/pyproject.toml +0 -31
- xmipp3_installer-1.0.1/src/xmipp3_installer/api_client/api_client.py +0 -50
- xmipp3_installer-1.0.1/src/xmipp3_installer/api_client/assembler/installation_info_assembler.py +0 -181
- xmipp3_installer-1.0.1/src/xmipp3_installer/application/cli/arguments/modes.py +0 -130
- xmipp3_installer-1.0.1/src/xmipp3_installer/application/cli/arguments/params.py +0 -76
- xmipp3_installer-1.0.1/src/xmipp3_installer/application/cli/cli.py +0 -271
- xmipp3_installer-1.0.1/src/xmipp3_installer/application/cli/parsers/base_help_formatter.py +0 -244
- xmipp3_installer-1.0.1/src/xmipp3_installer/application/cli/parsers/error_handler_parser.py +0 -68
- xmipp3_installer-1.0.1/src/xmipp3_installer/application/cli/parsers/format.py +0 -35
- xmipp3_installer-1.0.1/src/xmipp3_installer/application/cli/parsers/general_help_formatter.py +0 -92
- xmipp3_installer-1.0.1/src/xmipp3_installer/application/cli/parsers/mode_help_formatter.py +0 -115
- xmipp3_installer-1.0.1/src/xmipp3_installer/application/logger/__init__.py +0 -0
- xmipp3_installer-1.0.1/src/xmipp3_installer/application/logger/errors.py +0 -28
- xmipp3_installer-1.0.1/src/xmipp3_installer/application/logger/logger.py +0 -230
- xmipp3_installer-1.0.1/src/xmipp3_installer/application/logger/predefined_messages.py +0 -66
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/handlers/cmake/cmake_handler.py +0 -69
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/handlers/conda_handler.py +0 -13
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/handlers/generic_package_handler.py +0 -18
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/handlers/git_handler.py +0 -185
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/handlers/shell_handler.py +0 -114
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_all_executor.py +0 -63
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_clean/mode_clean_all_executor.py +0 -44
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_clean/mode_clean_bin_executor.py +0 -94
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_clean/mode_clean_executor.py +0 -45
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_cmake/mode_cmake_executor.py +0 -55
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_cmake/mode_compile_and_install_executor.py +0 -49
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_cmake/mode_config_build_executor.py +0 -64
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_config_executor.py +0 -46
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_get_sources_executor.py +0 -132
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_git_executor.py +0 -41
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_sync/mode_add_model_executor.py +0 -104
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_sync/mode_get_models_executor.py +0 -51
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_sync/mode_sync_executor.py +0 -48
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_sync/mode_test_executor.py +0 -91
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/modes/mode_version_executor.py +0 -164
- xmipp3_installer-1.0.1/src/xmipp3_installer/installer/orquestrator.py +0 -37
- xmipp3_installer-1.0.1/src/xmipp3_installer/repository/config.py +0 -241
- xmipp3_installer-1.0.1/src/xmipp3_installer/repository/config_vars/__init__.py +0 -0
- xmipp3_installer-1.0.1/src/xmipp3_installer/repository/config_vars/config_values_adapter.py +0 -107
- xmipp3_installer-1.0.1/src/xmipp3_installer/repository/config_vars/default_values.py +0 -36
- xmipp3_installer-1.0.1/src/xmipp3_installer/shared/file_operations.py +0 -18
- xmipp3_installer-1.0.1/src/xmipp3_installer/shared/singleton.py +0 -25
- xmipp3_installer-1.0.1/src/xmipp3_installer.egg-info/PKG-INFO +0 -729
- xmipp3_installer-1.0.1/src/xmipp3_installer.egg-info/requires.txt +0 -11
- /xmipp3_installer-1.0.1/LICENSE → /xmipp3_installer-2.0.0/LICENSE.txt +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/setup.cfg +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/__init__.py +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/application/__init__.py +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/application/cli/__init__.py +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/__init__.py +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/handlers/__init__.py +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/handlers/cmake/__init__.py +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/handlers/cmake/cmake_constants.py +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/modes/__init__.py +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/modes/mode_clean/__init__.py +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/installer/modes/mode_cmake/__init__.py +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer/repository/__init__.py +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer.egg-info/dependency_links.txt +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer.egg-info/entry_points.txt +0 -0
- {xmipp3_installer-1.0.1 → xmipp3_installer-2.0.0}/src/xmipp3_installer.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xmipp3_installer
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Package to handle the installation of Xmipp3
|
|
5
|
+
Author-email: Martín Salinas <ssalinasmartin@gmail.com>
|
|
6
|
+
License: GPL-3.0-only
|
|
7
|
+
Project-URL: Homepage, https://github.com/I2PC/xmipp3-installer
|
|
8
|
+
Project-URL: Issues, https://github.com/I2PC/xmipp3-installer/issues
|
|
9
|
+
Keywords: xmipp3,installer
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE.txt
|
|
22
|
+
Requires-Dist: typing-extensions>=4.12
|
|
23
|
+
Requires-Dist: distro>=1.9.0
|
|
24
|
+
Provides-Extra: test
|
|
25
|
+
Requires-Dist: pytest==8.*; extra == "test"
|
|
26
|
+
Requires-Dist: pytest-cov==5.*; python_version < "3.9" and extra == "test"
|
|
27
|
+
Requires-Dist: pytest-cov==6.*; python_version >= "3.9" and extra == "test"
|
|
28
|
+
Requires-Dist: pytest-subprocess==1.*; extra == "test"
|
|
29
|
+
Requires-Dist: pytest-localserver==0.*; extra == "test"
|
|
30
|
+
Requires-Dist: ruff==0.*; extra == "test"
|
|
31
|
+
Requires-Dist: cmake==4.*; extra == "test"
|
|
32
|
+
Requires-Dist: ninja==1.*; extra == "test"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# xmipp3-installer
|
|
36
|
+
Python package that handles the installation of [xmipp3](https://github.com/I2PC/xmipp3).
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
To install the package, simply run:
|
|
40
|
+
```
|
|
41
|
+
pip install xmipp3-installer
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
This package has a CLI built-in, with help messages that explain how to use it.
|
|
46
|
+
To run such help, once the package is installed, run:
|
|
47
|
+
```
|
|
48
|
+
xmipp3_installer -h
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Testing the code
|
|
52
|
+
In order to run the tests for this project, the project needs to be installed in development mode and also the test dependencies need to be installed.
|
|
53
|
+
|
|
54
|
+
To do that, you need to clone this project, move inside the repository's folder, and run:
|
|
55
|
+
```
|
|
56
|
+
pip install -e .[test]
|
|
57
|
+
```
|
|
58
|
+
Once the dependencies have been installed, the automatic tests for this package can be run using `./scripts/run-tests.sh` in bash, or `.\scripts\run-tests.ps1` in PowerShell.
|
|
59
|
+
If you intend to run this tests from within VSCode, you will need extension `Test Adapter Converter`, and a local `.vscode` folder with a file named `settings.json` inside with the following content:
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"python.testing.pytestArgs": [
|
|
63
|
+
".",
|
|
64
|
+
"--capture=no"
|
|
65
|
+
],
|
|
66
|
+
"python.testing.unittestEnabled": false,
|
|
67
|
+
"python.testing.pytestEnabled": true
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## SonarQube status
|
|
72
|
+
[](https://sonarcloud.io/summary/new_code?id=I2PC_xmipp3-installer)
|
|
73
|
+
|
|
74
|
+
### Ratings
|
|
75
|
+
[](https://sonarcloud.io/summary/new_code?id=I2PC_xmipp3-installer)
|
|
76
|
+
[](https://sonarcloud.io/summary/new_code?id=I2PC_xmipp3-installer)
|
|
77
|
+
[](https://sonarcloud.io/summary/new_code?id=I2PC_xmipp3-installer)
|
|
78
|
+
|
|
79
|
+
### Specific metrics
|
|
80
|
+
[](https://sonarcloud.io/summary/new_code?id=I2PC_xmipp3-installer)
|
|
81
|
+
[](https://sonarcloud.io/summary/new_code?id=I2PC_xmipp3-installer)
|
|
82
|
+
[](https://sonarcloud.io/summary/new_code?id=I2PC_xmipp3-installer)
|
|
83
|
+
[](https://sonarcloud.io/summary/new_code?id=I2PC_xmipp3-installer)
|
|
84
|
+
[](https://sonarcloud.io/summary/new_code?id=I2PC_xmipp3-installer)
|
|
85
|
+
[](https://sonarcloud.io/summary/new_code?id=I2PC_xmipp3-installer)
|
|
86
|
+
[](https://sonarcloud.io/summary/new_code?id=I2PC_xmipp3-installer)
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
# xmipp3-installer
|
|
2
|
-
Python package that handles the installation of xmipp3
|
|
2
|
+
Python package that handles the installation of [xmipp3](https://github.com/I2PC/xmipp3).
|
|
3
|
+
|
|
4
|
+
## Installation
|
|
5
|
+
To install the package, simply run:
|
|
6
|
+
```
|
|
7
|
+
pip install xmipp3-installer
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
This package has a CLI built-in, with help messages that explain how to use it.
|
|
12
|
+
To run such help, once the package is installed, run:
|
|
13
|
+
```
|
|
14
|
+
xmipp3_installer -h
|
|
15
|
+
```
|
|
3
16
|
|
|
4
17
|
## Testing the code
|
|
5
|
-
|
|
18
|
+
In order to run the tests for this project, the project needs to be installed in development mode and also the test dependencies need to be installed.
|
|
19
|
+
|
|
20
|
+
To do that, you need to clone this project, move inside the repository's folder, and run:
|
|
21
|
+
```
|
|
22
|
+
pip install -e .[test]
|
|
23
|
+
```
|
|
24
|
+
Once the dependencies have been installed, the automatic tests for this package can be run using `./scripts/run-tests.sh` in bash, or `.\scripts\run-tests.ps1` in PowerShell.
|
|
6
25
|
If you intend to run this tests from within VSCode, you will need extension `Test Adapter Converter`, and a local `.vscode` folder with a file named `settings.json` inside with the following content:
|
|
7
26
|
```json
|
|
8
27
|
{
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "xmipp3_installer"
|
|
3
|
+
version = "2.0.0"
|
|
4
|
+
authors = [
|
|
5
|
+
{ name = "Martín Salinas", email = "ssalinasmartin@gmail.com" },
|
|
6
|
+
]
|
|
7
|
+
description = "Package to handle the installation of Xmipp3"
|
|
8
|
+
keywords = ["xmipp3", "installer"]
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Programming Language :: Python :: 3",
|
|
11
|
+
"Programming Language :: Python :: 3.8",
|
|
12
|
+
"Programming Language :: Python :: 3.9",
|
|
13
|
+
"Programming Language :: Python :: 3.10",
|
|
14
|
+
"Programming Language :: Python :: 3.11",
|
|
15
|
+
"Programming Language :: Python :: 3.12",
|
|
16
|
+
"Programming Language :: Python :: 3.13",
|
|
17
|
+
"Programming Language :: Python :: 3.14",
|
|
18
|
+
"Operating System :: POSIX :: Linux"
|
|
19
|
+
]
|
|
20
|
+
readme = "README.md"
|
|
21
|
+
license = { text = "GPL-3.0-only" }
|
|
22
|
+
|
|
23
|
+
requires-python = ">=3.8"
|
|
24
|
+
dependencies = [
|
|
25
|
+
"typing-extensions>=4.12",
|
|
26
|
+
"distro>=1.9.0"
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[build-system]
|
|
30
|
+
requires = ["setuptools>=75.1", "wheel"]
|
|
31
|
+
build-backend = "setuptools.build_meta"
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
test = [
|
|
35
|
+
"pytest==8.*",
|
|
36
|
+
"pytest-cov==5.*; python_version < '3.9'",
|
|
37
|
+
"pytest-cov==6.*; python_version >= '3.9'",
|
|
38
|
+
"pytest-subprocess==1.*",
|
|
39
|
+
"pytest-localserver==0.*",
|
|
40
|
+
"ruff==0.*",
|
|
41
|
+
"cmake==4.*",
|
|
42
|
+
"ninja==1.*"
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[project.urls]
|
|
46
|
+
Homepage = "https://github.com/I2PC/xmipp3-installer"
|
|
47
|
+
Issues = "https://github.com/I2PC/xmipp3-installer/issues"
|
|
48
|
+
|
|
49
|
+
[project.scripts]
|
|
50
|
+
xmipp3_installer = "xmipp3_installer.__main__:main"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""### Contains an API client that registers the installation attempts."""
|
|
2
|
+
|
|
3
|
+
import http.client
|
|
4
|
+
import json
|
|
5
|
+
from typing import Dict
|
|
6
|
+
from urllib.parse import urlparse, ParseResult
|
|
7
|
+
|
|
8
|
+
from xmipp3_installer.installer import urls
|
|
9
|
+
from xmipp3_installer.application.logger.logger import logger
|
|
10
|
+
|
|
11
|
+
def send_installation_attempt(installation_info: Dict):
|
|
12
|
+
"""
|
|
13
|
+
### Sends a POST request to Xmipp's metrics's API.
|
|
14
|
+
|
|
15
|
+
#### Params:
|
|
16
|
+
- installation_info (dict): Dictionary containing all the installation information.
|
|
17
|
+
"""
|
|
18
|
+
if installation_info is None:
|
|
19
|
+
return
|
|
20
|
+
params = json.dumps(installation_info)
|
|
21
|
+
headers = {"Content-type": "application/json"}
|
|
22
|
+
parsed_url = urlparse(urls.API_URL)
|
|
23
|
+
conn = None
|
|
24
|
+
try:
|
|
25
|
+
conn = __get_https_connection(parsed_url, 6)
|
|
26
|
+
conn.request("POST", parsed_url.path, body=params, headers=headers)
|
|
27
|
+
conn.getresponse()
|
|
28
|
+
except TimeoutError:
|
|
29
|
+
logger(
|
|
30
|
+
logger.yellow("There was a timeout while sending installation data."),
|
|
31
|
+
show_in_terminal=False
|
|
32
|
+
)
|
|
33
|
+
finally:
|
|
34
|
+
if conn is not None:
|
|
35
|
+
conn.close()
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def __get_https_connection(parsed_url: ParseResult, timeout_seconds: int) -> http.client.HTTPSConnection:
|
|
39
|
+
"""
|
|
40
|
+
### Establishes the connection needed to send the API call.
|
|
41
|
+
|
|
42
|
+
Separated to enable integration & E2E tests.
|
|
43
|
+
|
|
44
|
+
#### Params:
|
|
45
|
+
- parsed_url (ParseResult): Object containing all elements of the url.
|
|
46
|
+
- timeout_seconds (int): Number of seconds to wait until a timeout.
|
|
47
|
+
|
|
48
|
+
#### Returns:
|
|
49
|
+
- (HTTPSConnection): Established connection.
|
|
50
|
+
"""
|
|
51
|
+
return http.client.HTTPSConnection(parsed_url.hostname or "localhost", parsed_url.port, timeout=timeout_seconds)
|
xmipp3_installer-2.0.0/src/xmipp3_installer/api_client/assembler/installation_info_assembler.py
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"""### Contains functions to assemble the data dictionary required by the API client."""
|
|
2
|
+
|
|
3
|
+
import getpass
|
|
4
|
+
import hashlib
|
|
5
|
+
import platform
|
|
6
|
+
import re
|
|
7
|
+
import os
|
|
8
|
+
from typing import Optional, List, Dict
|
|
9
|
+
|
|
10
|
+
import distro
|
|
11
|
+
|
|
12
|
+
from xmipp3_installer.installer import constants, orquestrator
|
|
13
|
+
from xmipp3_installer.installer.constants import paths
|
|
14
|
+
from xmipp3_installer.installer.handlers import shell_handler, git_handler, versions_manager
|
|
15
|
+
from xmipp3_installer.installer.handlers.cmake import cmake_constants, cmake_handler
|
|
16
|
+
|
|
17
|
+
def get_installation_info(version_manager: versions_manager.VersionsManager, ret_code: int=0) -> Dict:
|
|
18
|
+
"""
|
|
19
|
+
### Creates a dictionary with the necessary data for the API POST message.
|
|
20
|
+
|
|
21
|
+
#### Params:
|
|
22
|
+
- version_manager (VersionsManager): Object containing all the version-related info.
|
|
23
|
+
- ret_code (int): Optional. Return code for the API request.
|
|
24
|
+
|
|
25
|
+
#### Return:
|
|
26
|
+
- (dict): Dictionary with the required info.
|
|
27
|
+
"""
|
|
28
|
+
library_versions = cmake_handler.get_library_versions_from_cmake_file(
|
|
29
|
+
paths.LIBRARY_VERSIONS_FILE
|
|
30
|
+
)
|
|
31
|
+
environment_info = orquestrator.run_parallel_jobs(
|
|
32
|
+
[
|
|
33
|
+
__get_cpu_flags,
|
|
34
|
+
git_handler.get_current_branch,
|
|
35
|
+
git_handler.is_branch_up_to_date,
|
|
36
|
+
__is_installed_by_scipion,
|
|
37
|
+
__get_log_tail
|
|
38
|
+
],
|
|
39
|
+
[(), (), (), (), ()]
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
"user": {
|
|
44
|
+
"userId": __get_user_id()
|
|
45
|
+
},
|
|
46
|
+
"version": {
|
|
47
|
+
"os": get_os_release_name(),
|
|
48
|
+
"cpuFlags": environment_info[0],
|
|
49
|
+
"cuda": library_versions.get(cmake_constants.CMAKE_CUDA),
|
|
50
|
+
"cmake": library_versions.get(cmake_constants.CMAKE_CMAKE),
|
|
51
|
+
"gcc": library_versions.get(cmake_constants.CMAKE_GCC),
|
|
52
|
+
"gpp": library_versions.get(cmake_constants.CMAKE_GPP),
|
|
53
|
+
"mpi": library_versions.get(cmake_constants.CMAKE_MPI),
|
|
54
|
+
"python": library_versions.get(cmake_constants.CMAKE_PYTHON),
|
|
55
|
+
"sqlite": library_versions.get(cmake_constants.CMAKE_SQLITE),
|
|
56
|
+
"java": library_versions.get(cmake_constants.CMAKE_JAVA),
|
|
57
|
+
"hdf5": library_versions.get(cmake_constants.CMAKE_HDF5),
|
|
58
|
+
"jpeg": library_versions.get(cmake_constants.CMAKE_JPEG)
|
|
59
|
+
},
|
|
60
|
+
"xmipp": {
|
|
61
|
+
"branch": __get_installation_branch_name(
|
|
62
|
+
environment_info[1], version_manager
|
|
63
|
+
),
|
|
64
|
+
"updated": environment_info[2],
|
|
65
|
+
"installedByScipion": environment_info[3]
|
|
66
|
+
},
|
|
67
|
+
"returnCode": ret_code,
|
|
68
|
+
"logTail": environment_info[4] if ret_code else None # Only needed if something went wrong
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
def get_os_release_name() -> str:
|
|
72
|
+
"""
|
|
73
|
+
### Returns the name of the current system OS release.
|
|
74
|
+
|
|
75
|
+
#### Returns:
|
|
76
|
+
- (str): OS release name.
|
|
77
|
+
"""
|
|
78
|
+
platform_system = platform.system()
|
|
79
|
+
if platform_system == "Linux":
|
|
80
|
+
return f"{distro.name()} {distro.version()}"
|
|
81
|
+
return f"{platform_system} {platform.release()}"
|
|
82
|
+
|
|
83
|
+
def __get_installation_branch_name(branch_name: str, version_manager: versions_manager.VersionsManager) -> str:
|
|
84
|
+
"""
|
|
85
|
+
### Returns the branch or release name of Xmipp.
|
|
86
|
+
|
|
87
|
+
#### Params:
|
|
88
|
+
- branch_name (str): Retrieved branch name.
|
|
89
|
+
- version_manager (VersionsManager): Object containing all the version-related info.
|
|
90
|
+
|
|
91
|
+
#### Return:
|
|
92
|
+
- (str): Release name if Xmipp is in a release branch, or the branch name otherwise.
|
|
93
|
+
"""
|
|
94
|
+
return branch_name or version_manager.xmipp_version_number
|
|
95
|
+
|
|
96
|
+
def __get_user_id() -> str:
|
|
97
|
+
"""
|
|
98
|
+
### Returns the unique user id for this machine.
|
|
99
|
+
|
|
100
|
+
#### Returns:
|
|
101
|
+
- (str): User id, or 'Anoymous' if there were any errors.
|
|
102
|
+
"""
|
|
103
|
+
identifier = __get_mac_address()
|
|
104
|
+
if not identifier:
|
|
105
|
+
identifier = getpass.getuser()
|
|
106
|
+
if not identifier:
|
|
107
|
+
return "Anonymous"
|
|
108
|
+
|
|
109
|
+
sha256 = hashlib.sha256()
|
|
110
|
+
sha256.update(identifier.encode())
|
|
111
|
+
return sha256.hexdigest()
|
|
112
|
+
|
|
113
|
+
def __get_cpu_flags() -> List[str]:
|
|
114
|
+
"""
|
|
115
|
+
### This function obtains the list of compilation flags supported by the CPU.
|
|
116
|
+
|
|
117
|
+
#### Returns:
|
|
118
|
+
- (list(str)): List of flags supported by the CPU.
|
|
119
|
+
"""
|
|
120
|
+
flags_header = "Flags:"
|
|
121
|
+
ret_code, flags_line = shell_handler.run_shell_command(f'lscpu | grep \"{flags_header}\"')
|
|
122
|
+
if ret_code:
|
|
123
|
+
return []
|
|
124
|
+
flags_line = flags_line.replace(flags_header, "").strip()
|
|
125
|
+
return [flag for flag in flags_line.split(" ") if flag]
|
|
126
|
+
|
|
127
|
+
def __get_log_tail() -> Optional[str]:
|
|
128
|
+
"""
|
|
129
|
+
### Returns the last lines of the installation log.
|
|
130
|
+
|
|
131
|
+
#### Returns:
|
|
132
|
+
- (str | None): Installation log's last lines, or None if there were any errors.
|
|
133
|
+
"""
|
|
134
|
+
ret_code, output = shell_handler.run_shell_command(
|
|
135
|
+
f"tail -n {constants.TAIL_LOG_NCHARS} {paths.LOG_FILE}"
|
|
136
|
+
)
|
|
137
|
+
return output if ret_code == 0 else None
|
|
138
|
+
|
|
139
|
+
def __get_mac_address() -> Optional[str]:
|
|
140
|
+
"""
|
|
141
|
+
### Returns a physical MAC address for this machine. It prioritizes ethernet over wireless.
|
|
142
|
+
|
|
143
|
+
#### Returns:
|
|
144
|
+
- (str | None): MAC address, or None if there were any errors.
|
|
145
|
+
"""
|
|
146
|
+
ret_code, output = shell_handler.run_shell_command("ip addr")
|
|
147
|
+
return __find_mac_address_in_lines(output.split('\n')) if ret_code == 0 else None
|
|
148
|
+
|
|
149
|
+
def __find_mac_address_in_lines(lines: List[str]) -> Optional[str]:
|
|
150
|
+
"""
|
|
151
|
+
### Returns a physical MAC address within the text lines provided.
|
|
152
|
+
|
|
153
|
+
#### Params:
|
|
154
|
+
- lines (list(str)): Lines of text where MAC address should be looked for.
|
|
155
|
+
|
|
156
|
+
#### Returns:
|
|
157
|
+
- (str | None): MAC address if found, None otherwise.
|
|
158
|
+
"""
|
|
159
|
+
for line_index in range(len(lines) - 1):
|
|
160
|
+
match = re.match(r"^\d+: (enp|wlp|eth|ens|eno)\w+", lines[line_index])
|
|
161
|
+
if not match:
|
|
162
|
+
continue
|
|
163
|
+
mac_match = re.search(r"link/ether ([0-9a-f:]{17})", lines[line_index + 1])
|
|
164
|
+
if mac_match:
|
|
165
|
+
return mac_match.group(1)
|
|
166
|
+
|
|
167
|
+
def __is_installed_by_scipion() -> bool:
|
|
168
|
+
"""
|
|
169
|
+
### Checks if the current xmipp installation is being carried out from Scipion.
|
|
170
|
+
|
|
171
|
+
#### Returns:
|
|
172
|
+
- (bool): True if the installation is executed by Scipion, False otherwise.
|
|
173
|
+
"""
|
|
174
|
+
return bool(os.getenv("SCIPION_SOFTWARE"))
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"""### Containis all common constants needed for the argument parsing part of Xmipp's installation."""
|
|
2
2
|
|
|
3
|
+
from xmipp3_installer.installer.constants import paths
|
|
4
|
+
|
|
3
5
|
XMIPP_PROGRAM_NAME = "xmipp"
|
|
4
6
|
|
|
5
7
|
# Other variables
|
|
6
8
|
COMMON_USAGE_HELP_MESSAGE = 'Run \"./xmipp -h\" for usage help.'
|
|
7
|
-
|
|
8
|
-
DEFAULT_MODELS_DIR = DEFAULT_BUILD_DIR
|
|
9
|
+
DEFAULT_MODELS_DIR = paths.INSTALL_PATH
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"""### Containis all mode constants needed for the argument parsing part of Xmipp's installation."""
|
|
2
|
+
|
|
3
|
+
from xmipp3_installer.application.cli import arguments
|
|
4
|
+
from xmipp3_installer.application.cli.arguments.params import (
|
|
5
|
+
PARAM_SHORT, PARAM_JOBS, PARAM_BRANCH, PARAM_KEEP_OUTPUT, PARAM_OVERWRITE,
|
|
6
|
+
PARAM_MODELS_DIRECTORY, PARAM_TEST_NAMES, PARAM_SHOW_TESTS, PARAM_GIT_COMMAND,
|
|
7
|
+
PARAM_LOGIN, PARAM_MODEL_PATH, PARAM_UPDATE, PARAMS, PARAM_ALL_FUNCTIONS,
|
|
8
|
+
PARAM_ALL_PROGRAMS, SHORT_VERSION, LONG_VERSION
|
|
9
|
+
)
|
|
10
|
+
from xmipp3_installer.installer import urls, constants
|
|
11
|
+
|
|
12
|
+
MODE = "mode"
|
|
13
|
+
|
|
14
|
+
# Mode list (alphabetical order)
|
|
15
|
+
MODE_ADD_MODEL = 'addModel'
|
|
16
|
+
MODE_ALL = 'all'
|
|
17
|
+
MODE_CLEAN_ALL = 'cleanAll'
|
|
18
|
+
MODE_CLEAN_BIN = 'cleanBin'
|
|
19
|
+
MODE_COMPILE_AND_INSTALL = 'compileAndInstall'
|
|
20
|
+
MODE_CONFIG_BUILD = 'configBuild'
|
|
21
|
+
MODE_CONFIG = 'config'
|
|
22
|
+
MODE_GET_MODELS = 'getModels'
|
|
23
|
+
MODE_GET_SOURCES = 'getSources'
|
|
24
|
+
MODE_GIT = 'git'
|
|
25
|
+
MODE_TEST = 'test'
|
|
26
|
+
MODE_VERSION = 'version'
|
|
27
|
+
|
|
28
|
+
# Modes with help message
|
|
29
|
+
MODES = {
|
|
30
|
+
'General': {
|
|
31
|
+
MODE_VERSION: ['Returns the version information. Add \'--short\' to print only the version number.'],
|
|
32
|
+
MODE_COMPILE_AND_INSTALL: ['Compiles and installs Xmipp based on already obtained sources.'],
|
|
33
|
+
MODE_ALL: [f'Default param. Runs {MODE_CONFIG}, {MODE_CONFIG_BUILD}, and {MODE_COMPILE_AND_INSTALL}.'],
|
|
34
|
+
MODE_CONFIG_BUILD: ['Configures the project with CMake.']
|
|
35
|
+
},
|
|
36
|
+
'Config': {
|
|
37
|
+
MODE_CONFIG: ['Generates a config file template with default values.'],
|
|
38
|
+
},
|
|
39
|
+
'Downloads': {
|
|
40
|
+
MODE_GET_MODELS: [
|
|
41
|
+
f'Downloads the Deep Learning Models required by the DLTK tools at dir/models ({arguments.DEFAULT_MODELS_DIR} by default).',
|
|
42
|
+
f'Visit {urls.DLTK_DOCS_URL} for more details.'
|
|
43
|
+
],
|
|
44
|
+
MODE_GET_SOURCES: [f'Clones Xmipp\'s source repositories {constants.XMIPP_CORE} & {constants.XMIPP_VIZ}.']
|
|
45
|
+
},
|
|
46
|
+
'Clean': {
|
|
47
|
+
MODE_CLEAN_BIN: ['Removes all compiled binaries.'],
|
|
48
|
+
MODE_CLEAN_ALL: ['Removes all compiled binaries and sources, leaves the repository as if freshly cloned (without pulling).']
|
|
49
|
+
},
|
|
50
|
+
'Test': {
|
|
51
|
+
MODE_TEST: [
|
|
52
|
+
'Runs Xmipp\'s tests.',
|
|
53
|
+
f'If used with \'{PARAMS[PARAM_TEST_NAMES][SHORT_VERSION]}\', only the tests provided will run.',
|
|
54
|
+
f'If used with \'{PARAMS[PARAM_SHOW_TESTS][LONG_VERSION]}\', a list the tests available and how to invoke them will be shown.',
|
|
55
|
+
f'If used with \'{PARAMS[PARAM_ALL_FUNCTIONS][LONG_VERSION]}\', all function tests will run.',
|
|
56
|
+
f'If used with \'{PARAMS[PARAM_ALL_PROGRAMS][LONG_VERSION]}\', all program tests will run.'
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
'Developers': {
|
|
60
|
+
MODE_GIT: ['Runs the given git action for all source repositories.'],
|
|
61
|
+
MODE_ADD_MODEL: [
|
|
62
|
+
"Takes a DeepLearning model from the modelPath, makes a tgz of it and uploads the .tgz according to the <login>.",
|
|
63
|
+
"This mode is used to upload a model folder to the Scipion/Xmipp server.",
|
|
64
|
+
"Usually the model folder contains big files used to feed deep learning procedures "
|
|
65
|
+
"with pretrained data. All the models stored in the server will be downloaded "
|
|
66
|
+
"using the 'get_models' mode, during the compilation/installation time, "
|
|
67
|
+
"or with scipion3 installb deepLearningToolkit.",
|
|
68
|
+
"Param <modelsPath> must be an absolute path.",
|
|
69
|
+
"",
|
|
70
|
+
"Usage: -> ./xmipp addModel <usr@server> <modelsPath> [--update]",
|
|
71
|
+
"Steps: 0. modelName = basename(modelsPath) <- Please, check the folders name!",
|
|
72
|
+
" 1. Packing in 'xmipp_model_modelName.tgz'",
|
|
73
|
+
" 2. Check if that model already exists (use --update to override an existing model)",
|
|
74
|
+
" 3. Upload the model to the server.",
|
|
75
|
+
" 4. Update the MANIFEST file.",
|
|
76
|
+
"",
|
|
77
|
+
"The model name will be the folder name in <modelsPath>",
|
|
78
|
+
"Must have write permissions to such machine."
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
# Arguments of each mode, sorted by group
|
|
84
|
+
# Inside each mode, params are grouped by mutually exclusive groups
|
|
85
|
+
# For example: MYMODE: [[PARAM1, PARAM2], [PARAM3, PARAM4]] would translate to
|
|
86
|
+
# "mymode ([param1] [param2] | [param3] [param4])" in the general help message
|
|
87
|
+
MODE_ARGS = {
|
|
88
|
+
MODE_VERSION: [PARAM_SHORT],
|
|
89
|
+
MODE_COMPILE_AND_INSTALL: [PARAM_JOBS, PARAM_KEEP_OUTPUT],
|
|
90
|
+
MODE_ALL: [PARAM_JOBS, PARAM_BRANCH, PARAM_KEEP_OUTPUT],
|
|
91
|
+
MODE_CONFIG_BUILD: [PARAM_KEEP_OUTPUT],
|
|
92
|
+
MODE_CONFIG: [PARAM_OVERWRITE],
|
|
93
|
+
MODE_GET_MODELS: [PARAM_MODELS_DIRECTORY],
|
|
94
|
+
MODE_GET_SOURCES: [PARAM_BRANCH, PARAM_KEEP_OUTPUT],
|
|
95
|
+
MODE_CLEAN_BIN: [],
|
|
96
|
+
MODE_CLEAN_ALL: [],
|
|
97
|
+
MODE_TEST: [[PARAM_TEST_NAMES], [PARAM_SHOW_TESTS], [PARAM_ALL_FUNCTIONS], [PARAM_ALL_PROGRAMS]],
|
|
98
|
+
MODE_GIT: [PARAM_GIT_COMMAND],
|
|
99
|
+
MODE_ADD_MODEL: [PARAM_LOGIN, PARAM_MODEL_PATH, PARAM_UPDATE]
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
# Examples for the help message of each mode
|
|
103
|
+
MODE_EXAMPLES = {
|
|
104
|
+
MODE_VERSION: [
|
|
105
|
+
f'./xmipp {MODE_VERSION}',
|
|
106
|
+
f'./xmipp {MODE_VERSION} {PARAMS[PARAM_SHORT][LONG_VERSION]}',
|
|
107
|
+
],
|
|
108
|
+
MODE_COMPILE_AND_INSTALL: [
|
|
109
|
+
f'./xmipp {MODE_COMPILE_AND_INSTALL}',
|
|
110
|
+
f'./xmipp {MODE_COMPILE_AND_INSTALL} {PARAMS[PARAM_JOBS][SHORT_VERSION]} 20',
|
|
111
|
+
],
|
|
112
|
+
MODE_ALL: [
|
|
113
|
+
'./xmipp',
|
|
114
|
+
f'./xmipp {MODE_ALL}',
|
|
115
|
+
f'./xmipp {PARAMS[PARAM_JOBS][SHORT_VERSION]} 20',
|
|
116
|
+
f'./xmipp {PARAMS[PARAM_BRANCH][SHORT_VERSION]} devel',
|
|
117
|
+
f'./xmipp {MODE_ALL} {PARAMS[PARAM_JOBS][SHORT_VERSION]} 20 '
|
|
118
|
+
f'{PARAMS[PARAM_BRANCH][SHORT_VERSION]} devel'
|
|
119
|
+
],
|
|
120
|
+
MODE_CONFIG_BUILD: [],
|
|
121
|
+
MODE_CONFIG: [
|
|
122
|
+
f'./xmipp {MODE_CONFIG} {PARAMS[PARAM_OVERWRITE][LONG_VERSION]}'
|
|
123
|
+
],
|
|
124
|
+
MODE_GET_MODELS: [
|
|
125
|
+
f'./xmipp {MODE_GET_MODELS}',
|
|
126
|
+
f'./xmipp {MODE_GET_MODELS} {PARAMS[PARAM_MODELS_DIRECTORY][SHORT_VERSION]} /path/to/my/model/directory'
|
|
127
|
+
],
|
|
128
|
+
MODE_GET_SOURCES: [
|
|
129
|
+
f'./xmipp {MODE_GET_SOURCES}'
|
|
130
|
+
f'./xmipp {MODE_GET_SOURCES} {PARAMS[PARAM_BRANCH][SHORT_VERSION]} devel'
|
|
131
|
+
],
|
|
132
|
+
MODE_CLEAN_BIN: [],
|
|
133
|
+
MODE_CLEAN_ALL: [],
|
|
134
|
+
MODE_TEST: [
|
|
135
|
+
f'./xmipp {MODE_TEST} xmipp_sample_test',
|
|
136
|
+
f'./xmipp {MODE_TEST} {PARAMS[PARAM_SHOW_TESTS][LONG_VERSION]}',
|
|
137
|
+
f'./xmipp {MODE_TEST} {PARAMS[PARAM_ALL_FUNCTIONS][LONG_VERSION]}',
|
|
138
|
+
f'./xmipp {MODE_TEST} {PARAMS[PARAM_ALL_PROGRAMS][LONG_VERSION]}'
|
|
139
|
+
],
|
|
140
|
+
MODE_GIT: [
|
|
141
|
+
f'./xmipp {MODE_GIT} pull',
|
|
142
|
+
f'./xmipp {MODE_GIT} checkout devel'
|
|
143
|
+
],
|
|
144
|
+
MODE_ADD_MODEL: [
|
|
145
|
+
f'./xmipp {MODE_ADD_MODEL} myuser@127.0.0.1 /home/myuser/mymodel'
|
|
146
|
+
]
|
|
147
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"""### Containis all param constants needed for the argument parsing part of Xmipp's installation."""
|
|
2
|
+
|
|
3
|
+
from xmipp3_installer.application.cli import arguments
|
|
4
|
+
|
|
5
|
+
# Definition of all params found in the
|
|
6
|
+
SHORT_VERSION = 'short'
|
|
7
|
+
LONG_VERSION = 'long'
|
|
8
|
+
DESCRIPTION = 'description'
|
|
9
|
+
|
|
10
|
+
# Possible param list
|
|
11
|
+
PARAM_SHORT = 'short'
|
|
12
|
+
PARAM_JOBS = 'jobs'
|
|
13
|
+
PARAM_BRANCH = 'branch'
|
|
14
|
+
PARAM_MODELS_DIRECTORY = 'directory'
|
|
15
|
+
PARAM_TEST_NAMES = 'testNames'
|
|
16
|
+
PARAM_SHOW_TESTS = 'show'
|
|
17
|
+
PARAM_ALL_FUNCTIONS = 'all_functions'
|
|
18
|
+
PARAM_ALL_PROGRAMS = 'all_programs'
|
|
19
|
+
PARAM_GIT_COMMAND = 'command'
|
|
20
|
+
PARAM_LOGIN = 'login'
|
|
21
|
+
PARAM_MODEL_PATH = 'modelPath'
|
|
22
|
+
PARAM_UPDATE = 'update'
|
|
23
|
+
PARAM_OVERWRITE = 'overwrite'
|
|
24
|
+
PARAM_KEEP_OUTPUT = "keep_output"
|
|
25
|
+
PARAMS = {
|
|
26
|
+
PARAM_SHORT: {
|
|
27
|
+
LONG_VERSION: "--short",
|
|
28
|
+
DESCRIPTION: "If set, only version number is shown."
|
|
29
|
+
},
|
|
30
|
+
PARAM_JOBS: {
|
|
31
|
+
SHORT_VERSION: "-j",
|
|
32
|
+
LONG_VERSION: "--jobs",
|
|
33
|
+
DESCRIPTION: "Number of jobs. Defaults to all available."
|
|
34
|
+
},
|
|
35
|
+
PARAM_BRANCH: {
|
|
36
|
+
SHORT_VERSION: "-b",
|
|
37
|
+
LONG_VERSION: "--branch",
|
|
38
|
+
DESCRIPTION: "Branch for the source repositories."
|
|
39
|
+
},
|
|
40
|
+
PARAM_MODELS_DIRECTORY: {
|
|
41
|
+
SHORT_VERSION: "-d",
|
|
42
|
+
LONG_VERSION: "--directory",
|
|
43
|
+
DESCRIPTION: f"Directory where models will be saved. Default is \"{arguments.DEFAULT_MODELS_DIR}\"."
|
|
44
|
+
},
|
|
45
|
+
PARAM_TEST_NAMES: {
|
|
46
|
+
SHORT_VERSION: PARAM_TEST_NAMES,
|
|
47
|
+
DESCRIPTION: "Name of the tests to run."
|
|
48
|
+
},
|
|
49
|
+
PARAM_SHOW_TESTS: {
|
|
50
|
+
LONG_VERSION: "--show",
|
|
51
|
+
DESCRIPTION: "Shows the tests available and how to invoke those."
|
|
52
|
+
},
|
|
53
|
+
PARAM_ALL_FUNCTIONS : {
|
|
54
|
+
LONG_VERSION: "--all-functions",
|
|
55
|
+
DESCRIPTION: "If set, all function tests will be run."
|
|
56
|
+
},
|
|
57
|
+
PARAM_ALL_PROGRAMS : {
|
|
58
|
+
LONG_VERSION: "--all-programs",
|
|
59
|
+
DESCRIPTION: "If set, all program tests will be run."
|
|
60
|
+
},
|
|
61
|
+
PARAM_GIT_COMMAND: {
|
|
62
|
+
SHORT_VERSION: PARAM_GIT_COMMAND,
|
|
63
|
+
DESCRIPTION: "Git command to run on all source repositories."
|
|
64
|
+
},
|
|
65
|
+
PARAM_LOGIN: {
|
|
66
|
+
SHORT_VERSION: "login",
|
|
67
|
+
DESCRIPTION: "Login (usr@server) for remote host to upload the model with. Must have write permissions to such machine."
|
|
68
|
+
},
|
|
69
|
+
PARAM_MODEL_PATH: {
|
|
70
|
+
SHORT_VERSION: PARAM_MODEL_PATH,
|
|
71
|
+
DESCRIPTION: "Path to the model to upload to remote host."
|
|
72
|
+
},
|
|
73
|
+
PARAM_UPDATE: {
|
|
74
|
+
LONG_VERSION: "--update",
|
|
75
|
+
DESCRIPTION: "Flag to update an existing model"
|
|
76
|
+
},
|
|
77
|
+
PARAM_OVERWRITE: {
|
|
78
|
+
SHORT_VERSION: "-o",
|
|
79
|
+
LONG_VERSION: "--overwrite",
|
|
80
|
+
DESCRIPTION: "If set, current config file will be overwritten with a new one."
|
|
81
|
+
},
|
|
82
|
+
PARAM_KEEP_OUTPUT: {
|
|
83
|
+
LONG_VERSION: "--keep-output",
|
|
84
|
+
DESCRIPTION: "If set, output sent through the terminal won't substitute lines, looking more like the log."
|
|
85
|
+
}
|
|
86
|
+
}
|