diff --git a/.docker/Dockerfile b/.docker/Dockerfile index dd4f3d258443dc1f8b2bacb8d535780e8e37e5e8..539ac0d4e70bfbde2f630d4254cacc7419105611 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update && \ python3-sphinx \ tox \ -y -RUN pip3 install recommonmark sphinx-rtd-theme +RUN pip3 install pylint recommonmark sphinx-rtd-theme COPY .docker/wait-for-it.sh /wait-for-it.sh ARG PYLIB ADD https://gitlab.indiscale.com/api/v4/projects/97/repository/commits/${PYLIB} \ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b2ecd97cbded32dea3be9046cfdaac516bfb0ec2..879291320a7a715c10113f850a9f43f9465a7196 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -279,7 +279,7 @@ cert: - cd .docker - CAOSHOSTNAME=caosdb-server ./cert.sh -style: +code-style: tags: [docker] stage: style image: $CI_REGISTRY_IMAGE @@ -290,6 +290,17 @@ style: - autopep8 -r --diff --exit-code . allow_failure: true +pylint: + tags: [docker] + stage: style + image: $CI_REGISTRY_IMAGE + needs: + - job: build-testenv + optional: true + allow_failure: true + script: + - pylint --unsafe-load-any-extension=y -d all -e E,F src/caoscrawler + # Build the sphinx documentation and make it ready for deployment by Gitlab Pages # Special job for serving a static website. See https://docs.gitlab.com/ee/ci/yaml/README.html#pages # Based on: https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/ci/editor?branch_name=main diff --git a/integrationtests/test_realworld_example.py b/integrationtests/test_realworld_example.py index 82644947a3cdc85a38be3403615b51fe1f4ded50..fbbf25643e1c1cf928aa9599c92d3d6e94a88974 100644 --- a/integrationtests/test_realworld_example.py +++ b/integrationtests/test_realworld_example.py @@ -24,24 +24,22 @@ """ an integration test module that runs a test against a (close to) real world example """ -from caosdb.utils.register_tests import clear_database, set_test_key -import logging import json +import logging import os +import pytest +import sys -import caosdb as db -from caosdb.cached import cache_clear +import linkahead as db +from linkahead.cached import cache_clear +from linkahead.utils.register_tests import clear_database, set_test_key +from caosadvancedtools.loadFiles import loadpath +from caosadvancedtools.models.parser import parse_model_from_json_schema, parse_model_from_yaml from caoscrawler.crawl import Crawler, crawler_main from caoscrawler.identifiable_adapters import CaosDBIdentifiableAdapter -from caoscrawler.structure_elements import Directory -import pytest -from caosadvancedtools.models.parser import parse_model_from_json_schema, parse_model_from_yaml -from caosadvancedtools.loadFiles import loadpath - from caoscrawler.scanner import load_definition, scan_structure_elements, create_converter_registry - -import sys +from caoscrawler.structure_elements import Directory set_test_key("10b128cf8a1372f30aa3697466bb55e76974e0c16a599bb44ace88f19c8f61e2") @@ -91,15 +89,6 @@ def usemodel(): dataset_inherits.sync_data_model(noquestion=True) -@pytest.fixture -def clear_database(): - # TODO(fspreck): Remove once the corresponding advancedtools function can - # be used. - ents = db.execute_query("FIND ENTITY WITH ID>99") - if ents: - ents.delete() - - def create_identifiable_adapter(): ident = CaosDBIdentifiableAdapter() ident.load_from_yaml_definition(os.path.join(DATADIR, "identifiables.yml")) diff --git a/src/caoscrawler/crawl.py b/src/caoscrawler/crawl.py index 26073cff3efeb6386617f422c54679d05ef9ce70..ffd0185604f243e119f3efd136488612276a9c05 100644 --- a/src/caoscrawler/crawl.py +++ b/src/caoscrawler/crawl.py @@ -1599,6 +1599,7 @@ def crawler_main(crawled_directory_path: str, logger.debug(err) if "SHARED_DIR" in os.environ: + # pylint: disable=E0601 domain = get_config_setting("public_host_url") logger.error("Unexpected Error: Please tell your administrator about this and provide the" f" following path.\n{domain}/Shared/" + debuglog_public)