From 4a22aee7181f1630e2e9f905c5ed1aaa24c58416 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 10:16:58 +0000 Subject: [PATCH 1/6] Bump django-pipeline from 3.0.0 to 3.1.0 (#210) Bumps [django-pipeline](https://github.com/jazzband/django-pipeline) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/jazzband/django-pipeline/releases) - [Changelog](https://github.com/jazzband/django-pipeline/blob/master/HISTORY.rst) - [Commits](https://github.com/jazzband/django-pipeline/compare/3.0.0...3.1.0) --- updated-dependencies: - dependency-name: django-pipeline dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8cf2cb0..a93a1e3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ django==4.2.10 djangorestframework==3.15.1 -django-pipeline==3.0.0 +django-pipeline==3.1.0 django-dotenv==1.4.2 django-redis==5.4.0 coreapi==2.3.3 From 2b1c9c4f4045e1a8b9df2e9a543d941d90e1890c Mon Sep 17 00:00:00 2001 From: Alex Laird Date: Fri, 17 May 2024 16:44:05 -0700 Subject: [PATCH 2/6] Improvements to the auto-merge action for Dependabot. --- .github/workflows/automerge.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/build.yml | 17 +---------------- 2 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..21285d1 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,28 @@ +name: Auto-Merge Dependabot PRs + +on: + pull_request: + +jobs: + automerge: + name: Auto-Merge Dependabot PRs + + runs-on: ubuntu-latest + + permissions: + pull-requests: write + contents: write + + if: github.actor == 'dependabot[bot]' + steps: + - name: Get Dependabot metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Enable auto-merge + run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e6d961b..ab78798 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,19 +33,4 @@ jobs: id: get_version run: echo ::set-output name=BRANCH::${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - name: Test - run: BRANCH=${{ steps.get_version.outputs.BRANCH }} make test - - automerge: - name: "Auto Approve" - needs: build - runs-on: ubuntu-latest - - permissions: - pull-requests: write - contents: write - - steps: - - uses: fastify/github-action-merge-dependabot@v3 - with: - target: major - use-github-auto-merge: true + run: BRANCH=${{ steps.get_version.outputs.BRANCH }} make test \ No newline at end of file From 4e000684e43c4bfdb964676805725360e8e675c3 Mon Sep 17 00:00:00 2001 From: Alex Laird Date: Fri, 17 May 2024 18:37:41 -0700 Subject: [PATCH 3/6] Add coverage report from built template project. --- .github/workflows/build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab78798..c05907f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,4 +33,10 @@ jobs: id: get_version run: echo ::set-output name=BRANCH::${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - name: Test - run: BRANCH=${{ steps.get_version.outputs.BRANCH }} make test \ No newline at end of file + run: BRANCH=${{ steps.get_version.outputs.BRANCH }} make test + - name: Upload coverage + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./build/template-project-test-build/build/coverage \ No newline at end of file From d856b524352b34ac1ec6ccca167b4ff0693f3e42 Mon Sep 17 00:00:00 2001 From: Alex Laird Date: Fri, 17 May 2024 18:45:56 -0700 Subject: [PATCH 4/6] Add a template README so the main README can look good. --- README.md | 8 +++--- README.md.template | 64 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 README.md.template diff --git a/README.md b/README.md index 94d5632..21507a5 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ ![Python Versions](https://img.shields.io/badge/python-%203.8%20|%203.9%20|%203.10%20|%203.11%20-blue) -[![Build](https://img.shields.io/github/actions/workflow/status/{%PROJECT_GITHUB_USER%}/{%PROJECT_ID%}/build.yml)](https://github.com/{%PROJECT_GITHUB_USER%}/{%PROJECT_ID%}/actions/workflows/build.yml) -![GitHub License](https://img.shields.io/github/license/{%PROJECT_GITHUB_USER%}/{%PROJECT_ID%}) +[![Build](https://img.shields.io/github/actions/workflow/status/HeliumEdu/template-project/build.yml)](https://github.com/HeliumEdu/template-project/actions/workflows/build.yml) +![GitHub License](https://img.shields.io/github/license/HeliumEdu/template-project) -# {%PROJECT_NAME%} +# template-project ## Getting Started The project is developed using Python and [Django](https://www.djangoproject.com). -This repository contains the source code for the {%PROJECT_NAME%} project. +This repository contains the source code for the HeliumEdu `template-project`. ### Project Setup diff --git a/README.md.template b/README.md.template new file mode 100644 index 0000000..94d5632 --- /dev/null +++ b/README.md.template @@ -0,0 +1,64 @@ +![Python Versions](https://img.shields.io/badge/python-%203.8%20|%203.9%20|%203.10%20|%203.11%20-blue) +[![Build](https://img.shields.io/github/actions/workflow/status/{%PROJECT_GITHUB_USER%}/{%PROJECT_ID%}/build.yml)](https://github.com/{%PROJECT_GITHUB_USER%}/{%PROJECT_ID%}/actions/workflows/build.yml) +![GitHub License](https://img.shields.io/github/license/{%PROJECT_GITHUB_USER%}/{%PROJECT_ID%}) + +# {%PROJECT_NAME%} + +## Getting Started + +The project is developed using Python and [Django](https://www.djangoproject.com). + +This repository contains the source code for the {%PROJECT_NAME%} project. + +### Project Setup + +To setup the Python/Django build environment, execute: + +```sh +make install +``` + +This project is configured to work with a Virtualenv which has now been setup in the `.venv` folder. If you're +unfamiliar with how this works, [read up on Virtualenv here](https://virtualenv.pypa.io/en/stable). The short version +is, virtualenv creates isolated environments for each project's dependencies. To activate and use this environment when +developing, execute: + +```sh +source .venv/bin/activate +``` + +All commands below will now be run within the virtualenv (though `make` commands will always automatically enter the +virtualenv before executing). + +To ensure the database is in sync with the latest schema, database migrations are generated and run with Django. To run +migrations, execute: + +```sh +make migrate +``` + +Once migrations have been run, you can create a super user, which is a standard user that also has access to the /admin +site. + +```sh +python manage.py createsuperuser +``` + +Before commits are made, be sure to run tests and check the generated coverage report. + +```sh +make test +``` + +Now you're all set! To start the development server, execute: + +```sh +bin/runserver +``` + +A development server will be started at , though there is no mounted root URL—visit + or to see the project serve a request. + +If the `USE_NGROK` environment variable is set when a dev server is started (using `runserver`), +[pyngrok](https://github.com/alexdlaird/pyngrok) will be used to open a `ngrok` tunnel. This is especially useful when +using webhooks. From e7af89694cc26a274874ff4b9c25d521de082eb9 Mon Sep 17 00:00:00 2001 From: Alex Laird Date: Sat, 18 May 2024 06:34:26 -0700 Subject: [PATCH 5/6] Badge updates for coverage, README updates. --- README.md | 12 +++++++++--- README.md.template | 5 +++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 21507a5..b2d1116 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ![Python Versions](https://img.shields.io/badge/python-%203.8%20|%203.9%20|%203.10%20|%203.11%20-blue) +[![Coverage](https://img.shields.io/codecov/c/github/HeliumEdu/template-project)](https://codecov.io/gh/HeliumEdu/template-project) [![Build](https://img.shields.io/github/actions/workflow/status/HeliumEdu/template-project/build.yml)](https://github.com/HeliumEdu/template-project/actions/workflows/build.yml) ![GitHub License](https://img.shields.io/github/license/HeliumEdu/template-project) @@ -8,7 +9,12 @@ The project is developed using Python and [Django](https://www.djangoproject.com). -This repository contains the source code for the HeliumEdu `template-project`. +This repository contains the source code for the HeliumEdu `template-project`, which can be initialized using +[`helium-cli`](https://github.com/HeliumEdu/heliumcli) with: + +``` +helium-cli init +``` ### Project Setup @@ -18,13 +24,13 @@ To setup the Python/Django build environment, execute: make install ``` -This project is configured to work with a Virtualenv which has now been setup in the `.venv` folder. If you're +This project is configured to work with a Virtualenv which has now been setup in the `venv` folder. If you're unfamiliar with how this works, [read up on Virtualenv here](https://virtualenv.pypa.io/en/stable). The short version is, virtualenv creates isolated environments for each project's dependencies. To activate and use this environment when developing, execute: ```sh -source .venv/bin/activate +source venv/bin/activate ``` All commands below will now be run within the virtualenv (though `make` commands will always automatically enter the diff --git a/README.md.template b/README.md.template index 94d5632..84d6c04 100644 --- a/README.md.template +++ b/README.md.template @@ -1,4 +1,5 @@ ![Python Versions](https://img.shields.io/badge/python-%203.8%20|%203.9%20|%203.10%20|%203.11%20-blue) +[![Coverage](https://img.shields.io/codecov/c/github/{%PROJECT_GITHUB_USER%}/{%PROJECT_ID%})](https://codecov.io/gh/{%PROJECT_GITHUB_USER%}/{%PROJECT_ID%}) [![Build](https://img.shields.io/github/actions/workflow/status/{%PROJECT_GITHUB_USER%}/{%PROJECT_ID%}/build.yml)](https://github.com/{%PROJECT_GITHUB_USER%}/{%PROJECT_ID%}/actions/workflows/build.yml) ![GitHub License](https://img.shields.io/github/license/{%PROJECT_GITHUB_USER%}/{%PROJECT_ID%}) @@ -18,13 +19,13 @@ To setup the Python/Django build environment, execute: make install ``` -This project is configured to work with a Virtualenv which has now been setup in the `.venv` folder. If you're +This project is configured to work with a Virtualenv which has now been setup in the `venv` folder. If you're unfamiliar with how this works, [read up on Virtualenv here](https://virtualenv.pypa.io/en/stable). The short version is, virtualenv creates isolated environments for each project's dependencies. To activate and use this environment when developing, execute: ```sh -source .venv/bin/activate +source venv/bin/activate ``` All commands below will now be run within the virtualenv (though `make` commands will always automatically enter the From 9a7185ac9918c7672136229a5374c55930687bc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 10:40:32 +0000 Subject: [PATCH 6/6] Bump schedule from 1.2.1 to 1.2.2 (#211) Bumps [schedule](https://github.com/dbader/schedule) from 1.2.1 to 1.2.2. - [Changelog](https://github.com/dbader/schedule/blob/master/HISTORY.rst) - [Commits](https://github.com/dbader/schedule/compare/1.2.1...1.2.2) --- updated-dependencies: - dependency-name: schedule dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a93a1e3..0bc570b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,5 @@ coreapi==2.3.3 mysqlclient==2.2.4 pytz==2024.1 python-dateutil==2.9.0.post0 -schedule==1.2.1 +schedule==1.2.2 -e git+https://github.com/alexdlaird/django-health-check.git@4.0.2#egg=django-health-check