add pytest

This commit is contained in:
Pritimay Sarkar
2024-01-17 15:33:40 +05:30
parent 6f4ba44e48
commit 1025a92337
3 changed files with 39 additions and 27 deletions

3
.gitignore vendored
View File

@@ -8,4 +8,5 @@ cloud-functions/python/functions/__pycache__/
*.pkl
*.png
*.svg
*.log
*.log
scripts/temp/*

View File

@@ -8,6 +8,9 @@
# https://hub.docker.com/r/library/python/tags/
image: python:latest
stages:
- test
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
@@ -24,33 +27,38 @@ before_script:
- virtualenv venv
- source venv/bin/activate
test:
unit_test:
stage: test
script:
- pip install ruff tox # you can also use tox
- pip install --editable ".[test]"
- tox -e py,ruff
- pytest
run:
script:
- pip install .
# run the command here
artifacts:
paths:
- build/*
# test:
# script:
# - pip install ruff tox # you can also use tox
# - pip install --editable ".[test]"
# - tox -e py,ruff
pages:
script:
- pip install sphinx sphinx-rtd-theme
- cd doc
- make html
- mv build/html/ ../public/
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# run:
# script:
# - pip install .
# # run the command here
# artifacts:
# paths:
# - build/*
deploy:
stage: deploy
script: echo "Define your deployment script!"
environment: production
# pages:
# script:
# - pip install sphinx sphinx-rtd-theme
# - cd doc
# - make html
# - mv build/html/ ../public/
# artifacts:
# paths:
# - public
# rules:
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# deploy:
# stage: deploy
# script: echo "Define your deployment script!"
# environment: production

View File

@@ -29,6 +29,7 @@ grpcio-status==1.57.0
html5lib==1.1
httplib2==0.22.0
idna==3.4
iniconfig==2.0.0
iso8601==2.0.0
joblib==1.3.2
kiwisolver==1.4.5
@@ -42,6 +43,7 @@ packaging==23.1
pandas==2.0.3
patsy==0.5.3
Pillow==10.0.0
pluggy==1.3.0
proto-plus==1.22.3
protobuf==4.24.0
pyasn1==0.5.0
@@ -55,6 +57,7 @@ pypdf==3.15.4
pypng==0.20220715.0
PyQRCode==1.2.1
pyserial==3.5
pytest==7.4.4
python-bidi==0.4.2
python-dateutil==2.8.2
pytz==2023.3