From f71d9474303c309104a20d835ef4fa1bee0d2c1d Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Tue, 12 Sep 2023 22:32:52 +0000 Subject: [PATCH 01/49] feat: Update ci config files --- .circleci/config.yml | 123 ++++++++++++++++++++++++++--- .github/workflows/auto-assign.yml | 10 ++- .github/workflows/bump-version.yml | 7 +- .github/workflows/ci.yaml | 27 +++++-- .github/workflows/pr-on-push.yaml | 13 ++- 5 files changed, 155 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b62af55d..e5ea6e70 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,21 +1,122 @@ version: 2.1 -workflows: - build-deploy: - jobs: - - build - - approval: - type: approval - requires: - - build - jobs: + requirements: + docker: + - image: cimg/python:3.11.4 + steps: + - checkout + - run: + name: Requirements check + command: | + python -V + poetry -V + + ruff: + docker: + - image: cimg/python:3.11.4 + steps: + - checkout + - run: + name: Ruff linting + command: | + python -V + poetry -V + + # executor: *python-executor + # steps: + # - checkout + # - python/install-packages: + # pip-dependency-file: requirements.txt + # pkg-manager: pip + # - run: *git-diff-py-files + # - run: + # name: List ruff errors + # command: ruff check . &> lint_checks.txt || true + # - run: + # name: 🧹 Diff-based ruff + # command: *display-lint-errors + + black: + docker: + - image: cimg/python:3.11.4 + steps: + - checkout + - run: + name: Black style formatting + command: | + python -V + poetry -V + + # executor: *python-executor + # steps: + # - checkout + # - checkout + # - python/install-packages: + # pip-dependency-file: requirements.txt + # pkg-manager: pip + # - run: &git-diff-py-files + # name: List added, copied, modified, and renamed *py files + # command: git diff --name-only --diff-filter=ACMR origin/main | grep -E "(.py$)" > diff.txt || true + # - run: + # name: List black errors + # command: black . --check &> lint_checks.txt || true + # - run: + # name: 🧹 Diff-based black + # command: &display-lint-errors | + # grep -Ff diff.txt lint_checks.txt > lint_errors.txt || true + # if [ -s lint_errors.txt ]; then + # cat lint_errors.txt + # printf 'Run the following command to fix your branch:\n make fixes' + # exit 1 + # fi + + unit-tests: + docker: + - image: cimg/python:3.11.4 + steps: + - run: + name: Unit testing + command: | + python -V + poetry -V + build: docker: - - image: cimg/python:3.11.5 + - image: cimg/python:3.11.4 steps: - checkout - run: - name: Ruff linting and Black formatting + name: Build command: | + python -V poetry -V + +workflows: + # version: 2 + ci: + jobs: + - requirements + + - black + # name: black style formatting + # filters: *ci-filter + + - ruff + # name: ruff linting + # filters: *ci-filter + + - unit-tests + # name: Unit testing + # filters: *ci-filter + # requires: + # - ruff + # - black + + build: + jobs: + - build + - approval: + type: approval + requires: + - ci diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 2a19d77f..08c47016 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -1,9 +1,15 @@ name: Auto Assign Issues and PRs + on: issues: types: [opened] pull_request: types: [opened] + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ASSIGNEE: ${{ vars.DEFAULT_ISSUE_ASSIGNEE }} + jobs: auto-assign: runs-on: ubuntu-latest @@ -14,5 +20,5 @@ jobs: - uses: pozil/auto-assign-issue@v1 with: abortIfPreviousAssignees: true - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: ${{ vars.DEFAULT_ISSUE_ASSIGNEE }} + repo-token: GITHUB_TOKEN + assignees: ASSIGNEE diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 0fc53324..8e3afdc8 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -5,6 +5,9 @@ on: branches: - master +env: + PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + jobs: bump-version: if: ${{ !startsWith(github.event.head_commit.message, 'bump:') }} @@ -14,10 +17,10 @@ jobs: - name: Check out uses: actions/checkout@v3 with: - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + token: PERSONAL_ACCESS_TOKEN fetch-depth: 0 - name: Create bump and changelog uses: commitizen-tools/commitizen-action@master with: - github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + github_token: PERSONAL_ACCESS_TOKEN \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index beeacf7b..a092a915 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,10 +1,15 @@ -name: CI +name: ci + on: - pull_request: - push: - branches-ignore: main + pull_request: + push: + branches-ignore: main + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + jobs: - lint-ruff: + ruff: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -20,15 +25,17 @@ jobs: # python -m pip install --upgrade pip # python -m pip install poetry # poetry install - check-black: + + black: runs-on: ubuntu-latest + needs: [ruff] steps: - uses: actions/checkout@v3 - name: Set up Python 3.11 uses: actions/setup-python@v4 with: python-version: 3.11 - - name: Black formatting + - name: Black style formatting uses: psf/black@stable with: options: --color --config=pyproject.toml --verbose @@ -39,3 +46,9 @@ jobs: # poetry run black . # env: # CHANGED_FILES: ${{ steps.file_changes.outputs.added_modified }} + + build: + runs-on: ubuntu-latest + needs: [black] + steps: + - uses: actions/checkout@v3 diff --git a/.github/workflows/pr-on-push.yaml b/.github/workflows/pr-on-push.yaml index 3e88b60a..a24d01ca 100644 --- a/.github/workflows/pr-on-push.yaml +++ b/.github/workflows/pr-on-push.yaml @@ -1,8 +1,15 @@ name: Create or update a pull request on push + on: push: branches-ignore: - main + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ASSIGNEE: ${{ vars.DEFAULT_ISSUE_ASSIGNEE }} + REVIEWER: ${{ vars.DEFAULT_PR_REVIEWER }} + jobs: create_pull_request: runs-on: ubuntu-latest @@ -12,12 +19,12 @@ jobs: id: open-pr uses: devops-infra/action-pull-request@v0.5.5 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: GITHUB_TOKEN target_branch: main title: "[#] : PLACEHOLDER TITLE" template: ".github/PULL_REQUEST_TEMPLATE.md" - reviewer: ${{ vars.DEFAULT_PR_REVIEWER }} - assignee: ${{ vars.DEFAULT_PR_ASSIGNEE }} + reviewer: REVIEWER + assignee: ASSIGNEE draft: true #label: "auto-pr" # Comma-separated list (no spaces) #milestone: "Milestone 1" # Milestone name From ab301252d7c0981144a5390243730aff85a4dc0f Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Tue, 12 Sep 2023 22:34:47 +0000 Subject: [PATCH 02/49] fix: Remove rst file check from pre-commit hooks --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d89d9893..8548170d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -129,12 +129,12 @@ repos: hooks: - id: pyproject-fmt - - repo: https://github.com/rstcheck/rstcheck - rev: v6.2.0 - hooks: - - id: rstcheck - additional_dependencies: - - tomli==2.0.1 + # - repo: https://github.com/rstcheck/rstcheck + # rev: v6.2.0 + # hooks: + # - id: rstcheck + # additional_dependencies: + # - tomli==2.0.1 # formatter and linter for HTML templates - repo: https://github.com/Riverside-Healthcare/djLint From 7e22e084099665ac6810b6c886690c1f9de7a75e Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Tue, 12 Sep 2023 22:41:23 +0000 Subject: [PATCH 03/49] fix: Remove rst file check from pre-commit hooks --- .circleci/config.yml | 2 +- .pre-commit-config.yaml | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e5ea6e70..080f9fb4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -119,4 +119,4 @@ workflows: - approval: type: approval requires: - - ci + - build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8548170d..ddb08d70 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -129,13 +129,6 @@ repos: hooks: - id: pyproject-fmt - # - repo: https://github.com/rstcheck/rstcheck - # rev: v6.2.0 - # hooks: - # - id: rstcheck - # additional_dependencies: - # - tomli==2.0.1 - # formatter and linter for HTML templates - repo: https://github.com/Riverside-Healthcare/djLint rev: v1.32.1 From fd2c2970107a0efe568416d65ae497d2dacf8fc0 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Tue, 12 Sep 2023 22:47:56 +0000 Subject: [PATCH 04/49] feat: Update circleci config --- .circleci/config.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 080f9fb4..5aeeb48e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 jobs: requirements: docker: - - image: cimg/python:3.11.4 + - image: cimg/python:3.11 steps: - checkout - run: @@ -14,7 +14,7 @@ jobs: ruff: docker: - - image: cimg/python:3.11.4 + - image: cimg/python:3.11 steps: - checkout - run: @@ -39,7 +39,7 @@ jobs: black: docker: - - image: cimg/python:3.11.4 + - image: cimg/python:3.11 steps: - checkout - run: @@ -73,7 +73,7 @@ jobs: unit-tests: docker: - - image: cimg/python:3.11.4 + - image: cimg/python:3.11 steps: - run: name: Unit testing @@ -83,7 +83,7 @@ jobs: build: docker: - - image: cimg/python:3.11.4 + - image: cimg/python:3.11 steps: - checkout - run: @@ -98,20 +98,23 @@ workflows: jobs: - requirements - - black - # name: black style formatting + - ruff: + # name: ruff linting # filters: *ci-filter + requires: + - requirements - - ruff - # name: ruff linting + - black: + # name: black style formatting # filters: *ci-filter + requires: + - ruff - - unit-tests + - unit-tests: # name: Unit testing # filters: *ci-filter - # requires: - # - ruff - # - black + requires: + - black build: jobs: From 2770ffaf4b8da394d5642141c9f6585247659ebd Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Tue, 12 Sep 2023 23:08:03 +0000 Subject: [PATCH 05/49] feat: Update circleci config --- .circleci/config.yml | 66 ++++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5aeeb48e..4fb7dad5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,31 +1,56 @@ version: 2.1 -jobs: - requirements: +executors: + app-executor: docker: - image: cimg/python:3.11 + working_directory: ~/app + +aliases: + - &show-current-branch + run: + name: Show Current Branch + command: echo ${CIRCLE_BRANCH} + + - &install-dependencies + run: + name: Install Dependencies + command: | + poetry install + echo "Successfully installed ependencies !" + + - &build-project + run: + name: Build Project + command: | + poetry install + echo "Build Successful !" + +jobs: + requirements: + executor: app-executor steps: - checkout + - *show-current-branch + - *install-dependencies - run: name: Requirements check command: | python -V poetry -V - ruff: - docker: - - image: cimg/python:3.11 + linting: + executor: app-executor steps: - checkout + - *show-current-branch - run: name: Ruff linting command: | python -V poetry -V - # executor: *python-executor # steps: - # - checkout # - python/install-packages: # pip-dependency-file: requirements.txt # pkg-manager: pip @@ -37,21 +62,19 @@ jobs: # name: 🧹 Diff-based ruff # command: *display-lint-errors - black: - docker: - - image: cimg/python:3.11 + formatting: + executor: app-executor steps: - checkout + - *show-current-branch - run: name: Black style formatting command: | python -V poetry -V - # executor: *python-executor + # steps: - # - checkout - # - checkout # - python/install-packages: # pip-dependency-file: requirements.txt # pkg-manager: pip @@ -71,10 +94,11 @@ jobs: # exit 1 # fi - unit-tests: - docker: - - image: cimg/python:3.11 + unit-testing: + executor: app-executor steps: + - checkout + - *show-current-branch - run: name: Unit testing command: | @@ -82,10 +106,10 @@ jobs: poetry -V build: - docker: - - image: cimg/python:3.11 + executor: app-executor steps: - checkout + - *show-current-branch - run: name: Build command: | @@ -98,19 +122,19 @@ workflows: jobs: - requirements - - ruff: + - linting: # name: ruff linting # filters: *ci-filter requires: - requirements - - black: + - formatting: # name: black style formatting # filters: *ci-filter requires: - ruff - - unit-tests: + - unit-testing: # name: Unit testing # filters: *ci-filter requires: From 0c77e2bb93dae278d6cbb6941fb145ca52f4189c Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Tue, 12 Sep 2023 23:08:38 +0000 Subject: [PATCH 06/49] feat: Update circleci config --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4fb7dad5..84e49193 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -132,13 +132,13 @@ workflows: # name: black style formatting # filters: *ci-filter requires: - - ruff + - linting - unit-testing: # name: Unit testing # filters: *ci-filter requires: - - black + - formatting build: jobs: From 60d60848e7c206df7ee31082f7425e68089163f6 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Tue, 12 Sep 2023 23:24:22 +0000 Subject: [PATCH 07/49] feat: Update circleci config --- .circleci/config.yml | 10 +++++----- .github/workflows/ci.yaml | 32 ++++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 84e49193..67c30697 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,7 +39,7 @@ jobs: python -V poetry -V - linting: + lint: executor: app-executor steps: - checkout @@ -62,7 +62,7 @@ jobs: # name: 🧹 Diff-based ruff # command: *display-lint-errors - formatting: + format: executor: app-executor steps: - checkout @@ -94,7 +94,7 @@ jobs: # exit 1 # fi - unit-testing: + unit-test: executor: app-executor steps: - checkout @@ -132,13 +132,13 @@ workflows: # name: black style formatting # filters: *ci-filter requires: - - linting + - lint - unit-testing: # name: Unit testing # filters: *ci-filter requires: - - formatting + - format build: jobs: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a092a915..06fb9785 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,8 +9,18 @@ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: - ruff: + requirements: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Requirements check + run: | + python -V + poetry -V + + lint: + runs-on: ubuntu-latest + needs: [requirements] steps: - uses: actions/checkout@v3 # - name: Set up Python 3.11 @@ -26,9 +36,9 @@ jobs: # python -m pip install poetry # poetry install - black: + format: runs-on: ubuntu-latest - needs: [ruff] + needs: [lint] steps: - uses: actions/checkout@v3 - name: Set up Python 3.11 @@ -47,8 +57,22 @@ jobs: # env: # CHANGED_FILES: ${{ steps.file_changes.outputs.added_modified }} + unit-test: + runs-on: ubuntu-latest + needs: [format] + steps: + - uses: actions/checkout@v3 + - name: Unit testing + run: | + python -V + poetry -V + build: runs-on: ubuntu-latest - needs: [black] + needs: [unit-test] steps: - uses: actions/checkout@v3 + - name: Build + run: | + python -V + poetry -V From 86f3281e6793c1f8a99bc6232b2d911b83f0006f Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Tue, 12 Sep 2023 23:26:02 +0000 Subject: [PATCH 08/49] feat: Update circleci config --- .circleci/config.yml | 8 ++++---- .github/workflows/ci.yaml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 67c30697..bc83f75b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -94,7 +94,7 @@ jobs: # exit 1 # fi - unit-test: + test: executor: app-executor steps: - checkout @@ -122,19 +122,19 @@ workflows: jobs: - requirements - - linting: + - lint: # name: ruff linting # filters: *ci-filter requires: - requirements - - formatting: + - format: # name: black style formatting # filters: *ci-filter requires: - lint - - unit-testing: + - test: # name: Unit testing # filters: *ci-filter requires: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 06fb9785..adc98e95 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -57,7 +57,7 @@ jobs: # env: # CHANGED_FILES: ${{ steps.file_changes.outputs.added_modified }} - unit-test: + test: runs-on: ubuntu-latest needs: [format] steps: @@ -69,7 +69,7 @@ jobs: build: runs-on: ubuntu-latest - needs: [unit-test] + needs: [test] steps: - uses: actions/checkout@v3 - name: Build From bbdf3dacc16a55548f40709dcb0d3a51c95e6201 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Tue, 12 Sep 2023 23:43:56 +0000 Subject: [PATCH 09/49] feat: Update circleci config --- .github/workflows/auto-assign.yml | 2 +- .github/workflows/bump-version.yml | 2 +- .github/workflows/pr-on-push.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 08c47016..72589990 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -11,7 +11,7 @@ env: ASSIGNEE: ${{ vars.DEFAULT_ISSUE_ASSIGNEE }} jobs: - auto-assign: + auto_assign: runs-on: ubuntu-latest permissions: issues: write diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 8e3afdc8..ad1b0436 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -9,7 +9,7 @@ env: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} jobs: - bump-version: + bump_version: if: ${{ !startsWith(github.event.head_commit.message, 'bump:') }} runs-on: ubuntu-latest name: "Bump version and create changelog with commitizen" diff --git a/.github/workflows/pr-on-push.yaml b/.github/workflows/pr-on-push.yaml index a24d01ca..8f744219 100644 --- a/.github/workflows/pr-on-push.yaml +++ b/.github/workflows/pr-on-push.yaml @@ -1,4 +1,4 @@ -name: Create or update a pull request on push +name: Pull request on push on: push: From 11509d46fb3a1597234050e2adf0091b6823d9f8 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Tue, 12 Sep 2023 23:49:18 +0000 Subject: [PATCH 10/49] feat: Update circleci config --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/pr-on-push.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index adc98e95..6f57d033 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,7 +16,7 @@ jobs: - name: Requirements check run: | python -V - poetry -V + # poetry -V lint: runs-on: ubuntu-latest @@ -65,7 +65,7 @@ jobs: - name: Unit testing run: | python -V - poetry -V + # poetry -V build: runs-on: ubuntu-latest @@ -75,4 +75,4 @@ jobs: - name: Build run: | python -V - poetry -V + # poetry -V diff --git a/.github/workflows/pr-on-push.yaml b/.github/workflows/pr-on-push.yaml index 8f744219..e3b3a580 100644 --- a/.github/workflows/pr-on-push.yaml +++ b/.github/workflows/pr-on-push.yaml @@ -1,4 +1,4 @@ -name: Pull request on push +name: pull request on push on: push: From 2da382eb925be34d5baa37fa82644c92ad3aa499 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Tue, 12 Sep 2023 23:57:48 +0000 Subject: [PATCH 11/49] feat: Update circleci config --- .github/workflows/auto-assign.yml | 2 +- .github/workflows/bump-version.yml | 4 ++-- .github/workflows/pr-on-push.yaml | 5 +---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 72589990..742732c5 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -1,4 +1,4 @@ -name: Auto Assign Issues and PRs +name: assign issues and prs on: issues: diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index ad1b0436..5d5fa6ce 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -1,9 +1,9 @@ -name: Bump version +name: bump version on: push: branches: - - master + - main env: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} diff --git a/.github/workflows/pr-on-push.yaml b/.github/workflows/pr-on-push.yaml index e3b3a580..212a5e0f 100644 --- a/.github/workflows/pr-on-push.yaml +++ b/.github/workflows/pr-on-push.yaml @@ -1,9 +1,6 @@ name: pull request on push -on: - push: - branches-ignore: - - main +on: [push] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From fb9beddc5b472a9a26db17ec9d8c3cf8d63302d2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 22:37:52 +0000 Subject: [PATCH 12/49] =?UTF-8?q?=E2=AC=86=20[pre-commit.ci]=20pre-commit?= =?UTF-8?q?=20autoupdate=20(#34)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> feat: Update circleci config --- .circleci/config.yml | 79 ++++++++++++++++++++---------- .github/workflows/auto-assign.yml | 2 +- .github/workflows/bump-version.yml | 2 +- .github/workflows/ci.yaml | 32 ++++++++++-- .github/workflows/pr-on-push.yaml | 2 +- .pre-commit-config.yaml | 2 +- 6 files changed, 85 insertions(+), 34 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 080f9fb4..bc83f75b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,31 +1,56 @@ version: 2.1 +executors: + app-executor: + docker: + - image: cimg/python:3.11 + working_directory: ~/app + +aliases: + - &show-current-branch + run: + name: Show Current Branch + command: echo ${CIRCLE_BRANCH} + + - &install-dependencies + run: + name: Install Dependencies + command: | + poetry install + echo "Successfully installed ependencies !" + + - &build-project + run: + name: Build Project + command: | + poetry install + echo "Build Successful !" + jobs: requirements: - docker: - - image: cimg/python:3.11.4 + executor: app-executor steps: - checkout + - *show-current-branch + - *install-dependencies - run: name: Requirements check command: | python -V poetry -V - ruff: - docker: - - image: cimg/python:3.11.4 + lint: + executor: app-executor steps: - checkout + - *show-current-branch - run: name: Ruff linting command: | python -V poetry -V - # executor: *python-executor # steps: - # - checkout # - python/install-packages: # pip-dependency-file: requirements.txt # pkg-manager: pip @@ -37,21 +62,19 @@ jobs: # name: 🧹 Diff-based ruff # command: *display-lint-errors - black: - docker: - - image: cimg/python:3.11.4 + format: + executor: app-executor steps: - checkout + - *show-current-branch - run: name: Black style formatting command: | python -V poetry -V - # executor: *python-executor + # steps: - # - checkout - # - checkout # - python/install-packages: # pip-dependency-file: requirements.txt # pkg-manager: pip @@ -71,10 +94,11 @@ jobs: # exit 1 # fi - unit-tests: - docker: - - image: cimg/python:3.11.4 + test: + executor: app-executor steps: + - checkout + - *show-current-branch - run: name: Unit testing command: | @@ -82,10 +106,10 @@ jobs: poetry -V build: - docker: - - image: cimg/python:3.11.4 + executor: app-executor steps: - checkout + - *show-current-branch - run: name: Build command: | @@ -98,20 +122,23 @@ workflows: jobs: - requirements - - black - # name: black style formatting + - lint: + # name: ruff linting # filters: *ci-filter + requires: + - requirements - - ruff - # name: ruff linting + - format: + # name: black style formatting # filters: *ci-filter + requires: + - lint - - unit-tests + - test: # name: Unit testing # filters: *ci-filter - # requires: - # - ruff - # - black + requires: + - format build: jobs: diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 08c47016..72589990 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -11,7 +11,7 @@ env: ASSIGNEE: ${{ vars.DEFAULT_ISSUE_ASSIGNEE }} jobs: - auto-assign: + auto_assign: runs-on: ubuntu-latest permissions: issues: write diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 8e3afdc8..ad1b0436 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -9,7 +9,7 @@ env: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} jobs: - bump-version: + bump_version: if: ${{ !startsWith(github.event.head_commit.message, 'bump:') }} runs-on: ubuntu-latest name: "Bump version and create changelog with commitizen" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a092a915..6f57d033 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,8 +9,18 @@ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: - ruff: + requirements: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Requirements check + run: | + python -V + # poetry -V + + lint: + runs-on: ubuntu-latest + needs: [requirements] steps: - uses: actions/checkout@v3 # - name: Set up Python 3.11 @@ -26,9 +36,9 @@ jobs: # python -m pip install poetry # poetry install - black: + format: runs-on: ubuntu-latest - needs: [ruff] + needs: [lint] steps: - uses: actions/checkout@v3 - name: Set up Python 3.11 @@ -47,8 +57,22 @@ jobs: # env: # CHANGED_FILES: ${{ steps.file_changes.outputs.added_modified }} + test: + runs-on: ubuntu-latest + needs: [format] + steps: + - uses: actions/checkout@v3 + - name: Unit testing + run: | + python -V + # poetry -V + build: runs-on: ubuntu-latest - needs: [black] + needs: [test] steps: - uses: actions/checkout@v3 + - name: Build + run: | + python -V + # poetry -V diff --git a/.github/workflows/pr-on-push.yaml b/.github/workflows/pr-on-push.yaml index a24d01ca..e3b3a580 100644 --- a/.github/workflows/pr-on-push.yaml +++ b/.github/workflows/pr-on-push.yaml @@ -1,4 +1,4 @@ -name: Create or update a pull request on push +name: pull request on push on: push: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ddb08d70..d011b9b7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -150,7 +150,7 @@ repos: ] - repo: https://github.com/psf/black - rev: 23.9.0 + rev: 23.9.1 hooks: - id: black args: [--config=pyproject.toml] From 45dc7c878c618f8ace075393e9db0a450c412dad Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Tue, 12 Sep 2023 23:57:48 +0000 Subject: [PATCH 13/49] feat: Update circleci config --- .github/workflows/auto-assign.yml | 2 +- .github/workflows/bump-version.yml | 4 ++-- .github/workflows/pr-on-push.yaml | 5 +---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 72589990..742732c5 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -1,4 +1,4 @@ -name: Auto Assign Issues and PRs +name: assign issues and prs on: issues: diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index ad1b0436..5d5fa6ce 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -1,9 +1,9 @@ -name: Bump version +name: bump version on: push: branches: - - master + - main env: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} diff --git a/.github/workflows/pr-on-push.yaml b/.github/workflows/pr-on-push.yaml index e3b3a580..212a5e0f 100644 --- a/.github/workflows/pr-on-push.yaml +++ b/.github/workflows/pr-on-push.yaml @@ -1,9 +1,6 @@ name: pull request on push -on: - push: - branches-ignore: - - main +on: [push] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8935b72a00f73e2ba56082ea3182eb6ca60ee3ac Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 00:35:41 +0000 Subject: [PATCH 14/49] feat: Update ci config --- .github/workflows/ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6f57d033..e024bc6c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,7 +16,9 @@ jobs: - name: Requirements check run: | python -V - # poetry -V + python -m pip install --upgrade pip + python -m pip install poetry + poetry install lint: runs-on: ubuntu-latest From 040a30050cf85fd074059fc52a58a42bb8e7a20a Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 00:38:51 +0000 Subject: [PATCH 15/49] fix: Upgraded Django version from chapter 02 --- ch02-hello/poetry.lock | 8 ++++---- ch02-hello/pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ch02-hello/poetry.lock b/ch02-hello/poetry.lock index f955b7ce..e3a8018c 100644 --- a/ch02-hello/poetry.lock +++ b/ch02-hello/poetry.lock @@ -16,13 +16,13 @@ tests = ["mypy (>=0.800)", "pytest", "pytest-asyncio"] [[package]] name = "django" -version = "4.2.4" +version = "4.2.5" description = "A high-level Python web framework that encourages rapid development and clean, pragmatic design." optional = false python-versions = ">=3.8" files = [ - {file = "Django-4.2.4-py3-none-any.whl", hash = "sha256:860ae6a138a238fc4f22c99b52f3ead982bb4b1aad8c0122bcd8c8a3a02e409d"}, - {file = "Django-4.2.4.tar.gz", hash = "sha256:7e4225ec065e0f354ccf7349a22d209de09cc1c074832be9eb84c51c1799c432"}, + {file = "Django-4.2.5-py3-none-any.whl", hash = "sha256:b6b2b5cae821077f137dc4dade696a1c2aa292f892eca28fa8d7bfdf2608ddd4"}, + {file = "Django-4.2.5.tar.gz", hash = "sha256:5e5c1c9548ffb7796b4a8a4782e9a2e5a3df3615259fc1bfd3ebc73b646146c1"}, ] [package.dependencies] @@ -64,4 +64,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "42f7d00604b90e91d1e107b843e74ef3d3434daf84f01a24e72283b12c99a5f3" +content-hash = "6b68b91ea4c452eaed288484a915a24de90c518ea2ccbee1c279ba89f114c050" diff --git a/ch02-hello/pyproject.toml b/ch02-hello/pyproject.toml index 5d36b51a..fb8aa249 100644 --- a/ch02-hello/pyproject.toml +++ b/ch02-hello/pyproject.toml @@ -8,7 +8,7 @@ license = "MIT" [tool.poetry.dependencies] python = "^3.11" -django = "4.2.4" +django = "4.2.5" [build-system] build-backend = "poetry.core.masonry.api" From ce9cbbfeaa72cdd5b77b8207d4440a9c9972493b Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 00:41:53 +0000 Subject: [PATCH 16/49] fix: Hide secret from chapter 02 --- .../django_project/settings/__init__.py | 4 + ch02-hello/django_project/settings/django.py | 111 ++++++++++++++++++ .../django_project/settings/environment.py | 15 +++ ch02-hello/django_project/settings/project.py | 0 .../django_project/settings/third_party.py | 0 5 files changed, 130 insertions(+) create mode 100644 ch02-hello/django_project/settings/__init__.py create mode 100644 ch02-hello/django_project/settings/django.py create mode 100644 ch02-hello/django_project/settings/environment.py create mode 100644 ch02-hello/django_project/settings/project.py create mode 100644 ch02-hello/django_project/settings/third_party.py diff --git a/ch02-hello/django_project/settings/__init__.py b/ch02-hello/django_project/settings/__init__.py new file mode 100644 index 00000000..4e0a805f --- /dev/null +++ b/ch02-hello/django_project/settings/__init__.py @@ -0,0 +1,4 @@ +from .django import * +from .environment import * +from .project import * +from .third_party import * diff --git a/ch02-hello/django_project/settings/django.py b/ch02-hello/django_project/settings/django.py new file mode 100644 index 00000000..a434c95e --- /dev/null +++ b/ch02-hello/django_project/settings/django.py @@ -0,0 +1,111 @@ +""" +Django settings for django_project project. + +Generated by 'django-admin startproject' using Django 4.2.4. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.2/ref/settings/ +""" +from .environment import env + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ + +# GENERAL +# ------------------------------------------------------------------------------ +# https://docs.djangoproject.com/en/dev/ref/settings +DEBUG = env.bool("DEBUG", default=False) +TEMPLATE_DEBUG = DEBUG +SECRET_KEY = env.str("SECRET_KEY") +ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=[]) + +# Application definition + +INSTALLED_APPS = [ + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", +] + +MIDDLEWARE = [ + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", +] + +ROOT_URLCONF = "django_project.urls" + +TEMPLATES = [ + { + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [], + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", + ], + }, + }, +] + +WSGI_APPLICATION = "django_project.wsgi.application" + + +# Database +# ------------------------------------------------------------------------------ + +DATABASES = {"default": env.db("DATABASE_URL")} + +# Password validation +# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.2/topics/i18n/ + +LANGUAGE_CODE = "en-us" + +TIME_ZONE = "UTC" + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.2/howto/static-files/ + +STATIC_URL = env.str("STATIC_URL", default="static/") + +# Default primary key field type +# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" diff --git a/ch02-hello/django_project/settings/environment.py b/ch02-hello/django_project/settings/environment.py new file mode 100644 index 00000000..b3be3905 --- /dev/null +++ b/ch02-hello/django_project/settings/environment.py @@ -0,0 +1,15 @@ +import os + +import environ + +env = environ.Env( + # set casting, default value + DEBUG=(bool, False) +) +env.prefix = "DJANGO_" + +site_root = environ.Path(__file__) - 3 # Root of the project + +env_file = site_root(".env") +if os.path.exists(env_file): # pragma: no cover + environ.Env.read_env(env_file=env_file) diff --git a/ch02-hello/django_project/settings/project.py b/ch02-hello/django_project/settings/project.py new file mode 100644 index 00000000..e69de29b diff --git a/ch02-hello/django_project/settings/third_party.py b/ch02-hello/django_project/settings/third_party.py new file mode 100644 index 00000000..e69de29b From d385fea7d1074dd2624ccb68efb6a374ffe1751a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 00:42:28 +0000 Subject: [PATCH 17/49] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20f?= =?UTF-8?q?ormat=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../django_project/settings/__init__.py | 8 +- ch02-hello/django_project/settings/django.py | 222 +++++++++--------- .../django_project/settings/environment.py | 30 +-- 3 files changed, 130 insertions(+), 130 deletions(-) diff --git a/ch02-hello/django_project/settings/__init__.py b/ch02-hello/django_project/settings/__init__.py index 4e0a805f..802db43f 100644 --- a/ch02-hello/django_project/settings/__init__.py +++ b/ch02-hello/django_project/settings/__init__.py @@ -1,4 +1,4 @@ -from .django import * -from .environment import * -from .project import * -from .third_party import * +from .django import * +from .environment import * +from .project import * +from .third_party import * diff --git a/ch02-hello/django_project/settings/django.py b/ch02-hello/django_project/settings/django.py index a434c95e..849d5129 100644 --- a/ch02-hello/django_project/settings/django.py +++ b/ch02-hello/django_project/settings/django.py @@ -1,111 +1,111 @@ -""" -Django settings for django_project project. - -Generated by 'django-admin startproject' using Django 4.2.4. - -For more information on this file, see -https://docs.djangoproject.com/en/4.2/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/4.2/ref/settings/ -""" -from .environment import env - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ - -# GENERAL -# ------------------------------------------------------------------------------ -# https://docs.djangoproject.com/en/dev/ref/settings -DEBUG = env.bool("DEBUG", default=False) -TEMPLATE_DEBUG = DEBUG -SECRET_KEY = env.str("SECRET_KEY") -ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=[]) - -# Application definition - -INSTALLED_APPS = [ - "django.contrib.admin", - "django.contrib.auth", - "django.contrib.contenttypes", - "django.contrib.sessions", - "django.contrib.messages", - "django.contrib.staticfiles", -] - -MIDDLEWARE = [ - "django.middleware.security.SecurityMiddleware", - "django.contrib.sessions.middleware.SessionMiddleware", - "django.middleware.common.CommonMiddleware", - "django.middleware.csrf.CsrfViewMiddleware", - "django.contrib.auth.middleware.AuthenticationMiddleware", - "django.contrib.messages.middleware.MessageMiddleware", - "django.middleware.clickjacking.XFrameOptionsMiddleware", -] - -ROOT_URLCONF = "django_project.urls" - -TEMPLATES = [ - { - "BACKEND": "django.template.backends.django.DjangoTemplates", - "DIRS": [], - "APP_DIRS": True, - "OPTIONS": { - "context_processors": [ - "django.template.context_processors.debug", - "django.template.context_processors.request", - "django.contrib.auth.context_processors.auth", - "django.contrib.messages.context_processors.messages", - ], - }, - }, -] - -WSGI_APPLICATION = "django_project.wsgi.application" - - -# Database -# ------------------------------------------------------------------------------ - -DATABASES = {"default": env.db("DATABASE_URL")} - -# Password validation -# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", - }, - { - "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", - }, - { - "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", - }, - { - "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/4.2/topics/i18n/ - -LANGUAGE_CODE = "en-us" - -TIME_ZONE = "UTC" - -USE_I18N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/4.2/howto/static-files/ - -STATIC_URL = env.str("STATIC_URL", default="static/") - -# Default primary key field type -# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field - -DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" +""" +Django settings for django_project project. + +Generated by 'django-admin startproject' using Django 4.2.4. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.2/ref/settings/ +""" +from .environment import env + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ + +# GENERAL +# ------------------------------------------------------------------------------ +# https://docs.djangoproject.com/en/dev/ref/settings +DEBUG = env.bool("DEBUG", default=False) +TEMPLATE_DEBUG = DEBUG +SECRET_KEY = env.str("SECRET_KEY") +ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=[]) + +# Application definition + +INSTALLED_APPS = [ + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", +] + +MIDDLEWARE = [ + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", +] + +ROOT_URLCONF = "django_project.urls" + +TEMPLATES = [ + { + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [], + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", + ], + }, + }, +] + +WSGI_APPLICATION = "django_project.wsgi.application" + + +# Database +# ------------------------------------------------------------------------------ + +DATABASES = {"default": env.db("DATABASE_URL")} + +# Password validation +# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.2/topics/i18n/ + +LANGUAGE_CODE = "en-us" + +TIME_ZONE = "UTC" + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.2/howto/static-files/ + +STATIC_URL = env.str("STATIC_URL", default="static/") + +# Default primary key field type +# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" diff --git a/ch02-hello/django_project/settings/environment.py b/ch02-hello/django_project/settings/environment.py index b3be3905..67af0201 100644 --- a/ch02-hello/django_project/settings/environment.py +++ b/ch02-hello/django_project/settings/environment.py @@ -1,15 +1,15 @@ -import os - -import environ - -env = environ.Env( - # set casting, default value - DEBUG=(bool, False) -) -env.prefix = "DJANGO_" - -site_root = environ.Path(__file__) - 3 # Root of the project - -env_file = site_root(".env") -if os.path.exists(env_file): # pragma: no cover - environ.Env.read_env(env_file=env_file) +import os + +import environ + +env = environ.Env( + # set casting, default value + DEBUG=(bool, False) +) +env.prefix = "DJANGO_" + +site_root = environ.Path(__file__) - 3 # Root of the project + +env_file = site_root(".env") +if os.path.exists(env_file): # pragma: no cover + environ.Env.read_env(env_file=env_file) From 54157506a617139e80c0b10c5bbd05e6f4bd5b60 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 00:53:49 +0000 Subject: [PATCH 18/49] feat: Update ci config --- .github/workflows/ci.yaml | 4 ++++ .readthedocs.yaml | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e024bc6c..4dcc9b7c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,6 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 - name: Requirements check run: | python -V diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 2d55dccc..1d0a7ea8 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -12,7 +12,9 @@ build: python: "3.11" jobs: post_create_environment: - - pip install poetry + - python -V + - python -m pip install --upgrade pip + - python -m pip install poetry - poetry config virtualenvs.create false post_install: - poetry install --only docs From 55a56f9d5855ce6ca9b6082e94e43b51d79d6cdb Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 01:17:52 +0000 Subject: [PATCH 19/49] feat: Update ci config --- .github/workflows/ci.yaml | 19 +++++++++++++------ poetry.lock | 16 ++++++++-------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4dcc9b7c..8c5461c7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,16 +13,23 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python 3.11 + - name: Install poetry + run: | + python -V + python -m pip install --upgrade pip + python -m pip install poetry + - name: Set up Python from Poetry config + id: python_version uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version-file: 'pyproject.toml' + cache: 'poetry' # caching poetry dependencies + - run: echo '${{ steps.python_version.outputs.python-version }}' - name: Requirements check run: | - python -V - python -m pip install --upgrade pip - python -m pip install poetry - poetry install + python -V + poetry install + poetry run pytest lint: runs-on: ubuntu-latest diff --git a/poetry.lock b/poetry.lock index 4c99ab82..6b131720 100644 --- a/poetry.lock +++ b/poetry.lock @@ -315,13 +315,13 @@ testing = ["covdefaults (>=2.3)", "coverage (>=7.3)", "diff-cover (>=7.7)", "pyt [[package]] name = "identify" -version = "2.5.27" +version = "2.5.28" description = "File identification library for Python" optional = false python-versions = ">=3.8" files = [ - {file = "identify-2.5.27-py2.py3-none-any.whl", hash = "sha256:fdb527b2dfe24602809b2201e033c2a113d7bdf716db3ca8e3243f735dcecaba"}, - {file = "identify-2.5.27.tar.gz", hash = "sha256:287b75b04a0e22d727bc9a41f0d4f3c1bcada97490fa6eabb5b28f0e9097e733"}, + {file = "identify-2.5.28-py2.py3-none-any.whl", hash = "sha256:87816de144bf46d161bd5b3e8f5596b16cade3b80be537087334b26bc5c177f3"}, + {file = "identify-2.5.28.tar.gz", hash = "sha256:94bb59643083ebd60dc996d043497479ee554381fbc5307763915cda49b0e78f"}, ] [package.extras] @@ -836,19 +836,19 @@ files = [ [[package]] name = "setuptools" -version = "68.2.0" +version = "68.2.2" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-68.2.0-py3-none-any.whl", hash = "sha256:af3d5949030c3f493f550876b2fd1dd5ec66689c4ee5d5344f009746f71fd5a8"}, - {file = "setuptools-68.2.0.tar.gz", hash = "sha256:00478ca80aeebeecb2f288d3206b0de568df5cd2b8fada1209843cc9a8d88a48"}, + {file = "setuptools-68.2.2-py3-none-any.whl", hash = "sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a"}, + {file = "setuptools-68.2.2.tar.gz", hash = "sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87"}, ] [package.extras] docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "snowballstemmer" @@ -1194,4 +1194,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "a3bc7cc7ff61d8cb15c5739256f19d492c35e25866fc16a57f49600d3650a625" +content-hash = "f30b6372bb7a29ea17e0160f4f3b0db55e74b7260a48b10d13a44bf41bd0fabc" From 875aa4aec8f518cc43ca07ad67d18bc01d88e9a7 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 01:26:52 +0000 Subject: [PATCH 20/49] feat: Update ci config --- .github/workflows/ci.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8c5461c7..1872afe3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,15 +16,14 @@ jobs: - name: Install poetry run: | python -V - python -m pip install --upgrade pip - python -m pip install poetry + python -m pipx install poetry - name: Set up Python from Poetry config - id: python_version + id: python_upgrade uses: actions/setup-python@v4 with: python-version-file: 'pyproject.toml' cache: 'poetry' # caching poetry dependencies - - run: echo '${{ steps.python_version.outputs.python-version }}' + - run: echo '${{ steps.python_upgrade.outputs.python-version }}' - name: Requirements check run: | python -V From 15f1158c7a6253c238998f0678db73efeb805d04 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 01:29:36 +0000 Subject: [PATCH 21/49] feat: Update ci config --- .github/workflows/ci.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1872afe3..c814b497 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,6 +17,7 @@ jobs: run: | python -V python -m pipx install poetry + poetry -V - name: Set up Python from Poetry config id: python_upgrade uses: actions/setup-python@v4 @@ -26,7 +27,8 @@ jobs: - run: echo '${{ steps.python_upgrade.outputs.python-version }}' - name: Requirements check run: | - python -V + python -V + poetry -V poetry install poetry run pytest @@ -39,6 +41,10 @@ jobs: # uses: actions/setup-python@v4 # with: # python-version: 3.11 + - name: Python & poetry version + run: | + python -V + poetry -V - name: Ruff linting uses: chartboost/ruff-action@v1 with: From dd0d735c85c4d55c0e6a0b1da03a26bd3a0d5228 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 01:32:07 +0000 Subject: [PATCH 22/49] feat: Update ci config --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c814b497..a43029b2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,6 +31,8 @@ jobs: poetry -V poetry install poetry run pytest + echo "$(poetry env info --path)/bin" >> $GITHUB_PATH + - uses: jakebailey/pyright-action@v1 lint: runs-on: ubuntu-latest From a7748ef317d19c70c4609c4667047a94ded154f9 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 01:46:58 +0000 Subject: [PATCH 23/49] feat: Update ci config --- .github/workflows/ci.yaml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a43029b2..25d933ce 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,36 +1,28 @@ name: ci -on: - pull_request: - push: - branches-ignore: main +on: [push, pull_request] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: requirements: - runs-on: ubuntu-latest + # Ubunty latest @ 13-Sep-23: + # Ubuntu 22.04.3 LTS | Python 3.10.12 | Pipx 1.2.0 | No poetry | PostgreSQL 14.9 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Install poetry - run: | - python -V - python -m pipx install poetry - poetry -V - - name: Set up Python from Poetry config - id: python_upgrade + - run: python -m pipx install poetry + - name: Set up Python version from Poetry config uses: actions/setup-python@v4 with: python-version-file: 'pyproject.toml' cache: 'poetry' # caching poetry dependencies - - run: echo '${{ steps.python_upgrade.outputs.python-version }}' - name: Requirements check run: | python -V poetry -V - poetry install - poetry run pytest + poetry install echo "$(poetry env info --path)/bin" >> $GITHUB_PATH - uses: jakebailey/pyright-action@v1 @@ -86,6 +78,7 @@ jobs: run: | python -V # poetry -V + # poetry run pytest build: runs-on: ubuntu-latest From 4bc03ff9a7f5678c51665510c752e1e982e458d9 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 01:50:07 +0000 Subject: [PATCH 24/49] feat: Update ci config --- .github/workflows/ci.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 25d933ce..1fbafde1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,14 +18,15 @@ jobs: with: python-version-file: 'pyproject.toml' cache: 'poetry' # caching poetry dependencies + # Warning: poetry cache is not found - name: Requirements check run: | python -V poetry -V poetry install echo "$(poetry env info --path)/bin" >> $GITHUB_PATH - - uses: jakebailey/pyright-action@v1 - + echo $GITHUB_PATH + lint: runs-on: ubuntu-latest needs: [requirements] @@ -47,6 +48,7 @@ jobs: # python -m pip install --upgrade pip # python -m pip install poetry # poetry install + - uses: jakebailey/pyright-action@v1 format: runs-on: ubuntu-latest From 76b4db1ad05d3cdf0b13343ea553539ac2be49fe Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 02:04:14 +0000 Subject: [PATCH 25/49] feat: Update ci config --- .github/workflows/ci.yaml | 64 +++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1fbafde1..4a43eaa4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,54 +20,44 @@ jobs: cache: 'poetry' # caching poetry dependencies # Warning: poetry cache is not found - name: Requirements check - run: | - python -V - poetry -V - poetry install - echo "$(poetry env info --path)/bin" >> $GITHUB_PATH - echo $GITHUB_PATH + run: poetry install lint: runs-on: ubuntu-latest needs: [requirements] steps: - uses: actions/checkout@v3 - # - name: Set up Python 3.11 - # uses: actions/setup-python@v4 - # with: - # python-version: 3.11 - - name: Python & poetry version - run: | - python -V - poetry -V + - run: python -m pipx install poetry + - name: Set up Python version from Poetry config + uses: actions/setup-python@v4 + with: + python-version-file: 'pyproject.toml' + cache: 'poetry' # caching poetry dependencies + # Warning: poetry cache is not found + - run: poetry install --only dev - name: Ruff linting uses: chartboost/ruff-action@v1 with: args: check --config=pyproject.toml --verbose - # run: | - # python -m pip install --upgrade pip - # python -m pip install poetry - # poetry install - - uses: jakebailey/pyright-action@v1 - + format: runs-on: ubuntu-latest needs: [lint] steps: - uses: actions/checkout@v3 - - name: Set up Python 3.11 + - run: python -m pipx install poetry + - name: Set up Python version from Poetry config uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version-file: 'pyproject.toml' + cache: 'poetry' # caching poetry dependencies + # Warning: poetry cache is not found + - run: poetry install --only dev - name: Black style formatting uses: psf/black@stable with: options: --color --config=pyproject.toml --verbose - # run: | - # python -m pip install --upgrade pip - # python -m pip install poetry - # poetry install --only dev - # poetry run black . + # run: poetry run black . # env: # CHANGED_FILES: ${{ steps.file_changes.outputs.added_modified }} @@ -76,10 +66,18 @@ jobs: needs: [format] steps: - uses: actions/checkout@v3 + - run: python -m pipx install poetry + - name: Set up Python version from Poetry config + uses: actions/setup-python@v4 + with: + python-version-file: 'pyproject.toml' + cache: 'poetry' # caching poetry dependencies + # Warning: poetry cache is not found + - run: poetry install --only dev - name: Unit testing run: | python -V - # poetry -V + poetry -V # poetry run pytest build: @@ -87,7 +85,15 @@ jobs: needs: [test] steps: - uses: actions/checkout@v3 + - run: python -m pipx install poetry + - name: Set up Python version from Poetry config + uses: actions/setup-python@v4 + with: + python-version-file: 'pyproject.toml' + cache: 'poetry' # caching poetry dependencies + # Warning: poetry cache is not found + - run: poetry install --only dev - name: Build run: | python -V - # poetry -V + poetry -V From 31a61981c6234afe7882d3c9a1d03aee399072e1 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 02:54:17 +0000 Subject: [PATCH 26/49] feat: Update ci config --- .github/workflows/ci.yaml | 6 ++--- .pre-commit-config.yaml | 52 ++++++++++----------------------------- 2 files changed, 16 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4a43eaa4..83cbb293 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: cache: 'poetry' # caching poetry dependencies # Warning: poetry cache is not found - name: Requirements check - run: poetry install + run: poetry install --no-interaction lint: runs-on: ubuntu-latest @@ -34,7 +34,7 @@ jobs: python-version-file: 'pyproject.toml' cache: 'poetry' # caching poetry dependencies # Warning: poetry cache is not found - - run: poetry install --only dev + - run: poetry install --only dev --no-interaction - name: Ruff linting uses: chartboost/ruff-action@v1 with: @@ -52,7 +52,7 @@ jobs: python-version-file: 'pyproject.toml' cache: 'poetry' # caching poetry dependencies # Warning: poetry cache is not found - - run: poetry install --only dev + - run: poetry install --only dev --no-interaction - name: Black style formatting uses: psf/black@stable with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d011b9b7..11049a8d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,25 +1,9 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks - ---- - -default_install_hook_types: - # - commit-msg - # - post-checkout - # - post-commit - # - post-rewrite - # - post-merge - - pre-commit - # - pre-push - # - prepare-commit-msg default_language_version: python: python3.11 -default_stages: - - commit - # - push - # - merge-commit exclude: .*migrations\/.*|.git minimum_pre_commit_version: 3.2.1 +default_stages: [commit, push] +fail_fast: true repos: # Automatically fix issues @@ -36,13 +20,13 @@ repos: additional_dependencies: - tomli - # ## Poetry - # - repo: https://github.com/python-poetry/poetry - # rev: 1.6.0 - # hooks: - # - id: poetry-check - # - id: poetry-lock - # - id: poetry-install + - repo: https://github.com/python-poetry/poetry + rev: 1.6.1 + hooks: + - id: poetry-check + - id: poetry-lock + # - id: poetry-export + - id: poetry-install ## Markdown - repo: https://github.com/frnmst/md-toc @@ -175,19 +159,9 @@ repos: hooks: - id: gitlint -# - repo: https://github.com/pre-commit/mirrors-mypy -# rev: v1.5.1 -# hooks: -# - id: mypy -# exclude: ^tests/ -# args: [ -# --strict, -# --config-file=pyproject.toml -# ] -# additional_dependencies: -# - pytest==7.1.2 - ci: autoupdate_schedule: weekly - autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks - autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate + autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit auto update + autofix_prs: false + autofix_commit_msg: 🎨 [pre-commit.ci] Auto fixes from pre-commit.com hooks + skip: [poetry-check, poetry-lock, poetry-install] From 95606c7eadcf5755bd0b6f7937dd296f1c6ac48c Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 02:59:31 +0000 Subject: [PATCH 27/49] feat: Update ci config --- .pre-commit-config.yaml | 11 ++- poetry.lock | 180 +--------------------------------------- pyproject.toml | 1 - 3 files changed, 10 insertions(+), 182 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11049a8d..9a97aede 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ default_language_version: - python: python3.11 + python: python3.11 exclude: .*migrations\/.*|.git minimum_pre_commit_version: 3.2.1 default_stages: [commit, push] @@ -125,10 +125,17 @@ repos: - id: checkov - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.287 + rev: v0.0.289 hooks: - id: ruff args: [ + --check, + --config=pyproject.toml, + --verbose + ] + - id: ruff-format + args: [ + --check, --config=pyproject.toml, --verbose ] diff --git a/poetry.lock b/poetry.lock index 6b131720..93e38f92 100644 --- a/poetry.lock +++ b/poetry.lock @@ -106,17 +106,6 @@ files = [ {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, ] -[[package]] -name = "cfgv" -version = "3.4.0" -description = "Validate configuration and produce human readable error messages." -optional = false -python-versions = ">=3.8" -files = [ - {file = "cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9"}, - {file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"}, -] - [[package]] name = "charset-normalizer" version = "3.2.0" @@ -240,17 +229,6 @@ files = [ [package.extras] graph = ["objgraph (>=1.7.2)"] -[[package]] -name = "distlib" -version = "0.3.7" -description = "Distribution utilities" -optional = false -python-versions = "*" -files = [ - {file = "distlib-0.3.7-py2.py3-none-any.whl", hash = "sha256:2e24928bc811348f0feb63014e97aaae3037f2cf48712d51ae61df7fd6075057"}, - {file = "distlib-0.3.7.tar.gz", hash = "sha256:9dafe54b34a028eafd95039d5e5d4851a13734540f1331060d31c9916e7147a8"}, -] - [[package]] name = "django" version = "4.2.5" @@ -298,35 +276,6 @@ files = [ {file = "docutils-0.18.1.tar.gz", hash = "sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"}, ] -[[package]] -name = "filelock" -version = "3.12.3" -description = "A platform independent file lock." -optional = false -python-versions = ">=3.8" -files = [ - {file = "filelock-3.12.3-py3-none-any.whl", hash = "sha256:f067e40ccc40f2b48395a80fcbd4728262fab54e232e090a4063ab804179efeb"}, - {file = "filelock-3.12.3.tar.gz", hash = "sha256:0ecc1dd2ec4672a10c8550a8182f1bd0c0a5088470ecd5a125e45f49472fac3d"}, -] - -[package.extras] -docs = ["furo (>=2023.7.26)", "sphinx (>=7.1.2)", "sphinx-autodoc-typehints (>=1.24)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.3)", "diff-cover (>=7.7)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)", "pytest-timeout (>=2.1)"] - -[[package]] -name = "identify" -version = "2.5.28" -description = "File identification library for Python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "identify-2.5.28-py2.py3-none-any.whl", hash = "sha256:87816de144bf46d161bd5b3e8f5596b16cade3b80be537087334b26bc5c177f3"}, - {file = "identify-2.5.28.tar.gz", hash = "sha256:94bb59643083ebd60dc996d043497479ee554381fbc5307763915cda49b0e78f"}, -] - -[package.extras] -license = ["ukkonen"] - [[package]] name = "idna" version = "3.4" @@ -519,20 +468,6 @@ files = [ {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, ] -[[package]] -name = "nodeenv" -version = "1.8.0" -description = "Node.js virtual environment builder" -optional = false -python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" -files = [ - {file = "nodeenv-1.8.0-py2.py3-none-any.whl", hash = "sha256:df865724bb3c3adc86b3876fa209771517b0cfe596beff01a92700e0e8be4cec"}, - {file = "nodeenv-1.8.0.tar.gz", hash = "sha256:d51e0c37e64fbf47d017feac3145cdbb58836d7eee8c6f6d3b6880c5456227d2"}, -] - -[package.dependencies] -setuptools = "*" - [[package]] name = "packaging" version = "23.1" @@ -570,24 +505,6 @@ files = [ docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.1)", "sphinx-autodoc-typehints (>=1.24)"] test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)"] -[[package]] -name = "pre-commit" -version = "3.4.0" -description = "A framework for managing and maintaining multi-language pre-commit hooks." -optional = false -python-versions = ">=3.8" -files = [ - {file = "pre_commit-3.4.0-py2.py3-none-any.whl", hash = "sha256:96d529a951f8b677f730a7212442027e8ba53f9b04d217c4c67dc56c393ad945"}, - {file = "pre_commit-3.4.0.tar.gz", hash = "sha256:6bbd5129a64cad4c0dfaeeb12cd8f7ea7e15b77028d985341478c8af3c759522"}, -] - -[package.dependencies] -cfgv = ">=2.0.0" -identify = ">=1.0.0" -nodeenv = ">=0.11.1" -pyyaml = ">=5.1" -virtualenv = ">=20.10.0" - [[package]] name = "psycopg2-binary" version = "2.9.7" @@ -728,65 +645,6 @@ files = [ [package.dependencies] pylint = ">=1.7" -[[package]] -name = "pyyaml" -version = "6.0.1" -description = "YAML parser and emitter for Python" -optional = false -python-versions = ">=3.6" -files = [ - {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, - {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, - {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, - {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, - {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, - {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, - {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, - {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, - {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, - {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, - {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, - {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, - {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, - {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, - {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, - {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, - {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, - {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, - {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, - {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, - {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, - {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, - {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, - {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, - {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, - {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, - {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, - {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, - {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, - {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, - {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, - {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, - {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, - {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, - {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, - {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, - {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, - {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, - {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, - {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, - {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, - {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, - {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, - {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, - {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, - {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, - {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, -] - [[package]] name = "requests" version = "2.31.0" @@ -834,22 +692,6 @@ files = [ {file = "ruff-0.0.286.tar.gz", hash = "sha256:f1e9d169cce81a384a26ee5bb8c919fe9ae88255f39a1a69fd1ebab233a85ed2"}, ] -[[package]] -name = "setuptools" -version = "68.2.2" -description = "Easily download, build, install, upgrade, and uninstall Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "setuptools-68.2.2-py3-none-any.whl", hash = "sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a"}, - {file = "setuptools-68.2.2.tar.gz", hash = "sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] - [[package]] name = "snowballstemmer" version = "2.2.0" @@ -1087,26 +929,6 @@ secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17. socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] -[[package]] -name = "virtualenv" -version = "20.24.5" -description = "Virtual Python Environment builder" -optional = false -python-versions = ">=3.7" -files = [ - {file = "virtualenv-20.24.5-py3-none-any.whl", hash = "sha256:b80039f280f4919c77b30f1c23294ae357c4c8701042086e3fc005963e4e537b"}, - {file = "virtualenv-20.24.5.tar.gz", hash = "sha256:e8361967f6da6fbdf1426483bfe9fca8287c242ac0bc30429905721cefbff752"}, -] - -[package.dependencies] -distlib = ">=0.3.7,<1" -filelock = ">=3.12.2,<4" -platformdirs = ">=3.9.1,<4" - -[package.extras] -docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] -test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] - [[package]] name = "wrapt" version = "1.15.0" @@ -1194,4 +1016,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "f30b6372bb7a29ea17e0160f4f3b0db55e74b7260a48b10d13a44bf41bd0fabc" +content-hash = "22fa6beaa68fb4a2e57da48d0798400221d508fb62d2f0b9a6c1a67953cdd930" diff --git a/pyproject.toml b/pyproject.toml index fcabc099..1b824796 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,6 @@ django = "^4.2.4" django-environ = "^0.10.0" [tool.poetry.group.dev.dependencies] -pre-commit = "^3.3.3" black = "^23.7.0" ruff = "^0.0.286" pylint-django = "^2.5.3" From 9b5883370731b0d32b0d0c4bb9dc6e3b409dccb2 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 03:08:49 +0000 Subject: [PATCH 28/49] feat: Update ci config --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9a97aede..a109f671 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,6 +27,8 @@ repos: - id: poetry-lock # - id: poetry-export - id: poetry-install + stages: + - post-checkout ## Markdown - repo: https://github.com/frnmst/md-toc @@ -167,8 +169,6 @@ repos: - id: gitlint ci: - autoupdate_schedule: weekly - autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit auto update autofix_prs: false - autofix_commit_msg: 🎨 [pre-commit.ci] Auto fixes from pre-commit.com hooks + autofix_commit_msg: 🎨 [pre-commit.ci] auto fixes from pre-commit.com hooks skip: [poetry-check, poetry-lock, poetry-install] From b782550792cb137de7ff5b7045d577b1f441d8aa Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 03:10:08 +0000 Subject: [PATCH 29/49] feat: Update ci config --- .pre-commit-config.yaml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a109f671..cb64af9f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,16 +20,6 @@ repos: additional_dependencies: - tomli - - repo: https://github.com/python-poetry/poetry - rev: 1.6.1 - hooks: - - id: poetry-check - - id: poetry-lock - # - id: poetry-export - - id: poetry-install - stages: - - post-checkout - ## Markdown - repo: https://github.com/frnmst/md-toc rev: 8.2.0 @@ -171,4 +161,3 @@ repos: ci: autofix_prs: false autofix_commit_msg: 🎨 [pre-commit.ci] auto fixes from pre-commit.com hooks - skip: [poetry-check, poetry-lock, poetry-install] From 52f2329cc95e64b6198adca6b0aa50b379c091ba Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 03:16:30 +0000 Subject: [PATCH 30/49] feat: Update ci config --- .pre-commit-config.yaml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cb64af9f..4627ebec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -112,7 +112,7 @@ repos: - id: djlint-django - repo: https://github.com/bridgecrewio/checkov.git - rev: 2.4.32 + rev: 2.4.33 hooks: - id: checkov @@ -121,13 +121,6 @@ repos: hooks: - id: ruff args: [ - --check, - --config=pyproject.toml, - --verbose - ] - - id: ruff-format - args: [ - --check, --config=pyproject.toml, --verbose ] From 704ac49b7cee13799ee88e67400c066fc8062127 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 03:27:14 +0000 Subject: [PATCH 31/49] feat: Update ci config --- .github/workflows/ci.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 83cbb293..e33ebd96 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ jobs: # Ubuntu 22.04.3 LTS | Python 3.10.12 | Pipx 1.2.0 | No poetry | PostgreSQL 14.9 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: python -m pipx install poetry - name: Set up Python version from Poetry config uses: actions/setup-python@v4 @@ -24,9 +24,9 @@ jobs: lint: runs-on: ubuntu-latest - needs: [requirements] + # needs: [requirements] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: python -m pipx install poetry - name: Set up Python version from Poetry config uses: actions/setup-python@v4 @@ -42,9 +42,9 @@ jobs: format: runs-on: ubuntu-latest - needs: [lint] + # needs: [lint] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: python -m pipx install poetry - name: Set up Python version from Poetry config uses: actions/setup-python@v4 @@ -63,9 +63,9 @@ jobs: test: runs-on: ubuntu-latest - needs: [format] + # needs: [format] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: python -m pipx install poetry - name: Set up Python version from Poetry config uses: actions/setup-python@v4 @@ -82,9 +82,9 @@ jobs: build: runs-on: ubuntu-latest - needs: [test] + # needs: [test] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: python -m pipx install poetry - name: Set up Python version from Poetry config uses: actions/setup-python@v4 From 387aefc8f0b68a7070491796c5c71645047faf6e Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 01:17:52 +0000 Subject: [PATCH 32/49] feat: Update ci config --- .github/workflows/ci.yaml | 77 +++++++++------- .pre-commit-config.yaml | 51 ++--------- poetry.lock | 180 +------------------------------------- pyproject.toml | 1 - 4 files changed, 54 insertions(+), 255 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4dcc9b7c..83cbb293 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,65 +1,63 @@ name: ci -on: - pull_request: - push: - branches-ignore: main +on: [push, pull_request] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: requirements: - runs-on: ubuntu-latest + # Ubunty latest @ 13-Sep-23: + # Ubuntu 22.04.3 LTS | Python 3.10.12 | Pipx 1.2.0 | No poetry | PostgreSQL 14.9 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python 3.11 + - run: python -m pipx install poetry + - name: Set up Python version from Poetry config uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version-file: 'pyproject.toml' + cache: 'poetry' # caching poetry dependencies + # Warning: poetry cache is not found - name: Requirements check - run: | - python -V - python -m pip install --upgrade pip - python -m pip install poetry - poetry install - + run: poetry install --no-interaction + lint: runs-on: ubuntu-latest needs: [requirements] steps: - uses: actions/checkout@v3 - # - name: Set up Python 3.11 - # uses: actions/setup-python@v4 - # with: - # python-version: 3.11 + - run: python -m pipx install poetry + - name: Set up Python version from Poetry config + uses: actions/setup-python@v4 + with: + python-version-file: 'pyproject.toml' + cache: 'poetry' # caching poetry dependencies + # Warning: poetry cache is not found + - run: poetry install --only dev --no-interaction - name: Ruff linting uses: chartboost/ruff-action@v1 with: args: check --config=pyproject.toml --verbose - # run: | - # python -m pip install --upgrade pip - # python -m pip install poetry - # poetry install - + format: runs-on: ubuntu-latest needs: [lint] steps: - uses: actions/checkout@v3 - - name: Set up Python 3.11 + - run: python -m pipx install poetry + - name: Set up Python version from Poetry config uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version-file: 'pyproject.toml' + cache: 'poetry' # caching poetry dependencies + # Warning: poetry cache is not found + - run: poetry install --only dev --no-interaction - name: Black style formatting uses: psf/black@stable with: options: --color --config=pyproject.toml --verbose - # run: | - # python -m pip install --upgrade pip - # python -m pip install poetry - # poetry install --only dev - # poetry run black . + # run: poetry run black . # env: # CHANGED_FILES: ${{ steps.file_changes.outputs.added_modified }} @@ -68,17 +66,34 @@ jobs: needs: [format] steps: - uses: actions/checkout@v3 + - run: python -m pipx install poetry + - name: Set up Python version from Poetry config + uses: actions/setup-python@v4 + with: + python-version-file: 'pyproject.toml' + cache: 'poetry' # caching poetry dependencies + # Warning: poetry cache is not found + - run: poetry install --only dev - name: Unit testing run: | python -V - # poetry -V + poetry -V + # poetry run pytest build: runs-on: ubuntu-latest needs: [test] steps: - uses: actions/checkout@v3 + - run: python -m pipx install poetry + - name: Set up Python version from Poetry config + uses: actions/setup-python@v4 + with: + python-version-file: 'pyproject.toml' + cache: 'poetry' # caching poetry dependencies + # Warning: poetry cache is not found + - run: poetry install --only dev - name: Build run: | python -V - # poetry -V + poetry -V diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d011b9b7..4627ebec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,25 +1,9 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks - ---- - -default_install_hook_types: - # - commit-msg - # - post-checkout - # - post-commit - # - post-rewrite - # - post-merge - - pre-commit - # - pre-push - # - prepare-commit-msg default_language_version: - python: python3.11 -default_stages: - - commit - # - push - # - merge-commit + python: python3.11 exclude: .*migrations\/.*|.git minimum_pre_commit_version: 3.2.1 +default_stages: [commit, push] +fail_fast: true repos: # Automatically fix issues @@ -36,14 +20,6 @@ repos: additional_dependencies: - tomli - # ## Poetry - # - repo: https://github.com/python-poetry/poetry - # rev: 1.6.0 - # hooks: - # - id: poetry-check - # - id: poetry-lock - # - id: poetry-install - ## Markdown - repo: https://github.com/frnmst/md-toc rev: 8.2.0 @@ -136,12 +112,12 @@ repos: - id: djlint-django - repo: https://github.com/bridgecrewio/checkov.git - rev: 2.4.32 + rev: 2.4.33 hooks: - id: checkov - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.287 + rev: v0.0.289 hooks: - id: ruff args: [ @@ -175,19 +151,6 @@ repos: hooks: - id: gitlint -# - repo: https://github.com/pre-commit/mirrors-mypy -# rev: v1.5.1 -# hooks: -# - id: mypy -# exclude: ^tests/ -# args: [ -# --strict, -# --config-file=pyproject.toml -# ] -# additional_dependencies: -# - pytest==7.1.2 - ci: - autoupdate_schedule: weekly - autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks - autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate + autofix_prs: false + autofix_commit_msg: 🎨 [pre-commit.ci] auto fixes from pre-commit.com hooks diff --git a/poetry.lock b/poetry.lock index 4c99ab82..93e38f92 100644 --- a/poetry.lock +++ b/poetry.lock @@ -106,17 +106,6 @@ files = [ {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, ] -[[package]] -name = "cfgv" -version = "3.4.0" -description = "Validate configuration and produce human readable error messages." -optional = false -python-versions = ">=3.8" -files = [ - {file = "cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9"}, - {file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"}, -] - [[package]] name = "charset-normalizer" version = "3.2.0" @@ -240,17 +229,6 @@ files = [ [package.extras] graph = ["objgraph (>=1.7.2)"] -[[package]] -name = "distlib" -version = "0.3.7" -description = "Distribution utilities" -optional = false -python-versions = "*" -files = [ - {file = "distlib-0.3.7-py2.py3-none-any.whl", hash = "sha256:2e24928bc811348f0feb63014e97aaae3037f2cf48712d51ae61df7fd6075057"}, - {file = "distlib-0.3.7.tar.gz", hash = "sha256:9dafe54b34a028eafd95039d5e5d4851a13734540f1331060d31c9916e7147a8"}, -] - [[package]] name = "django" version = "4.2.5" @@ -298,35 +276,6 @@ files = [ {file = "docutils-0.18.1.tar.gz", hash = "sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"}, ] -[[package]] -name = "filelock" -version = "3.12.3" -description = "A platform independent file lock." -optional = false -python-versions = ">=3.8" -files = [ - {file = "filelock-3.12.3-py3-none-any.whl", hash = "sha256:f067e40ccc40f2b48395a80fcbd4728262fab54e232e090a4063ab804179efeb"}, - {file = "filelock-3.12.3.tar.gz", hash = "sha256:0ecc1dd2ec4672a10c8550a8182f1bd0c0a5088470ecd5a125e45f49472fac3d"}, -] - -[package.extras] -docs = ["furo (>=2023.7.26)", "sphinx (>=7.1.2)", "sphinx-autodoc-typehints (>=1.24)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.3)", "diff-cover (>=7.7)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)", "pytest-timeout (>=2.1)"] - -[[package]] -name = "identify" -version = "2.5.27" -description = "File identification library for Python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "identify-2.5.27-py2.py3-none-any.whl", hash = "sha256:fdb527b2dfe24602809b2201e033c2a113d7bdf716db3ca8e3243f735dcecaba"}, - {file = "identify-2.5.27.tar.gz", hash = "sha256:287b75b04a0e22d727bc9a41f0d4f3c1bcada97490fa6eabb5b28f0e9097e733"}, -] - -[package.extras] -license = ["ukkonen"] - [[package]] name = "idna" version = "3.4" @@ -519,20 +468,6 @@ files = [ {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, ] -[[package]] -name = "nodeenv" -version = "1.8.0" -description = "Node.js virtual environment builder" -optional = false -python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" -files = [ - {file = "nodeenv-1.8.0-py2.py3-none-any.whl", hash = "sha256:df865724bb3c3adc86b3876fa209771517b0cfe596beff01a92700e0e8be4cec"}, - {file = "nodeenv-1.8.0.tar.gz", hash = "sha256:d51e0c37e64fbf47d017feac3145cdbb58836d7eee8c6f6d3b6880c5456227d2"}, -] - -[package.dependencies] -setuptools = "*" - [[package]] name = "packaging" version = "23.1" @@ -570,24 +505,6 @@ files = [ docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.1)", "sphinx-autodoc-typehints (>=1.24)"] test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)"] -[[package]] -name = "pre-commit" -version = "3.4.0" -description = "A framework for managing and maintaining multi-language pre-commit hooks." -optional = false -python-versions = ">=3.8" -files = [ - {file = "pre_commit-3.4.0-py2.py3-none-any.whl", hash = "sha256:96d529a951f8b677f730a7212442027e8ba53f9b04d217c4c67dc56c393ad945"}, - {file = "pre_commit-3.4.0.tar.gz", hash = "sha256:6bbd5129a64cad4c0dfaeeb12cd8f7ea7e15b77028d985341478c8af3c759522"}, -] - -[package.dependencies] -cfgv = ">=2.0.0" -identify = ">=1.0.0" -nodeenv = ">=0.11.1" -pyyaml = ">=5.1" -virtualenv = ">=20.10.0" - [[package]] name = "psycopg2-binary" version = "2.9.7" @@ -728,65 +645,6 @@ files = [ [package.dependencies] pylint = ">=1.7" -[[package]] -name = "pyyaml" -version = "6.0.1" -description = "YAML parser and emitter for Python" -optional = false -python-versions = ">=3.6" -files = [ - {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, - {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, - {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, - {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, - {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, - {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, - {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, - {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, - {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, - {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, - {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, - {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, - {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, - {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, - {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, - {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, - {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, - {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, - {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, - {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, - {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, - {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, - {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, - {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, - {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, - {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, - {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, - {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, - {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, - {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, - {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, - {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, - {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, - {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, - {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, - {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, - {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, - {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, - {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, - {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, - {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, - {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, - {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, - {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, - {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, - {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, - {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, -] - [[package]] name = "requests" version = "2.31.0" @@ -834,22 +692,6 @@ files = [ {file = "ruff-0.0.286.tar.gz", hash = "sha256:f1e9d169cce81a384a26ee5bb8c919fe9ae88255f39a1a69fd1ebab233a85ed2"}, ] -[[package]] -name = "setuptools" -version = "68.2.0" -description = "Easily download, build, install, upgrade, and uninstall Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "setuptools-68.2.0-py3-none-any.whl", hash = "sha256:af3d5949030c3f493f550876b2fd1dd5ec66689c4ee5d5344f009746f71fd5a8"}, - {file = "setuptools-68.2.0.tar.gz", hash = "sha256:00478ca80aeebeecb2f288d3206b0de568df5cd2b8fada1209843cc9a8d88a48"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] - [[package]] name = "snowballstemmer" version = "2.2.0" @@ -1087,26 +929,6 @@ secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17. socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] -[[package]] -name = "virtualenv" -version = "20.24.5" -description = "Virtual Python Environment builder" -optional = false -python-versions = ">=3.7" -files = [ - {file = "virtualenv-20.24.5-py3-none-any.whl", hash = "sha256:b80039f280f4919c77b30f1c23294ae357c4c8701042086e3fc005963e4e537b"}, - {file = "virtualenv-20.24.5.tar.gz", hash = "sha256:e8361967f6da6fbdf1426483bfe9fca8287c242ac0bc30429905721cefbff752"}, -] - -[package.dependencies] -distlib = ">=0.3.7,<1" -filelock = ">=3.12.2,<4" -platformdirs = ">=3.9.1,<4" - -[package.extras] -docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] -test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] - [[package]] name = "wrapt" version = "1.15.0" @@ -1194,4 +1016,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "a3bc7cc7ff61d8cb15c5739256f19d492c35e25866fc16a57f49600d3650a625" +content-hash = "22fa6beaa68fb4a2e57da48d0798400221d508fb62d2f0b9a6c1a67953cdd930" diff --git a/pyproject.toml b/pyproject.toml index fcabc099..1b824796 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,6 @@ django = "^4.2.4" django-environ = "^0.10.0" [tool.poetry.group.dev.dependencies] -pre-commit = "^3.3.3" black = "^23.7.0" ruff = "^0.0.286" pylint-django = "^2.5.3" From 902a5959fa238bd6871074f04a87d1c810abf454 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 03:27:14 +0000 Subject: [PATCH 33/49] feat: Update ci config --- .github/workflows/ci.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 83cbb293..e33ebd96 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ jobs: # Ubuntu 22.04.3 LTS | Python 3.10.12 | Pipx 1.2.0 | No poetry | PostgreSQL 14.9 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: python -m pipx install poetry - name: Set up Python version from Poetry config uses: actions/setup-python@v4 @@ -24,9 +24,9 @@ jobs: lint: runs-on: ubuntu-latest - needs: [requirements] + # needs: [requirements] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: python -m pipx install poetry - name: Set up Python version from Poetry config uses: actions/setup-python@v4 @@ -42,9 +42,9 @@ jobs: format: runs-on: ubuntu-latest - needs: [lint] + # needs: [lint] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: python -m pipx install poetry - name: Set up Python version from Poetry config uses: actions/setup-python@v4 @@ -63,9 +63,9 @@ jobs: test: runs-on: ubuntu-latest - needs: [format] + # needs: [format] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: python -m pipx install poetry - name: Set up Python version from Poetry config uses: actions/setup-python@v4 @@ -82,9 +82,9 @@ jobs: build: runs-on: ubuntu-latest - needs: [test] + # needs: [test] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: python -m pipx install poetry - name: Set up Python version from Poetry config uses: actions/setup-python@v4 From 4f5947946389ba2021b5df69ffff3e7769a99225 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 04:16:21 +0000 Subject: [PATCH 34/49] feat: Update ci config --- .circleci/config.yml | 13 +++++-------- .github/workflows/ci.yaml | 3 +-- .pre-commit-config.yaml | 9 +++++++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bc83f75b..347a3bb5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,14 +4,11 @@ executors: app-executor: docker: - image: cimg/python:3.11 + # @ 13-Sep-23: + # ubuntu 22.04.2 LTS | python3 3.11.5 | poetry 1.6.1 working_directory: ~/app aliases: - - &show-current-branch - run: - name: Show Current Branch - command: echo ${CIRCLE_BRANCH} - - &install-dependencies run: name: Install Dependencies @@ -24,14 +21,13 @@ aliases: name: Build Project command: | poetry install - echo "Build Successful !" + echo "Build Successful !"" jobs: requirements: executor: app-executor steps: - checkout - - *show-current-branch - *install-dependencies - run: name: Requirements check @@ -49,6 +45,7 @@ jobs: command: | python -V poetry -V + poetry run black --check --diff --color --config=pyproject.toml # steps: # - python/install-packages: @@ -72,7 +69,7 @@ jobs: command: | python -V poetry -V - + poetry run black . --check --diff --color --config=pyproject.toml # steps: # - python/install-packages: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e33ebd96..6465e7d4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,8 +56,7 @@ jobs: - name: Black style formatting uses: psf/black@stable with: - options: --color --config=pyproject.toml --verbose - # run: poetry run black . + options: "--check --diff --color --config=pyproject.toml" # env: # CHANGED_FILES: ${{ steps.file_changes.outputs.added_modified }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4627ebec..8bbace34 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -125,11 +125,16 @@ repos: --verbose ] - - repo: https://github.com/psf/black + - repo: https://github.com/psf/black-pre-commit-mirror rev: 23.9.1 hooks: - id: black - args: [--config=pyproject.toml] + args: [ + --check, + --diff, + --color, + --config=pyproject.toml + ] - repo: https://github.com/adamchainz/blacken-docs rev: 1.16.0 From 1763d0988d46dff728b14b84e020c6270bad0a87 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 04:38:37 +0000 Subject: [PATCH 35/49] feat: Update ci config --- .circleci/config.yml | 6 +----- .github/workflows/ci.yaml | 4 ++-- .pre-commit-config.yaml | 2 ++ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 347a3bb5..1243ade2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,13 +39,12 @@ jobs: executor: app-executor steps: - checkout - - *show-current-branch - run: name: Ruff linting command: | python -V poetry -V - poetry run black --check --diff --color --config=pyproject.toml + poetry run ruff check --config=pyproject.toml . # steps: # - python/install-packages: @@ -63,7 +62,6 @@ jobs: executor: app-executor steps: - checkout - - *show-current-branch - run: name: Black style formatting command: | @@ -95,7 +93,6 @@ jobs: executor: app-executor steps: - checkout - - *show-current-branch - run: name: Unit testing command: | @@ -106,7 +103,6 @@ jobs: executor: app-executor steps: - checkout - - *show-current-branch - run: name: Build command: | diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6465e7d4..74d38cb8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,7 +38,7 @@ jobs: - name: Ruff linting uses: chartboost/ruff-action@v1 with: - args: check --config=pyproject.toml --verbose + args: --config=pyproject.toml --verbose format: runs-on: ubuntu-latest @@ -56,7 +56,7 @@ jobs: - name: Black style formatting uses: psf/black@stable with: - options: "--check --diff --color --config=pyproject.toml" + options: --check --diff --color --config=pyproject.toml # env: # CHANGED_FILES: ${{ steps.file_changes.outputs.added_modified }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8bbace34..24fb3074 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -121,7 +121,9 @@ repos: hooks: - id: ruff args: [ + check, --config=pyproject.toml, + --force-exclude, --verbose ] From 5665f243858fa78ab8969c698a62b9eb1d17df11 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 04:50:01 +0000 Subject: [PATCH 36/49] feat: Update ci config --- .circleci/config.yml | 22 +++++++++++++++++----- .github/workflows/ci.yaml | 4 ++-- .pre-commit-config.yaml | 1 - 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1243ade2..8624f0da 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,17 +11,24 @@ executors: aliases: - &install-dependencies run: - name: Install Dependencies - command: | - poetry install - echo "Successfully installed ependencies !" + name: Install dependencies + command: poetry install + + - &install-dev-dependencies + run: + name: Install dev dependencies + command: poetry install --only dev + + - &install-test-dependencies + run: + name: Install test dependencies + command: poetry install --only test - &build-project run: name: Build Project command: | poetry install - echo "Build Successful !"" jobs: requirements: @@ -39,6 +46,7 @@ jobs: executor: app-executor steps: - checkout + - *install-dev-dependencies - run: name: Ruff linting command: | @@ -62,6 +70,7 @@ jobs: executor: app-executor steps: - checkout + - *install-dev-dependencies - run: name: Black style formatting command: | @@ -93,6 +102,8 @@ jobs: executor: app-executor steps: - checkout + #- *install-test-dependencies + - *install-dev-dependencies - run: name: Unit testing command: | @@ -103,6 +114,7 @@ jobs: executor: app-executor steps: - checkout + - *install-dependencies - run: name: Build command: | diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 74d38cb8..ee87139b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,7 +72,7 @@ jobs: python-version-file: 'pyproject.toml' cache: 'poetry' # caching poetry dependencies # Warning: poetry cache is not found - - run: poetry install --only dev + - run: poetry install --only dev --no-interaction - name: Unit testing run: | python -V @@ -91,7 +91,7 @@ jobs: python-version-file: 'pyproject.toml' cache: 'poetry' # caching poetry dependencies # Warning: poetry cache is not found - - run: poetry install --only dev + - run: poetry install - name: Build run: | python -V diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 24fb3074..6119cd44 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -123,7 +123,6 @@ repos: args: [ check, --config=pyproject.toml, - --force-exclude, --verbose ] From f3170558af9c303a2702d58a08e54a3e4af7aec4 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 05:24:16 +0000 Subject: [PATCH 37/49] feat: Update ci config --- .circleci/config.yml | 55 ++++++++++++++------------------------- .github/workflows/ci.yaml | 2 +- .pre-commit-config.yaml | 1 - pyproject.toml | 5 +++- 4 files changed, 24 insertions(+), 39 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8624f0da..a2d38e14 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,8 +27,7 @@ aliases: - &build-project run: name: Build Project - command: | - poetry install + command: poetry install jobs: requirements: @@ -47,56 +46,40 @@ jobs: steps: - checkout - *install-dev-dependencies + - run: &git-diff-py-files + name: List added, copied, modified, and renamed *py files + command: git diff --name-only --diff-filter=ACMR origin/main | grep -E "(.py$)" > diff.txt || true - run: name: Ruff linting command: | python -V poetry -V - poetry run ruff check --config=pyproject.toml . - - # steps: - # - python/install-packages: - # pip-dependency-file: requirements.txt - # pkg-manager: pip - # - run: *git-diff-py-files - # - run: - # name: List ruff errors - # command: ruff check . &> lint_checks.txt || true - # - run: - # name: 🧹 Diff-based ruff - # command: *display-lint-errors + poetry run ruff check --config=pyproject.toml . &> lint_checks.txt || true + - run: + name: Diff-based ruff + command: &display-lint-errors | + grep -Ff diff.txt lint_checks.txt > lint_errors.txt || true + if [ -s lint_errors.txt ]; then + cat lint_errors.txt + printf 'Run the following command to fix your branch:\n make fixes' + exit 1 + fi format: executor: app-executor steps: - checkout - *install-dev-dependencies + - run: *git-diff-py-files - run: name: Black style formatting command: | python -V poetry -V - poetry run black . --check --diff --color --config=pyproject.toml - - # steps: - # - python/install-packages: - # pip-dependency-file: requirements.txt - # pkg-manager: pip - # - run: &git-diff-py-files - # name: List added, copied, modified, and renamed *py files - # command: git diff --name-only --diff-filter=ACMR origin/main | grep -E "(.py$)" > diff.txt || true - # - run: - # name: List black errors - # command: black . --check &> lint_checks.txt || true - # - run: - # name: 🧹 Diff-based black - # command: &display-lint-errors | - # grep -Ff diff.txt lint_checks.txt > lint_errors.txt || true - # if [ -s lint_errors.txt ]; then - # cat lint_errors.txt - # printf 'Run the following command to fix your branch:\n make fixes' - # exit 1 - # fi + poetry run black . --check --diff --color --config=pyproject.toml &> lint_checks.txt || true + - run: + name: 🧹 Diff-based black + command: *display-lint-errors test: executor: app-executor diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ee87139b..0d3e04f2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,7 +38,7 @@ jobs: - name: Ruff linting uses: chartboost/ruff-action@v1 with: - args: --config=pyproject.toml --verbose + args: --config=pyproject.toml format: runs-on: ubuntu-latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6119cd44..fcf4b69a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -123,7 +123,6 @@ repos: args: [ check, --config=pyproject.toml, - --verbose ] - repo: https://github.com/psf/black-pre-commit-mirror diff --git a/pyproject.toml b/pyproject.toml index 1b824796..8d5379d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,9 @@ psycopg2-binary = "^2.9.7" django = "^4.2.4" django-environ = "^0.10.0" +[tool.poetry.group.dev] +optional = true + [tool.poetry.group.dev.dependencies] black = "^23.7.0" ruff = "^0.0.286" @@ -49,7 +52,7 @@ extend-exclude = ''' [tool.ruff] cache-dir = "~/.cache/ruff" -fix = true +fix = false target-version = "py311" show-fixes = true show-source = true From 734e6981e06c3de67f8eb21ca88c916be59bb8d1 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 05:28:31 +0000 Subject: [PATCH 38/49] feat: Update ci config --- .circleci/config.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a2d38e14..ca7cd708 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -108,23 +108,29 @@ workflows: # version: 2 ci: jobs: - - requirements + - requirements: + name: Validate requirements + filters: &ci-filter + branches: + ignore: main + tags: + ignore: /.*/ - lint: - # name: ruff linting - # filters: *ci-filter + name: Ruff linting + filters: *ci-filter requires: - requirements - format: - # name: black style formatting - # filters: *ci-filter + name: black style formatting + filters: *ci-filter requires: - lint - test: - # name: Unit testing - # filters: *ci-filter + name: Unit testing + filters: *ci-filter requires: - format From d11235530c105c828a50995a106ff38b9b16b4fa Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 05:36:30 +0000 Subject: [PATCH 39/49] feat: Update ci config --- .circleci/config.yml | 14 +++++++------- .pre-commit-config.yaml | 1 - poetry.lock | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ca7cd708..c53e2bf6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,7 +109,7 @@ workflows: ci: jobs: - requirements: - name: Validate requirements + name: 🧪 Validate requirements filters: &ci-filter branches: ignore: main @@ -117,22 +117,22 @@ workflows: ignore: /.*/ - lint: - name: Ruff linting + name: 🚓 Ruff linting filters: *ci-filter requires: - - requirements + - 🧪 Validate requirements - format: - name: black style formatting + name: ⚫ Black formatting filters: *ci-filter requires: - - lint + - 🚓 Ruff linting - test: - name: Unit testing + name: 🧪 Unit testing filters: *ci-filter requires: - - format + - ⚫ Black formatting build: jobs: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fcf4b69a..9359a1c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -121,7 +121,6 @@ repos: hooks: - id: ruff args: [ - check, --config=pyproject.toml, ] diff --git a/poetry.lock b/poetry.lock index 93e38f92..85a71492 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1016,4 +1016,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "22fa6beaa68fb4a2e57da48d0798400221d508fb62d2f0b9a6c1a67953cdd930" +content-hash = "82824c40d622370e7b96fd0b364af3236d040787b5bf62ba61a5576829c84dfe" From fc65477e6f636caecbd642b909fd38f0a1b1ecff Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 05:46:54 +0000 Subject: [PATCH 40/49] feat: Update ci config --- .circleci/config.yml | 5 +---- ch04-bookstore/manage.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c53e2bf6..1aad8e7a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,10 +51,7 @@ jobs: command: git diff --name-only --diff-filter=ACMR origin/main | grep -E "(.py$)" > diff.txt || true - run: name: Ruff linting - command: | - python -V - poetry -V - poetry run ruff check --config=pyproject.toml . &> lint_checks.txt || true + command: poetry run ruff check --config=pyproject.toml . &> lint_checks.txt || true - run: name: Diff-based ruff command: &display-lint-errors | diff --git a/ch04-bookstore/manage.py b/ch04-bookstore/manage.py index e41316e0..e8fd740c 100644 --- a/ch04-bookstore/manage.py +++ b/ch04-bookstore/manage.py @@ -6,7 +6,7 @@ def main(): """Run administrative tasks.""" - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookstore.settings") + os.environ.setdefault('DJANGO_SETTINGS_MODULE', "bookstore.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: From bbfa1992f6e3e04604f28021c5323a4947b7da46 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 05:54:07 +0000 Subject: [PATCH 41/49] feat: Update ci config --- .circleci/config.yml | 3 ++- .github/workflows/ci.yaml | 8 ++++---- .pre-commit-config.yaml | 1 - pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1aad8e7a..269338e0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -123,12 +123,13 @@ workflows: name: ⚫ Black formatting filters: *ci-filter requires: - - 🚓 Ruff linting + - 🧪 Validate requirements - test: name: 🧪 Unit testing filters: *ci-filter requires: + - 🚓 Ruff linting - ⚫ Black formatting build: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0d3e04f2..4fd04683 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -24,7 +24,7 @@ jobs: lint: runs-on: ubuntu-latest - # needs: [requirements] + needs: [requirements] steps: - uses: actions/checkout@v4 - run: python -m pipx install poetry @@ -42,7 +42,7 @@ jobs: format: runs-on: ubuntu-latest - # needs: [lint] + needs: [requirements] steps: - uses: actions/checkout@v4 - run: python -m pipx install poetry @@ -62,7 +62,7 @@ jobs: test: runs-on: ubuntu-latest - # needs: [format] + needs: [lint, format] steps: - uses: actions/checkout@v4 - run: python -m pipx install poetry @@ -81,7 +81,7 @@ jobs: build: runs-on: ubuntu-latest - # needs: [test] + needs: [test] steps: - uses: actions/checkout@v4 - run: python -m pipx install poetry diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9359a1c8..1c1c0f55 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,6 @@ default_language_version: exclude: .*migrations\/.*|.git minimum_pre_commit_version: 3.2.1 default_stages: [commit, push] -fail_fast: true repos: # Automatically fix issues diff --git a/pyproject.toml b/pyproject.toml index 8d5379d9..1334de39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ extend-exclude = ''' [tool.ruff] cache-dir = "~/.cache/ruff" -fix = false +fix = true target-version = "py311" show-fixes = true show-source = true From 3e68cd2e73a1c10379d8267faff4573bdc460558 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 05:59:52 +0000 Subject: [PATCH 42/49] feat: Update ci config --- .circleci/config.yml | 16 ++++++++-------- ch04-bookstore/manage.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 269338e0..fc2e8d34 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -106,7 +106,7 @@ workflows: ci: jobs: - requirements: - name: 🧪 Validate requirements + name: Validate requirements filters: &ci-filter branches: ignore: main @@ -114,23 +114,23 @@ workflows: ignore: /.*/ - lint: - name: 🚓 Ruff linting + name: Ruff linting filters: *ci-filter requires: - - 🧪 Validate requirements + - Validate requirements - format: - name: ⚫ Black formatting + name: Black formatting filters: *ci-filter requires: - - 🧪 Validate requirements + - Validate requirements - test: - name: 🧪 Unit testing + name: Unit testing filters: *ci-filter requires: - - 🚓 Ruff linting - - ⚫ Black formatting + - Ruff linting + - Black formatting build: jobs: diff --git a/ch04-bookstore/manage.py b/ch04-bookstore/manage.py index e8fd740c..e41316e0 100644 --- a/ch04-bookstore/manage.py +++ b/ch04-bookstore/manage.py @@ -6,7 +6,7 @@ def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', "bookstore.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookstore.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: From 673717e8bbdf96adb7beb23d56aea45592e72f1b Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 06:19:58 +0000 Subject: [PATCH 43/49] feat: Update ci config --- .circleci/config.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fc2e8d34..4922285d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,8 @@ version: 2.1 +orbs: + python: circleci/python@2.1.1 + executors: app-executor: docker: @@ -34,7 +37,8 @@ jobs: executor: app-executor steps: - checkout - - *install-dependencies + - python/install-packages: + pkg-manager: poetry - run: name: Requirements check command: | @@ -42,7 +46,10 @@ jobs: poetry -V lint: - executor: app-executor + # executor: app-executor + executor: &python-executor + name: python/default + #tag: 3.10.12 steps: - checkout - *install-dev-dependencies @@ -63,7 +70,8 @@ jobs: fi format: - executor: app-executor + # executor: app-executor + executor: *python-executor steps: - checkout - *install-dev-dependencies @@ -79,11 +87,12 @@ jobs: command: *display-lint-errors test: - executor: app-executor + # executor: app-executor + executor: *python-executor steps: - checkout - #- *install-test-dependencies - - *install-dev-dependencies + - python/install-packages: + pkg-manager: poetry - run: name: Unit testing command: | @@ -102,7 +111,6 @@ jobs: poetry -V workflows: - # version: 2 ci: jobs: - requirements: From 69bb3e0b3961270ef09f1ff71b94bc6c40d68045 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 06:22:16 +0000 Subject: [PATCH 44/49] feat: Update ci config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4922285d..9cecf684 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,7 @@ jobs: # executor: app-executor executor: &python-executor name: python/default - #tag: 3.10.12 + tag: 3.11.5 steps: - checkout - *install-dev-dependencies From 3492b82ec55a02aeef0985eb08fdb44dedcf096e Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 06:23:41 +0000 Subject: [PATCH 45/49] feat: Update ci config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9cecf684..a50a9d55 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,7 @@ jobs: # executor: app-executor executor: &python-executor name: python/default - tag: 3.11.5 + tag: 3.11 steps: - checkout - *install-dev-dependencies From 4c7b993f0741da23f20122b5491559912c8e04a4 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 06:25:44 +0000 Subject: [PATCH 46/49] feat: Update ci config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a50a9d55..fe1dee4e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,7 @@ jobs: # executor: app-executor executor: &python-executor name: python/default - tag: 3.11 + tag: "3.11" steps: - checkout - *install-dev-dependencies From 92ddb69731f3ba3abf798528d18943b3996e5580 Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 06:29:36 +0000 Subject: [PATCH 47/49] feat: Update ci config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe1dee4e..c95daa0b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,7 @@ jobs: poetry -V poetry run black . --check --diff --color --config=pyproject.toml &> lint_checks.txt || true - run: - name: 🧹 Diff-based black + name: Diff-based black command: *display-lint-errors test: From 107175b999042be7067fca0042ceccc5deec9d4d Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 06:30:58 +0000 Subject: [PATCH 48/49] feat: Update ci config --- ch04-bookstore/manage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch04-bookstore/manage.py b/ch04-bookstore/manage.py index e41316e0..e8fd740c 100644 --- a/ch04-bookstore/manage.py +++ b/ch04-bookstore/manage.py @@ -6,7 +6,7 @@ def main(): """Run administrative tasks.""" - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookstore.settings") + os.environ.setdefault('DJANGO_SETTINGS_MODULE', "bookstore.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: From ce1474bfc3b8fad12bc8f2d27a6829668df289db Mon Sep 17 00:00:00 2001 From: Carlos Regis Date: Wed, 13 Sep 2023 06:33:00 +0000 Subject: [PATCH 49/49] feat: Update ci config --- ch04-bookstore/manage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch04-bookstore/manage.py b/ch04-bookstore/manage.py index e8fd740c..e41316e0 100644 --- a/ch04-bookstore/manage.py +++ b/ch04-bookstore/manage.py @@ -6,7 +6,7 @@ def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', "bookstore.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookstore.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: