From dd8b3aa5a8bcfdb2e6e4226b97895174cd8c1eb7 Mon Sep 17 00:00:00 2001 From: Dane Hillard Date: Sat, 22 Aug 2020 17:50:50 -0400 Subject: [PATCH 1/6] Enable middleware to work in newer versions of Django --- .gitignore | 1 + .travis.yml | 2 +- setup.cfg | 12 +++++++----- src/webmention/middleware.py | 3 ++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 1c0aa53..e7ef8f5 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ var/ *.egg-info/ .installed.cfg *.egg +pip-wheel-metadata/ # PyInstaller # Usually these files are written by a python script from a template diff --git a/.travis.yml b/.travis.yml index 1c635c9..f16e7a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,10 @@ language: python cache: pip python: + - "3.8" - "3.7" - "3.6" - "3.5" - - "3.8-dev" install: - pip install tox-travis diff --git a/setup.cfg b/setup.cfg index 480804a..bcd585e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,12 +13,12 @@ classifiers = Development Status :: 5 - Production/Stable Intended Audience :: Developers Framework :: Django - Framework :: Django :: 1.8 - Framework :: Django :: 1.9 - Framework :: Django :: 1.10 Framework :: Django :: 1.11 Framework :: Django :: 2.0 Framework :: Django :: 2.1 + Framework :: Django :: 2.2 + Framework :: Django :: 3.0 + Framework :: Django :: 3.1 Topic :: Internet :: WWW/HTTP :: Indexing/Search License :: OSI Approved :: MIT License Programming Language :: Python @@ -27,6 +27,7 @@ classifiers = Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 [options] package_dir = =src @@ -69,11 +70,10 @@ DJANGO_SETTINGS_MODULE = tests.test_settings python_files = tests.py test_*.py -testdirs = tests addopts = -ra -q --cov=webmention [tox:tox] -envlist = {py35,py36,py37,py38}-django{1.11,2.1,2.2} +envlist = {py35,py36,py37,py38}-django{1.11,2.1,2.2,3.0,3.1} [testenv] extras = test @@ -83,6 +83,8 @@ deps = django1.11: Django>=1.11,<2 django2.1: Django>=2.1,<2.2 django2.2: Django>=2.2,<2.3 + django3.0: Django>=3.0,<3.1 + django3.1: Django>=3.1,<3.2 [testenv:lint] extras = lint diff --git a/src/webmention/middleware.py b/src/webmention/middleware.py index 1fb15a9..2f63c10 100644 --- a/src/webmention/middleware.py +++ b/src/webmention/middleware.py @@ -1,4 +1,5 @@ from django.utils.decorators import decorator_from_middleware +from django.utils.deprecation import MiddlewareMixin try: from django.core.urlresolvers import reverse @@ -18,7 +19,7 @@ def add_webmention_headers_to_response(request, response): return response -class WebMentionMiddleware(object): +class WebMentionMiddleware(MiddlewareMixin): def process_response(self, request, response): return add_webmention_headers_to_response(request, response) From c8962bc0ccceff389a03c8a8814dd93ad4bbfa10 Mon Sep 17 00:00:00 2001 From: Dane Hillard Date: Sat, 22 Aug 2020 19:16:49 -0400 Subject: [PATCH 2/6] Drop Python 3.5 support --- .travis.yml | 1 - setup.cfg | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f16e7a1..1814764 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,6 @@ python: - "3.8" - "3.7" - "3.6" - - "3.5" install: - pip install tox-travis diff --git a/setup.cfg b/setup.cfg index bcd585e..4492cf7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,6 @@ classifiers = Programming Language :: Python Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 - Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 @@ -73,7 +72,7 @@ python_files = addopts = -ra -q --cov=webmention [tox:tox] -envlist = {py35,py36,py37,py38}-django{1.11,2.1,2.2,3.0,3.1} +envlist = {py36,py37,py38}-django{1.11,2.1,2.2,3.0,3.1} [testenv] extras = test From 8e174c46211c56d13e227a872c91f460054b08e7 Mon Sep 17 00:00:00 2001 From: Dane Hillard Date: Sat, 22 Aug 2020 19:42:50 -0400 Subject: [PATCH 3/6] Add GitHub and PyPI release automation --- .travis.yml | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1814764..98bca63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,9 @@ language: python cache: pip python: - - "3.8" - - "3.7" - - "3.6" + - '3.8' + - '3.7' + - '3.6' install: - pip install tox-travis @@ -16,9 +16,41 @@ script: stages: - lint - test + - name: deploy + if: tag IS present jobs: include: - stage: lint script: - tox -e lint + + - stage: deploy + before_deploy: + python setup.py sdist bdist_wheel + deploy: + - provider: releases # GitHub releases + api_key: + secure: 'ONG/Gqo6zQvLTW2F4wIiu21fgDsBOSVWhuSgmzs98P6brIeSY4IqAYh6MH4d0XszfYOV1ytky3YjyoXbQsBdYBhyS6Psgw8XvJeLN/mRjr3gNmxZ0dEUiJcdnYePRLe7FG+gFB08FS+Aq4d9GqpithmBcHpGSmL6q5ZnnxC98OX/Ts46CrNiBCA6gg8klkOygk1VOJklJwWHK39yRZNuyUpKGk9WEf23BDpLoaqrnivwJODvMDCnGaAjTeeziCZlpGTdR75F6CViJkeqA9dq0cG6zy1i3q6Mf8zEBmmRJxFcrbW2pdDYgKiguGohTsxt2drhDQRTItbgu01pMXDtapX4WO51tEbEr2JjOq7Yv1L1VAyARFdM6E07s+JE5WLCWKxWlFxly0Vc58pRpd7wgP87lvGiPHSHPUVVeic9hzCbxMsl8iVzEO+MldZHHrgU9R0PQNW4LtpN0HGTTIyyu8cbGytfdd/ZoQVzW1cJMxuxBP8c4tj8uGlHQCRmxOy4pHhj3r2kyTLrbaR8VK2aLIMiosqylp1ZIDbmHSsSEYYDSrRsaXqEXXBaozqi/o9vZ0vnPMoHJ7L6FxR2c+1FjaIlmjnSUv6de5a9ytR6xoT8QYF4fbWA/U46yCJL7mboRXXqgqBwxHZNRrivnxBD3sfDSUT0Ykq3fegGGow2lfM=' + file_glob: true + file: + - dist/django-webmention-*-py3-none-any.whl + - dist/django-webmention-*.tar.gz + skip_cleanup: true + on: + tags: true + python: '3.8' + + - &pypi # Product PyPI + provider: pypi + user: '__token__' + password: + secure: 'XXT3GDecB3QDePR5+3OotyUkz6esUmZK5InF4lJQ58SKU1e0R2CxgKivEKDDs88dFtiHdNnKwRknQ4/9WgQ5rhXuEZ/eiwmxue1xfa9284rfX6fAmnY1WCvnIonus82tmhCB6eSkQnRRu03+aLIilI4WYSb1rwkOx8Soa6rtRMbfGJNv8cAeDeHK2uM16WWgDVp+pZOO54r0a/j05SQk4VL/W5c9visFFnWKxZqBTK+C95ZAk1d4BoS+VHiYxzX4dImqSwomC4OZ4Df/lS7p/thabrC4T8n/KXBvI3LiM2u6glFM42rJ6MmFoadLaBwON4+OhInKJ+Pc8yWjKuQ34e07VZ97t3XXxEoSG3hrH0wHyTSx9tca8UwuIFqNP70DV9X8ePbINBCPCLKuJCOa5njUubU3MpXM9nwt71IjWCgZpxXj9mEYH0lPGDcR8kQLLGxxtoFL5oVrEDR6YrPoObuTokXMgXeLrNkcCkEKuzB6fPnH28hvXIshmixFygnz+fio4Z/CcE6A9oCp8hmFOAj+1ZPWJuiRZrQzuGV4S7/G6GHWhdI4S9W54A+3MU6QFhi2oum/IcG55C54eY0p04oFL87LaRhuy1SB7obr2i0871j2LR8tWzQIaaTgNww4cYPLKWnnYGXmiQxtkuwqT1VtCFvI2AufcDdL9x8bJ3U=' + skip_cleanup: true + skip_existing: true + on: + tags: true + python: '3.8' + + - <<: *pypi # Test PyPI + server: 'https://test.pypi.org/legacy/' From 13c8c72e7e4a29a0390d7fcde871fcea922a8c7b Mon Sep 17 00:00:00 2001 From: Dane Hillard Date: Sat, 22 Aug 2020 19:43:37 -0400 Subject: [PATCH 4/6] Bump version number --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 4492cf7..9384cb3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = django-webmention -version = 1.1.0 +version = 2.0.0 description = A pluggable implementation of webmention for Django projects author = Dane Hillard author_email = github@danehillard.com From 0d88bcf639ae15ab62dd277b5ccf8d94243e2efc Mon Sep 17 00:00:00 2001 From: Dane Hillard Date: Sat, 22 Aug 2020 19:49:16 -0400 Subject: [PATCH 5/6] Add different token for Test PyPI --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 98bca63..7e00a1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,3 +54,5 @@ jobs: - <<: *pypi # Test PyPI server: 'https://test.pypi.org/legacy/' + password: + secure: 'Wgbk8W2KQfsaXFQBKNAAo7VvwuBIpGboYG+iaf/ImrkjDz1oLOy/P/d7qlEY79SJVdOAK5Orrf6Dp+vlKziiIcIIa+A0qfcLtNlT6nIhrx0h0l+N9/Hsliw1FAd1DhJA1a6qE8z3790ZHB6QXA8FWP2Vqd2iY05l3R3Ii0Rz+701WLENNi1+6iHiTdzLJJtcpvy9snzwdwLHLXJN2FDJbKRN1DJW2GE35OOxrhuZC8x8lUwsJujI1UbN5P16TWxVgNZz6Ob05hOkkRBaMDxXA9deSsk+wDqKoJaD2KWEr9GDzJLFTyw9ZOG3iN5eJ8IN011cXeJ3YneucHEkD+0xFjFF1oRzMkTw6Kga1+/IIzeUG8CeKR6RQ2V+1yI9Ou2qZmc975AlgPCbbfmBtOsoZZWsoQAPXrOyBpLhoiEHuqMglbhQDTz2jS9mgyYW5bXbhJhPrb7CwAtwjH1QpVlC2v0TTgwpGdY0KEhwKogm/cSudCOgKUHfU63AXJoIjAzTmsWbiCbkKrdQ+E7kHLVUxrPVennfueBQ0AXHrSRPkupYSzjeQFI4mE5y3NSxwDFgb3IZj8ingTKokHrO5W0JUBDlZEVlrT1HX0bcbu2V7sM9Iul1ZIWGAigOo+2izQSvxu1YMHvLX8ghjQagkOOFRXWiAzr++aKkqnxhJrgmjFM=' From ae39a55a8ed68bbb2e7268cc7107a42ad86f72e9 Mon Sep 17 00:00:00 2001 From: Dane Hillard Date: Sat, 22 Aug 2020 19:50:07 -0400 Subject: [PATCH 6/6] Fix typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7e00a1a..1d4d73d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ jobs: tags: true python: '3.8' - - &pypi # Product PyPI + - &pypi # Production PyPI provider: pypi user: '__token__' password: