From 78d1768b4da8d723293b0cc0b1157d83bf018dbc Mon Sep 17 00:00:00 2001 From: tomaszn Date: Mon, 6 Feb 2023 12:49:24 +0100 Subject: [PATCH 1/3] tests: replace travis with GitHub workflow --- .github/workflows/tests.yml | 51 +++++++++++++++++++++++++++++++++++++ .travis.yml | 41 ----------------------------- README.md | 1 - setup.py | 9 ++++++- 4 files changed, 59 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..fce62c0 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,51 @@ +name: Tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + tests: + runs-on: ubuntu-18.04 + strategy: + max-parallel: 4 + matrix: + include: + - python: 3.11.1 + django: 4.1.6 + djangorestframework: 3.14.0 + - python: 3.9.16 + django: 3.2.17 + djangorestframework: 3.13.0 + - python: 3.7.15 + django: 2.2.28 + djangorestframework: 3.9.4 + - python: 3.5.10 + django: 1.11.29 + djangorestframework: 3.9.4 + - python: 2.7.18 + django: 1.8.19 + djangorestframework: 3.6.4 + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + - name: Install Dependencies + run: >- + python -m pip + install --upgrade + pip + 'setuptools<56' + wheel + flake8 + 'Django==${{ matrix.django }}' + 'djangorestframework==${{ matrix.djangorestframework }}' + - name: Run Tests + run: | + ./runtests.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5341340..0000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: python -python: 3.8 -dist: xenial -env: - global: - - DRF="djangorestframework==3.11.0" - - DJANGO="django==3.0.2" -matrix: - include: - - name: "Defaults (Python 3.8, Django 3.0, DRF 3.11)" - - name: "Python 3.7" - python: "3.7" - - name: "Python 3.6" - python: "3.6" - - name: "Django 2.2" - env: - - DJANGO="django==2.2.9" - - name: "Django 1.11" - env: - - DJANGO="django==1.11.27" - - name: "Python 3.5, Django 2.2" - python: "3.5" - env: - - DJANGO="django==2.2.9" - - name: "Python 3.4, Django 2.0, DRF 3.9" - python: "3.4" - env: - - DJANGO="django==2.0.13" - - DRF="djangorestframework==3.9.4" - - name: "Python 2.7, Django 1.8, DRF 3.6" - python: "2.7" - env: - - DJANGO="django==1.8.19" - - DRF="djangorestframework==3.6.4" - - name: "Code Lint" - env: - - LINT="flake8" -install: - - pip install $DJANGO $DRF $LINT -script: - - ./runtests.sh diff --git a/README.md b/README.md index 6e1de44..1201bc2 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ A number of Pystache/Mustache backends for Django exist, though many are outdate [![GitHub Forks](https://img.shields.io/github/forks/wq/django-mustache.svg)](https://github.com/wq/django-mustache/network) [![GitHub Issues](https://img.shields.io/github/issues/wq/django-mustache.svg)](https://github.com/wq/django-mustache/issues) -[![Travis Build Status](https://img.shields.io/travis/wq/django-mustache/master.svg)](https://travis-ci.org/wq/django-mustache) [![Python Support](https://img.shields.io/pypi/pyversions/django-mustache.svg)](https://pypi.org/project/django-mustache) [![Django Support](https://img.shields.io/pypi/djversions/django-mustache.svg)](https://pypi.org/project/django-mustache) diff --git a/setup.py b/setup.py index 28fa930..21491fb 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def readme(): long_description_content_type='text/markdown', install_requires=[ 'Django>=1.8', - 'pystache', + 'pystache<0.6', ], classifiers=[ 'Framework :: Django', @@ -42,6 +42,9 @@ def readme(): 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'Framework :: Django', 'Framework :: Django :: 1.8', @@ -50,6 +53,10 @@ def readme(): 'Framework :: Django :: 2.1', 'Framework :: Django :: 2.2', 'Framework :: Django :: 3.0', + 'Framework :: Django :: 3.1', + 'Framework :: Django :: 3.2', + 'Framework :: Django :: 4.0', + 'Framework :: Django :: 4.1', 'Topic :: Text Processing :: Markup :: HTML', ], From 8e5db1fb3dcd3856ccaa60bc972964d022123a26 Mon Sep 17 00:00:00 2001 From: Tomasz Nowak Date: Mon, 6 Feb 2023 19:43:03 +0100 Subject: [PATCH 2/3] Django 4.0 compatibility --- tests/urls.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/urls.py b/tests/urls.py index 0624288..b7c05ed 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -1,4 +1,7 @@ -from django.conf.urls import url +try: + from django.urls import re_path +except ImportError: + from django.conf.urls import url as re_path from tests.views import ( ContextView, @@ -9,9 +12,9 @@ ) urlpatterns = [ - url('^context$', ContextView.as_view()), - url('^partials$', PartialsView.as_view()), - url('^mustachecp$', MustacheCPView.as_view()), - url('^djangocp$', DjangoCPView.as_view()), - url('^apptemplate$', AppTemplateView.as_view()), + re_path('^context$', ContextView.as_view()), + re_path('^partials$', PartialsView.as_view()), + re_path('^mustachecp$', MustacheCPView.as_view()), + re_path('^djangocp$', DjangoCPView.as_view()), + re_path('^apptemplate$', AppTemplateView.as_view()), ] From 20a7a26f070d949b6688a8942dfdf07f4326d67c Mon Sep 17 00:00:00 2001 From: Tomasz Nowak Date: Tue, 8 Apr 2025 19:00:22 +0200 Subject: [PATCH 3/3] upgrade workflow runner and CI tools --- .github/workflows/tests.yml | 21 +++++++++------------ setup.py | 13 ++----------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fce62c0..363c49e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,13 +10,16 @@ on: jobs: tests: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 strategy: max-parallel: 4 matrix: include: - - python: 3.11.1 - django: 4.1.6 + - python: 3.11.11 + django: 5.2.0 + djangorestframework: 3.16.0 + - python: 3.11.11 + django: 4.1.13 djangorestframework: 3.14.0 - python: 3.9.16 django: 3.2.17 @@ -24,16 +27,10 @@ jobs: - python: 3.7.15 django: 2.2.28 djangorestframework: 3.9.4 - - python: 3.5.10 - django: 1.11.29 - djangorestframework: 3.9.4 - - python: 2.7.18 - django: 1.8.19 - djangorestframework: 3.6.4 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - name: Install Dependencies @@ -41,7 +38,7 @@ jobs: python -m pip install --upgrade pip - 'setuptools<56' + 'setuptools<58' wheel flake8 'Django==${{ matrix.django }}' diff --git a/setup.py b/setup.py index 21491fb..554e74d 100644 --- a/setup.py +++ b/setup.py @@ -34,12 +34,6 @@ def readme(): 'Environment :: Web Environment', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', @@ -47,16 +41,13 @@ def readme(): 'Programming Language :: Python :: 3.11', 'Framework :: Django', - 'Framework :: Django :: 1.8', - 'Framework :: Django :: 1.11', - 'Framework :: Django :: 2.0', - 'Framework :: Django :: 2.1', 'Framework :: Django :: 2.2', 'Framework :: Django :: 3.0', 'Framework :: Django :: 3.1', 'Framework :: Django :: 3.2', 'Framework :: Django :: 4.0', 'Framework :: Django :: 4.1', + 'Framework :: Django :: 4.2', 'Topic :: Text Processing :: Markup :: HTML', ], @@ -65,6 +56,6 @@ def readme(): 'djangorestframework' ], setup_requires=[ - 'setuptools_scm', + 'setuptools_scm<8', ], )