ositah 24.2.dev1__tar.gz → 24.7.dev1__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.

Potentially problematic release.


This version of ositah might be problematic. Click here for more details.

Files changed (79) hide show
  1. {ositah-24.2.dev1/ositah.egg-info → ositah-24.7.dev1}/PKG-INFO +1 -1
  2. ositah-24.7.dev1/docker/Dockerfile +20 -0
  3. ositah-24.7.dev1/docker/docker-compose.yml +13 -0
  4. ositah-24.7.dev1/docker/pyproject-poetry.toml +16 -0
  5. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/configuration/main.py +5 -1
  6. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/main.py +2 -4
  7. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/ositah.example.cfg +1 -1
  8. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/menus.py +1 -1
  9. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/teams.py +42 -42
  10. {ositah-24.2.dev1 → ositah-24.7.dev1/ositah.egg-info}/PKG-INFO +1 -1
  11. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah.egg-info/SOURCES.txt +3 -0
  12. {ositah-24.2.dev1 → ositah-24.7.dev1}/pyproject.toml +4 -1
  13. {ositah-24.2.dev1 → ositah-24.7.dev1}/.gitignore +0 -0
  14. {ositah-24.2.dev1 → ositah-24.7.dev1}/.gitlab-ci.yml +0 -0
  15. {ositah-24.2.dev1 → ositah-24.7.dev1}/LICENSE +0 -0
  16. {ositah-24.2.dev1 → ositah-24.7.dev1}/README.md +0 -0
  17. {ositah-24.2.dev1 → ositah-24.7.dev1}/gunicorn.config/README.md +0 -0
  18. {ositah-24.2.dev1 → ositah-24.7.dev1}/gunicorn.config/gunicorn.ositah +0 -0
  19. {ositah-24.2.dev1 → ositah-24.7.dev1}/gunicorn.config/gunicorn@.service +0 -0
  20. {ositah-24.2.dev1 → ositah-24.7.dev1}/gunicorn.config/ositah.conf.py +0 -0
  21. {ositah-24.2.dev1 → ositah-24.7.dev1}/noxfile.py +0 -0
  22. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/__init__.py +0 -0
  23. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/app.py +0 -0
  24. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/__init__.py +0 -0
  25. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/analysis.py +0 -0
  26. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/configuration/__init__.py +0 -0
  27. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/configuration/callbacks.py +0 -0
  28. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/configuration/parameters.py +0 -0
  29. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/configuration/tools.py +0 -0
  30. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/export.py +0 -0
  31. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/validation/__init__.py +0 -0
  32. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/validation/callbacks.py +0 -0
  33. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/validation/main.py +0 -0
  34. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/validation/parameters.py +0 -0
  35. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/validation/tables.py +0 -0
  36. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/apps/validation/tools.py +0 -0
  37. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/assets/arrow_down_up.svg +0 -0
  38. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/assets/ositah.css +0 -0
  39. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/assets/sort_ascending.svg +0 -0
  40. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/assets/sort_descending.svg +0 -0
  41. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/assets/sorttable.js +0 -0
  42. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/static/style.css +0 -0
  43. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/templates/base.html +0 -0
  44. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/templates/bootstrap_login.html +0 -0
  45. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/templates/login_form.html +0 -0
  46. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/__init__.py +0 -0
  47. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/agents.py +0 -0
  48. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/authentication.py +0 -0
  49. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/cache.py +0 -0
  50. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/core.py +0 -0
  51. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/exceptions.py +0 -0
  52. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/hito_db.py +0 -0
  53. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/hito_db_model.py +0 -0
  54. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/period.py +0 -0
  55. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/projects.py +0 -0
  56. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah/utils/utils.py +0 -0
  57. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah.egg-info/dependency_links.txt +0 -0
  58. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah.egg-info/entry_points.txt +0 -0
  59. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah.egg-info/requires.txt +0 -0
  60. {ositah-24.2.dev1 → ositah-24.7.dev1}/ositah.egg-info/top_level.txt +0 -0
  61. {ositah-24.2.dev1 → ositah-24.7.dev1}/setup.cfg +0 -0
  62. {ositah-24.2.dev1 → ositah-24.7.dev1}/setup.py +0 -0
  63. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/README.md +0 -0
  64. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/accordion.py +0 -0
  65. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/authentication.py +0 -0
  66. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/checkbox.py +0 -0
  67. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/checklist.py +0 -0
  68. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/file-selector.py +0 -0
  69. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/file-upload.py +0 -0
  70. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/long_running_callback.py +0 -0
  71. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/pandas_split.py +0 -0
  72. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/pandas_split_bug_report.py +0 -0
  73. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/pattern-matching-callback.py +0 -0
  74. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/progess_bar.py +0 -0
  75. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/reset_table_checkboxes.py +0 -0
  76. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/sortable_table.py +0 -0
  77. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/sqlalchemy_test.py +0 -0
  78. {ositah-24.2.dev1 → ositah-24.7.dev1}/test-dash/templates/base.html +0 -0
  79. {ositah-24.2.dev1 → ositah-24.7.dev1}/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.2.dev1
3
+ Version: 24.7.dev1
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
@@ -117,7 +117,7 @@ def url_not_found(path):
117
117
  # valid role missing jumbotron
118
118
  def valid_role_missing(msg):
119
119
  return ositah_jumbotron(
120
- "You don't havea valid Hito role to OSITAH",
120
+ "You don't have a valid Hito role to OSITAH",
121
121
  msg,
122
122
  title_class="text-warning",
123
123
  )
@@ -204,9 +204,7 @@ def render_page_content(pathname, login_menu):
204
204
  if not user_session_data.agent_teams:
205
205
  if role == HITO_ROLE_TEAM_MGR:
206
206
  # For a team manager, show only the teams he/she is a manager
207
- teams = Team.query.filter(
208
- Team.managers.any(email_auth=session["user_email"])
209
- ).all()
207
+ teams = Team.query.filter(Team.managers.any(email=session["user_email"])).all()
210
208
  if len(teams) == 0:
211
209
  # A user with role ROLE_RESP but is not the manager of any team is degraded
212
210
  # to ROLE_AGENT
@@ -85,7 +85,7 @@ server:
85
85
  # Options related to declarations
86
86
  declaration:
87
87
  # Default date must be a date included into the selected validation period. It is a default, if no other explicitly select
88
- default_date: 2021-07-01
88
+ #default_date: 2021-07-01
89
89
  # max_hours specifies the upper valid value for activities declared in hours
90
90
  max_hours: 400
91
91
  # Agent statut whose declaration is not mandatory
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ositah
3
- Version: 24.2.dev1
3
+ Version: 24.7.dev1
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.2.dev1"
7
+ version = "24.7.dev1"
8
8
  description = "Outils de Suivi d'Activités basé sur Hito"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -47,3 +47,6 @@ Homepage = "https://gitlab.in2p3.fr/hito/ositah"
47
47
 
48
48
  [project.scripts]
49
49
  ositah = "ositah.main:main"
50
+
51
+ [tool.setuptools]
52
+ py-modules = [ "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