Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: caktus/django-email-bandit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.5.0
Choose a base ref
...
head repository: caktus/django-email-bandit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref

Commits on Jan 11, 2018

  1. Fix RST formatting

    vkurup committed Jan 11, 2018
    Copy the full SHA
    ba0e251 View commit details

Commits on Jan 24, 2018

  1. It is required to add bandit to INSTALLED_APPS

    Otherwise the templates can not be found.
    Revert 18ac77e
    153957 authored Jan 24, 2018

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    aef293e View commit details

Commits on Jan 26, 2018

  1. Merge pull request #27 from 153957/patch-1

    It is required to add bandit to INSTALLED_APPS
    vkurup authored Jan 26, 2018

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    edee00a View commit details

Commits on Jul 3, 2020

  1. Copy the full SHA
    83c8ea5 View commit details

Commits on Dec 3, 2020

  1. Update docs/settings.rst

    vkurup authored Dec 3, 2020

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3312870 View commit details
  2. Merge pull request #29 from PetrDlouhy/regexps

    add BANDIT_REGEXP_WHITELIST to match by regexps
    Vinod Kurup authored Dec 3, 2020

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    948a559 View commit details
  3. Bump version for 1.6

    vkurup committed Dec 3, 2020
    Copy the full SHA
    7b72f81 View commit details

Commits on Dec 4, 2020

  1. Set up GitHub Actions for CI

    vkurup committed Dec 4, 2020
    Copy the full SHA
    6cfb280 View commit details

Commits on Dec 10, 2020

  1. Copy the full SHA
    4d610e7 View commit details
  2. Copy the full SHA
    b1aaae1 View commit details

Commits on Dec 16, 2020

  1. Merge pull request #30 from caktus/github-actions

    Set up GitHub Actions for CI
    Vinod Kurup authored Dec 16, 2020

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    66286fa View commit details
  2. Copy the full SHA
    660a5e5 View commit details
  3. Copy the full SHA
    3617acd View commit details
  4. Update README

    vkurup committed Dec 16, 2020
    Copy the full SHA
    dfefcd2 View commit details
  5. Update setup.py classifiers

    vkurup committed Dec 16, 2020
    Copy the full SHA
    8b3e8f0 View commit details

Commits on Dec 17, 2020

  1. Merge pull request #31 from caktus/django-22-31

    Test against Django 2.2,3.0,3.1 and remove python2isms
    Vinod Kurup authored Dec 17, 2020

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1504d3d View commit details
  2. Bump version for 2.0

    vkurup committed Dec 17, 2020
    Copy the full SHA
    a77f205 View commit details
  3. Copy the full SHA
    a950732 View commit details
  4. Fix badge image URL

    vkurup committed Dec 17, 2020
    Copy the full SHA
    1612229 View commit details

Commits on Nov 4, 2021

  1. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5539ccb View commit details
  2. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9d503ff View commit details

Commits on Aug 11, 2022

  1. Update testing configuration

    * Add Python 4.10
    * Add Django 4.1
    * Drop Django 3.0
    * Drop Django 3.1
    jaap3 committed Aug 11, 2022
    Copy the full SHA
    b5b961f View commit details
  2. Copy the full SHA
    33ae8ca View commit details
  3. Copy the full SHA
    232b075 View commit details
  4. Remove u string prefixes

    jaap3 committed Aug 11, 2022
    Copy the full SHA
    517e668 View commit details
  5. Update list trove, readme

    jaap3 committed Aug 11, 2022
    Copy the full SHA
    63d24de View commit details

Commits on Aug 22, 2022

  1. Merge pull request #36 from leukeleu/django-4.1

    Update testing configuration
    Dmitriy Chukhin authored Aug 22, 2022

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8d84bb5 View commit details
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[run]
branch = true
source = bandit
omit = */tests*

[report]
fail_under = 85
show_missing = true
skip_covered = true
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see:
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
release:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
83 changes: 83 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: lint-test

on:
pull_request:
branches:
- develop
push:
branches:
- master
- develop
schedule:
# run once a week on early monday mornings
- cron: '22 2 * * 1'

jobs:
pre-commit:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0

test:
runs-on: ubuntu-20.04
strategy:
matrix:
# tox-gh-actions will only run the tox environments which match the currently
# running python-version. See [gh-actions] in tox.ini for the mapping
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- name: Test with tox
run: tox

