ositah 24.4.dev1__tar.gz → 24.7__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.
Files changed (79) hide show
  1. {ositah-24.4.dev1/ositah.egg-info → ositah-24.7}/PKG-INFO +1 -1
  2. ositah-24.7/docker/Dockerfile +20 -0
  3. ositah-24.7/docker/docker-compose.yml +13 -0
  4. ositah-24.7/docker/pyproject-poetry.toml +16 -0
  5. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/configuration/main.py +5 -1
  6. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/validation/tables.py +1 -1
  7. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/hito_db_model.py +8 -0
  8. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/menus.py +1 -1
  9. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/teams.py +42 -42
  10. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/utils.py +1 -2
  11. {ositah-24.4.dev1 → ositah-24.7/ositah.egg-info}/PKG-INFO +1 -1
  12. {ositah-24.4.dev1 → ositah-24.7}/ositah.egg-info/SOURCES.txt +3 -0
  13. {ositah-24.4.dev1 → ositah-24.7}/pyproject.toml +7 -7
  14. {ositah-24.4.dev1 → ositah-24.7}/.gitignore +0 -0
  15. {ositah-24.4.dev1 → ositah-24.7}/.gitlab-ci.yml +0 -0
  16. {ositah-24.4.dev1 → ositah-24.7}/LICENSE +0 -0
  17. {ositah-24.4.dev1 → ositah-24.7}/README.md +0 -0
  18. {ositah-24.4.dev1 → ositah-24.7}/gunicorn.config/README.md +0 -0
  19. {ositah-24.4.dev1 → ositah-24.7}/gunicorn.config/gunicorn.ositah +0 -0
  20. {ositah-24.4.dev1 → ositah-24.7}/gunicorn.config/gunicorn@.service +0 -0
  21. {ositah-24.4.dev1 → ositah-24.7}/gunicorn.config/ositah.conf.py +0 -0
  22. {ositah-24.4.dev1 → ositah-24.7}/noxfile.py +0 -0
  23. {ositah-24.4.dev1 → ositah-24.7}/ositah/__init__.py +0 -0
  24. {ositah-24.4.dev1 → ositah-24.7}/ositah/app.py +0 -0
  25. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/__init__.py +0 -0
  26. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/analysis.py +0 -0
  27. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/configuration/__init__.py +0 -0
  28. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/configuration/callbacks.py +0 -0
  29. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/configuration/parameters.py +0 -0
  30. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/configuration/tools.py +0 -0
  31. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/export.py +0 -0
  32. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/validation/__init__.py +0 -0
  33. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/validation/callbacks.py +0 -0
  34. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/validation/main.py +0 -0
  35. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/validation/parameters.py +0 -0
  36. {ositah-24.4.dev1 → ositah-24.7}/ositah/apps/validation/tools.py +0 -0
  37. {ositah-24.4.dev1 → ositah-24.7}/ositah/assets/arrow_down_up.svg +0 -0
  38. {ositah-24.4.dev1 → ositah-24.7}/ositah/assets/ositah.css +0 -0
  39. {ositah-24.4.dev1 → ositah-24.7}/ositah/assets/sort_ascending.svg +0 -0
  40. {ositah-24.4.dev1 → ositah-24.7}/ositah/assets/sort_descending.svg +0 -0
  41. {ositah-24.4.dev1 → ositah-24.7}/ositah/assets/sorttable.js +0 -0
  42. {ositah-24.4.dev1 → ositah-24.7}/ositah/main.py +0 -0
  43. {ositah-24.4.dev1 → ositah-24.7}/ositah/ositah.example.cfg +0 -0
  44. {ositah-24.4.dev1 → ositah-24.7}/ositah/static/style.css +0 -0
  45. {ositah-24.4.dev1 → ositah-24.7}/ositah/templates/base.html +0 -0
  46. {ositah-24.4.dev1 → ositah-24.7}/ositah/templates/bootstrap_login.html +0 -0
  47. {ositah-24.4.dev1 → ositah-24.7}/ositah/templates/login_form.html +0 -0
  48. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/__init__.py +0 -0
  49. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/agents.py +0 -0
  50. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/authentication.py +0 -0
  51. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/cache.py +0 -0
  52. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/core.py +0 -0
  53. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/exceptions.py +0 -0
  54. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/hito_db.py +0 -0
  55. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/period.py +0 -0
  56. {ositah-24.4.dev1 → ositah-24.7}/ositah/utils/projects.py +0 -0
  57. {ositah-24.4.dev1 → ositah-24.7}/ositah.egg-info/dependency_links.txt +0 -0
  58. {ositah-24.4.dev1 → ositah-24.7}/ositah.egg-info/entry_points.txt +0 -0
  59. {ositah-24.4.dev1 → ositah-24.7}/ositah.egg-info/requires.txt +0 -0
  60. {ositah-24.4.dev1 → ositah-24.7}/ositah.egg-info/top_level.txt +0 -0
  61. {ositah-24.4.dev1 → ositah-24.7}/setup.cfg +0 -0
  62. {ositah-24.4.dev1 → ositah-24.7}/setup.py +0 -0
  63. {ositah-24.4.dev1 → ositah-24.7}/test-dash/README.md +0 -0
  64. {ositah-24.4.dev1 → ositah-24.7}/test-dash/accordion.py +0 -0
  65. {ositah-24.4.dev1 → ositah-24.7}/test-dash/authentication.py +0 -0
  66. {ositah-24.4.dev1 → ositah-24.7}/test-dash/checkbox.py +0 -0
  67. {ositah-24.4.dev1 → ositah-24.7}/test-dash/checklist.py +0 -0
  68. {ositah-24.4.dev1 → ositah-24.7}/test-dash/file-selector.py +0 -0
  69. {ositah-24.4.dev1 → ositah-24.7}/test-dash/file-upload.py +0 -0
  70. {ositah-24.4.dev1 → ositah-24.7}/test-dash/long_running_callback.py +0 -0
  71. {ositah-24.4.dev1 → ositah-24.7}/test-dash/pandas_split.py +0 -0
  72. {ositah-24.4.dev1 → ositah-24.7}/test-dash/pandas_split_bug_report.py +0 -0
  73. {ositah-24.4.dev1 → ositah-24.7}/test-dash/pattern-matching-callback.py +0 -0
  74. {ositah-24.4.dev1 → ositah-24.7}/test-dash/progess_bar.py +0 -0
  75. {ositah-24.4.dev1 → ositah-24.7}/test-dash/reset_table_checkboxes.py +0 -0
  76. {ositah-24.4.dev1 → ositah-24.7}/test-dash/sortable_table.py +0 -0
  77. {ositah-24.4.dev1 → ositah-24.7}/test-dash/sqlalchemy_test.py +0 -0
  78. {ositah-24.4.dev1 → ositah-24.7}/test-dash/templates/base.html +0 -0
  79. {ositah-24.4.dev1 → ositah-24.7}/test-dash/templates/login_form.html +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ositah
