Skip to main content

No project description provided

Project description

Python practice field

Just a practice field for making, linting, testing and describing python projects and setting CI/CD for it.

Here is a Docker image that runs FastAPI server with two simple get and post methods.

TO DO:

CI:

Добавить правила для коммитов:

  • мануал шаг с деплоем на тест
  • мануал шаг с деплоем на прод

General:

  • Добавить test coverage
  • Описать все, что происходит в репо в шапке

Requirements

  • python ~3.10

Debug

Clone repo first:

git clone git@github.com:alexnazarv/training-project-api.git

Run without Docker

Install poetry:

pip install poetry==1.5.1

Move to project directory and make a venv:

cd training-project-api && poetry shell

Install dependencies and run the app:

poetry install && poetry run python3 -m app.main

Run with Docker

Build image and run container:

docker build . -t apicontainer -t apicontainer:test &&
docker run -d --rm --name apicontainer -p 8000:8000 apicontainer:test &&
docker rmi $(docker images -f "dangling=true" -q)

Clean up container and image:

docker rm -f apicontainer &&
docker rmi $(docker images apicontainer -q) -f

Run tests

poetry run python3 -m pytest --cov=app

Run linters

poetry run flake8 . && mypy . && isort .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_practice_field-0.0.2.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

python_practice_field-0.0.2-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page