Skip to content

Commit

Permalink
Update Python and Django versions and CI setup
Browse files Browse the repository at this point in the history
Migrate from TravisCI to GitHub Actions
Add dependabot configuration for automatic pakcageu pdates
Update test setup to include QA and doc runs in main tox file
Update requirements and move them into a single requirements.txt file
  • Loading branch information
aleksihakli authored and dominicrodger committed Jan 17, 2022
1 parent fcb813c commit 0d681a4
Show file tree
Hide file tree
Showing 11 changed files with 181 additions and 96 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
time: "12:00"
open-pull-requests-limit: 10
80 changes: 80 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Test

on: [push, pull_request]

jobs:
build:
name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.8']
django-version: ['2.2', '3.2']
include:
# Tox configuration for documentation environment
- python-version: '3.7'
django-version: 'docs'
# Tox configuration for QA environment
- python-version: '3.7'
django-version: 'qa'
# # Django 4.0
# - python-version: '3.8'
# django-version: '4.0'
# - python-version: '3.9'
# django-version: '4.0'
# - python-version: '3.10'
# django-version: '4.0'
# # Django main
# - python-version: '3.8'
# django-version: 'main'
# experimental: true
# - python-version: '3.9'
# django-version: 'main'
# experimental: true
# - python-version: '3.10'
# django-version: 'main'
# experimental: true
exclude:
# Exclude Django main branch for Python 3.7 as it is not supported
- python-version: '3.7'
django-version: 'main'

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ matrix.python-version }}-v1-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
- name: Tox tests
run: |
tox -v
env:
DJANGO: ${{ matrix.django-version }}

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ dist/
/.idea
/.vscode
/venv
coverage.xml
.eggs/
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
coverage:
py.test --cov-report html --cov-report term-missing --cov recurrence
pytest

test:
py.test
pytest

testall:
tox
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# django-recurrence

