Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reglas ruff #20

Open
wants to merge 97 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
15eadfc
[Integrantes] Se añadio al alumno chesini Pablo
pchesini Apr 24, 2024
c3cd0cf
[Integrantes] Se añadio al alumno Scianca Manuel
ManuelScianca Apr 24, 2024
6ce7246
[Integrantes] Se añadio al alumno Da Silva Franco
fdasilva5 Apr 26, 2024
15b66cc
[Integrantes]Se añadio al alumno Lucich Francisco
franlucich Apr 27, 2024
a77a277
[Integrantes] Arreglo error de case sensitivity en el readme
franlucich Apr 27, 2024
ca4e762
añado modelo veterinario
franlucich Apr 27, 2024
59e5380
agrego migracion para el modelo vet
franlucich Apr 27, 2024
ebd99e3
añado funcionalidad listar veterianarios, con su view, url y template
franlucich Apr 27, 2024
8872dba
agrego boton veterinarios a template home
franlucich Apr 28, 2024
502f32f
añado alta veterinarios, fix en la tabla de vets_repo
franlucich Apr 28, 2024
cb7026c
validaciones basicas alta veterinarios
franlucich Apr 28, 2024
2a27980
añado funcionalidad editar veterinarios, reutilizando el template del…
franlucich Apr 28, 2024
3763eca
funcionalidad eliminar veterinarios
franlucich Apr 28, 2024
8f6e3ee
agrego clase Product a models con metodos de clase
ManuelScianca Apr 28, 2024
c6f3049
agrego validaciones a la clase Product
ManuelScianca Apr 28, 2024
92c7a68
agrego la migracion del modelo Product
ManuelScianca Apr 28, 2024
1cd18d6
creo el template de products
ManuelScianca Apr 28, 2024
5d44b32
añado el repository de productos en views y en las urls
ManuelScianca Apr 28, 2024
ff9dbd1
agrego el boton de Productos en home
ManuelScianca Apr 28, 2024
f889dc2
agrego formulario para agregar productos
ManuelScianca Apr 28, 2024
b5a47cb
completo el repository de productos
ManuelScianca Apr 28, 2024
ce8e6a1
añado el formulario de productos a las vistas
ManuelScianca Apr 28, 2024
3806b1a
añado la funcionalidad eliminar productos a las vistas
ManuelScianca Apr 28, 2024
0fda8cf
añado el path para crear productos a urls
ManuelScianca Apr 28, 2024
73c8577
fix en form.html y rehago migracion de Product por error en el precio
ManuelScianca Apr 28, 2024
4be8580
agrego los paths para editar y elimianr productos a urls
ManuelScianca Apr 28, 2024
c695288
modifico el input type en el formulario de productos
ManuelScianca Apr 28, 2024
92faa73
cambio el ícono de productos en home
ManuelScianca Apr 28, 2024
a8025ff
fix en repository.html para correcto listado
ManuelScianca Apr 29, 2024
adb9458
merge de main hacia abm/product
ManuelScianca Apr 29, 2024
f4af547
Agrego el modelo provider
fdasilva5 Apr 29, 2024
8040cc3
Agrego migraciones para provider
fdasilva5 Apr 29, 2024
3fc5b13
[abm/medicine]:Se creó el template de medicine junto con el formulari…
pchesini Apr 29, 2024
03380a3
Agrego templates de proveedores
fdasilva5 Apr 29, 2024
301bb18
Agregado de métodos para crear y actualizar instancias del objeto Med…
pchesini Apr 29, 2024
76bd245
[abm/medicine]:Agregado enlace y tarjeta para la sección de Medicina …
pchesini Apr 29, 2024
e5b96ab
modifico la migracion de vet
ManuelScianca Apr 29, 2024
703b5bc
[abm/medicine]: fix en la views.py de medicine
pchesini Apr 29, 2024
8f67b35
[abm/medicine]: migracion del modelo medicine
pchesini Apr 29, 2024
9152441
[abm/medicine]: fix en views.py
pchesini Apr 29, 2024
a7f403c
Se agregaron views y urls
fdasilva5 Apr 30, 2024
0aac262
merge de main
fdasilva5 Apr 30, 2024
182b29f
[abm/medicine] fix y validaciones en el form
pchesini Apr 30, 2024
a3f8f19
fix de las columnas de home.html
ManuelScianca Apr 30, 2024
349dd44
[abm/medicine]Se corrigieron conflicto del merge a la rama abm/medicine
pchesini Apr 30, 2024
50d1012
[abm/medicine]Se reinicio migraciones y recreao base de datos desde …
pchesini Apr 30, 2024
d65c9ce
merge de rama main a abm/product y fix de validacion de product
ManuelScianca Apr 30, 2024
d911adb
fix en la validacion del campo price en product
ManuelScianca May 2, 2024
a23bf1f
agrego el contenido original del README
ManuelScianca May 12, 2024
5163974
dockerfile creado
franlucich May 12, 2024
ed6e813
se agregan comentarios detallados
franlucich May 12, 2024
a8140eb
instrucciones docker en readme y dockerignore
franlucich May 12, 2024
0776a01
fix readme link de localhost
franlucich May 12, 2024
a51aa6e
se implementa el uso de variables de entorno
franlucich May 12, 2024
9279734
se crea un entrypoint para iniciar el contenedor con un script
ManuelScianca May 16, 2024
146ce08
Comentarios en el archivo env-example
fdasilva5 May 19, 2024
0f31d60
[test unitarios] Agregadas pruebas en el modelo para asegurar la func…
pchesini May 25, 2024
3946494
fix corrigiendo imporatciones
pchesini May 25, 2024
1f371a3
agrego el guardado a la modificacion de un producto
ManuelScianca May 25, 2024
da18e6d
arreglo la sintaxis del save un producto
ManuelScianca May 25, 2024
35a0e51
agrego la clase is-invalid para mostrar mensaje de error en el precio…
ManuelScianca May 25, 2024
2d45b1e
agrego la validación del precio en el update de producto
ManuelScianca May 25, 2024
84fbefa
hago el test de unidad y manejo la validación del precio con excepciones
ManuelScianca May 25, 2024
1a72d0b
[Pruebas de integracion] Comprueba que las dosis esten dentro de los…
pchesini May 25, 2024
1cb9b1e
agrego enum de specialty al modelo de vet
franlucich May 26, 2024
bd028c0
añado select con las especialidades a los formularios y agrego especi…
franlucich May 26, 2024
15e1dbf
defino label en el TextChoices de especialidad y agrego test unitario…
franlucich May 26, 2024
b8fcdf0
agrego casos de test de valores del precio
ManuelScianca May 26, 2024
5579ce8
añado los tests de integración
ManuelScianca May 26, 2024
22e9dfc
realizo el test de integración
ManuelScianca May 26, 2024
53b060d
agrego test de integracion que asegure que se muestre la especialidad
franlucich May 26, 2024
ca71021
Agrego el atributo address a proveedor
fdasilva5 May 26, 2024
f385092
Actualizo templates de proveedor
fdasilva5 May 26, 2024
3885a80
test e2e para vets
franlucich May 26, 2024
d33aacb
Agrego test de unidad para proveedor
fdasilva5 May 26, 2024
a264b86
Agrego testo de integracion para proveedor
fdasilva5 May 26, 2024
9f1a72b
reescribo los tests de Cliente previamente sobreescritos
ManuelScianca May 26, 2024
a763aec
Agrego test e2e para Provider
fdasilva5 May 26, 2024
76b55fb
Arreglo error de tipeo
fdasilva5 May 26, 2024
5f03914
[test e2n] se agregan las validaciones de crear, ver errores y edita…
pchesini May 26, 2024
fd7f397
[Pruebas de integracion]Implemento el uso de Asserts
pchesini May 26, 2024
54e76bc
Merge pull request #4 from pchesini/feature/validación_precio
ManuelScianca May 26, 2024
da84f5c
Merge branch 'main' into feature/especialidad_veterinario
franlucich May 27, 2024
714ec93
Merge pull request #6 from pchesini/feature/especialidad_veterinario
franlucich May 27, 2024
e7cf531
Merge branch 'main' into feature/direccion_proveedor
fdasilva5 May 27, 2024
482421e
Mergeo migraciones
fdasilva5 May 27, 2024
9d8c071
Merge pull request #7 from pchesini/feature/direccion_proveedor
franlucich May 27, 2024
e81ea9b
Merge branch 'main' into feature/validacion_dosis
pchesini May 27, 2024
ae121b5
Merge pull request #8 from pchesini/feature/validacion_dosis
franlucich May 27, 2024
a5c8bfd
agrego action de integracion continua
franlucich Jun 2, 2024
f3db804
cambios en las variables de entorno para deployar en render, agrego a…
franlucich Jun 2, 2024
52c12c4
agrego action para entrega continua
franlucich Jun 2, 2024
904cc02
Se agrego la regla COM812 para comas faltantes
pchesini Jun 2, 2024
d223a18
Se corrigio el faltante de la coma luego de detectarlo con el ruff c…
pchesini Jun 2, 2024
8eb3660
Comente la linea donde se agrego la coma para mejor visualizacion
pchesini Jun 2, 2024
bb475b9
Se corrigieron comas falntes despues de ejecutar ruff check
pchesini Jun 3, 2024
61e5cc4
De acuerdo al comentario en PR, se agrega regla al archivo correcto
pchesini Jun 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
README.MD
Dockerfile
.git
.ruff
.gitignore
.editorconfig
__pycache__
functional_tests
.env
37 changes: 37 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: cd

