Skip to content

Commit f8bb6f6

Browse files
authored
Merge pull request #274 from Rod2Cod/develop
Merge develop in master
2 parents 905293f + d939c6f commit f8bb6f6

140 files changed

Lines changed: 120697 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/coverage.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Update coverage report
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- develop
7+
pull_request:
8+
branches:
9+
- main
10+
- develop
11+
workflow_dispatch:
12+
13+
jobs:
14+
CodeCoverageFrontend:
15+
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
working-directory: ./Artificial_QI/frontend
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Use Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '20'
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Build project
33+
run: npm run build
34+
35+
- name: Run tests and generate coverage
36+
run: npm run test:unit
37+
38+
- name: Upload coverage to Coveralls
39+
uses: coverallsapp/github-action@v2
40+
with:
41+
github-token: ${{ secrets.GITHUB_TOKEN }}
42+
path-to-lcov: ./Artificial_QI/frontend/coverage/lcov.info
43+
CodeCoverageBackend:
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Set up Python 3.x
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: '3.x'
52+
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install -r Artificial_QI/requirements.txt
57+
58+
- name: Pre-download BERT model
59+
run: |
60+
python -c "from transformers import AutoModel; AutoModel.from_pretrained('bert-base-uncased')"
61+
62+
- name: Run tests and generate coverage report
63+
run: |
64+
cd Artificial_QI
65+
coverage run -m pytest
66+
coverage report
67+
coverage xml
68+
- name: Upload coverage to Coveralls
69+
uses: coverallsapp/github-action@v2
70+
71+
CheckCiclomaticComplexity:
72+
runs-on: ubuntu-latest
73+
74+
steps:
75+
- uses: actions/checkout@v4
76+
- name: Set up Python 3.x
77+
uses: actions/setup-python@v5
78+
with:
79+
python-version: '3.x'
80+
81+
- name: Install dependencies
82+
run: |
83+
python -m pip install --upgrade pip
84+
pip install xenon radon
85+
86+
- name: Check ciclomatic complexity
87+
run: |
88+
cd Artificial_QI
89+
xenon --max-absolute B --max-average A -e "test/*" .

.gitignore

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/python
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
3+
4+
### Python ###
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
10+
# C extensions
11+
*.so
12+
13+
# Distribution / packaging
14+
.Python
15+
build/
16+
develop-eggs/
17+
dist/
18+
downloads/
19+
eggs/
20+
.eggs/
21+
lib/
22+
lib64/
23+
parts/
24+
sdist/
25+
var/
26+
wheels/
27+
share/python-wheels/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
MANIFEST
32+
33+
# PyInstaller
34+
# Usually these files are written by a python script from a template
35+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
36+
*.manifest
37+
*.spec
38+
39+
# Installer logs
40+
pip-log.txt
41+
pip-delete-this-directory.txt
42+
43+
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
46+
.nox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
*.py,cover
54+
.hypothesis/
55+
.pytest_cache/
56+
cover/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
db.sqlite3
66+
db.sqlite3-journal
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
.pybuilder/
80+
target/
81+
82+
# Jupyter Notebook
83+
.ipynb_checkpoints
84+
85+
# IPython
86+
profile_default/
87+
ipython_config.py
88+
89+
# pyenv
90+
# For a library or package, you might want to ignore these files since the code is
91+
# intended to run in multiple environments; otherwise, check them in:
92+
# .python-version
93+
94+
# pipenv
95+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
97+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
98+
# install all needed dependencies.
99+
#Pipfile.lock
100+
101+
# poetry
102+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
103+
# This is especially recommended for binary packages to ensure reproducibility, and is more
104+
# commonly ignored for libraries.
105+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
106+
#poetry.lock
107+
108+
# pdm
109+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
110+
#pdm.lock
111+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
112+
# in version control.
113+
# https://pdm.fming.dev/#use-with-ide
114+
.pdm.toml
115+
116+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
117+
__pypackages__/
118+
119+
# Celery stuff
120+
celerybeat-schedule
121+
celerybeat.pid
122+
123+
# SageMath parsed files
124+
*.sage.py
125+
126+
# Environments
127+
.env
128+
.venv
129+
env/
130+
venv/
131+
ENV/
132+
env.bak/
133+
venv.bak/
134+
135+
# Spyder project settings
136+
.spyderproject
137+
.spyproject
138+
139+
# Rope project settings
140+
.ropeproject
141+
142+
# mkdocs documentation
143+
/site
144+
145+
# mypy
146+
.mypy_cache/
147+
.dmypy.json
148+
dmypy.json
149+
150+
# Pyre type checker
151+
.pyre/
152+
153+
# pytype static type analyzer
154+
.pytype/
155+
156+
# Cython debug symbols
157+
cython_debug/
158+
159+
# PyCharm
160+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162+
# and can be added to the global gitignore or merged into this file. For a more nuclear
163+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
164+
#.idea/
165+
166+
### Python Patch ###
167+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
168+
poetry.toml
169+
170+
# ruff
171+
.ruff_cache/
172+
173+
# LSP config files
174+
pyrightconfig.json
175+
176+
# End of https://www.toptal.com/developers/gitignore/api/python
177+
178+
# POSTGRESQL DOCKER
179+
# escludo .gitkeep per mantenere la cartella
180+
Artificial_QI/db/db_data/*
181+
!Artificial_QI/db/db_data/.gitkeep
182+
Artificial_QI/db/pgadmin_data/*
183+
!Artificial_QI/db/pgadmin_data/.gitkeep
184+
185+
# IDE
186+
.vscode/
187+
.idea/
188+
189+
# modelli joblib
190+
*.joblib
191+
192+
# File di prova
193+
prova*

Artificial_QI/.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# No test
2+
.pytest_cache/
3+
test/**/__pycache__/
4+
test/
5+
# No db
6+
db_data/
7+
pgadmin_data/
8+
# No frontend
9+
frontend/public/
10+
src/**/__pycache__/
11+
# No file runtime python
12+
__pycache__/
13+
*.pyc
14+
*.pyo
15+
*.pyd
16+
# No altri file
17+
*.DS_Store
18+
# No file progettazione starUML
19+
*.mdj
20+
# No file configurazione Github Actions
21+
*.toml
22+
*.cfg
23+
# No training model files
24+
trainModel/

Artificial_QI/Dockerfile.backend

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Use a Python base image
2+
FROM python:3.13
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Copy requirements file
8+
COPY requirements.txt .
9+
10+
# Install PostgreSQL development libraries
11+
RUN apt-get update && apt-get install -y --no-install-recommends \
12+
libpq-dev \
13+
gcc \
14+
&& rm -rf /var/lib/apt/lists/*
15+
16+
# Install dependencies
17+
RUN pip install --no-cache-dir -r requirements.txt
18+
19+
# Copy application code (excluding frontend directory if it exists)
20+
COPY . .
21+
22+
# Expose port for the backend service
23+
EXPOSE 8080
24+
25+
# Command to run the application
26+
CMD ["waitress-serve", "--host", "0.0.0.0", "--call", "application:create_app"]

0 commit comments

Comments
 (0)