3
- Version: 24.4.dev1
3
+ Version: 24.7
4
4
  Summary: Outils de Suivi d'Activités basé sur Hito
5
5
  Author-email: Michel Jouvin <michel.jouvin@ijclab.in2p3.fr>
6
6
  License: BSD 3-Clause License
@@ -0,0 +1,20 @@
1
+ FROM python
2
+
3
+ WORKDIR /ositah
4
+
5
+ ENV POETRY_HOME=/opt/poetry
6
+ ENV POETRY_VIRTUALENVS_IN_PROJECT=true
7
+ ENV PATH="$POETRY_HOME/bin:$PATH"
8
+
9
+ RUN apt update
10
+ RUN apt upgrade -qy
11
+ RUN apt install -qy libsasl2-dev python-dev libldap2-dev libssl-dev
12
+
13
+ RUN python -c 'from urllib.request import urlopen; print(urlopen("https://install.python-poetry.org").read().decode())' | python -
14
+
15
+ COPY ./pyproject-poetry.toml ./pyproject.toml
16
+
17
+ # Ensure to get latest ositah version
18
+ RUN poetry add ositah@latest
19
+
20
+ RUN poetry install --no-interaction --no-ansi -vvv
@@ -0,0 +1,13 @@
1
+ version: "3.8"
2
+ services:
3
+ ositah:
4
+ image: ositah
5
+ build: .
6
+ container_name: ositah
7
+ command: "/ositah/.venv/bin/gunicorn --chdir /ositah/conf --config /ositah/conf/ositah.conf.py 'ositah.main:make_app()'"
8
+ volumes:
9
+ - <path to ositah.conf.py>:/ositah/conf/ositah.conf.py
10
+ - <path to ositah.cfg>:/ositah/conf/ositah.cfg
11
+ - ./logs:/ositah/logs
12
+ ports:
13
+ - "7777:7777"
@@ -0,0 +1,16 @@
1
+ [tool.poetry]
2
+ name = "ositah-app"
3
+ version = "1.0"
4
+ description = "Outils de Suivi d'Activités basé sur Hito"
5
+ authors = ["Michel Jouvin"]
6
+ readme = "README.md"
7
+
8
+ [tool.poetry.dependencies]
9
+ python = "^3.11"
10
+ gunicorn = "^20.1.0"
11
+ greenlet = "^2.0.1"
12
+
13
+
14
+ [build-system]
15
+ requires = ["poetry-core"]
16
+ build-backend = "poetry.core.masonry.api"
@@ -55,7 +55,11 @@ def declaration_periods_layout():
55
55
 
