Skip to content

Commit

Permalink
handled CI/CD and .toml files
Browse files Browse the repository at this point in the history
  • Loading branch information
lrdossan committed Jul 17, 2024
1 parent f4824a0 commit b5617c4
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 87 deletions.
60 changes: 21 additions & 39 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,60 +11,42 @@ include:
file: acc_py_devtools/templates/gitlab-ci/python.yml

variables:
project_name: caimira
PY_VERSION: "3.11"


# ###################################################################################################
# Test code - CAiMIRA (model) and CERN CAiMIRA (CERN's UI)

# A full installation of CAiMIRA, tested with pytest.
test_install:
extends: .acc_py_full_test
variables:
project_root: ./caimira
project_name: caimira
.py_full_test:
image: registry.cern.ch/docker.io/library/python:${PY_VERSION}
stage: test
before_script:
- pip install -e ${caimira_root}[test]
- pip install -e ${cern_caimira_root}[test]
script:
- cd ${caimira_root}
- python -m pytest
- cd ../${cern_caimira_root}
- python -m pytest


# A development installation of CAiMIRA tested with pytest.
test_dev:
extends: .acc_py_dev_test
# A full installation of CAiMIRA, tested with pytest.
caimira_full_test:
extends: .py_full_test
variables:
project_root: ./caimira
project_name: caimira
caimira_root: ./caimira
cern_caimira_root: ./cern_caimira


# A development installation of CAiMIRA tested with pytest.
test_dev-39:
caimira_full_test-39:
extends: .py_full_test
variables:
PY_VERSION: "3.9"
project_root: ./caimira
project_name: caimira
extends: .acc_py_dev_test

# A full installation of CERN CAiMIRA, tested with pytest.
test_install_cern_caimira:
extends: .acc_py_full_test
variables:
project_root: ./_cern_caimira
project_name: cern_caimira
caimira_root: ./caimira
cern_caimira_root: ./cern_caimira


# A development installation of CERN CAiMIRA tested with pytest.
test_dev_cern_caimira:
extends: .acc_py_dev_test
variables:
project_root: ./_cern_caimira
project_name: cern_caimira


# A development installation of CERN CAiMIRA tested with pytest.
test_dev-39_cern_caimira:
variables:
PY_VERSION: "3.9"
project_root: ./_cern_caimira
project_name: cern_caimira
extends: .acc_py_dev_test

# ###################################################################################################
# Test OpenShift config

Expand Down
50 changes: 6 additions & 44 deletions caimira/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,21 @@ classifiers = [
]
requires-python = ">=3.9"
dependencies = [
"ipykernel",
"ipympl>=0.9.0",
"ipywidgets<8.0",
"Jinja2",
"loky",
"matplotlib",
"memoization",
"mistune",
"numpy",
"pandas",
"psutil",
"pyinstrument",
"pyjwt",
"python-dateutil",
"requests",
"retry",
"ruptures",
"scipy",
"scikit-learn",
"tabulate",
"timezonefinder",
"tornado",
"types-retry",
]

[project.optional-dependencies]
Expand All @@ -51,7 +45,8 @@ test = [
"numpy-stubs @ git+https://github.com/numpy/numpy-stubs.git",
"types-dataclasses",
"types-python-dateutil",
"types-requests"
"types-requests",
"types-retry",
]
doc = [
"sphinx",
Expand All @@ -71,40 +66,7 @@ addopts = "--mypy"
[tool.mypy]
no_warn_no_return = true
exclude = "caimira/profiler.py"
ignore_missing_imports = true # TODO what to do here?

[tool.mypy-loky]
ignore_missing_imports = true

[tool.mypy-ipympl]
ignore_missing_imports = true

[tool.mypy-ipywidgets]
ignore_missing_imports = true

[tool.mypy-matplotlib]
ignore_missing_imports = true

[tool.mypy-mistune]
ignore_missing_imports = true

[tool.mypy-qrcode]
ignore_missing_imports = true

[tool.mypy-scipy]
ignore_missing_imports = true

[tool.mypy-timezonefinder]
ignore_missing_imports = true

[tool.mypy-pandas]
ignore_missing_imports = true

[tool.mypy-pstats]
follow_imports = "skip"

[tool.mypy-tabulate]
ignore_missing_imports = true

[tool.mypy-ruptures]
[[tool.mypy.overrides]]
module = ["pandas", "ruptures", "scipy.*", "setuptools", "sklearn.*", "tabulate"]
ignore_missing_imports = true
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import typing

import numpy as np
from sklearn.neighbors import KernelDensity # type: ignore
from sklearn.neighbors import KernelDensity

from caimira.calculator.models import models

Expand Down
4 changes: 2 additions & 2 deletions caimira/src/caimira/scripts/data/vaccine_effectiveness.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# import pandas as pd
# from tabulate import tabulate
import pandas as pd
from tabulate import tabulate

'''
Script file to generate the vaccine effectiveness values.
Expand Down
6 changes: 5 additions & 1 deletion cern_caimira/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ addopts = "--mypy"

[tool.mypy]
no_warn_no_return = true
ignore_missing_imports = true # TODO what to do here?

[[tool.mypy.overrides]]
module = ["caimira.*", "ipympl.*", "loky", "ipywidgets", "setuptools", "pandas"]
ignore_missing_imports = true


[tool.mypy-loky]
ignore_missing_imports = true
Expand Down
Empty file.

0 comments on commit b5617c4

Please sign in to comment.