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

1
.gitignore vendored
View File

@@ -9,3 +9,4 @@ cloud-functions/python/functions/__pycache__/
*.png *.png
*.svg *.svg
*.log *.log
scripts/temp/*

View File

@@ -8,6 +8,9 @@
# https://hub.docker.com/r/library/python/tags/ # https://hub.docker.com/r/library/python/tags/
image: python:latest image: python:latest
stages:
- test
# Change pip's cache directory to be inside the project directory since we can # Change pip's cache directory to be inside the project directory since we can
# only cache local items. # only cache local items.
variables: variables:
@@ -24,33 +27,38 @@ before_script:
- virtualenv venv - virtualenv venv
- source venv/bin/activate - source venv/bin/activate
test: unit_test:
stage: test
script: script:
- pip install ruff tox # you can also use tox - pytest
- pip install --editable ".[test]"
- tox -e py,ruff
run: # test:
script: # script:
- pip install . # - pip install ruff tox # you can also use tox
# run the command here # - pip install --editable ".[test]"
artifacts: # - tox -e py,ruff
paths:
- build/*
pages: # run:
script: # script:
- pip install sphinx sphinx-rtd-theme # - pip install .
- cd doc # # run the command here
- make html # artifacts:
- mv build/html/ ../public/ # paths:
artifacts: # - build/*
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
deploy: # pages:
stage: deploy # script:
script: echo "Define your deployment script!" # - pip install sphinx sphinx-rtd-theme
environment: production # - 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 html5lib==1.1
httplib2==0.22.0 httplib2==0.22.0
idna==3.4 idna==3.4
iniconfig==2.0.0
iso8601==2.0.0 iso8601==2.0.0
joblib==1.3.2 joblib==1.3.2
kiwisolver==1.4.5 kiwisolver==1.4.5
@@ -42,6 +43,7 @@ packaging==23.1
pandas==2.0.3 pandas==2.0.3
patsy==0.5.3 patsy==0.5.3
Pillow==10.0.0 Pillow==10.0.0
pluggy==1.3.0
proto-plus==1.22.3 proto-plus==1.22.3
protobuf==4.24.0 protobuf==4.24.0
pyasn1==0.5.0 pyasn1==0.5.0
@@ -55,6 +57,7 @@ pypdf==3.15.4
pypng==0.20220715.0 pypng==0.20220715.0
PyQRCode==1.2.1 PyQRCode==1.2.1
pyserial==3.5 pyserial==3.5
pytest==7.4.4
python-bidi==0.4.2 python-bidi==0.4.2
python-dateutil==2.8.2 python-dateutil==2.8.2
pytz==2023.3 pytz==2023.3