on:
release:
types: [published]

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest

steps:
- name: check out code
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Get the date
run: echo "date=$(date '+%Y%m%d%H%M%S')" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/vetsoft:latest,${{ secrets.DOCKERHUB_USERNAME }}/vetsoft:${{ env.date }}

- name: Deploy
run: curl ${{ secrets.RENDER_HOOK }}
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ci

on:
pull_request:
branches: [main]

jobs:
tests:
name: tests
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt

- name: Install playwright
run: python -m playwright install --with-deps firefox

- name: Run static test
run: ruff check

- name: Run unit and integration tests
run: coverage run --source="./app" --omit="./app/migrations/**" manage.py test app

- name: Check coverage
run: coverage report --fail-under=92

- name: Run e2e tests
run: python manage.py test functional_tests
5 changes: 3 additions & 2 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ exclude = [
"node_modules",
"site-packages",
"venv",
"migrations"
"migrations",
"test*"
]

# Same as Black.
Expand All @@ -38,7 +39,7 @@ target-version = "py38"

[lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
select = ["E4", "E7", "E9", "F"]
select = ["E4", "E7", "E9", "F","COM812"]
ignore = []

# Allow fix for all enabled rules (when `--fix`) is provided.
Expand Down
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#Usamos como base la imagen oficial de python slim
FROM python:3.12-slim

#Establecemos el directorio de trabajo dentro del contenedor
WORKDIR /app

#Copiamos los requerimientos al directorio de trabajo
COPY requirements.txt .

#Instalamos los paquetes requeridos dentro del contenedor
RUN pip install --no-cache-dir -r requirements.txt

#Copiamos el resto de la aplicacion
COPY . .

#Exponemos el puerto para poder acceder desde afuera del contenedor
EXPOSE 8000

#Corremos el comando para iniciar la aplicacion
#CMD [ "python", "manage.py","runserver","0.0.0.0:8000" ]

# Copiamos el script de entrypoint y le damos permisos de ejecución
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh

# Ejecutamos el script de entrypoint cuando se enciende el contenedor
ENTRYPOINT ["entrypoint.sh"]



42 changes: 42 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Vetsoft

Aplicación web para veterinarias utilizada en la cursada 2024 de Ingeniería y Calidad de Software. UTN-FRLP

## Integrantes

- Chesini Pablo
- Da Silva Franco
- Lucich Francisco
- Scianca Manuel

## Dependencias

- python 3
- Django
- sqlite
- playwright
- ruff

## Instalar dependencias

`pip install -r requirements.txt`

## Iniciar la Base de Datos

`python manage.py migrate`

## Iniciar app

`python manage.py runserver`

## Construir imagen docker

`docker build -t vetsoft-app:1.0 .`

## Desplegar contenedor

Antes de desplegar debemos crea el archivo .env en la raiz del repositorio y completarlo, para hacerlo se puede seguir el .env-example

`docker run -d -p 8000:8000 --env-file .env --name "Vetsoft" vetsoft-app:1.0`

Luego se puede acceder a la aplicacion desde localhost:8000
24 changes: 0 additions & 24 deletions README.md

This file was deleted.

44 changes: 40 additions & 4 deletions app/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 5.0.4 on 2024-04-20 18:47
# Generated by Django 5.0.4 on 2024-04-30 19:00

from django.db import migrations, models

Expand All @@ -12,12 +12,48 @@ class Migration(migrations.Migration):

operations = [
migrations.CreateModel(
name='Cliente',
name='Client',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('nombre', models.CharField(max_length=100)),
('telefono', models.CharField(max_length=15)),
('name', models.CharField(max_length=100)),
('phone', models.CharField(max_length=15)),
('email', models.EmailField(max_length=254)),
('address', models.CharField(blank=True, max_length=100)),
],
),
migrations.CreateModel(
name='Medi',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('description', models.TextField()),
('dose', models.IntegerField()),
],
),
migrations.CreateModel(
name='Product',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('type', models.CharField(max_length=100)),
('price', models.FloatField()),
],
),
migrations.CreateModel(
name='Provider',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('email', models.EmailField(max_length=254)),
],
),
migrations.CreateModel(
name='Vet',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('email', models.EmailField(max_length=254)),
('phone', models.CharField(max_length=15)),
],
),
]
26 changes: 0 additions & 26 deletions app/migrations/0002_client_delete_cliente.py

This file was deleted.

18 changes: 18 additions & 0 deletions app/migrations/0002_provider_address.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.0.4 on 2024-05-26 19:22

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('app', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='provider',
name='address',
field=models.CharField(blank=True, max_length=100),
),
]
18 changes: 18 additions & 0 deletions app/migrations/0002_vet_specialty.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.0.4 on 2024-05-26 04:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('app', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='vet',
name='specialty',
field=models.CharField(choices=[('Sin especialidad', 'Sin Especialidad'), ('Cardiología', 'Cardiologia'), ('Medicina interna de pequeños animales', 'Medicina Interna Pequenos Animales'), ('Medicina interna de grandes animales', 'Medicina Interna Grandes Animales'), ('Neurología', 'Neurologia'), ('Oncología', 'Oncologia'), ('Nutrición', 'Nutricion')], default='Sin especialidad', max_length=100),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 5.0.4 on 2024-05-27 00:27

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('app', '0002_provider_address'),
('app', '0002_vet_specialty'),
]

operations = [
]
Loading