From a49fc88a4b7b452942446eb3d7b41de7e0548016 Mon Sep 17 00:00:00 2001 From: dangannn Date: Mon, 14 Oct 2024 11:44:13 +0300 Subject: [PATCH 1/4] fix: read.me --- README.md | 72 ++++++++++++++++++++++++++++++++++++++++++++++++-- pyproject.toml | 1 + 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eb72a4de..94195eea 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,9 @@ 🔑 Copy `.env.example` to `.env` and change api settings ### Install dependencies - -* 🐍 Install poetry with command `pip install poetry` +Before installing dependencies, make sure that you have python 3.11 (see the recommendations section below) + +* 🐍 Install poetry with command `pip install poetry==1.2.2` * 📎 Install dependencies with command `poetry install` ### Accept migrations @@ -22,6 +23,73 @@ ### Run project 🚀 Run project via `python manage.py runserver` + +## Recommendations + +### 1.Installing Pyenv + +Clone Pyenv from the official GitHub repository: + +```zsh +curl https://pyenv.run | bash +``` + +Add Pyenv to your shell profile (e.g., .bashrc, .bash_profile, or .zshrc): + +```zsh +export PATH="$HOME/.pyenv/bin:$PATH"eval "$(pyenv init --path)" +eval "$(pyenv init -)" +eval "$(pyenv virtualenv-init -)" +``` + +Apply changes to your shell environment: + +```zsh +source ~/.bashrc # or equivalent profile, e.g., for Zsh use .zshrc +``` + +Verify Pyenv is installed correctly: + +pyenv --version + +### 2. Installing Python 3.11 + +Once Pyenv is set up, you can install Python 3.11 with the following steps: + +Install Python 3.11: + +```zsh +pyenv install 3.11.0 +``` + +Verify Python 3.11 has been installed: + +pyenv versions + +### 3. Setting Python 3.11 as the Default Version + +To set Python 3.11 as the default global version, use the following command: + +```zsh +pyenv global 3.11.0 +``` + +This will switch your system's Python interpreter to use Python 3.11 by default. + +### 4. Verification + +Check that Python 3.11 is now the active version: + +```zsh +python --version +``` + +You should see: + +```zsh +Python 3.11.0 +``` + ## For developers ### Install pre-commit hooks diff --git a/pyproject.toml b/pyproject.toml index a7185ae6..cea0e384 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ packages = [] [tool.poetry.dependencies] python = "^3.11" +poetry = { version = "1.2.2", optional = true } djangorestframework = "^3.14.0" flake8 = "^5.0.4" python-decouple = "^3.6" From 7dc88828f18f31d7e1e4805711bc248de8f376a5 Mon Sep 17 00:00:00 2001 From: dangannn Date: Sun, 16 Mar 2025 21:22:14 +0300 Subject: [PATCH 2/4] feat: docker fixes to pr --- .env.example | 12 ++++++------ Dockerfile | 2 ++ Makefile | 4 +++- README.md | 4 ++++ docker-compose.yml | 1 + pyproject.toml | 1 - 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index 13e8e71d..57d789f9 100644 --- a/.env.example +++ b/.env.example @@ -1,10 +1,10 @@ -DEBUG= -DJANGO_SECRET_KEY= +DEBUG=True +DJANGO_SECRET_KEY=examplekey EMAIL_USER= EMAIL_PASSWORD= -EMAIL_HOST= -EMAIL_PORT= +EMAIL_HOST=1 +EMAIL_PORT=1 SENTRY_DSN= @@ -14,7 +14,7 @@ DATABASE_PASSWORD= DATABASE_HOST= DATABASE_PORT= -SELECTEL_ACCOUNT_ID= +SELECTEL_ACCOUNT_ID=-1 SELECTEL_CONTAINER_NAME= SELECTEL_CONTAINER_PASSWORD= SELECTEL_CONTAINER_USERNAME= @@ -26,4 +26,4 @@ TELEGRAM_BOT_TOKEN= TELEGRAM_CHANNEL= CLICKUP_API_TOKEN= -CLICKUP_SPACE_ID= +CLICKUP_SPACE_ID=-1 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 516d3605..3d4c13c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ FROM python:3.11 RUN apt update --no-install-recommends -y +RUN apt install -y cmake +RUN rm -rf /var/lib/apt/lists/* ENV PYTHONFAULTHANDLER=1 \ PYTHONUNBUFFERED=1 \ diff --git a/Makefile b/Makefile index 5832d918..d5c5a99f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ up: docker compose -f docker-compose.yml up -d down: - docker compose -f docker-compose.yml down \ No newline at end of file + docker compose -f docker-compose.yml down +build: + docker compose -f docker-compose.yml build \ No newline at end of file diff --git a/README.md b/README.md index 94195eea..0b6c44b0 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ Before installing dependencies, make sure that you have python 3.11 (see the rec 🚀 Run project via `python manage.py runserver` +### Run project in docker + +You can run project in docker with commands from Makefile (e.g. `make up`) + ## Recommendations ### 1.Installing Pyenv diff --git a/docker-compose.yml b/docker-compose.yml index 0bbeda3c..998a7b73 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: command: bash ./scripts/startup.sh volumes: - ./log:/procollab/log + - ./:/procollab/. env_file: - .env environment: diff --git a/pyproject.toml b/pyproject.toml index cea0e384..a7185ae6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,6 @@ packages = [] [tool.poetry.dependencies] python = "^3.11" -poetry = { version = "1.2.2", optional = true } djangorestframework = "^3.14.0" flake8 = "^5.0.4" python-decouple = "^3.6" From 67d936ff8f544da701f27effb5a72ae8a68ea019 Mon Sep 17 00:00:00 2001 From: dangannn Date: Sun, 16 Mar 2025 21:26:41 +0300 Subject: [PATCH 3/4] fix: docs --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0b6c44b0..c554a2a6 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Before installing dependencies, make sure that you have python 3.11 (see the rec * 🐍 Install poetry with command `pip install poetry==1.2.2` * 📎 Install dependencies with command `poetry install` +* 🐚 Активируйте виртуальное окружение: `poetry shell` ### Accept migrations @@ -63,7 +64,7 @@ Once Pyenv is set up, you can install Python 3.11 with the following steps: Install Python 3.11: ```zsh -pyenv install 3.11.0 +pyenv install 3.11 ``` Verify Python 3.11 has been installed: @@ -75,7 +76,7 @@ pyenv versions To set Python 3.11 as the default global version, use the following command: ```zsh -pyenv global 3.11.0 +pyenv local 3.11 ``` This will switch your system's Python interpreter to use Python 3.11 by default. From 754611d4d2ebae93e0f43bfa6bb42bfef8987013 Mon Sep 17 00:00:00 2001 From: Daniil Nikoronov <110919308+dangannn@users.noreply.github.com> Date: Sun, 16 Mar 2025 21:27:27 +0300 Subject: [PATCH 4/4] Update django-test.yml --- .github/workflows/django-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/django-test.yml b/.github/workflows/django-test.yml index 4514720d..d72dd1bd 100644 --- a/.github/workflows/django-test.yml +++ b/.github/workflows/django-test.yml @@ -19,7 +19,7 @@ jobs: python-version: 3.11 - name: cache poetry install - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.local key: poetry-1.2.2-0 @@ -32,7 +32,7 @@ jobs: - name: cache deps id: cache-deps - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: .venv key: pydeps-${{ hashFiles('**/poetry.lock') }} @@ -46,4 +46,4 @@ jobs: - name: Run tests run: poetry run python manage.py test env: - DEBUG: True \ No newline at end of file + DEBUG: True