diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b7c00b4..c2f728e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -4,62 +4,54 @@ name: Python package on: - push: - branches: [ develop ] - pull_request: - branches: [ develop ] + push: + branches: [ develop ] + pull_request: + branches: [ develop ] jobs: - lint: - name: Check code style - runs-on: ubuntu-latest - container: python:3-slim - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install flake8 black - - name: Blacken code - run: black . --safe --quiet - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - test: - name: Test (Python, Django) - runs-on: ubuntu-latest - needs: lint - strategy: - matrix: - python-version: [ 3.8, 3.9, "3.10" ] - django-version: [ "3.2", "4.0" ] - env: - PYTHON: ${{ matrix.python-version }} - DJANGO: ${{ matrix.django-version }} - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade django~=${{ matrix.django-version }} - if [ -f requirements/local.txt ]; then pip install -r requirements/local.txt; fi - - name: Test with pytest and update coverage - run: | - coverage run -m pytest - coverage xml - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: coverage.xml - flags: unittests - env_vars: PYTHON, DJANGO - fail_ci_if_error: true - verbose: true + lint: + name: Check code style + runs-on: ubuntu-latest + container: python:3-slim + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 black + - name: Blacken code + run: black . --safe --quiet + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + tests: + name: Python ${{ matrix.python-version }} + runs-on: ubuntu-20.04 + strategy: + matrix: + python-version: + - '3.9' + - '3.10' + - '3.11' + - '3.12' + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: 'requirements/*.txt' + - name: Upgrade packaging tools + run: python -m pip install --upgrade pip setuptools virtualenv wheel + - name: Install dependencies + run: python -m pip install --upgrade codecov tox + - name: Run tox targets for ${{ matrix.python-version }} + run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d . | cut -f 1 -d '-') + - name: Upload coverage + run: | + codecov -e TOXENV,DJANGO \ No newline at end of file diff --git a/AUTHORS b/AUTHORS index 55f0887..edef57f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,4 @@ - Jarek Glowacki - Stas Kaledin - John Cass +- JAEGYUN JUNG \ No newline at end of file diff --git a/docs/changelog.md b/docs/changelog.md index c0870a9..32ef57f 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,8 +1,15 @@ # Changelog This changelog is used to track all major changes to django-apscheduler. + +## v0.7.0(2024-09-24) -## v0.6.3 (UNRELEASED) +**Enhancements** +- Drop support for Python 3.8 and Django 3.2. +- Add support for Python 3.9 to 3.12, Django 4.2 to 5.1 +- Bump pytest to >7, remove pytest-pythonpath as it is no longer needed. +- Add tox.ini file to run tests against all supported versions of Python and Django. +- Update CI configuration to use tox. **Fixes** diff --git a/pytest.ini b/pytest.ini index 1562108..fac9915 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,9 +1,5 @@ [pytest] +pythonpath = . python_files = tests.py test_*.py *_tests.py - -;https://github.com/bigsassy/pytest-pythonpath#usage -python_paths = tests/ - addopts = --ds=tests.settings - norecursedirs = django_apscheduler diff --git a/requirements/local.txt b/requirements/local.txt index fd1375c..4a3e08b 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -2,9 +2,9 @@ # Testing # ------------------------------------------------------------------------------ -pytest~=6.2 # https://github.com/pytest-dev/pytest +tox==4.19.0 # https://github.com/tox-dev/tox +pytest>7.0.0 # https://github.com/pytest-dev/pytest pytest-sugar~=0.9 # https://github.com/Frozenball/pytest-sugar -pytest-pythonpath~=0.7 # https://github.com/bigsassy/pytest-pythonpath # Django # ------------------------------------------------------------------------------ diff --git a/setup.py b/setup.py index 511f0ab..ec9cf44 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name="django-apscheduler", - version="0.6.2", + version="0.7.0", description="APScheduler for Django", long_description=long_description, long_description_content_type="text/markdown", @@ -26,17 +26,19 @@ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Framework :: Django", - "Framework :: Django :: 3.2", - "Framework :: Django :: 4.0", + "Framework :: Django :: 4.2", + "Framework :: Django :: 5.0", + "Framework :: Django :: 5.1", ], keywords="django apscheduler django-apscheduler", packages=find_packages(exclude=("tests",)), install_requires=[ - "django>=3.2", + "django>=4.2", "apscheduler>=3.2,<4.0", ], zip_safe=False, diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..6bc1385 --- /dev/null +++ b/tox.ini @@ -0,0 +1,19 @@ +[tox] +envlist = + {py39}-{django42} + {py310}-{django42,django50,django51,djangomain} + {py311}-{django42,django50,django51,djangomain} + {py312}-{django42,django50,django51,djangomain} + +[testenv] +setenv = + PYTHONPATH = {toxinidir} +deps = + pytest + pytest-django + django42: django>=4.2,<5.0 + django50: django>=5.0,<5.1 + django51: django>=5.1,<5.2 + djangomain: https://github.com/django/django/archive/main.tar.gz +commands = + pytest \ No newline at end of file