Skip to content

Commit

Permalink
Merge branch 'release-0.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenjackson01 committed Apr 10, 2017
2 parents 04b089e + b1e7d84 commit 5a2700d
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 33 deletions.
4 changes: 4 additions & 0 deletions .pyup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
update: all
branch: develop
schedule: "every week"
label_prs: update
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ notifications:
addons:
code_climate:
repo_token: e8d3f32c2549e7919e154bc5506d4cc743a03408f3ca2bf957020c3e5f826eaf
deploy:
provider: pypi
user: UCCSER
password:
secure: 1ImbakdpIPHmO89yAFH5ZApwhCRApI3BtiGjx7sflYWJcMzFydaaS6zo+tU3lY7QHtpWE6HQMjOLweupLgu1od9RJ9BX+4mJ37FHelqjaEGAMVR/e70H4jL/Mn8ImiTwJ14wCnjek/kYrrrMQqDqCLuNvQRb/Q8ipbw+fEBtRlmRgDx2Looik4ehk19iPybpGfb+7mq8rVPk3ZEl7oZp4cMKckqX3IMXX3yNG0tka6M1Q2a41W4N6EPoBgVwcAY2FwzwXEQC+KDjwxVkPviZ+pWbbV/is9spX8SV/BCjnsJWBCNu0x4GOk3atr+R7ZzIs7e7edehy0QG8gzGvhb0qaOyPVWkIvrTJwEEVTfcNGl8dYZar0EuM7GBpP5ttx4IShY/0XfuT3XXl5C50kxuIQocJHjNn0xu6E3x4LheUuDPp3S92zQxNHcOGS9v2syY4Kb3Bxvjlk0HhrPpZ4wo0U93TaB9lAahQsulYS/gbynzYjpphIHLSslK/imQEZNoSz9roKK3Q/JLSQsc2jGdZM93IHWwoB0+uqjDyBLsYRmPaOKOAlew0bGzP4uX3ovMsCexwodTISFjgb/2JOaUkz289lPQ4fK/gz7uVtIDYkHj9oAz+GeT9PlnRFb8U5fiRSJf5OWFt/D149XvXc4c5OES7sgbfK5jvsTfCsVa4L0=
on:
branch: master
7 changes: 5 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.. figure:: verto/images/verto-logo.png
:alt: Verto Logo
|Verto Image|

|Build Status| |Code Climate Status|

Expand Down Expand Up @@ -52,3 +51,7 @@ The changelog is available within the `documentation`_.
.. |Code Climate Status| image:: https://codeclimate.com/github/uccser/verto/badges/gpa.svg
:target: https://codeclimate.com/github/uccser/verto
:alt: Code Climate

.. |Verto Image| image:: https://raw.githubusercontent.com/uccser/verto/master/verto/images/verto-logo.png
:target: https://github.com/uccser/verto
:alt: Verto GitHub
11 changes: 11 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
Changelog
#######################################

0.4.1
=======================================

Fixes:

- pypi configuration fixes.
- pyup configuration to use develop branch.
- Improved asset file loading for deployed package.

0.4.0
=======================================

Fourth prerelease of the Verto converter.
(The project was renamed to Verto from Kordac in release.)

Expand All @@ -27,6 +37,7 @@ Fixes:

0.3.1
=======================================

Fixes:

- Updated documentation and changelog.
Expand Down
9 changes: 5 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Required dependencies for Verto (installed automatically in setup.py)
markdown==2.6.8
beautifulsoup4==4.5.3
Jinja2==2.9.5
python-slugify==1.2.1
Jinja2==2.9.6
python-slugify==1.2.2
setuptools

# Required dependencies for building documentation
sphinx==1.5.2
sphinx_rtd_theme==0.1.9
sphinx==1.5.5
sphinx_rtd_theme==0.2.4
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
long_description=open('README.rst').read(),
url='https://github.com/uccser/verto',
author='University of Canterbury Computer Science Education Research Group',
author_email='csse-education-research@canterbury.ac.nz',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
Expand All @@ -25,13 +26,13 @@
'Topic :: Text Processing :: Markup',
'Topic :: Text Processing :: Markup :: HTML'
],
keywords='markdown verto development textbook converter media richtext interactive education html book author extension',
packages=find_packages(),
include_package_data=True,
install_requires=[
'markdown>=2.6.8',
'bs4>=0.0.1',
'Jinja2>=2.9.5',
'python-slugify>=1.2.1'
],
zip_safe=False
'beautifulsoup4==4.5.3',
'Jinja2>=2.9.6',
'python-slugify>=1.2.2'
]
)
3 changes: 2 additions & 1 deletion verto/VertoExtension.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import json

from jinja2 import Environment, PackageLoader, select_autoescape
import pkg_resources


