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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file python_practice_field-0.0.2.tar.gz.

File metadata

  • Download URL: python_practice_field-0.0.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1041-azure

File hashes

Hashes for python_practice_field-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1d55aacf5b321d084ad1dbca3388bcbdf8a28c6537a9e67e7443a4144e2f4c8f
MD5 1a837f42920c15fd843ba490645d7e47
BLAKE2b-256 69c164920f2f897fae2d0fc7f5999c4479a5ebcd2d5f79fad5659452c8d8449c

See more details on using hashes here.

File details

Details for the file python_practice_field-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for python_practice_field-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 343581dc91e805cff4d54b31ad2c7444df80eecda3ae3b3557ec31fe43132209
MD5 396047674d8868571414aa3b636933b3
BLAKE2b-256 311202a78f3ddfef3b95906ec5e47b48828e4c2bec48c8c7899842ab18f3c5c7

See more details on using hashes here.

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