Skip to content

Commit

Permalink
Release 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Nov 15, 2020
1 parent 3d66c52 commit 45e6d55
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ repos:
- flake8-tidy-imports
- pep8-naming
- repo: https://github.com/econchick/interrogate
rev: 1.3.1
rev: 1.3.2
hooks:
- id: interrogate
args:
- "-cpyproject.toml"
- "--quiet"
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.3
rev: v2.7.4
hooks:
- id: pyupgrade
args:
Expand Down
5 changes: 4 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ Previous maintainers
Contributors
------------

* Adam Chainz
* Gaetano D'Onghia <[email protected]>
* Giovanni Bottalico <[email protected]>
* Nicola Ciccarone <[email protected]>
* Gaetano D'Onghia <[email protected]>
* schroedingersZombie
* Vladimir Kuvandjiev
* Xiphoseer
10 changes: 10 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ History

.. towncrier release notes start
0.6.0 (2020-11-15)
==================

Features
--------

- Drop Python 2, Django < 2.2 - Update toolchain (#39)
- Fix Handling of trailing slashes in redirects (#31)


Unreleased
==================

Expand Down
26 changes: 10 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ This is heavily borrowed from ``django.contrib.redirects`` with three major chan
* Selection of redirect status code
* Middleware can processed in the request or response phase

****************************
Why using process_request?
--------------------------
****************************

Doing database queries in the middleware ``process_request`` is heavily discouraged as it's a
performance hit, especially when doing redirects which are just a tiny part of the
Expand All @@ -24,36 +25,29 @@ Except that sometimes it's just what you need (for example to "hide" content wit
By caching both existing and non existing redirects for a given URL the performance hit is
minimized for the use cases that requires ``process_request``.

****************************
Documentation
-------------
****************************

The full documentation is at https://djangocms-redirect.readthedocs.io.

****************************
Installation
------------
****************************

See https://djangocms-redirect.readthedocs.io/en/latest/installation.html

****************************
Features
--------
****************************

* Set old and new path, by selection existing django CMS pages or writing down the complete address
* Select the redirect status code (301, 302)
* Support for status code 410

Running Tests
-------------

Does the code actually work?

::

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements-test.txt
(myenv) $ python setup.py test

****************************
Credits
---------
****************************

Tools used in rendering this package:

Expand Down
1 change: 0 additions & 1 deletion changes/39.feature

This file was deleted.

2 changes: 1 addition & 1 deletion djangocms_redirect/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.1.dev1"
__version__ = "0.6.0"
46 changes: 23 additions & 23 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[bumpversion]
current_version = 0.5.1.dev1
current_version = 0.6.0
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.?)(?P<release>[a-z]*)(?P<relver>\d*)
serialize =
{major}.{minor}.{patch}.{release}{relver}
{major}.{minor}.{patch}
{major}.{minor}.{patch}.{release}{relver}
{major}.{minor}.{patch}
commit = True
tag = True
sign_tags = True
Expand All @@ -13,11 +13,11 @@ message = Release {new_version}
[bumpversion:part:release]
optional_value = gamma
values =
dev
a
b
rc
gamma
dev
a
b
rc
gamma

[bumpversion:file:djangocms_redirect/__init__.py]

Expand All @@ -26,7 +26,7 @@ name = djangocms-redirect
version = attr: djangocms_redirect.__version__
url = https://github.com/nephila/djangocms-redirect
project_urls =
Documentation = https://djangocms-redirect.readthedocs.io/
Documentation = https://djangocms-redirect.readthedocs.io/
author = Iacopo Spalletti
author_email = [email protected]
description = A django CMS enabled application to handle redirects
Expand All @@ -35,24 +35,24 @@ long_description_content_type = text/x-rst
license = BSD
license_file = LICENSE
classifiers =
License :: OSI Approved :: BSD License
Development Status :: 5 - Production/Stable
Framework :: Django
Framework :: Django :: 2.2
Framework :: Django :: 3.0
Framework :: Django :: 3.1
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
License :: OSI Approved :: BSD License
Development Status :: 5 - Production/Stable
Framework :: Django
Framework :: Django :: 2.2
Framework :: Django :: 3.0
Framework :: Django :: 3.1
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8

[options]
include_package_data = True
install_requires =
django-cms>=3.7
django-cms>=3.7
setup_requires =
setuptools
setuptools
packages = djangocms_redirect
python_requires = >=3.6
test_suite = cms_helper.run
Expand All @@ -64,7 +64,7 @@ djangocms_redirect = *.html *.png *.gif *js *jpg *jpeg *svg *py *mo *po

[options.extras_require]
docs =
django<3.1
django<3.1

[upload]
repository = https://upload.pypi.org/legacy/
Expand Down
19 changes: 10 additions & 9 deletions tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,18 +338,18 @@ def test_slash_append_slash(self):

class TestClean(BaseRedirectTest):

_pages_data = (
{"en": {"title": "home page", "template": "page.html", "publish": True}},
)
_pages_data = ({"en": {"title": "home page", "template": "page.html", "publish": True}},)

def _make_form(self, old_path):
pages = self.get_pages()
return RedirectForm({
"site": self.site_1.pk,
"old_path": old_path,
"new_path": pages[0].get_absolute_url(),
"response_code": "301",
})
return RedirectForm(
{
"site": self.site_1.pk,
"old_path": old_path,
"new_path": pages[0].get_absolute_url(),
"response_code": "301",
}
)

def _assert_clean(self, old_path, old_path_cleaned):
redirect_form = self._make_form(old_path)
Expand All @@ -373,6 +373,7 @@ def test_clean_no_append_slash(self):
with override_settings(APPEND_SLASH=False):
self._assert_clean("/slash-baz", "/slash-baz")


class TestPartialMatch(BaseRedirectTest):
_pages_data = (
{"en": {"title": "home page", "template": "page.html", "publish": True}},
Expand Down

0 comments on commit 45e6d55

Please sign in to comment.