coverage:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('dev-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- name: Run coverage report
run: |
coverage run runtests.py
coverage report
build-docs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('dev-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
- name: Build docs
run: sphinx-build docs docs/_build/html
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black

- repo: https://github.com/pycqa/isort
rev: 5.10.0
hooks:
- id: isort

- repo: https://gitlab.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
4 changes: 4 additions & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
3.9.0
3.8.6
3.7.9
3.6.12
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -12,3 +12,4 @@ Arne de Laat (@153957)
Jaap Roes (@jaap3)
Tony S Yu (@tonysyu)
Dan Poirier (@dpoirier)
Petr Dlouhý (@PetrDlouhy)
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011-2018, Caktus Consulting Group, LLC
Copyright (c) 2011-2021, Caktus Consulting Group, LLC
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
48 changes: 39 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Django-Email-Bandit
django-email-bandit
==============================

.. sidebar:: Build Status
@@ -16,21 +16,21 @@ logging. Mixin classes are provided to use the same hijack logic for any existin
email backend such as `django-ses <https://github.com/hmarr/django-ses>`_.

.. |master-status| image::
https://api.travis-ci.org/caktus/django-email-bandit.svg?branch=master
https://github.com/caktus/django-email-bandit/workflows/lint-test/badge.svg?branch=master
:alt: Build Status
:target: https://travis-ci.org/caktus/django-email-bandit
:target: https://github.com/caktus/django-email-bandit/actions?query=branch%3Amaster

.. |develop-status| image::
https://api.travis-ci.org/caktus/django-email-bandit.svg?branch=develop
https://github.com/caktus/django-email-bandit/workflows/lint-test/badge.svg?branch=develop
:alt: Build Status
:target: https://travis-ci.org/caktus/django-email-bandit
:target: https://github.com/caktus/django-email-bandit/actions?query=branch%3Adevelop


Requirements
-------------------------------

- Python 2.7 or 3.5+
- Django >= 1.8 (supported versions)
- Python >= 3.6
- Django >= 2.2 (supported versions)


Installation
@@ -40,6 +40,14 @@ To install django-email-bandit via pip::

pip install django-email-bandit

Add django-email-bandit to your installed apps::

INSTALLED_APPS = (
...
'bandit',
...
)

For your test environment you should enable the backend::

EMAIL_BACKEND = 'bandit.backends.smtp.HijackSMTPBackend'
@@ -48,7 +56,7 @@ and set the email which will receive all of the emails::

BANDIT_EMAIL = 'bandit@example.com'

or even multiple addresses:
or even multiple addresses::

BANDIT_EMAIL = ['bandit@example.com', 'accomplice@example.com']

@@ -66,11 +74,33 @@ Documentation
Full project documentation is on `Read the Docs <https://django-email-bandit.readthedocs.org/>`_.


Maintainer Information
-------------------------------

We use Github Actions to lint (using pre-commit, black, isort, and flake8),
test (using tox and tox-gh-actions), calculate coverage (using coverage), and build
documentation (using sphinx).

We have a local script to do these actions locally, named ``maintain.sh``::

$ ./maintain.sh

A Github Action workflow also builds and pushes a new package to PyPI whenever a new
Release is created in Github. This uses a project-specific PyPI token, as described in
the `PyPI documentation here <https://pypi.org/help/#apitoken>`_. That token has been
saved in the ``PYPI_PASSWORD`` settings for this repo, but has not been saved anywhere
else so if it is needed for any reason, the current one should be deleted and a new one
generated.

As always, be sure to bump the version in ``bandit/__init__.py`` before creating a
Release, so that the proper version gets pushed to PyPI.


Questions or Issues?
-------------------------------

If you have questions, issues or requests for improvements please let us know on
`Github <https://github.com/caktus/django-email-bandit/issues>`_.

Development sponsored by `Caktus Consulting Group, LLC
<http://www.caktusgroup.com/services>`_.
<https://www.caktusgroup.com/services>`_.
20 changes: 11 additions & 9 deletions bandit/__init__.py
Original file line number Diff line number Diff line change
@@ -3,24 +3,26 @@
"""

__version_info__ = {
'major': 1,
'minor': 5,
'micro': 0,
'releaselevel': 'final',
"major": 2,
"minor": 0,
"micro": 0,
"releaselevel": "final",
}


def get_version():
"""
Return the formatted version information
"""
vers = ["%(major)i.%(minor)i" % __version_info__, ]
vers = [
"%(major)i.%(minor)i" % __version_info__,
]

if __version_info__['micro']:
if __version_info__["micro"]:
vers.append(".%(micro)i" % __version_info__)
if __version_info__['releaselevel'] != 'final':
vers.append('%(releaselevel)s' % __version_info__)
return ''.join(vers)
if __version_info__["releaselevel"] != "final":
vers.append("%(releaselevel)s" % __version_info__)
return "".join(vers)


__version__ = get_version()
Loading