Skip to content

Commit

Permalink
Updates!
Browse files Browse the repository at this point in the history
* add the Pinax Patch to readme
* update to latest CI stack
* update to build matrix
* drop support for older versions of Django
* update import ordering to match our new isort config
  • Loading branch information
paltman committed Oct 21, 2017
1 parent a0fbbe1 commit 4927460
Show file tree
Hide file tree
Showing 24 changed files with 395 additions and 257 deletions.
136 changes: 136 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,136 @@
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 [[ "$TOXENV" != checkqa ]]; then
PATH=$HOME/.local/bin:$PATH
pip install --user codecov
~/.local/bin/codecov --required --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
py27dj18:
<<: *common
docker:
- image: circleci/python:2.7
environment:
TOXENV=py27-dj18
py27dj110:
<<: *common
docker:
- image: circleci/python:2.7
environment:
TOXENV=py27-dj110
py27dj111:
<<: *common
docker:
- image: circleci/python:2.7
environment:
TOXENV=py27-dj111
py34dj18:
<<: *common
docker:
- image: circleci/python:3.4
environment:
TOXENV=py34-dj18
py34dj110:
<<: *common
docker:
- image: circleci/python:3.4
environment:
TOXENV=py34-dj110
py34dj111:
<<: *common
docker:
- image: circleci/python:3.4
environment:
TOXENV=py34-dj111
py34dj20:
<<: *common
docker:
- image: circleci/python:3.4
environment:
TOXENV=py34-dj20
py35dj18:
<<: *common
docker:
- image: circleci/python:3.5
environment:
TOXENV=py35-dj18
py35dj110:
<<: *common
docker:
- image: circleci/python:3.5
environment:
TOXENV=py35-dj110
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
- py27dj18
- py27dj110
- py27dj111
- py34dj18
- py34dj110
- py34dj111
- py34dj20
- py35dj18
- py35dj110
- py35dj111
- py35dj20
- py36dj111
- py36dj20
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,4 @@
.cache
build
dist
.coverage
Expand All @@ -8,3 +9,4 @@ MANIFEST
*.egg
docs/_build/
htmlcov/
.eggs
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

45 changes: 22 additions & 23 deletions CONTRIBUTING.md
Expand Up @@ -45,16 +45,17 @@ a message that will link the commit message to the issue and auto-close it
if appropriate.

Add ability to travel back in time

You need to be driving 88 miles per hour to generate 1.21 gigawatts of
power to properly use this feature.

Fixes #88



## Coding style

When writing code to be included in django-user-accounts keep our style in mind:
When writing code to be included in Pinax keep our style in mind:

* Follow [PEP8](http://www.python.org/dev/peps/pep-0008/) there are some
cases where we do not follow PEP8. It is an excellent starting point.
Expand All @@ -70,7 +71,6 @@ Django's coding style:
* Use double quotes not single quotes. Single quotes are allowed in cases
where a double quote is needed in the string. This makes the code read
cleaner in those cases.
* Blank lines should contain no whitespace.
* Docstrings always use three double quotes on a line of their own, so, for
example, a single line docstring should take up three lines not one.
* Imports are grouped specifically and ordered alphabetically. This is shown
Expand All @@ -85,56 +85,55 @@ Here is an example of these rules applied:
# first set of imports are stdlib imports
# non-from imports go first then from style import in their own group
import csv

# second set of imports are Django imports with contrib in their own
# group.
from django.core.urlresolvers import reverse

# second set of imports are Django imports
from django.contrib.auth.models import User
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _

from django.contrib.auth.models import User


# third set of imports are external apps (if applicable)
from tagging.fields import TagField

# fourth set of imports are local apps
from .fields import MarkupField


class Task(models.Model):
"""
A model for storing a task.
"""

creator = models.ForeignKey(User)
created = models.DateTimeField(default=timezone.now)
modified = models.DateTimeField(default=timezone.now)

objects = models.Manager()

class Meta:
verbose_name = _("task")
verbose_name_plural = _("tasks")

def __unicode__(self):
return self.summary

def save(self, **kwargs):
self.modified = datetime.now()
super(Task, self).save(**kwargs)

def get_absolute_url(self):
return reverse("task_detail", kwargs={"task_id": self.pk})

# custom methods


class TaskComment(models.Model):
# ... you get the point ...
pass



## Pull Requests

Please keep your pull requests focused on one specific thing only. If you
Expand Down
15 changes: 0 additions & 15 deletions Makefile

This file was deleted.

33 changes: 20 additions & 13 deletions README.rst
@@ -1,29 +1,36 @@
.. image:: http://pinaxproject.com/pinax-design/patches/pinax-points.svg

============
Pinax Points
============

.. image:: http://slack.pinaxproject.com/badge.svg
:target: http://slack.pinaxproject.com/

.. image:: https://img.shields.io/travis/pinax/pinax-points.svg
:target: https://travis-ci.org/pinax/pinax-points
.. image:: https://circleci.com/gh/pinax/pinax-points.svg?style=svg
:target: https://circleci.com/gh/pinax/pinax-points

.. image:: https://img.shields.io/coveralls/pinax/pinax-points.svg
:target: https://coveralls.io/r/pinax/pinax-points

.. image:: https://img.shields.io/pypi/dm/pinax-points.svg
:target: https://pypi.python.org/pypi/pinax-points/
.. image:: https://img.shields.io/codecov/c/github/pinax/pinax-points.svg
:target: https://codecov.io/gh/pinax/pinax-points

.. image:: https://img.shields.io/pypi/v/pinax-points.svg
:target: https://pypi.python.org/pypi/pinax-points/

.. image:: https://img.shields.io/badge/license-MIT-blue.svg
:target: https://pypi.python.org/pypi/pinax-points/



.. image:: https://img.shields.io/github/contributors/pinax/pinax-points.svg
:target: https://github.com/pinax/pinax-points/issues/
.. image:: https://img.shields.io/github/issues-pr/pinax/pinax-points.svg
:target: https://github.com/pinax/pinax-points/issues/
.. image:: https://img.shields.io/github/issues-pr-closed/pinax/pinax-points.svg
:target: https://github.com/pinax/pinax-points/issues/


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.
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.
Expand All @@ -32,7 +39,7 @@ This app was developed as part of the Pinax ecosystem but is just a Django app a
pinax-points
-------------

``pinax-points`` is a points, positions and levels app for Django.
``pinax-points`` is a points, positions and levels app for Django.

``pinax-points``, formerly agon, provides the ability to track points on arbitrary
objects in your system. The common case being ``User`` instances. It can
Expand Down Expand Up @@ -66,13 +73,13 @@ See this blog post http://blog.pinaxproject.com/2016/02/26/recap-february-pinax-

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/).
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/.
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.


Expand Down
23 changes: 23 additions & 0 deletions makemigrations.py
@@ -0,0 +1,23 @@
#!/usr/bin/env python
import os
import sys

import django


def run(*args):
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pinax.points.tests.settings")
django.setup()

parent = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, parent)

django.core.management.call_command(
"makemigrations",
"pinax_points",
*args
)


if __name__ == "__main__":
run(*sys.argv[1:])
1 change: 1 addition & 0 deletions pinax/points/__init__.py
@@ -1,4 +1,5 @@
import pkg_resources


default_app_config = "pinax.points.apps.AppConfig"
__version__ = pkg_resources.get_distribution("pinax-points").version

0 comments on commit 4927460

Please sign in to comment.