diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ef5dbb..91cec96 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,75 +4,85 @@ on: pull_request: branches: - main + push: + branches: + - main jobs: - build: + test: runs-on: ubuntu-latest strategy: max-parallel: 4 matrix: - python-version: ['3.9', '3.10'] - redis-version: ['6'] + python-version: [ '3.9', '3.10' ] + django-version: [ '3.2.12', '4.0.4' ] + include: + - python-version: '3.10' + django-version: '4.0.4' + coverage: yes steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - cache-dependency-path: poetry.lock - - name: Install poetry - shell: bash - run: | + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache-dependency-path: poetry.lock + - name: Install poetry + shell: bash + run: | python -m pip --quiet install poetry echo "$HOME/.poetry/bin" >> $GITHUB_PATH - - name: Install dependencies - run: poetry install - - name: Start Redis - uses: supercharge/redis-github-action@1.4.0 - with: - redis-version: ${{ matrix.redis-version }} - - name: Run Tests - run: | - cd testproject19 - poetry run coverage run manage.py test scheduler - - name: Coverage report - id: coverage_report - uses: mathiasvr/command-output@v1 - with: + - name: Install dependencies + run: | + poetry install + poetry run pip install django==${{ matrix.django-version }} + - name: Start Redis + uses: supercharge/redis-github-action@1.4.0 + with: + redis-version: 6 + - name: Run Tests without coverage + if: ${{ matrix.coverage != 'yes' }} + run: | + cd testproject19 + poetry run python manage.py test scheduler + # Steps for coverage check + - name: Run Tests with coverage + if: ${{ matrix.coverage == 'yes' }} + run: | + cd testproject19 + poetry run coverage run manage.py test scheduler + + - name: Coverage report + if: ${{ matrix.coverage == 'yes' }} + id: coverage_report + uses: mathiasvr/command-output@v1 + with: + run: | + mv testproject19/.coverage . + poetry run coverage report + - name: json report + if: ${{ matrix.coverage == 'yes' }} run: | - mv testproject19/.coverage . - poetry run coverage report - - name: json report - run: | - poetry run coverage json - echo "COVERAGE=$(jq '.totals.percent_covered_display|tonumber' coverage.json)" >> $GITHUB_ENV - - name: Create Awesome Badge django3.2 - if: matrix.python-version == '3.9' - uses: schneegans/dynamic-badges-action@v1.1.0 - with: - auth: ${{ secrets.GIST_SECRET }} - gistID: b756396efb895f0e34558c980f1ca0c7 - filename: django-rq-scheduler-32.json - label: Test coverage django 3.2 - message: ${{ env.COVERAGE }}% - color: green - - name: Create Awesome Badge django4 - if: matrix.python-version == '3.10' - uses: schneegans/dynamic-badges-action@v1.1.0 - with: - auth: ${{ secrets.GIST_SECRET }} - gistID: b756396efb895f0e34558c980f1ca0c7 - filename: django-rq-scheduler-4.json - label: Test coverage django 4 - message: ${{ env.COVERAGE }}% - color: green - - uses: mshick/add-pr-comment@v1 - with: - message: | - Coverage report python ${{ matrix.python-version }} (python 3.9 tests with django 3.2, while 3.10 tests with latest): - ``` - ${{ steps.coverage_report.outputs.stdout }} - ``` - repo-token: ${{ secrets.GITHUB_TOKEN }} - repo-token-user-login: 'github-actions[bot]' - allow-repeats: true + poetry run coverage json + echo "COVERAGE=$(jq '.totals.percent_covered_display|tonumber' coverage.json)" >> $GITHUB_ENV + - uses: mshick/add-pr-comment@v1 + if: ${{ matrix.coverage == 'yes' }} + with: + message: | + Coverage report python ${{ matrix.python-version }} (python 3.9 tests with django 3.2, while 3.10 tests with latest): + ``` + ${{ steps.coverage_report.outputs.stdout }} + ``` + repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token-user-login: 'github-actions[bot]' + allow-repeats: true + - name: Create coverage badge + if: ${{ matrix.coverage == 'yes' && github.ref == 'ref/heads/main' }} + uses: schneegans/dynamic-badges-action@v1.1.0 + with: + auth: ${{ secrets.GIST_SECRET }} + gistID: b756396efb895f0e34558c980f1ca0c7 + filename: django-rq-scheduler-4.json + label: coverage + message: ${{ env.COVERAGE }}% + color: green \ No newline at end of file diff --git a/README.md b/README.md index 7a42032..179e56a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # Django RQ Scheduler [![Django CI](https://github.com/cunla/django-rqscheduler/actions/workflows/test.yml/badge.svg)](https://github.com/cunla/django-rqscheduler/actions/workflows/test.yml) -![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/cunla/b756396efb895f0e34558c980f1ca0c7/raw/django-rq-scheduler-32.json) ![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/cunla/b756396efb895f0e34558c980f1ca0c7/raw/django-rq-scheduler-4.json) diff --git a/poetry.lock b/poetry.lock index adda848..39eb0bb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -17,6 +17,17 @@ category = "main" optional = false python-versions = ">=3.6" +[[package]] +name = "backports.zoneinfo" +version = "0.2.1" +description = "Backport of the standard library zoneinfo module" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.extras] +tzdata = ["tzdata"] + [[package]] name = "cachecontrol" version = "0.12.10" @@ -193,24 +204,7 @@ python-versions = "*" [[package]] name = "django" -version = "3.2.12" -description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design." -category = "main" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -asgiref = ">=3.3.2,<4" -pytz = "*" -sqlparse = ">=0.2.2" - -[package.extras] -argon2 = ["argon2-cffi (>=19.1.0)"] -bcrypt = ["bcrypt"] - -[[package]] -name = "django" -version = "4.0.3" +version = "4.0.4" description = "A high-level Python web framework that encourages rapid development and clean, pragmatic design." category = "main" optional = false @@ -218,6 +212,7 @@ python-versions = ">=3.8" [package.dependencies] asgiref = ">=3.4.1,<4" +"backports.zoneinfo" = {version = "*", markers = "python_version < \"3.9\""} sqlparse = ">=0.2.2" tzdata = {version = "*", markers = "sys_platform == \"win32\""} @@ -666,7 +661,7 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "virtualenv" -version = "20.14.0" +version = "20.14.1" description = "Virtual Python Environment builder" category = "dev" optional = false @@ -713,7 +708,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest- [metadata] lock-version = "1.1" python-versions = "^3.8" -content-hash = "9bd19ea870e83079e040611bbebfc071cc15dc6a268d7c5e523d65d13a936789" +content-hash = "4ff1da0e0d0715066362e767a32d274253f6f69f037f9673e0360d8c5e8d59bc" [metadata.files] asgiref = [ @@ -724,6 +719,24 @@ async-timeout = [ {file = "async-timeout-4.0.2.tar.gz", hash = "sha256:2163e1640ddb52b7a8c80d0a67a08587e5d245cc9c553a74a847056bc2976b15"}, {file = "async_timeout-4.0.2-py3-none-any.whl", hash = "sha256:8ca1e4fcf50d07413d66d1a5e416e42cfdf5851c981d679a09851a6853383b3c"}, ] +"backports.zoneinfo" = [ + {file = "backports.zoneinfo-0.2.1-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:da6013fd84a690242c310d77ddb8441a559e9cb3d3d59ebac9aca1a57b2e18bc"}, + {file = "backports.zoneinfo-0.2.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:89a48c0d158a3cc3f654da4c2de1ceba85263fafb861b98b59040a5086259722"}, + {file = "backports.zoneinfo-0.2.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:1c5742112073a563c81f786e77514969acb58649bcdf6cdf0b4ed31a348d4546"}, + {file = "backports.zoneinfo-0.2.1-cp36-cp36m-win32.whl", hash = "sha256:e8236383a20872c0cdf5a62b554b27538db7fa1bbec52429d8d106effbaeca08"}, + {file = "backports.zoneinfo-0.2.1-cp36-cp36m-win_amd64.whl", hash = "sha256:8439c030a11780786a2002261569bdf362264f605dfa4d65090b64b05c9f79a7"}, + {file = "backports.zoneinfo-0.2.1-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:f04e857b59d9d1ccc39ce2da1021d196e47234873820cbeaad210724b1ee28ac"}, + {file = "backports.zoneinfo-0.2.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:17746bd546106fa389c51dbea67c8b7c8f0d14b5526a579ca6ccf5ed72c526cf"}, + {file = "backports.zoneinfo-0.2.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:5c144945a7752ca544b4b78c8c41544cdfaf9786f25fe5ffb10e838e19a27570"}, + {file = "backports.zoneinfo-0.2.1-cp37-cp37m-win32.whl", hash = "sha256:e55b384612d93be96506932a786bbcde5a2db7a9e6a4bb4bffe8b733f5b9036b"}, + {file = "backports.zoneinfo-0.2.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a76b38c52400b762e48131494ba26be363491ac4f9a04c1b7e92483d169f6582"}, + {file = "backports.zoneinfo-0.2.1-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:8961c0f32cd0336fb8e8ead11a1f8cd99ec07145ec2931122faaac1c8f7fd987"}, + {file = "backports.zoneinfo-0.2.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:e81b76cace8eda1fca50e345242ba977f9be6ae3945af8d46326d776b4cf78d1"}, + {file = "backports.zoneinfo-0.2.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7b0a64cda4145548fed9efc10322770f929b944ce5cee6c0dfe0c87bf4c0c8c9"}, + {file = "backports.zoneinfo-0.2.1-cp38-cp38-win32.whl", hash = "sha256:1b13e654a55cd45672cb54ed12148cd33628f672548f373963b0bff67b217328"}, + {file = "backports.zoneinfo-0.2.1-cp38-cp38-win_amd64.whl", hash = "sha256:4a0f800587060bf8880f954dbef70de6c11bbe59c673c3d818921f042f9954a6"}, + {file = "backports.zoneinfo-0.2.1.tar.gz", hash = "sha256:fadbfe37f74051d024037f223b8e001611eac868b5c5b06144ef4d8b799862f2"}, +] cachecontrol = [ {file = "CacheControl-0.12.10-py2.py3-none-any.whl", hash = "sha256:b0d43d8f71948ef5ebdee5fe236b86c6ffc7799370453dccb0e894c20dfa487c"}, {file = "CacheControl-0.12.10.tar.gz", hash = "sha256:d8aca75b82eec92d84b5d6eb8c8f66ea16f09d2adb09dbca27fe2d5fc8d3732d"}, @@ -890,10 +903,8 @@ distlib = [ {file = "distlib-0.3.4.zip", hash = "sha256:e4b58818180336dc9c529bfb9a0b58728ffc09ad92027a3f30b7cd91e3458579"}, ] django = [ - {file = "Django-3.2.12-py3-none-any.whl", hash = "sha256:9b06c289f9ba3a8abea16c9c9505f25107809fb933676f6c891ded270039d965"}, - {file = "Django-3.2.12.tar.gz", hash = "sha256:9772e6935703e59e993960832d66a614cf0233a1c5123bc6224ecc6ad69e41e2"}, - {file = "Django-4.0.3-py3-none-any.whl", hash = "sha256:1239218849e922033a35d2a2f777cb8bee18bd725416744074f455f34ff50d0c"}, - {file = "Django-4.0.3.tar.gz", hash = "sha256:77ff2e7050e3324c9b67e29b6707754566f58514112a9ac73310f60cd5261930"}, + {file = "Django-4.0.4-py3-none-any.whl", hash = "sha256:07c8638e7a7f548dc0acaaa7825d84b7bd42b10e8d22268b3d572946f1e9b687"}, + {file = "Django-4.0.4.tar.gz", hash = "sha256:4e8177858524417563cc0430f29ea249946d831eacb0068a1455686587df40b5"}, ] django-model-utils = [ {file = "django-model-utils-4.2.0.tar.gz", hash = "sha256:e7a95e102f9c9653427eadab980d5d59e1dea972913b9c9e01ac37f86bba0ddf"}, @@ -1080,8 +1091,8 @@ urllib3 = [ {file = "urllib3-1.26.9.tar.gz", hash = "sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e"}, ] virtualenv = [ - {file = "virtualenv-20.14.0-py2.py3-none-any.whl", hash = "sha256:1e8588f35e8b42c6ec6841a13c5e88239de1e6e4e4cedfd3916b306dc826ec66"}, - {file = "virtualenv-20.14.0.tar.gz", hash = "sha256:8e5b402037287126e81ccde9432b95a8be5b19d36584f64957060a3488c11ca8"}, + {file = "virtualenv-20.14.1-py2.py3-none-any.whl", hash = "sha256:e617f16e25b42eb4f6e74096b9c9e37713cf10bf30168fb4a739f3fa8f898a3a"}, + {file = "virtualenv-20.14.1.tar.gz", hash = "sha256:ef589a79795589aada0c1c5b319486797c03b67ac3984c48c669c0e4f50df3a5"}, ] webencodings = [ {file = "webencodings-0.5.1-py2.py3-none-any.whl", hash = "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78"}, diff --git a/pyproject.toml b/pyproject.toml index acd4d3b..6deef13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,10 +31,7 @@ homepage = "https://github.com/cunla/django-rqscheduler" [tool.poetry.dependencies] python = "^3.8" -django = [ - {version="^3.2", markers="python_version == '3.9'"}, - {version="^4.0", markers="python_version >= '3.10'"} -] +django = ">=3.2, >=4.0" django-model-utils = "^4.2.0" django-rq = "^2.4.1" rq-scheduler = "^0.11.0"