Skip to content

Commit bafbfe8

Browse files
committed
Merge branch 'main' of gitlab.pasteur.fr:gem/macsylib
2 parents 66c8259 + 7a78b88 commit bafbfe8

4 files changed

Lines changed: 81 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ model = [
6161

6262
[project.scripts]
6363
msl_data = "macsylib.scripts.macsydata:main"
64-
msl_profile = "macslib.scripts.macsyprofile:main"
64+
msl_profile = "macsylib.scripts.macsyprofile:main"
6565

6666
[project.urls]
6767
Homepage = "https://github.com/gem-pasteur/macsylib/"

src/macsylib/scripts/macsydata.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ def prefix(indent:int, char:str, prev_indent:int, pipe:bool = True) -> str:
662662

663663
def explore_def(def_loc: DefinitionLocation, indent:int = 0, prev_indent:int = 0, char:str = '', pipe:bool = True) -> None:
664664
"""
665-
explore recursively the tree structure of DefintionLocation with subdefinition. and compute what to dispaly for each line
665+
explore recursively the tree structure of DefintionLocation with subdefinition. and compute what to display for each line
666666
667667
:param def_loc: The definition location to explore
668668
:param indent: the indentation of the label
@@ -1112,7 +1112,7 @@ def create_repo(model_package_name: str, models_dir: str | None = None) -> str:
11121112
pre_push_path = impresources.files('macsylib') / 'data' / 'pre-push'
11131113
dest = os.path.join(repo.git_dir, 'hooks', 'pre-push')
11141114
if os.path.exists(dest):
1115-
_log.warning(f"A git hook '{pre_push_path}' already exists cannot install macsydata prepush hook.")
1115+
_log.warning(f"A git hook '{pre_push_path}' already exists cannot install msl_data prepush hook.")
11161116
_log.warning("Do it manually, check documentation: ")
11171117
else:
11181118
shutil.copy(pre_push_path, dest)
@@ -1127,7 +1127,7 @@ def create_repo(model_package_name: str, models_dir: str | None = None) -> str:
11271127
- A configuration file has been added (model_conf.xml) with default value tweak this file if needed.
11281128
(https://macsylib.readthedocs.io/en/latest/modeler_guide/package.html#model-configuration)
11291129
1130-
Before to publish your package you can use `macsydata check` to verify it's integrity.
1130+
Before to publish your package you can use `msl_data check` to verify it's integrity.
11311131
"""
11321132
)
11331133
_log.warning("To share your models with the MacSyModels community.")
@@ -1166,7 +1166,7 @@ def build_arg_parser(header:str, version:str,
11661166
"""
11671167
Build argument parser.
11681168
1169-
:param header: the header of console scriot
1169+
:param header: the header of console script
11701170
:param args: The arguments provided on the command line
11711171
:param package_name: the name of the higher package that embed the macsylib (eg 'macsyfinder')
11721172
:param tool_name: the name of this tool as it appear in pyproject.toml
@@ -1233,7 +1233,7 @@ def build_arg_parser(header:str, version:str,
12331233
help='Reinstall Model package even if it is already up-to-date.')
12341234
install_subparser.add_argument('--org',
12351235
default="macsy-models",
1236-
help="The name of Model orgagnization"
1236+
help="The name of Model organization"
12371237
"(default 'macsy-models'))"
12381238
)
12391239
install_dest = install_subparser.add_mutually_exclusive_group()

tests/test_functional.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#########################################################################
2+
# MacSyLib - Python library to detect macromolecular systems #
3+
# in prokaryotes protein dataset using systems modelling #
4+
# and similarity search. #
5+
# #
6+
# Authors: Sophie Abby, Bertrand Neron #
7+
# Copyright (c) 2014-2025 Institut Pasteur (Paris) and CNRS. #
8+
# See the COPYRIGHT file for details #
9+
# #
10+
# This file is part of MacSyLib package. #
11+
# #
12+
# MacSyLib is free software: you can redistribute it and/or modify #
13+
# it under the terms of the GNU General Public License as published by #
14+
# the Free Software Foundation, either version 3 of the License, or #
15+
# (at your option) any later version. #
16+
# #
17+
# MacSyLib is distributed in the hope that it will be useful, #
18+
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
19+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
20+
# GNU General Public License for more details . #
21+
# #
22+
# You should have received a copy of the GNU General Public License #
23+
# along with MacSyLib (COPYING). #
24+
# If not, see <https://www.gnu.org/licenses/>. #
25+
#########################################################################
26+
27+
import subprocess
28+
from tests import MacsyTest
29+
30+
31+
class Test_msl_data(MacsyTest):
32+
33+
def test_help(self):
34+
35+
expected_output = r"""usage: msl_data [-h] [-v] [--version]
36+
{available,download,install,uninstall,search,info,list,freeze,cite,help,check,show,definition,init}"""
37+
38+
p = subprocess.run("msl_data --help", shell=True, check=True, capture_output=True, text=True, encoding='utf8')
39+
self.assertEqual(p.returncode, 0)
40+
# for an unknow reason the output is not exactly formated in same manner on all plateform/execution
41+
# on some execution some lines ar wrapped
42+
# on some other no
43+
# so I test only the beginning of the help message
44+
self.assertTrue(p.stdout.startswith(expected_output))
45+
46+
47+
class Test_msl_profile(MacsyTest):
48+
49+
def test_help(self):
50+
51+
expected_output = r"""usage: msl_profile [-h] [--coverage-profile COVERAGE_PROFILE]
52+
[--i-evalue-sel I_EVALUE_SEL]
53+
[--best-hits {score,i_eval,profile_coverage}] [-p PATTERN]
54+
[-o OUT] [--index-dir INDEX_DIR] [-f] [-V] [-v] [--mute]
55+
previous_run
56+
57+
* * * * *
58+
* * * * * **
59+
** * * * * * *
60+
* _ * ** __ _ _ *
61+
_ __ ___ ___| | _ __ _ __ ___ / _(_) | ___
62+
| '_ ` _ \/ __| | | '_ \| '__/ _ \| |_| | |/ _ \
63+
| | | | | \__ \ | | |_) | | | (_) | _| | | __/
64+
|_| |_| |_|___/_|____| .__/|_| \___/|_| |_|_|\___|
65+
* |_____|_| * *
66+
* * * * ** * * * *
67+
* * * * * *
68+
* * * *
69+
70+
msl_profile - MacSyLib profile helper tool
71+
"""
72+
p = subprocess.run("msl_profile --help", shell=True, check=True, capture_output=True, text=True, encoding='utf8')
73+
self.assertEqual(p.returncode, 0)
74+
self.assertTrue(p.stdout.startswith(expected_output))

tests/test_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from macsylib.system import System, HitSystemTracker, RejectedCandidate, AbstractUnordered, LikelySystem, UnlikelySystem
4545
from macsylib.solution import Solution
4646

47-
from src.macsylib.io import loner_warning
47+
from macsylib.io import loner_warning
4848
from tests import MacsyTest
4949

5050

0 commit comments

Comments
 (0)