diff --git a/conda_recipe/meta.yaml b/conda_recipe/meta.yaml index 837c2816e..a902d1d58 100644 --- a/conda_recipe/meta.yaml +++ b/conda_recipe/meta.yaml @@ -1,6 +1,6 @@ {% set module = environ.get('MODULE', 'mss') %} -{% set project = load_file_data('requirements.d/mswms.toml', from_recipe_dir=False).get('project') %} +{% set project = load_file_data('requirements.d/mscolab.toml', from_recipe_dir=False).get('project') %} {% set name = project.get('name') %} {% set summary = project.get('description') %} diff --git a/conftest.py b/conftest.py index b58622e97..d8cb44e40 100644 --- a/conftest.py +++ b/conftest.py @@ -40,7 +40,10 @@ import keyring except ModuleNotFoundError: keyring = None -from mslib.mswms.demodata import DataFiles +try: # mscolab + from mslib.mswms.demodata import DataFiles +except ModuleNotFoundError: + DataFiles = None import tests.constants as constants from mslib.utils.loggerdef import configure_mpl_logger @@ -96,7 +99,7 @@ def generate_initial_config(): sample_path = os.path.join(os.path.dirname(__file__), "tests", "data") shutil.copy(os.path.join(sample_path, "example.ftml"), constants.ROOT_DIR) - if not constants.SERVER_CONFIG_FS.exists(constants.SERVER_CONFIG_FILE): + if DataFiles is not None and not constants.SERVER_CONFIG_FS.exists(constants.SERVER_CONFIG_FILE): print('\n configure testdata') # ToDo check pytest tmpdir_factory examples = DataFiles(data_fs=constants.DATA_FS, @@ -218,12 +221,14 @@ def _load_module(module_name, path): sys.modules[module_name] = module spec.loader.exec_module(module) - - _load_module("mswms_settings", constants.SERVER_CONFIG_FILE_PATH) + if DataFiles is not None: + _load_module("mswms_settings", constants.SERVER_CONFIG_FILE_PATH) _load_module("mscolab_settings", path) - -generate_initial_config() +try: # mscolab + generate_initial_config() +except TypeError: + pass try: # This import must come after the call to generate_initial_config, otherwise SQLAlchemy will have a wrong database path diff --git a/mslib/mscolab/mscolab.py b/mslib/mscolab/mscolab.py index a04afe940..ed2e96aa1 100644 --- a/mslib/mscolab/mscolab.py +++ b/mslib/mscolab/mscolab.py @@ -41,7 +41,6 @@ add_all_users_to_all_operations, delete_user from mslib.mscolab.utils import create_files from mslib.utils import setup_logging -from mslib.utils.qt import Worker, Updater def handle_start(args): @@ -355,7 +354,6 @@ def handle_sso_metadata_init(repo_exists): def main(): parser = argparse.ArgumentParser() parser.add_argument("-v", "--version", help="show version", action="store_true", default=False) - parser.add_argument("--update", help="Updates MSS to the newest version", action="store_true", default=False) subparsers = parser.add_subparsers(help='Available actions', dest='action') @@ -405,16 +403,6 @@ def main(): except git.exc.InvalidGitRepositoryError: repo_exists = False - updater = Updater() - if args.update: - updater.on_update_available.connect(lambda old, new: updater.update_mss()) - updater.on_log_update.connect(lambda s: print(s.replace("\n", ""))) - updater.on_status_update.connect(lambda s: print(s.replace("\n", ""))) - updater.run() - while Worker.workers: - list(Worker.workers)[0].wait() - sys.exit() - if args.action == "start": handle_start(args) diff --git a/requirements.d/mscolab.toml b/requirements.d/mscolab.toml new file mode 100644 index 000000000..ac92a581d --- /dev/null +++ b/requirements.d/mscolab.toml @@ -0,0 +1,102 @@ +[project] +name = "mscolab" + +description = 'The MSColab server of the Mission Support System (MSS) - developed in the community to collaboratively exchange flight plans based on model data.' +readme = "README.md" +keywords = ["MSS", "collaboratively", "science", "flight planning"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "License :: OSI Approved :: Apache-2.0" +] +version = "9.0.0" + +source_patches = [ + 'build_mswms_setuppy.patch' +] + +dependencies = [ + 'python', + 'pyyaml', + 'future', + 'defusedxml', + 'chameleon', + 'execnet', + 'isodate', + 'lxml', + 'pillow', + 'requests >=2.31.0', + 'fs', + 'cftime >=1.0.1', + 'pyjwt', + 'flask >=2.3.2', + 'flask-httpauth', + 'flask-mail', + 'flask-migrate', + 'werkzeug >=2.2.3, <3.0.0', + 'flask-socketio >=5.1.0', + 'flask-sqlalchemy >=3.0.0', + 'flask-cors', + 'flask-wtf', + 'flask-login', + 'pysaml2', + 'libxmlsec1 # [not win]', + 'email_validator', + 'python-socketio >=5', + 'python-engineio >=4', + 'websocket-client', + 'passlib', + 'keyring', + 'dbus-python # [not win]', + 'gitpython', + 'git', + 'psycopg2', + 'PyMySQL >=0.9.3', + 'validate_email', + 'multidict', + 'markdown', + 'xstatic', + 'xstatic-jquery', + 'xstatic-bootstrap', + 'metpy', + 'libtiff <4.5.0', + 'python-slugify', +] + +run_constrained = [ +] +build_dependencies = [ + 'python', + 'pip', + 'setuptools', + 'future', +] + +host_dependencies = [ + 'python', + 'setuptools', + 'pip', + 'future' +] + +authors = ["see AUTHORS"] + +maintainers = [ + {name = "ReimarBauer", email = "rb.proj@gmail.com"} +] + +test_imports = [ + 'mslib' +] +test_commands = [ + 'mscolab -h', + 'msidp -h # [not win]' +] + + +[project.urls] +Homepage = "https://open-mss.github.io/" +Documentation = "https://mss.rtfd.io" +Repository = "https://github.com/open-mss/MSS" +Issues = "https://github.com/Open-MSS/MSS/issues" +Changelog = "https://github.com/Open-MSS/MSS/blob/stable/CHANGES.rst" diff --git a/tests/fixtures.py b/tests/fixtures.py index d3df57b75..00ad054c6 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -28,7 +28,11 @@ import multiprocessing import time import urllib -import mslib.mswms.mswms +try: # mscolab + import mslib.mswms.mswms +except ModuleNotFoundError: + pass + import eventlet import eventlet.wsgi @@ -178,7 +182,10 @@ def mscolab_server(mscolab_session_server, reset_mscolab): :returns: The URL where the server is running. """ # Update mscolab URL to avoid "Update Server List" message boxes - modify_config_file({"default_MSCOLAB": [mscolab_session_server]}) + try: # mscolab server tests should not access clients config + modify_config_file({"default_MSCOLAB": [mscolab_session_server]}) + except TypeError: + pass return mscolab_session_server