[![Build Status](https://travis-ci.org/django-recurrence/django-recurrence.svg?branch=master)](https://travis-ci.org/django-recurrence/django-recurrence)
[![GitHub](https://img.shields.io/github/stars/django-recurrence/django-recurrence.svg?label=Stars&style=socialcA)](https://github.com/jazzband/django-recurrence)
[![PyPI releases](https://img.shields.io/pypi/v/django-recurrence.svg)](https://pypi.org/project/django-recurrence/)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/django-recurrence.svg)](https://pypi.org/project/django-recurrence/)
[![Supported Django versions](https://img.shields.io/pypi/djversions/django-recurrence.svg)](https://pypi.org/project/django-recurrence/)
[![Documentation](https://img.shields.io/readthedocs/django-recurrence.svg)](https://django-recurrence.readthedocs.io/)
[![GitHub Actions](https://github.com/django-recurrence/django-recurrence/workflows/Test/badge.svg)](https://github.com/django-recurrence/django-recurrence/actions)
[![Coverage](https://codecov.io/gh/django-recurrence/django-recurrence/branch/master/graph/badge.svg)](https://codecov.io/gh/django-recurrence/django-recurrence)

django-recurrence is a utility for working with recurring dates in
Django. Documentation is available at
https://django-recurrence.readthedocs.org/.

**Django-recurrence is unmaintained** and looking for a maintainer to take over the project. (You may wish to open an issue, reply on [this thread](https://github.com/django-recurrence/django-recurrence/pull/182#issuecomment-784467431) or reach out on [Twitter](https://twitter.com/dominicrodger/).)
https://django-recurrence.readthedocs.io/.

It provides:

Expand Down
3 changes: 2 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[pytest]
DJANGO_SETTINGS_MODULE = tests.settings
addopts = --tb=short
addopts = --cov recurrence --cov-append --cov-branch --cov-report term-missing --cov-report=xml
testpaths = tests
8 changes: 8 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
flake8==4.0.1
pytest-cov==3.0.0
pytest-django==4.5.2
pytest-sugar==0.9.4
pytest==6.2.5
sphinx==4.3.2
sphinx_rtd_theme==1.0.0
tox==3.24.5
5 changes: 0 additions & 5 deletions requirements_test.txt

This file was deleted.

48 changes: 19 additions & 29 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,43 @@
import os
import sys

from setuptools import setup
from setuptools.command.test import test as TestCommand


class PyTest(TestCommand):
def finalize_options(self):
self.test_args = []
self.test_suite = True

super().finalize_options()

def run_tests(self):
import pytest

errno = pytest.main(self.test_args)
sys.exit(errno)


with open("README.md", "r") as fh:
long_description = fh.read()


setup(
name="django-recurrence",
version="1.10.3",
use_scm_version=True,
license="BSD",
description="Django utility wrapping dateutil.rrule",
long_description=long_description,
long_description=open("README.md", encoding="utf-8").read(),
long_description_content_type="text/markdown",
author="Tamas Kemenczy",
author_email="[email protected]",
url="https://github.com/django-recurrence/django-recurrence",
classifiers=(
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Environment :: Plugins",
"Framework :: Django",
"Framework :: Django",
"Framework :: Django :: 2.2",
"Framework :: Django :: 3.2",
# "Framework :: Django :: 4.0",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
),
install_requires=("Django", "pytz", "python-dateutil"),
packages=("recurrence", "recurrence.migrations"),
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
python_requires=">=3.7",
install_requires=["django>=2.2,<4.0", "pytz", "python-dateutil"],
setup_requires=["setuptools_scm"],
packages=["recurrence", "recurrence.migrations"],
package_dir={"recurrence": "recurrence"},
package_data={
"recurrence": [
Expand All @@ -59,5 +50,4 @@ def run_tests(self):
},
zip_safe=False,
include_package_data=True,
cmdclass={"test": PyTest},
)
82 changes: 52 additions & 30 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,37 +1,59 @@
[tox]
envlist = {py36,py37}-{111,21,22,master},docs,flake8
envlist =
py37-djdocs
py37-djqa
py{37,38,39,310,py38}-dj22
py{37,38,39,310,py38}-dj32
# py{38,39,310,py38}-dj40
# py{38,39,310,py38}-djmain

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
pypy-3.8: pypy38

[gh-actions:env]
DJANGO =
docs: djdocs
qa: djqa
2.2: dj22
3.2: dj32
# 4.0: dj40
# main: djmain

[testenv]
basepython =
py36: python3.6
py37: python3.7
deps=
-r requirements_test.txt
111: django>=1.11,<1.12
21: django>=2.1,<2.2
22: django>=2.2,<2.3
master: https://github.com/django/django/archive/master.tar.gz
commands=python setup.py test
usedevelop = true
setenv =
PYTHONDONTWRITEBYTECODE=1
deps =
-r requirements.txt
dj22: django>=2.2,<2.3
dj32: django>=3.2,<3.3
# dj40: django>=4.0,4.1
# djmain: https://github.com/django/django/archive/main.tar.gz
commands =
pytest

[testenv:docs]
basepython=python
changedir=docs
deps=
sphinx
sphinx_rtd_theme
whitelist_externals = echo
commands=
sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
echo ""
echo "The built documentation is available in {envtmpdir}/html"
[testenv:py37-djqa]
basepython = python3.7
ignore_errors = true
deps =
-r requirements.txt
commands =
flake8 recurrence
flake8 setup.py
flake8 tests

[testenv:flake8]
basepython=python
deps=flake8==2.1.0
commands=
flake8 recurrence
flake8 setup.py
flake8 tests
[testenv:py37-djdocs]
basepython = python3.7
changedir = docs
deps =
-r requirements.txt
commands =
sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

[flake8]
ignore = E122,E125,E129,E501
ignore = E122,E125,E129,E501,W503,W504

0 comments on commit 0d681a4

Please sign in to comment.