56
56
  # Disable creation of a new (next) period if the period matching the current already exists
57
57
  today = date.today().isoformat()
58
- if today >= declaration_periods[-1].start_date and today <= declaration_periods[-1].end_date:
58
+ if (
59
+ len(declaration_periods) > 0
60
+ and today >= declaration_periods[-1].start_date
61
+ and today <= declaration_periods[-1].end_date
62
+ ):
59
63
  current_period_exists = True
60
64
  else:
61
65
  current_period_exists = False
@@ -298,7 +298,7 @@ def build_validation_table(team, team_selection_date, declaration_set: int, peri
298
298
  html.Em(
299
299
  (
300
300
  f"Temps déclarés de l'équipe / total ="
301
- f" {round(selected_declarations['percent_global'].mean(),1)}%"
301
+ f" {round(selected_declarations['percent_global'].mean(), 1)}%"
302
302
  f" (100%={SEMESTER_WEEKS} semaines)"
303
303
  )
304
304
  )
@@ -199,12 +199,16 @@ class ActiviteDetail(db.Model):
199
199
 
200
200
 
201
201
  class OSITAHSession(db.Model):
202
+ __table_args__ = {"mysql_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"}
203
+
202
204
  id = db.Column(db.String(36), primary_key=True)
203
205
  email = db.Column(db.String(255), nullable=False)
204
206
  last_use = db.Column(db.DateTime, nullable=False)
205
207
 
206
208
 
207
209
  class OSITAHValidation(db.Model):
210
+ __table_args__ = {"mysql_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"}
211
+
208
212
  id = db.Column(db.String(36), primary_key=True, default=new_uuid)
209
213
  validated = db.Column(db.Boolean, nullable=False)
210
214
  timestamp = db.Column(db.DateTime, nullable=False)
@@ -221,6 +225,8 @@ class OSITAHValidation(db.Model):
221
225
 
222
226
 
223
227
  class OSITAHValidationPeriod(db.Model):
228
+ __table_args__ = {"mysql_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"}
229
+
224
230
  id = db.Column(db.String(36), primary_key=True, default=new_uuid)
225
231
  name = db.Column(db.String(255), unique=True, nullable=False)
226
232
  start_date = db.Column(db.DateTime, nullable=False)
@@ -229,6 +235,8 @@ class OSITAHValidationPeriod(db.Model):
229
235
 
230
236
 
231
237
  class OSITAHProjectDeclaration(db.Model):
238
+ __table_args__ = {"mysql_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"}
239
+
232
240
  id = db.Column(db.String(36), primary_key=True, default=new_uuid)
233
241
  projet = db.Column(db.String(255), nullable=False)
234
242
  masterprojet = db.Column(db.String(255), nullable=False)
@@ -324,7 +324,7 @@ def ositah_jumbotron(title: str, main_text: str, details: str = None, title_clas
324
324
  return html.Div(
325
325
  dbc.Container(
326
326
  [
327
- html.H1(title, className=f"display-3 {title_class if ( title_class ) else ''}"),
327
+ html.H1(title, className=f"display-3 {title_class if (title_class) else ''}"),
328
328
  html.P(
329
329
  main_text,
330
330
  className="lead",
@@ -1,42 +1,42 @@
1
- import re
2
- from typing import Dict, List
3
-
4
- import pandas as pd
5
-
6
-
7
- def get_hito_teams():
8
- """
9
- Return Hito teams as a Dataframe
10
-
11
- :return: Hito teams
12
- """
13
-
14
- from .hito_db import Team, db
15
-
16
- team_query = Team.query
17
-
18
- teams = pd.read_sql(team_query.statement, con=db.session.bind)
19
-
20
- return teams
21
-
22
-
23
- def get_project_team_ids(team_config: Dict[str, str], project: str) -> List[str]:
24
- """
25
- Return the list of team ID associated with the project based on the configuration passed.
26
- The configuration is a dict where the key is a pattern applied to the project name and
27
- the value is the list of team names.
28
-
29
- :param team_config: dict describing the teams associated with a project
30
- :param project: project name
31
- :return: list of team ids or None if no match is found
32
- """
33
-
34
- for pattern, team_list in team_config.items():
35
- if re.match(pattern, project):
36
- hito_teams = get_hito_teams()
37
- hito_teams["selected"] = False
38
- for team_pattern in team_list:
39
- hito_teams.loc[hito_teams.nom.str.match(f"{team_pattern}$"), "selected"] = True
40
- return hito_teams["id"].to_list()
41
-
42
- return None
1
+ import re
2
+ from typing import Dict, List
3
+
4
+ import pandas as pd
5
+
6
+
7
+ def get_hito_teams():
8
+ """
9
+ Return Hito teams as a Dataframe
10
+
11
+ :return: Hito teams
12
+ """
13
+
14
+ from .hito_db_model import Team, db
15
+
16
+ team_query = Team.query
17
+
18
+ teams = pd.read_sql(team_query.statement, con=db.session.bind)
19
+
20
+ return teams
21
+
22
+
23
+ def get_project_team_ids(team_config: Dict[str, str], project: str) -> List[str]:
24
+ """
25
+ Return the list of team ID associated with the project based on the configuration passed.
26
+ The configuration is a dict where the key is a pattern applied to the project name and
27
+ the value is the list of team names.
28
+
29
+ :param team_config: dict describing the teams associated with a project
30
+ :param project: project name
31
+ :return: list of team ids or None if no match is found
32
+ """
33
+
34
+ for pattern, team_list in team_config.items():
35
+ if re.match(pattern, project):
36
+ hito_teams = get_hito_teams()
37
+ hito_teams["selected"] = False
38
+ for team_pattern in team_list:
39
+ hito_teams.loc[hito_teams.nom.str.match(f"{team_pattern}$"), "selected"] = True
40
+ return hito_teams["id"].to_list()
41
+
42
+ return None
@@ -5,7 +5,6 @@ from typing import List
5
5
 
6
6
  import dash_bootstrap_components as dbc
7
7
  from dash import html
8
- from dateutil.relativedelta import relativedelta
9
8
  from flask import session
10
9
  from flask_sqlalchemy import SQLAlchemy
11
10
  from hito_tools.exceptions import ConfigFileEmpty, ConfigMissingParam
@@ -389,7 +388,7 @@ def define_config_params(file):
389
388
  config["declaration"]["thresholds"] = {"low": 50, "suspect": 75, "good": 100}
390
389
  # Default declaration period date defaults to current day if not explicitly defined
391
390
  if "default_date" not in config["declaration"]:
392
- config["declaration"]["default_date"] = datetime.now() - relativedelta(months=10)
391
+ config["declaration"]["default_date"] = datetime.now()
393
392
  global_params.declaration_options = config["declaration"]
394
393
 
395
394
  if "validation" not in config:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ositah
3
- Version: 24.4.dev1
3
+ Version: 24.7
4
4
  Summary: Outils de Suivi d'Activités basé sur Hito
5
5
  Author-email: Michel Jouvin <michel.jouvin@ijclab.in2p3.fr>
6
6
  License: BSD 3-Clause License
@@ -5,6 +5,9 @@ README.md
5
5
  noxfile.py
6
6
  pyproject.toml
7
7
  setup.py
8
+ docker/Dockerfile
9
+ docker/docker-compose.yml
10
+ docker/pyproject-poetry.toml
8
11
  gunicorn.config/README.md
9
12
  gunicorn.config/gunicorn.ositah
10
13
  gunicorn.config/gunicorn@.service
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ositah"
7
- version = "24.4.dev1"
7
+ version = "24.7"
8
8
  description = "Outils de Suivi d'Activités basé sur Hito"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -31,19 +31,19 @@ dependencies = [
31
31
  ]
32
32
  dynamic = []
33
33
 
34
+ [project.license]
35
+ text = "BSD 3-Clause License"
36
+
34
37
  [[project.authors]]
35
38
  name = "Michel Jouvin"
36
39
  email = "michel.jouvin@ijclab.in2p3.fr"
37
40
 
38
-
39
- [tool]
40
-
41
- [project.license]
42
- text = "BSD 3-Clause License"
43
-
44
41
  [project.urls]
45
42
  Homepage = "https://gitlab.in2p3.fr/hito/ositah"
46
43
  "Bug Tracker" = "https://gitlab.in2p3.fr/hito/ositah/-/issues"
47
44
 
48
45
  [project.scripts]
49
46
  ositah = "ositah.main:main"
47
+
48
+ [tool.setuptools]
49
+ packages = [ "ositah",]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes