Skip to content
Snippets Groups Projects
Commit d52aa2cc authored by Antoine Gaudron-Desjardins's avatar Antoine Gaudron-Desjardins
Browse files

setup linter

parent 1d0e3c2a
Branches
No related tags found
1 merge request!6Ci
Pipeline #43653 failed
...@@ -91,7 +91,7 @@ lint: ...@@ -91,7 +91,7 @@ lint:
- source ./venv/bin/activate - source ./venv/bin/activate
- pip install pycodestyle - pip install pycodestyle
script: script:
- pycodestyle --show-source --show-pep8 ./backend - pycodestyle --config=./backend ./backend
test: test:
......
...@@ -18,6 +18,12 @@ Navigate to [http://localhost:3001](http://localhost:3001) ...@@ -18,6 +18,12 @@ Navigate to [http://localhost:3001](http://localhost:3001)
<br/> <br/>
### *Le linter*
So the new commits can be deployed, you'll need to use the linter from backend :
`pycodestyle --config=./setup.cnf --exclude=./env ./`
<br/>
## In production mode ## In production mode
Build the docker image : `docker-compose build` Build the docker image : `docker-compose build`
Run the server, `docker-compose up -d` Run the server, `docker-compose up -d`
......
...@@ -7,8 +7,7 @@ from db import models, schemas ...@@ -7,8 +7,7 @@ from db import models, schemas
def get_records(place: str, db: Session): def get_records(place: str, db: Session):
""" Get all the records for the given place """ """ Get all the records for the given place """
records = db.query(models.Records).filter( records = db.query(models.Records).filter(models.Records.place == place).order_by(models.Records.date.desc()).all()
models.Records.place == place).order_by(models.Records.date.desc()).all()
return records return records
......
...@@ -9,7 +9,13 @@ import os ...@@ -9,7 +9,13 @@ import os
# load environment variables # load environment variables
load_dotenv() load_dotenv()
SQLALCHEMY_DATABASE_URL = f"mysql+pymysql://{os.getenv('MYSQL_USER')}:{os.getenv('MYSQL_PASSWORD')}@{os.getenv('DB_HOST')}:{os.getenv('DB_PORT')}/{os.getenv('MYSQL_DATABASE')}?charset=utf8" user = os.getenv('MYSQL_USER')
password = os.getenv('MYSQL_PASSWORD')
host = os.getenv('DB_HOST')
port = os.getenv('DB_PORT')
database = os.getenv('MYSQL_DATABASE')
SQLALCHEMY_DATABASE_URL = f"mysql+pymysql://{user}:{password}@{host}:{port}/{database}?charset=utf8"
engine = create_engine(SQLALCHEMY_DATABASE_URL) engine = create_engine(SQLALCHEMY_DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
......
[pycodestyle]
max-line-length = 160
\ No newline at end of file
...@@ -23,6 +23,7 @@ def norm_by_imagenet(img): ...@@ -23,6 +23,7 @@ def norm_by_imagenet(img):
print('Wrong shape of the input.') print('Wrong shape of the input.')
return None return None
def fix_singular_shape(img, unit_len=16): def fix_singular_shape(img, unit_len=16):
""" """
Some network like w-net has both N maxpooling layers and concatenate layers, Some network like w-net has both N maxpooling layers and concatenate layers,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment