From 91618aa55b28151ab8090682210543aaf968daea Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Apr 2017 18:16:46 +1200 Subject: [PATCH 1/9] Update python-slugify from 1.2.1 to 1.2.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2c105801..747dfb7d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ markdown==2.6.8 beautifulsoup4==4.5.3 Jinja2==2.9.5 -python-slugify==1.2.1 +python-slugify==1.2.2 # Required dependencies for building documentation sphinx==1.5.2 From 022cd9548e4aa5c30191aa45cebf6b1abe7e14b5 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Apr 2017 18:16:52 +1200 Subject: [PATCH 2/9] Update sphinx-rtd-theme from 0.1.9 to 0.2.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2c105801..5b59ddbe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,4 @@ python-slugify==1.2.1 # Required dependencies for building documentation sphinx==1.5.2 -sphinx_rtd_theme==0.1.9 +sphinx-rtd-theme==0.2.4 From 380877a93bac74d3b571fc90125accdd1885899c Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 4 Apr 2017 02:53:41 +1200 Subject: [PATCH 3/9] Update jinja2 from 2.9.5 to 2.9.6 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2c105801..24d17314 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # Required dependencies for Verto (installed automatically in setup.py) markdown==2.6.8 beautifulsoup4==4.5.3 -Jinja2==2.9.5 +Jinja2==2.9.6 python-slugify==1.2.1 # Required dependencies for building documentation From c905ba536df2e2041804356a11db9ae70128f566 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 4 Apr 2017 08:40:42 +1200 Subject: [PATCH 4/9] Update sphinx from 1.5.2 to 1.5.5 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2c105801..3aa24f8a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,5 @@ Jinja2==2.9.5 python-slugify==1.2.1 # Required dependencies for building documentation -sphinx==1.5.2 +sphinx==1.5.5 sphinx_rtd_theme==0.1.9 From 50c438e93de2072078da2d9c9b3843524647970d Mon Sep 17 00:00:00 2001 From: ravenmaster001 Date: Tue, 4 Apr 2017 10:59:27 +1200 Subject: [PATCH 5/9] Configure Pyup. --- .pyup.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .pyup.yml diff --git a/.pyup.yml b/.pyup.yml new file mode 100644 index 00000000..839c262c --- /dev/null +++ b/.pyup.yml @@ -0,0 +1,4 @@ +update: all +branch: develop +schedule: "every week" +label_prs: update From 5ccc7fb0f036adf75fffee323b1bbb3af6329645 Mon Sep 17 00:00:00 2001 From: ravenmaster001 Date: Mon, 10 Apr 2017 11:46:52 +1200 Subject: [PATCH 6/9] travis to auto deploy to pypi --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index e4afa667..e4017175 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 From 9c41a996622982b489a72217bdebedb4bb128e26 Mon Sep 17 00:00:00 2001 From: ravenmaster001 Date: Mon, 10 Apr 2017 14:13:04 +1200 Subject: [PATCH 7/9] Update resources to load for pypi builds. --- README.rst | 7 +++++-- requirements.txt | 1 + setup.py | 11 ++++++----- verto/VertoExtension.py | 3 ++- verto/tests/BaseTest.py | 7 ++++--- verto/tests/ProcessorTest.py | 3 ++- verto/tests/SmokeTests.py | 31 +++++++++++++++---------------- 7 files changed, 35 insertions(+), 28 deletions(-) diff --git a/README.rst b/README.rst index 72e86eec..69e10bbc 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,4 @@ -.. figure:: verto/images/verto-logo.png - :alt: Verto Logo +|Verto Image| |Build Status| |Code Climate Status| @@ -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 diff --git a/requirements.txt b/requirements.txt index 00129467..1eb6b57f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ markdown==2.6.8 beautifulsoup4==4.5.3 Jinja2==2.9.6 python-slugify==1.2.2 +pkg_resources # Required dependencies for building documentation sphinx==1.5.5 diff --git a/setup.py b/setup.py index 9b15aa3e..b7a1485a 100644 --- a/setup.py +++ b/setup.py @@ -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', @@ -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' + ] ) diff --git a/verto/VertoExtension.py b/verto/VertoExtension.py index f88f6017..899c34d0 100644 --- a/verto/VertoExtension.py +++ b/verto/VertoExtension.py @@ -32,6 +32,7 @@ import json from jinja2 import Environment, PackageLoader, select_autoescape +import pkg_resources class VertoExtension(Extension): @@ -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): diff --git a/verto/tests/BaseTest.py b/verto/tests/BaseTest.py index 94faa13c..69966cb9 100644 --- a/verto/tests/BaseTest.py +++ b/verto/tests/BaseTest.py @@ -1,4 +1,6 @@ import unittest +import pkg_resources + class BaseTest(unittest.TestCase): '''A base test class for individual test classes.''' @@ -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): @@ -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 diff --git a/verto/tests/ProcessorTest.py b/verto/tests/ProcessorTest.py index 62dd635b..48f65147 100644 --- a/verto/tests/ProcessorTest.py +++ b/verto/tests/ProcessorTest.py @@ -1,4 +1,5 @@ import unittest +import pkg_resources import json import markdown from verto.VertoExtension import VertoExtension @@ -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): diff --git a/verto/tests/SmokeTests.py b/verto/tests/SmokeTests.py index f349c537..d85109c3 100644 --- a/verto/tests/SmokeTests.py +++ b/verto/tests/SmokeTests.py @@ -1,4 +1,5 @@ import unittest, os, subprocess +import pkg_resources from verto import Verto class SmokeDocsTest(unittest.TestCase): @@ -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. ''' @@ -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. @@ -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 @@ -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) From 82a7335b5c3923d1386c9f58430ca97e04bfde68 Mon Sep 17 00:00:00 2001 From: ravenmaster001 Date: Mon, 10 Apr 2017 14:18:36 +1200 Subject: [PATCH 8/9] Replace package with pypi parent package. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1eb6b57f..fea37b6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ markdown==2.6.8 beautifulsoup4==4.5.3 Jinja2==2.9.6 python-slugify==1.2.2 -pkg_resources +setuptools # Required dependencies for building documentation sphinx==1.5.5 From b1e7d84f7e9b0c91aae59e0262652cc10e9312cf Mon Sep 17 00:00:00 2001 From: ravenmaster001 Date: Mon, 10 Apr 2017 14:26:06 +1200 Subject: [PATCH 9/9] Bumped version number to 0.4.1 --- docs/source/changelog.rst | 11 +++++++++++ verto/__init__.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index a9ea2c0a..e9e6b101 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -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.) @@ -27,6 +37,7 @@ Fixes: 0.3.1 ======================================= + Fixes: - Updated documentation and changelog. diff --git a/verto/__init__.py b/verto/__init__.py index eeffec8b..382a79cf 100644 --- a/verto/__init__.py +++ b/verto/__init__.py @@ -1,4 +1,4 @@ # flake8: noqa from .Verto import Verto -__version__ = '0.4.0' +__version__ = '0.4.1'