class VertoExtension(Extension):
Expand Down Expand Up @@ -204,7 +205,7 @@ def loadProcessorInfo(self):
Returns:
The json object of the file where objects are ordered dictionaries.
'''
json_data = open(os.path.join(os.path.dirname(__file__), 'processor-info.json')).read()
json_data = pkg_resources.resource_string('verto', 'processor-info.json').decode('utf-8')
return json.loads(json_data, object_pairs_hook=OrderedDict)

def get_heading_tree(self):
Expand Down
2 changes: 1 addition & 1 deletion verto/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# flake8: noqa
from .Verto import Verto

__version__ = '0.4.0'
__version__ = '0.4.1'
7 changes: 4 additions & 3 deletions verto/tests/BaseTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import unittest
import pkg_resources


class BaseTest(unittest.TestCase):
'''A base test class for individual test classes.'''
Expand All @@ -11,7 +13,7 @@ def __init__(self, *args, **kwargs):
test failures.
'''
unittest.TestCase.__init__(self, *args, **kwargs)
self.test_file_path = 'verto/tests/assets/{test_type}/{filename}'
self.test_file_path = 'tests/assets/{test_type}/{filename}'
self.maxDiff = None

def read_test_file(self, test_type, filename, strip=False):
Expand All @@ -20,8 +22,7 @@ def read_test_file(self, test_type, filename, strip=False):
This function reads a file from a given filename in UTF-8 encoding.
'''
file_path = self.test_file_path.format(test_type=test_type, filename=filename)
file_object = open(file_path, encoding='utf-8')
text = file_object.read()
text = pkg_resources.resource_string('verto', file_path).decode('utf-8')
if strip:
text = text.rstrip('\r\n')
return text
3 changes: 2 additions & 1 deletion verto/tests/ProcessorTest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest
import pkg_resources
import json
import markdown
from verto.VertoExtension import VertoExtension
Expand Down Expand Up @@ -36,7 +37,7 @@ def loadJinjaTemplate(self, template):
def loadProcessorInfo(self):
'''Loads the processor info similar to the verto extension.
'''
pattern_data = open('verto/processor-info.json').read()
pattern_data = pkg_resources.resource_string('verto', 'processor-info.json').decode('utf-8')
return json.loads(pattern_data)

def to_blocks(self, string):
Expand Down
31 changes: 15 additions & 16 deletions verto/tests/SmokeTests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest, os, subprocess
import pkg_resources
from verto import Verto

class SmokeDocsTest(unittest.TestCase):
Expand All @@ -9,7 +10,7 @@ def __init__(self, *args, **kwargs):
self.maxDiff = None
self.build_path = 'docs/build'

@unittest.skipIf(not os.path.isdir('docs') and os.name not in ['nt', 'posix'], 'Docs are not present')
@unittest.skipIf(not pkg_resources.resource_isdir('verto', 'docs') and os.name not in ['nt', 'posix'], 'Docs are not present')
def test_compile_docs(self):
'''This test is skipped if the docs directory is not found.
'''
Expand Down Expand Up @@ -42,7 +43,7 @@ def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
self.maxDiff = None
self.verto = None
self.assets_template = 'verto/tests/assets/smoke/{}'
self.assets_template = 'tests/assets/smoke/{}'

def setUp(self):
'''Run before any testcases.
Expand All @@ -58,14 +59,13 @@ def test_compile_files(self):
'''Tests that some example files are converted.
'''
for chapter in ['algorithms.md', 'introduction.md']:
with open(self.assets_template.format(chapter), 'r') as f:
text = f.read()
result = self.verto.convert(text)
text = pkg_resources.resource_string('verto', self.assets_template.format(chapter)).decode('utf-8')
result = self.verto.convert(text)

self.assertIsNot(result, None)
self.assertIsNot(result.title, None)
self.assertIsNot(result.html_string, None)
self.assertTrue(len(result.html_string) > 0)
self.assertIsNot(result, None)
self.assertIsNot(result.title, None)
self.assertIsNot(result.html_string, None)
self.assertTrue(len(result.html_string) > 0)

def test_compile_files_custom(self):
'''Tests that some example files are converted with custom
Expand All @@ -78,11 +78,10 @@ def test_compile_files_custom(self):

verto = Verto(html_templates=custom_templates)
for chapter in ['algorithms.md', 'introduction.md']:
with open(self.assets_template.format(chapter), 'r') as f:
text = f.read()
result = verto.convert(text)
text = pkg_resources.resource_string('verto', self.assets_template.format(chapter)).decode('utf-8')
result = verto.convert(text)

self.assertIsNot(result, None)
self.assertIsNot(result.title, None)
self.assertIsNot(result.html_string, None)
self.assertTrue(len(result.html_string) > 0)
self.assertIsNot(result, None)
self.assertIsNot(result.title, None)
self.assertIsNot(result.html_string, None)
self.assertTrue(len(result.html_string) > 0)

0 comments on commit 5a2700d

Please sign in to comment.