From ce20900636d8d8addf5441d8652df406b6baa60f Mon Sep 17 00:00:00 2001 From: Katherine Michel Date: Sun, 17 Dec 2017 14:59:33 -0600 Subject: [PATCH] Dropping support and standardizing docs --- .circleci/config.yml | 96 +++++++++ .gitignore | 51 ++++- .travis.yml | 25 --- AUTHORS | 3 +- MANIFEST.in | 2 +- README.md | 189 ++++++++++++++++++ README.rst | 71 ------- docs/changelog.md | 18 -- docs/index.md | 97 --------- pinax/events/admin.py | 1 - pinax/events/models.py | 1 - pinax/events/specs.py | 2 +- .../events/templatetags/pinax_events_tags.py | 1 - pinax/events/tests/tests.py | 2 +- pinax/events/tests/urls.py | 1 - runtests.py | 1 - setup.py | 59 ++++-- tox.ini | 56 ++++-- 18 files changed, 420 insertions(+), 256 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .travis.yml create mode 100644 README.md delete mode 100644 README.rst delete mode 100644 docs/changelog.md delete mode 100644 docs/index.md diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..acbd03c --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,96 @@ +version: 2.0 + +common: &common + working_directory: ~/repo + steps: + - checkout + - restore_cache: + keys: + - v2-deps-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} + - v2-deps- + - run: + name: install dependencies + command: pip install --user tox + - run: + name: run tox + command: ~/.local/bin/tox + - run: + name: upload coverage report + command: | + if [[ "$UPLOAD_COVERAGE" != 0 ]]; then + PATH=$HOME/.local/bin:$PATH + pip install --user codecov + coverage xml + ~/.local/bin/codecov --required -X search gcov pycov -f coverage.xml --flags $CIRCLE_JOB + fi + - save_cache: + paths: + - .tox + - ~/.cache/pip + - ~/.local + - ./eggs + key: v2-deps-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} + +jobs: + lint: + <<: *common + docker: + - image: circleci/python:3.6.1 + environment: + - TOXENV=checkqa + - UPLOAD_COVERAGE=0 + py27dj111: + <<: *common + docker: + - image: circleci/python:2.7 + environment: + TOXENV=py27-dj111 + py34dj111: + <<: *common + docker: + - image: circleci/python:3.4 + environment: + TOXENV=py34-dj111 + py34dj20: + <<: *common + docker: + - image: circleci/python:3.4 + environment: + TOXENV=py34-dj20 + py35dj111: + <<: *common + docker: + - image: circleci/python:3.5 + environment: + TOXENV=py35-dj111 + py35dj20: + <<: *common + docker: + - image: circleci/python:3.5 + environment: + TOXENV=py35-dj20 + py36dj111: + <<: *common + docker: + - image: circleci/python:3.6 + environment: + TOXENV=py36-dj111 + py36dj20: + <<: *common + docker: + - image: circleci/python:3.6 + environment: + TOXENV=py36-dj20 + +workflows: + version: 2 + test: + jobs: + - lint + - py27dj111 + - py34dj111 + - py34dj20 + - py35dj111 + - py35dj20 + - py36dj111 + - py36dj20 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8cc49fb..90463c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,45 @@ -build -dist -.coverage -.tox -.idea MANIFEST -*.pyc -*.egg-info -*.egg +.DS_Store + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ docs/_build/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg +*.eggs +.python-version + +# Pipfile +Pipfile +Pipfile.lock + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports htmlcov/ -.eggs/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# IDEs +.idea/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a1d740e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -sudo: false -language: python -python: - - "2.7" - - "3.3" - - "3.4" - - "3.5" -env: - - DJANGO=1.8 - - DJANGO=1.9 - - DJANGO=master -matrix: - exclude: - - python: "3.3" - env: DJANGO=1.9 - - python: "3.3" - env: DJANGO=master -install: - - pip install tox coveralls -script: - - tox -e py${TRAVIS_PYTHON_VERSION//[.]/}-$DJANGO -after_success: - - coveralls -notifications: - slack: pinax:rCb02bR4xVh1cRyOwajSAWoD diff --git a/AUTHORS b/AUTHORS index f4283a4..83dac49 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,3 @@ Patrick Altman -Brian Rosner +Brian Rosner +Katherine “Kati” Michel diff --git a/MANIFEST.in b/MANIFEST.in index edc8039..7d306c2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include AUTHORS include LICENSE -include README.rst +include README.md recursive-include pinax/events/static * recursive-include pinax/events/templates * diff --git a/README.md b/README.md new file mode 100644 index 0000000..65761cf --- /dev/null +++ b/README.md @@ -0,0 +1,189 @@ +# Pinax Events + +[![CircleCi](https://img.shields.io/circleci/project/github/pinax/pinax-events.svg)](https://circleci.com/gh/pinax/pinax-events) +[![Codecov](https://img.shields.io/codecov/c/github/pinax/pinax-events.svg)](https://codecov.io/gh/pinax/pinax-events) +[![](https://img.shields.io/pypi/dm/pinax-events.svg)](https://pypi.python.org/pypi/pinax-events/) +[![](https://img.shields.io/pypi/v/pinax-events.svg)](https://pypi.python.org/pypi/pinax-events/) + +[![](http://slack.pinaxproject.com/badge.svg)](http://slack.pinaxproject.com/) +[![](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) + +## Table of Contents + +* [About Pinax](#about-pinax) +* [Overview](#overview) + * [Supported Django and Python versions](#supported-django-and-python-versions) +* [Documentation](#documentation) + * [Installation](#installation) + * [Settings](#settings) + * [Usage](#usage) +* [Change Log](#change-log) +* [Contribute](#contribute) +* [Code of Conduct](#code-of-conduct) +* [Connect with Pinax](#connect-with-pinax) +* [License](#license) + +## About Pinax + +Pinax is an open-source platform built on the Django Web Framework. It is an ecosystem of reusable +Django apps, themes, and starter project templates. This collection can be found at http://pinaxproject.com. + + +## pinax-events + +### Overview + +``pinax-events`` is a simple app for publishing events on your site. + +#### Supported Django and Python versions + +Django \ Python | 2.7 | 3.4 | 3.5 | 3.6 +--------------- | --- | --- | --- | --- +1.11 | * | * | * | * +2.0 | | * | * | * + + +## Documentation + +### Installation + +To install pinax-events: + + pip install pinax-events + +Add `pinax-events` to your `INSTALLED_APPS` setting: + +```python + INSTALLED_APPS = ( + ... + "imagekit", + "pinax.events", + ... + ) +``` + +You will need either `PIL` or `Pillow` installed for `imagekit` to work. We +recommend `Pillow`: + + pip install Pillow + +### Settings + +There are two settings that have defaults but if you want to override them you +need to just set them to the dotted-notation path to the `ImageSpec` class that +you wish to use to process the `image` and `secondary_image` files for the +`image_thumb` and `secondary_image_thumb` attributes on the `News` model. + +```python +PINAX_EVENTS_IMAGE_THUMBNAIL_SPEC = "pinax.events.specs.ImageThumbnail" +PINAX_EVENTS_SECONDARY_IMAGE_THUMBNAIL_SPEC = "pinax.events.specs.SecondaryImageThumbnail" +``` + +To create your own `ImageSpec` classes you can reference the defaults, but it is +basically subclassing `imagekit.ImageSpec`. + +### Usage + +In your template where you want to display events: + +First, load the template tags: + + {% load pinax_events_tags %} + +Then: + + {% events as event_items %} + +And here is an example that how you can show the events: + +```html +
+ {% for event in event_items %} + + {% endfor %} +
+``` + +Add and manage events via the Django admin. + + +## Change Log + +### 2.0.0 + +* Add Django 2.0 compatibility testing +* Drop Django 1.8, 1.9, 1.10 and Python 3.3 support +* Move documentation into README +* Standardize documentation layout +* Convert CI and coverage to CircleCi and CodeCov +* Add PyPi-compatible long description + +### 1.1.1 + +* added missing migrations from 1.1.0 changes + +### 1.1.0 + +* added support for secondary images +* added support for customized image sizing + +### 1.0.0 + +* added docs and tests and wired up CI + +### 0.1 + +* initial release + + +## Contribute + +For an overview on how contributing to Pinax works read this [blog post](http://blog.pinaxproject.com/2016/02/26/recap-february-pinax-hangout/) +and watch the included video, or read our [How to Contribute](http://pinaxproject.com/pinax/how_to_contribute/) section. +For concrete contribution ideas, please see our +[Ways to Contribute/What We Need Help With](http://pinaxproject.com/pinax/ways_to_contribute/) section. + +In case of any questions we recommend you join our [Pinax Slack team](http://slack.pinaxproject.com) +and ping us there instead of creating an issue on GitHub. Creating issues on GitHub is of course +also valid but we are usually able to help you faster if you ping us in Slack. + +We also highly recommend reading our blog post on [Open Source and Self-Care](http://blog.pinaxproject.com/2016/01/19/open-source-and-self-care/). + +## Code of Conduct + +In order to foster a kind, inclusive, and harassment-free community, the Pinax Project +has a [code of conduct](http://pinaxproject.com/pinax/code_of_conduct/). +We ask you to treat everyone as a smart human programmer that shares an interest in Python, Django, and Pinax with you. + + +## Connect with Pinax + +For updates and news regarding the Pinax Project, please follow us on Twitter [@pinaxproject](https://twitter.com/pinaxproject) +and check out our [Pinax Project blog](http://blog.pinaxproject.com). + + +## License + +Copyright (c) 2012-2018 James Tauber and contributors under the [MIT license](https://opensource.org/licenses/MIT). \ No newline at end of file diff --git a/README.rst b/README.rst deleted file mode 100644 index 1626cf5..0000000 --- a/README.rst +++ /dev/null @@ -1,71 +0,0 @@ -Pinax Events -============ - -.. image:: http://slack.pinaxproject.com/badge.svg - :target: http://slack.pinaxproject.com/ - -.. image:: https://img.shields.io/travis/pinax/pinax-events.svg - :target: https://travis-ci.org/pinax/pinax-events - -.. image:: https://img.shields.io/coveralls/pinax/pinax-events.svg - :target: https://coveralls.io/r/pinax/pinax-events - -.. image:: https://img.shields.io/pypi/dm/pinax-events.svg - :target: https://pypi.python.org/pypi/pinax-events/ - -.. image:: https://img.shields.io/pypi/v/pinax-events.svg - :target: https://pypi.python.org/pypi/pinax-events/ - -.. image:: https://img.shields.io/badge/license-MIT-blue.svg - :target: https://pypi.python.org/pypi/pinax-events/ - - -Pinax ------- - -Pinax is an open-source platform built on the Django Web Framework. It is an ecosystem of reusable Django apps, themes, and starter project templates. -This collection can be found at http://pinaxproject.com. - -This app was developed as part of the Pinax ecosystem but is just a Django app and can be used independently of other Pinax apps. - - -pinax-events ---------------------- - -``pinax-events`` is a simple app for publishing events on your site. - -Running the Tests -------------------- - - :: - - $ pip install detox - $ detox - - -Documentation ----------------- - -The Pinax documentation is available at http://pinaxproject.com/pinax/. The ``pinax-events`` documentation can be found here http://pinax-events.readthedocs.io/en/latest/. - - -Contribute ----------------- - -See this blog post http://blog.pinaxproject.com/2016/02/26/recap-february-pinax-hangout/ including a video, or our How to Contribute (http://pinaxproject.com/pinax/how_to_contribute/) section for an overview on how contributing to Pinax works. For concrete contribution ideas, please see our Ways to Contribute/What We Need Help With (http://pinaxproject.com/pinax/ways_to_contribute/) section. - -In case of any questions we recommend you join our Pinax Slack team (http://slack.pinaxproject.com) and ping us there instead of creating an issue on GitHub. Creating issues on GitHub is of course also valid but we are usually able to help you faster if you ping us in Slack. - -We also highly recommend reading our Open Source and Self-Care blog post (http://blog.pinaxproject.com/2016/01/19/open-source-and-self-care/). - - -Code of Conduct ----------------- - -In order to foster a kind, inclusive, and harassment-free community, the Pinax Project has a code of conduct, which can be found here http://pinaxproject.com/pinax/code_of_conduct/. We ask you to treat everyone as a smart human programmer that shares an interest in Python, Django, and Pinax with you. - - -Pinax Project Blog and Twitter --------------------------------- - -For updates and news regarding the Pinax Project, please follow us on Twitter at @pinaxproject and check out our blog http://blog.pinaxproject.com. diff --git a/docs/changelog.md b/docs/changelog.md deleted file mode 100644 index dda669c..0000000 --- a/docs/changelog.md +++ /dev/null @@ -1,18 +0,0 @@ -# Change Log - -## 1.1.1 - -* added missing migrations from 1.1.0 changes - -## 1.1.0 - -* added support for secondary images -* added support for customized image sizing - -## 1.0.0 - -* added docs and tests and wired up CI - -## 0.1 - -* initial release diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index b061901..0000000 --- a/docs/index.md +++ /dev/null @@ -1,97 +0,0 @@ -# pinax-events - - -!!! note "Pinax Ecosystem" - This app is part of the Pinax ecosystem and is designed for use - both with and independently of other Pinax apps. - - To learn more about Pinax, see - - -## Quickstart - -To install pinax-events: - - pip install pinax-events - -Add `pinax-events` to your `INSTALLED_APPS` setting: - -```python - INSTALLED_APPS = ( - ... - "imagekit", - "pinax.events", - ... - ) -``` - -You will need either `PIL` or `Pillow` installed for `imagekit` to work. We -recommend `Pillow`: - - pip install Pillow - - -## Settings - -There are two settings that have defaults but if you want to override them you -need to just set them to the dotted-notation path to the `ImageSpec` class that -you wish to use to process the `image` and `secondary_image` files for the -`image_thumb` and `secondary_image_thumb` attributes on the `News` model. - -```python -PINAX_EVENTS_IMAGE_THUMBNAIL_SPEC = "pinax.events.specs.ImageThumbnail" -PINAX_EVENTS_SECONDARY_IMAGE_THUMBNAIL_SPEC = "pinax.events.specs.SecondaryImageThumbnail" -``` - -To create your own `ImageSpec` classes you can reference the defaults, but it is -basically subclassing `imagekit.ImageSpec`. - -## Usage - -In your template where you want to display events: - -First, load the template tags: - - {% load pinax_events_tags %} - -Then: - - {% events as event_items %} - -And here is an example that how you can show the events: - -```html -
- {% for event in event_items %} - - {% endfor %} -
-``` - -Add and manage events via the Django admin. - -## Changelog - -See [Changelog](./changelog.md). diff --git a/pinax/events/admin.py b/pinax/events/admin.py index b792124..85e13b7 100644 --- a/pinax/events/admin.py +++ b/pinax/events/admin.py @@ -2,5 +2,4 @@ from .models import Event - admin.site.register(Event, list_display=["title", "image", "where", "what", "start_date", "end_date", "published_at", "created_at"]) diff --git a/pinax/events/models.py b/pinax/events/models.py index 1803d29..5410612 100644 --- a/pinax/events/models.py +++ b/pinax/events/models.py @@ -4,7 +4,6 @@ from django.utils import timezone import markdown - from imagekit.models import ImageSpecField diff --git a/pinax/events/specs.py b/pinax/events/specs.py index 3d409fe..d4e58ae 100644 --- a/pinax/events/specs.py +++ b/pinax/events/specs.py @@ -1,5 +1,5 @@ from imagekit import ImageSpec -from pilkit.processors import SmartResize, ResizeToFit +from pilkit.processors import ResizeToFit, SmartResize class ImageThumbnail(ImageSpec): diff --git a/pinax/events/templatetags/pinax_events_tags.py b/pinax/events/templatetags/pinax_events_tags.py index 7bbb952..f1e8346 100644 --- a/pinax/events/templatetags/pinax_events_tags.py +++ b/pinax/events/templatetags/pinax_events_tags.py @@ -3,7 +3,6 @@ from ..models import Event - register = template.Library() diff --git a/pinax/events/tests/tests.py b/pinax/events/tests/tests.py index bcdd087..75c0471 100644 --- a/pinax/events/tests/tests.py +++ b/pinax/events/tests/tests.py @@ -1,7 +1,7 @@ from datetime import timedelta -from django.utils import timezone from django.test import TestCase +from django.utils import timezone from pinax.events.models import Event from pinax.events.templatetags.pinax_events_tags import events diff --git a/pinax/events/tests/urls.py b/pinax/events/tests/urls.py index 9cdc8e6..7f50740 100644 --- a/pinax/events/tests/urls.py +++ b/pinax/events/tests/urls.py @@ -1,6 +1,5 @@ from django.conf.urls import include - urlpatterns = [ (r"^", include("pinax.events.urls")), ] diff --git a/runtests.py b/runtests.py index 4327057..8a636c8 100644 --- a/runtests.py +++ b/runtests.py @@ -23,7 +23,6 @@ } }, SITE_ID=1, - ROOT_URLCONF="pinax.events.tests.urls", SECRET_KEY="notasecret", ) diff --git a/setup.py b/setup.py index 562cf6c..efd40a7 100644 --- a/setup.py +++ b/setup.py @@ -1,22 +1,49 @@ -import codecs - -from os import path from setuptools import find_packages, setup +LONG_DESCRIPTION = """ +.. image:: http://pinaxproject.com/pinax-design/patches/pinax-events.svg + :target: https://pypi.python.org/pypi/pinax-events/ +=================== +Pinax Notifications +=================== +.. image:: https://img.shields.io/pypi/v/pinax-events.svg + :target: https://pypi.python.org/pypi/pinax-events/ +.. image:: https://img.shields.io/badge/license-MIT-blue.svg + :target: https://pypi.python.org/pypi/pinax-events/ +.. image:: https://img.shields.io/circleci/project/github/pinax/pinax-events.svg + :target: https://circleci.com/gh/pinax/pinax-events +.. image:: https://img.shields.io/codecov/c/github/pinax/pinax-events.svg + :target: https://codecov.io/gh/pinax/pinax-events +.. image:: https://img.shields.io/github/contributors/pinax/pinax-events.svg + :target: https://github.com/pinax/pinax-events/graphs/contributors +.. image:: https://img.shields.io/github/issues-pr/pinax/pinax-events.svg + :target: https://github.com/pinax/pinax-events/pulls +.. image:: https://img.shields.io/github/issues-pr-closed/pinax/pinax-events.svg + :target: https://github.com/pinax/pinax-events/pulls?q=is%3Apr+is%3Aclosed +.. image:: http://slack.pinaxproject.com/badge.svg + :target: http://slack.pinaxproject.com/ -def read(*parts): - filename = path.join(path.dirname(__file__), *parts) - with codecs.open(filename, encoding="utf-8") as fp: - return fp.read() +``pinax-events`` is a simple app for publishing events on your site. + +Supported Django and Python Versions +------------------------------------ ++-----------------+-----+-----+-----+-----+ +| Django \ Python | 2.7 | 3.4 | 3.5 | 3.6 | ++=================+=====+=====+=====+=====+ +| 1.11 | * | * | * | * | ++-----------------+-----+-----+-----+-----+ +| 2.0 | | * | * | * | ++-----------------+-----+-----+-----+-----+ +""" setup( author="Pinax Team", author_email="team@pinaxproject.com", description="a simple app for publishing events on your site", name="pinax-events", - long_description=read("README.rst"), - version="1.1.1", + long_description=LONG_DESCRIPTION, + version="2.0.0", url="http://github.com/pinax/pinax-events/", license="MIT", packages=find_packages(), @@ -32,16 +59,22 @@ def read(*parts): "Markdown>=2.6.6" ], classifiers=[ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", + 'Framework :: Django :: 1.11', + 'Framework :: Django :: 2.0', "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 3", + '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', "Topic :: Software Development :: Libraries :: Python Modules", ], zip_safe=False -) +) \ No newline at end of file diff --git a/tox.ini b/tox.ini index 6ff14f4..5ca0a95 100644 --- a/tox.ini +++ b/tox.ini @@ -2,27 +2,55 @@ ignore = E265,E501 max-line-length = 100 max-complexity = 10 -exclude = migrations/*,docs/* +exclude = pinax/events/migrations/* +inline-quotes = double + +[isort] +multi_line_output=3 +known_django=django +known_third_party=pinax +sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER +skip_glob=*/pinax/events/migrations/* + +[coverage:run] +source = pinax +omit = pinax/events/conf.py,pinax/events/tests/*,pinax/events/migrations/* +branch = true +data_file = .coverage + +[coverage:report] +omit = pinax/events/conf.py,pinax/events/tests/*,pinax/events/migrations/* +exclude_lines = + coverage: omit +show_missing = True [tox] envlist = - py27-{1.8,1.9,master}, - py33-{1.8}, - py34-{1.8,1.9,master}, - py35-{1.8,1.9,master} + checkqa, + py27-dj{111} + py34-dj{111,20} + py35-dj{111,20} + py36-dj{111,20} [testenv] +passenv = CI CIRCLECI CIRCLE_* deps = - coverage == 4.0.2 - flake8 == 2.5.0 - 1.8: Django>=1.8,<1.9 - 1.9: Django>=1.9,<1.10 + coverage + codecov + dj111: Django>=1.11,<1.12 + dj20: Django<2.1 master: https://github.com/django/django/tarball/master + usedevelop = True -setenv = - LANG=en_US.UTF-8 - LANGUAGE=en_US:en - LC_ALL=en_US.UTF-8 commands = - flake8 pinax coverage run setup.py test + coverage report -m --skip-covered + +[testenv:checkqa] +commands = + flake8 pinax + isort --recursive --check-only --diff pinax -sp tox.ini +deps = + flake8 == 3.4.1 + flake8-quotes == 0.11.0 + isort == 4.2.15