Handle file zipping for DataMap.
- Docker
- Docker Compose
Use Makefile targets to make your life easier!
- Start docker containers
make ENV={env} docker-run- If you need to delete the docker containers
make ENV={env} docker-downObs.: this will delete the containers, but not the images generated nor the database data, since it uses a docker volume to persistently storage data.
- Start the application
make ENV={env} python-runWe are using unittest. See examples at https://docs.python.org/3/library/unittest.html
To run all tests from command line, use:
python -m unittest discover -p "*_test.py"or:
make ENV=local python-testTo generage the code coverage reports, use:
# Run the tests and generage the .coverage file
coverage run -m unittest discover -p "*_test.py"
# Print the coverage report on console
coverage report
# Generate the coverage report in html
coverage htmlWARNING: The current deployment process causes downtime for services.
# Connect to USP infra
ssh [email protected] -p 5010
# Navegate to the project folder
cd zipper
# Get the last (main) branch version
git pull
# Start python virtual env
python3 -m venv venv
. venv/bin/activate
# Install libraries
make ENV={env} python-pip-install
# Deactivate python virtual env
deactivate
# Refresh and deploy the last docker image.
make docker-deployment- Backend:
https://datamap.pcs.usp.br/zipper/api/v1/docs
This projects uses Ruff to manage code style, linter and formatting.
- To check code style problems:
ruff check - To auto-fix some problems:
ruff check --fix - To format files:
ruff format