-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make djangocms-transfer publicly available (#4)
* added tests, readme and some updates * fix django.core.urlresolvers * fix django CMS 3.6 compatibility
- Loading branch information
1 parent
77baa6a
commit 432e430
Showing
14 changed files
with
234 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[run] | ||
branch = True | ||
source = djangocms_transfer | ||
omit = | ||
migrations/* | ||
tests/* | ||
|
||
[report] | ||
exclude_lines = | ||
pragma: no cover | ||
def __repr__ | ||
if self.debug: | ||
if settings.DEBUG | ||
raise AssertionError | ||
raise NotImplementedError | ||
if 0: | ||
if __name__ == .__main__.: | ||
ignore_errors = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
.idea/ | ||
.tox/ | ||
.eggs/ | ||
dist/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
language: python | ||
|
||
sudo: false | ||
|
||
matrix: | ||
include: | ||
- python: 3.5 | ||
env: TOX_ENV='flake8' | ||
# Django 1.11 | ||
- python: 2.7 | ||
env: DJANGO='dj111' CMS='cms34' | ||
- python: 3.5 | ||
env: DJANGO='dj111' CMS='cms35' | ||
- python: 3.5 | ||
env: DJANGO='dj111' CMS='cms36' | ||
# Django 2.0 | ||
- python: 3.5 | ||
env: DJANGO='dj20' CMS='cms36' | ||
# Django 2.1 | ||
- python: 3.5 | ||
env: DJANGO='dj21' CMS='cms36' | ||
|
||
install: | ||
- pip install tox coverage | ||
- "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then export PY_VER=py27; fi" | ||
- "if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then export PY_VER=py35; fi" | ||
- "if [[ ${DJANGO}z != 'z' ]]; then export TOX_ENV=$PY_VER-$DJANGO-$CMS; fi" | ||
|
||
script: | ||
- tox -e $TOX_ENV | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
========= | ||
Changelog | ||
========= | ||
|
||
1.0.0 (unreleased) | ||
================== | ||
|
||
* Public release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
=================== | ||
django CMS Transfer | ||
=================== | ||
|
||
|
||
|pypi| |build| |coverage| | ||
|
||
**django CMS Transfer** is an **experimental** package that allows you to export | ||
and import plugin data from a page or a placeholder. It does not support foreign | ||
key relations and won't import/export related data. | ||
|
||
This addon is compatible with `Divio Cloud <http://divio.com>`_ and is also available on the | ||
`django CMS Marketplace <https://marketplace.django-cms.org/en/addons/browse/djangocms-transfer/>`_ | ||
for easy installation. | ||
|
||
|
||
Contributing | ||
============ | ||
|
||
This is a an open-source project. We'll be delighted to receive your | ||
feedback in the form of issues and pull requests. Before submitting your | ||
pull request, please review our `contribution guidelines | ||
<http://docs.django-cms.org/en/latest/contributing/index.html>`_. | ||
|
||
|
||
Running Tests | ||
------------- | ||
|
||
You can run tests by executing:: | ||
|
||
virtualenv env | ||
source env/bin/activate | ||
pip install -r tests/requirements.txt | ||
python setup.py test | ||
|
||
|
||
.. |pypi| image:: https://badge.fury.io/py/djangocms-transfer.svg | ||
:target: http://badge.fury.io/py/djangocms-transfer | ||
.. |build| image:: https://travis-ci.org/divio/djangocms-transfer.svg?branch=master | ||
:target: https://travis-ci.org/divio/djangocms-transfer | ||
.. |coverage| image:: https://codecov.io/gh/divio/djangocms-transfer/branch/master/graph/badge.svg | ||
:target: https://codecov.io/gh/divio/djangocms-transfer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,49 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from setuptools import find_packages, setup | ||
|
||
import djangocms_transfer | ||
from djangocms_transfer import __version__ | ||
|
||
|
||
INSTALL_REQUIREMENTS = [ | ||
'Django>=1.8,<2', | ||
'django-cms>=3.4.2', | ||
REQUIREMENTS = [ | ||
'django-cms>=3.4.5', | ||
] | ||
|
||
|
||
CLASSIFIERS = [ | ||
'Development Status :: 5 - Production/Stable', | ||
'Environment :: Web Environment', | ||
'Framework :: Django', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python', | ||
'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 :: Internet :: WWW/HTTP', | ||
'Topic :: Internet :: WWW/HTTP :: Dynamic Content', | ||
'Topic :: Software Development :: Libraries :: Application Frameworks', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
] | ||
|
||
|
||
setup( | ||
name='djangocms-transfer', | ||
packages=find_packages(), | ||
include_package_data=True, | ||
version=djangocms_transfer.__version__, | ||
description=djangocms_transfer.__doc__, | ||
long_description=open('README.rst').read(), | ||
classifiers=[ | ||
'Framework :: Django', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Operating System :: OS Independent', | ||
'Topic :: Software Development' | ||
], | ||
install_requires=INSTALL_REQUIREMENTS, | ||
version=__version__, | ||
author='Divio AG', | ||
author_email='[email protected]', | ||
url='http://github.com/divio/djangocms-transfer', | ||
license='BSD', | ||
description='Adds import and export of plugin data.', | ||
packages=find_packages(exclude=['tests']), | ||
long_description=open('README.rst').read(), | ||
include_package_data=True, | ||
zip_safe=False, | ||
install_requires=REQUIREMENTS, | ||
classifiers=CLASSIFIERS, | ||
test_suite='tests.settings.run', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# -*- coding: utf-8 -*- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# other requirements | ||
djangocms-helper | ||
tox | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
HELPER_SETTINGS = { | ||
'INSTALLED_APPS': [], | ||
'LANGUAGE_CODE': 'en', | ||
'CMS_LANGUAGES': { | ||
1: [{ | ||
'code': 'en', | ||
'name': 'English', | ||
}] | ||
}, | ||
'ALLOWED_HOSTS': ['localhost'], | ||
} | ||
|
||
|
||
def run(): | ||
from djangocms_helper import runner | ||
runner.cms('djangocms_transfer') | ||
|
||
|
||
if __name__ == '__main__': | ||
run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# -*- coding: utf-8 -*- | ||
# original from | ||
# http://tech.octopus.energy/news/2016/01/21/testing-for-missing-migrations-in-django.html | ||
from django.core.management import call_command | ||
from django.test import TestCase, override_settings | ||
from django.utils.six import text_type | ||
from django.utils.six.moves import StringIO | ||
|
||
|
||
class MigrationTestCase(TestCase): | ||
|
||
@override_settings(MIGRATION_MODULES={}) | ||
def test_for_missing_migrations(self): | ||
output = StringIO() | ||
options = { | ||
'interactive': False, | ||
'dry_run': True, | ||
'stdout': output, | ||
'check_changes': True, | ||
} | ||
|
||
try: | ||
call_command('makemigrations', **options) | ||
except SystemExit as e: | ||
status_code = text_type(e) | ||
else: | ||
# the "no changes" exit code is 0 | ||
status_code = '0' | ||
|
||
if status_code == '1': | ||
self.fail('There are missing migrations:\n {}'.format(output.getvalue())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[tox] | ||
envlist = | ||
flake8 | ||
py{27,34,35,36}-dj111-cms{34,35,36} | ||
py{34,35,36}-dj20-cms36 | ||
py{35,36}-dj21-cms36 | ||
|
||
skip_missing_interpreters=True | ||
|
||
[testenv] | ||
deps = | ||
-r{toxinidir}/tests/requirements.txt | ||
dj111: Django>=1.11,<2.0 | ||
dj20: Django>=2.0,<2.1 | ||
dj21: Django>=2.1,<2.2 | ||
cms34: django-cms>=3.4,<3.5 | ||
cms35: django-cms>=3.5,<3.6 | ||
cms36: https://github.com/divio/django-cms/archive/release/3.6.x.zip | ||
commands = | ||
{envpython} --version | ||
{env:COMMAND:coverage} erase | ||
{env:COMMAND:coverage} run setup.py test | ||
{env:COMMAND:coverage} report | ||
|
||
[flake8] | ||
max-line-length = 120 | ||
exclude = */docs/*,*/migrations/* |