diff --git a/.gitignore b/.gitignore index ea01090..0b8c676 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,13 @@ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] +*$py.class # C extensions *.so # Distribution / packaging .Python -env/ -venv/ build/ develop-eggs/ dist/ @@ -20,9 +19,13 @@ lib64/ parts/ sdist/ var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ *.egg-info/ .installed.cfg *.egg +MANIFEST # PyInstaller # Usually these files are written by a python script from a template @@ -37,20 +40,32 @@ pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ +.nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml -*,cover -*.db +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ # Translations -*.mo *.pot # Django stuff: *.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy # Sphinx documentation docs/_build/ @@ -58,8 +73,56 @@ docs/_build/ # PyBuilder target/ -# PyCharm -.idea +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json -# Mac stuff -.DS_Store +# Pyre type checker +.pyre/ diff --git a/.travis.yml b/.travis.yml index 2a0f75f..4fd1b5e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,30 +3,38 @@ dist: xenial language: python matrix: include: - - env: TOXENV=py36-dj20 - python: 3.6 - - env: TOXENV=py36-dj21 - python: 3.6 - env: TOXENV=py36-dj22 python: 3.6 - env: TOXENV=py36-dj30 python: 3.6 - - env: TOXENV=py37-dj20 - python: 3.7 - - env: TOXENV=py37-dj21 - python: 3.7 + - env: TOXENV=py36-dj31 + python: 3.6 + - env: TOXENV=py36-dj32 + python: 3.6 - env: TOXENV=py37-dj22 python: 3.7 - env: TOXENV=py37-dj30 python: 3.7 - - env: TOXENV=py38-dj20 - python: 3.8 - - env: TOXENV=py38-dj21 - python: 3.8 + - env: TOXENV=py37-dj31 + python: 3.7 + - env: TOXENV=py37-dj32 + python: 3.7 - env: TOXENV=py38-dj22 python: 3.8 - env: TOXENV=py38-dj30 python: 3.8 + - env: TOXENV=py38-dj31 + python: 3.8 + - env: TOXENV=py38-dj32 + python: 3.8 + - env: TOXENV=py39-dj22 + python: 3.9 + - env: TOXENV=py39-dj30 + python: 3.9 + - env: TOXENV=py39-dj31 + python: 3.9 + - env: TOXENV=py39-dj32 + python: 3.9 - env: TOXENV=flake8 python: 3.7 before_install: @@ -34,7 +42,7 @@ before_install: - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin install: - - pip install tox + - pip install tox-travis script: - docker-compose -f tests/testapp/docker-compose.yaml up -d firefox hub - - tox \ No newline at end of file + - tox diff --git a/CHANGELOG b/CHANGELOG index 6ee18b5..85c1b5b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,12 @@ Changelog ========= -1.1.2 (unreleased) +1.1.2 (2021-11-05) ------------------ - +* Add Django 3.2 support. Drop Django <2.2 support. +* Add Wagtail 2.10-2.14 support. +* Add Python 3.9 to travis test matrix. +* Updated some docs. * Fix circular imports. 1.1.1 (2020-06-13) diff --git a/MANIFEST.in b/MANIFEST.in index def2515..5f91f59 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,4 +2,7 @@ include AUTHORS include LICENSE include CHANGELOG include README.rst -recursive-include puput * +recursive-exclude example * +recursive-include puput/static *.css *.js *.gif *.otf *.eot *.svg *.ttf *.woff +recursive-include puput/templates *.html *.xml +recursive-include puput/locale *.po *.mo diff --git a/docs/comments.rst b/docs/comments.rst index ee0ad71..6da207b 100644 --- a/docs/comments.rst +++ b/docs/comments.rst @@ -4,7 +4,7 @@ Comments Puput allows customize the comment system for your blog entries. Simply go to settings tab while editing blog properties and add the required parameters depending on which system you want to use. -There is a :code:`PUPUT_COMMENTS_PROVIDER` setting that should point to the specific provider class. It defaults to :class:`DisqusProvider`. +There is a :code:`PUPUT_COMMENTS_PROVIDER` setting that should point to the specific provider class. It defaults to :class:`DisqusCommentsProvider`. Disqus ------ @@ -35,7 +35,7 @@ In your :file:`settings.py` file: .. code-block:: python - PUPUT_COMMENTS_PROVIDER = 'puput.comments.DjangoCommentsCommentsProvider' + PUPUT_COMMENTS_PROVIDER = 'puput.comments.DjangoCommentsProvider' .. note:: @@ -57,7 +57,7 @@ method to return the path to your custom template. Implement your own provider --------------------------- -To add your own comment provider you will need to subclass :class:`CommentProvider` and implement its methods: +To add your own comment provider you will need to subclass :class:`CommentsProvider` and implement its methods: :code:`template` @@ -69,4 +69,4 @@ return dictionary with data needed in your template :code:`get_num_comments` -return number of comments for the entry page \ No newline at end of file +return number of comments for the entry page diff --git a/docs/settings.rst b/docs/settings.rst index 4e4a551..293163a 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -48,4 +48,4 @@ PUPUT_COMMENTS_PROVIDER **Default value:** ``'puput.comments.DisqusCommentsProvider'`` -String setting to define the class path for CommentProvider implementation. See :doc:`comments` for more details. \ No newline at end of file +String setting to define the class path for ``CommentsProvider`` implementation. See :doc:`comments` for more details. diff --git a/docs/setup.rst b/docs/setup.rst index 3481a1f..e700a2f 100644 --- a/docs/setup.rst +++ b/docs/setup.rst @@ -25,6 +25,7 @@ If you are already referencing one of these apps in your :code:`INSTALLED_APPS` INSTALLED_APPS = ( ... + 'wagtail.contrib.legacy.richtext', 'wagtail.core', 'wagtail.admin', 'wagtail.documents', diff --git a/puput/__init__.py b/puput/__init__.py index 4e027d4..a055cb6 100644 --- a/puput/__init__.py +++ b/puput/__init__.py @@ -1,9 +1,10 @@ __author__ = "Marc Tudurí" __email__ = "marctc@gmail.com" -__version__ = "1.1.1" +__version__ = "1.1.2" PUPUT_APPS = ( # Wagtail apps + "wagtail.contrib.legacy.richtext", "wagtail.core", "wagtail.admin", "wagtail.documents", diff --git a/puput/abstracts.py b/puput/abstracts.py index de6dfc6..704d696 100644 --- a/puput/abstracts.py +++ b/puput/abstracts.py @@ -1,7 +1,7 @@ import datetime from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from wagtail.admin.edit_handlers import FieldPanel, MultiFieldPanel, InlinePanel, PageChooserPanel from wagtail.images.edit_handlers import ImageChooserPanel diff --git a/puput/apps.py b/puput/apps.py index 7aa502c..8d9fe14 100644 --- a/puput/apps.py +++ b/puput/apps.py @@ -4,6 +4,7 @@ class PuputAppConfig(AppConfig): name = 'puput' verbose_name = 'Puput' + default_auto_field = 'django.db.models.AutoField' def ready(self): import puput.signals # noqa: F401 diff --git a/puput/comments.py b/puput/comments.py index b8fa11f..0b3eee6 100644 --- a/puput/comments.py +++ b/puput/comments.py @@ -1,4 +1,4 @@ -class CommentProvider: +class CommentsProvider: def __init__(self, blog_page, entry_page): self.blog_page = blog_page self.entry_page = entry_page @@ -14,7 +14,7 @@ def get_num_comments(self): raise NotImplementedError() -class DisqusCommentProvider(CommentProvider): +class DisqusCommentsProvider(CommentsProvider): @property def template(self): @@ -46,7 +46,7 @@ def get_num_comments(self): raise Exception('You need to install tapioca-disqus before using Disqus as comment system.') -class DjangoCommentsProvider(CommentProvider): +class DjangoCommentsProvider(CommentsProvider): @property def template(self): diff --git a/puput/locale/ar/LC_MESSAGES/django.mo b/puput/locale/ar/LC_MESSAGES/django.mo new file mode 100644 index 0000000..7f20445 Binary files /dev/null and b/puput/locale/ar/LC_MESSAGES/django.mo differ diff --git a/puput/locale/de/LC_MESSAGES/django.mo b/puput/locale/de/LC_MESSAGES/django.mo new file mode 100644 index 0000000..23d10df Binary files /dev/null and b/puput/locale/de/LC_MESSAGES/django.mo differ diff --git a/puput/locale/en/LC_MESSAGES/django.mo b/puput/locale/en/LC_MESSAGES/django.mo new file mode 100644 index 0000000..9383a56 Binary files /dev/null and b/puput/locale/en/LC_MESSAGES/django.mo differ diff --git a/puput/locale/fr/LC_MESSAGES/django.mo b/puput/locale/fr/LC_MESSAGES/django.mo new file mode 100644 index 0000000..26b716e Binary files /dev/null and b/puput/locale/fr/LC_MESSAGES/django.mo differ diff --git a/puput/locale/nl/LC_MESSAGES/django.mo b/puput/locale/nl/LC_MESSAGES/django.mo new file mode 100644 index 0000000..d0ae653 Binary files /dev/null and b/puput/locale/nl/LC_MESSAGES/django.mo differ diff --git a/puput/locale/pl/LC_MESSAGES/django.mo b/puput/locale/pl/LC_MESSAGES/django.mo new file mode 100644 index 0000000..dabbb71 Binary files /dev/null and b/puput/locale/pl/LC_MESSAGES/django.mo differ diff --git a/puput/locale/pt_BR/LC_MESSAGES/django.mo b/puput/locale/pt_BR/LC_MESSAGES/django.mo new file mode 100644 index 0000000..129776e Binary files /dev/null and b/puput/locale/pt_BR/LC_MESSAGES/django.mo differ diff --git a/puput/locale/pt_PT/LC_MESSAGES/django.mo b/puput/locale/pt_PT/LC_MESSAGES/django.mo new file mode 100644 index 0000000..9383a56 Binary files /dev/null and b/puput/locale/pt_PT/LC_MESSAGES/django.mo differ diff --git a/puput/locale/ru/LC_MESSAGES/django.mo b/puput/locale/ru/LC_MESSAGES/django.mo new file mode 100644 index 0000000..8a10978 Binary files /dev/null and b/puput/locale/ru/LC_MESSAGES/django.mo differ diff --git a/puput/locale/ru/LC_MESSAGES/django.po b/puput/locale/ru/LC_MESSAGES/django.po index 617decb..c43c15d 100644 --- a/puput/locale/ru/LC_MESSAGES/django.po +++ b/puput/locale/ru/LC_MESSAGES/django.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: puput\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-04-10 09:49+0200\n" -"PO-Revision-Date: 2017-01-24 15:08+0700\n" -"Last-Translator: Basil Shubin \n" +"PO-Revision-Date: 2021-11-01 17:59+0700\n" +"Last-Translator: Basil S. \n" "Language-Team: \n" "Language: ru\n" "MIME-Version: 1.0\n" @@ -18,6 +18,7 @@ msgstr "" "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" "%100>=11 && n%100<=14)? 2 : 3);\n" +"X-Generator: Poedit 2.4.2\n" #: abstracts.py:16 msgid "body" @@ -29,7 +30,7 @@ msgstr "Дата публикации" #: abstracts.py:21 models.py:38 msgid "Header image" -msgstr "Изображение заголовка" +msgstr "Заглавное изображение" #: abstracts.py:29 msgid "excerpt" @@ -51,7 +52,7 @@ msgstr "Рубрики" #: abstracts.py:52 templates/puput/related_entries.html:6 msgid "Related Entries" -msgstr "Связанные записи" +msgstr "Похожие публикации" #: abstracts.py:56 msgid "Metadata" @@ -67,7 +68,7 @@ msgstr "" #: models.py:45 msgid "Blog Main Color" -msgstr "" +msgstr "Основной цвет" #: models.py:47 msgid "Display comments" @@ -83,11 +84,11 @@ msgstr "Метки" #: models.py:50 msgid "Display popular entries" -msgstr "Популярные записи" +msgstr "Популярные публикации" #: models.py:51 msgid "Display last entries" -msgstr "Последнии записи" +msgstr "Последнии публикации" #: models.py:52 msgid "Display archive" @@ -95,7 +96,7 @@ msgstr "Архив" #: models.py:57 msgid "Entries per page" -msgstr "Количество записей на странице" +msgstr "Количество публикаций на странице" #: models.py:58 msgid "Last entries limit" @@ -127,7 +128,7 @@ msgstr "Комментарии" #: models.py:103 msgid "Feeds" -msgstr "" +msgstr "Ленты" #: models.py:127 msgid "Blog" @@ -155,11 +156,11 @@ msgstr "Рубрика" #: models.py:189 models.py:190 models.py:245 msgid "Entry" -msgstr "Запись" +msgstr "Публикация" #: models.py:246 msgid "Entries" -msgstr "Записи" +msgstr "Публикации" #: routes.py:22 msgid "date" @@ -195,11 +196,11 @@ msgstr "Поиск" #: templates/puput/base.html:80 msgid "Last Entries" -msgstr "Последние записи" +msgstr "Последние публикации" #: templates/puput/base.html:86 msgid "Popular Entries" -msgstr "Популярные записи" +msgstr "Популярные публикации" #: templates/puput/base.html:98 msgid "Tags" @@ -212,7 +213,7 @@ msgstr "Архив" #: templates/puput/blog_page.html:15 templates/puput/blog_page.html.py:23 #: templates/puput/blog_page.html:50 msgid "Entries for" -msgstr "Записи:" +msgstr "Публикации:" #: templates/puput/blog_page.html:84 msgid "Continue reading" @@ -224,7 +225,7 @@ msgstr "Ничего не найдено." #: templates/puput/entry_page.html:62 msgid "Return" -msgstr "" +msgstr "Вернуться" #: templates/puput/tags/archives_list.html:23 msgid "No entry archives yet" @@ -236,7 +237,7 @@ msgstr "Рубрики отсутствуют" #: templates/puput/tags/entries_list.html:31 msgid "No entries yet" -msgstr "Записей еще нет" +msgstr "Пока нет публикаций" #: templates/puput/tags/tags_list.html:9 msgid "No tags yet" diff --git a/puput/models.py b/puput/models.py index 534d693..16753a2 100644 --- a/puput/models.py +++ b/puput/models.py @@ -2,7 +2,7 @@ from django.core.exceptions import ValidationError from django.db import models from django.template.defaultfilters import slugify -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from wagtail.core.models import Page from wagtail.admin.edit_handlers import FieldPanel diff --git a/puput/routes.py b/puput/routes.py index 2fa8082..11648a0 100644 --- a/puput/routes.py +++ b/puput/routes.py @@ -3,7 +3,7 @@ from django.contrib.auth import get_user_model from django.utils.dateformat import DateFormat from django.utils.formats import date_format -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.conf import settings from wagtail.contrib.routable_page.models import RoutablePageMixin, route diff --git a/puput/static/puput/fonts/FontAwesome.otf b/puput/static/puput/fonts/FontAwesome.otf index e69de29..81c9ad9 100644 Binary files a/puput/static/puput/fonts/FontAwesome.otf and b/puput/static/puput/fonts/FontAwesome.otf differ diff --git a/puput/static/puput/fonts/fontawesome-webfont.eot b/puput/static/puput/fonts/fontawesome-webfont.eot index e69de29..84677bc 100644 Binary files a/puput/static/puput/fonts/fontawesome-webfont.eot and b/puput/static/puput/fonts/fontawesome-webfont.eot differ diff --git a/puput/static/puput/fonts/fontawesome-webfont.woff b/puput/static/puput/fonts/fontawesome-webfont.woff index e69de29..628b6a5 100644 Binary files a/puput/static/puput/fonts/fontawesome-webfont.woff and b/puput/static/puput/fonts/fontawesome-webfont.woff differ diff --git a/setup.py b/setup.py index 499e58d..533deb7 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ def get_metadata(package, field): setup( name='puput', version=get_metadata('puput', 'version'), - packages=find_packages(), + packages=find_packages(exclude=("example*", "tests*")), include_package_data=True, keywords="django wagtail puput blog cms app", description='A Django blog app implemented in Wagtail.', @@ -38,16 +38,17 @@ def get_metadata(package, field): classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', - 'Framework :: Django :: 2.0', - 'Framework :: Django :: 2.1', 'Framework :: Django :: 2.2', 'Framework :: Django :: 3.0', + 'Framework :: Django :: 3.1', + 'Framework :: Django :: 3.2', 'Intended Audience :: Developers', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', 'Operating System :: OS Independent', 'Topic :: Software Development' ] diff --git a/tox.ini b/tox.ini index 0439597..1fe4d51 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{36,37,38}-dj{20,21,22,30}, flake8 +envlist = py{36,37,38,39}-dj{22,30,31,32}, flake8 [flake8] max-line-length = 120 @@ -18,6 +18,7 @@ basepython = py36: python3.6 py37: python3.7 py38: python3.8 + py39: python3.9 deps = selenium==3.3 @@ -34,6 +35,8 @@ deps = dj21: Django>=2.1,<2.2 dj22: Django>=2.2,<3.0 dj30: Django>=3.0,<3.1 + dj31: Django>=3.1,<3.2 + dj32: Django>=3.2,<3.3 [testenv:flake8] basepython = python3.7