From 45a92752cdc4ead93e1b136dfa8655b97524378f Mon Sep 17 00:00:00 2001 From: Ayan Banerjee Date: Sat, 2 Feb 2019 16:55:41 +0530 Subject: [PATCH 01/11] :umbrella: Add tests --- moban_velocity/engine.py | 3 +- .../velocity_tests/expected_output.txt | 8 ++++ tests/fixtures/velocity_tests/file_tests.json | 8 ++++ .../velocity_tests/file_tests.velocity | 8 ++++ tests/test_velocity_engine.py | 39 +++++++++++++++++++ 5 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 tests/fixtures/velocity_tests/expected_output.txt create mode 100644 tests/fixtures/velocity_tests/file_tests.json create mode 100644 tests/fixtures/velocity_tests/file_tests.velocity create mode 100644 tests/test_velocity_engine.py diff --git a/moban_velocity/engine.py b/moban_velocity/engine.py index 11988b6..4711f3e 100644 --- a/moban_velocity/engine.py +++ b/moban_velocity/engine.py @@ -1,4 +1,3 @@ -import sys import codecs from airspeed import Template @@ -19,7 +18,7 @@ def get_template(self, template_file): def get_template_from_string(self, string): return Template(string) - + def apply_template(self, template, data, output): rendered_content = template.merge(data) return rendered_content diff --git a/tests/fixtures/velocity_tests/expected_output.txt b/tests/fixtures/velocity_tests/expected_output.txt new file mode 100644 index 0000000..f2b6b2f --- /dev/null +++ b/tests/fixtures/velocity_tests/expected_output.txt @@ -0,0 +1,8 @@ +Old people: + + Bill + + Bob + + +Third person is Mark diff --git a/tests/fixtures/velocity_tests/file_tests.json b/tests/fixtures/velocity_tests/file_tests.json new file mode 100644 index 0000000..90be32a --- /dev/null +++ b/tests/fixtures/velocity_tests/file_tests.json @@ -0,0 +1,8 @@ +{ + "people":[ + {"name": "Bill", "age": 100}, + {"name": "Bob", "age": 90}, + {"name": "Mark", "age": 25} + ], + "hello": "World!" +} \ No newline at end of file diff --git a/tests/fixtures/velocity_tests/file_tests.velocity b/tests/fixtures/velocity_tests/file_tests.velocity new file mode 100644 index 0000000..3721265 --- /dev/null +++ b/tests/fixtures/velocity_tests/file_tests.velocity @@ -0,0 +1,8 @@ +Old people: +#foreach ($person in $people) + #if($person.age > 70) + $person.name + #end +#end + +Third person is $people[2].name diff --git a/tests/test_velocity_engine.py b/tests/test_velocity_engine.py new file mode 100644 index 0000000..4973641 --- /dev/null +++ b/tests/test_velocity_engine.py @@ -0,0 +1,39 @@ +import os + +from nose.tools import eq_ +from moban.plugins import ENGINES, BaseEngine +from moban_velocity.engine import EngineVelocity + + +def test_velocity_engine_type(): + engine = ENGINES.get_engine("velocity", [], "") + assert engine.engine_cls == EngineVelocity + pass + + +def test_velocity_file_test(): + output = "test.txt" + path = os.path.join("tests", "fixtures", "velocity_tests") + engine = BaseEngine(path, path, EngineVelocity) + engine.render_to_file("file_tests.velocity", "file_tests.json", output) + with open(output, "r") as output_file: + expected_path = os.path.join("tests", "fixtures", "velocity_tests", + "expected_output.txt") + with open(expected_path) as expected_file: + expected = expected_file.read() + content = output_file.read() + eq_(content, expected) + os.unlink(output) + + +def test_velocity_string_template(): + string_template = "Hello $hello" + output = "test.txt" + path = os.path.join("tests", "fixtures", "velocity_tests") + engine = BaseEngine(path, path, EngineVelocity) + engine.render_string_to_file(string_template, "file_tests.json", output) + with open(output, "r") as output_file: + expected = "Hello World!" + content = output_file.read() + eq_(content, expected) + os.unlink(output) From be02085373bd29f5dc76bbcc8c84f76ecc883b79 Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 29 May 2020 23:00:52 +0100 Subject: [PATCH 02/11] :handshake: synchronize with latest pypi mobans --- .gitignore | 80 ++++++++++++++++++++++++-- .moban.yml | 4 +- .travis.yml | 46 +++++++++++++-- CHANGELOG.rst | 3 +- Pipfile | 11 +++- README.rst | 7 +++ docs/source/conf.py | 127 +++-------------------------------------- setup.py | 112 +++++++++++++++++++++--------------- test.sh | 2 +- tests/requirements.txt | 2 +- 10 files changed, 213 insertions(+), 181 deletions(-) diff --git a/.gitignore b/.gitignore index d09b336..a9ca840 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ parts/ sdist/ var/ wheels/ +share/python-wheels/ *.egg-info/ .installed.cfg *.egg @@ -43,14 +44,17 @@ pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ +.nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover +*.py,cover .hypothesis/ .pytest_cache/ +cover/ # Translations *.mo @@ -60,6 +64,7 @@ coverage.xml *.log local_settings.py db.sqlite3 +db.sqlite3-journal # Flask stuff: instance/ @@ -72,16 +77,34 @@ instance/ docs/_build/ # PyBuilder +.pybuilder/ target/ # Jupyter Notebook .ipynb_checkpoints +# IPython +profile_default/ +ipython_config.py + # pyenv -.python-version +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock -# celery beat schedule file +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff celerybeat-schedule +celerybeat.pid # SageMath parsed files *.sage.py @@ -107,6 +130,17 @@ venv.bak/ # mypy .mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ # VirtualEnv rules # Virtualenv @@ -140,6 +174,7 @@ pip-selfcheck.json # Windows rules # Windows thumbnail cache files Thumbs.db +Thumbs.db:encryptable ehthumbs.db ehthumbs_vista.db @@ -238,9 +273,14 @@ flycheck_*.el # directory configuration .dir-locals.el +# network security +/network-security.data + + # Vim rules # Swap [._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files [._]*.sw[a-p] [._]s[a-rt-v][a-z] [._]ss[a-gi-z] @@ -248,6 +288,7 @@ flycheck_*.el # Session Session.vim +Sessionx.vim # Temporary .netrwhist @@ -258,7 +299,7 @@ tags [._]*.un~ # JetBrains rules -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff @@ -268,6 +309,9 @@ tags .idea/**/dictionaries .idea/**/shelf +# Generated files +.idea/**/contentModel.xml + # Sensitive or high-churn files .idea/**/dataSources/ .idea/**/dataSources.ids @@ -281,6 +325,19 @@ tags .idea/**/gradle.xml .idea/**/libraries +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + # CMake cmake-build-*/ @@ -311,6 +368,9 @@ fabric.properties # Editor-based Rest Client .idea/httpRequests +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + # SublimeText rules # Cache files for Sublime Text *.tmlanguage.cache @@ -326,6 +386,7 @@ fabric.properties # SFTP configuration file sftp-config.json +sftp-config-alt*.json # Package control specific files Package Control.last-run @@ -363,6 +424,10 @@ tmtags !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ # Xcode rules # Xcode @@ -389,8 +454,10 @@ DerivedData/ *.perspectivev3 !default.perspectivev3 -# Eclipse rules +## Gcc Patch +/*.gcno +# Eclipse rules .metadata bin/ tmp/ @@ -441,12 +508,17 @@ local.properties # Annotation Processing .apt_generated/ +.apt_generated_test/ # Scala IDE specific (Scala & Java development for Eclipse) .cache-main .scala_dependencies .worksheet +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project + # TortoiseGit rules # Project-level settings /.tgitconfig diff --git a/.moban.yml b/.moban.yml index 2fc785b..d561047 100644 --- a/.moban.yml +++ b/.moban.yml @@ -1,8 +1,6 @@ -requires: - - pypi-mobans-pkg==0.0.2 configuration: template_dir: - - "pypi-mobans-pkg:templates" + - "git://github.com/moremoban/pypi-mobans?submodule=true&branch=dev!/templates" - ".moban.d" configuration: moban-velocity.yml targets: diff --git a/.travis.yml b/.travis.yml index 8295c53..a3d3387 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,56 @@ sudo: false +dist: xenial language: python notifications: email: false python: - - pypy-5.3.1 - - 3.7-dev + - &pypy2 pypy2.7-6.0 + - &pypy3 pypy3.5-6.0 + - 3.8 + - 3.7 - 3.6 - 3.5 - - 3.4 - 2.7 + +stages: + - lint + - moban + - test + + +.lint: &lint + git: + submodules: false + python: 3.6 + env: + - MINREQ=0 + stage: lint + install: pip install flake8 + script: flake8 + +.moban: &moban + python: 3.6 + env: + - MINREQ=0 + stage: moban + install: pip install moban>=0.0.4 gitfs2 pypifs + script: + - moban + - git diff --exit-code + +jobs: + include: + - *moban + - *lint + +stage: test + before_install: - - if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install flake8==2.6.2; fi - if [[ -f min_requirements.txt && "$MINREQ" -eq 1 ]]; then mv min_requirements.txt requirements.txt ; fi - - test ! -f rnd_requirements.txt || pip install --no-deps -r rnd_requirements.txt + - test ! -f rnd_requirements.txt || + pip install --no-deps -r rnd_requirements.txt - test ! -f rnd_requirements.txt || pip install -r rnd_requirements.txt ; - pip install -r tests/requirements.txt script: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8b375c6..045ebf4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,7 +4,6 @@ Change log 0.0.1 - 02.02.2018 -------------------------------------------------------------------------------- -First release -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +**First release** #. Render .velocity, .vtl files for moban diff --git a/Pipfile b/Pipfile index 1872188..2d3821d 100644 --- a/Pipfile +++ b/Pipfile @@ -7,5 +7,12 @@ name = 'pypi' python_version= '3.6' [packages] - lml>=0.0.7 - airspeed = "*" +lml = '>=0.0.7' +airspeed = "*" + +[dev-packages] +nose = "*" +mock = "*" +codecov = "*" +coverage = "*" +flake8 = "*" diff --git a/README.rst b/README.rst index 8a938d5..cf1ce07 100644 --- a/README.rst +++ b/README.rst @@ -7,7 +7,14 @@ moban-velocity .. image:: https://codecov.io/github/moremoban/moban-velocity/coverage.png :target: https://codecov.io/github/moremoban/moban-velocity +.. image:: https://badge.fury.io/py/moban-velocity.svg + :target: https://pypi.org/project/moban-velocity +.. image:: https://pepy.tech/badge/moban-velocity/month + :target: https://pepy.tech/project/moban-velocity/month + +.. image:: https://img.shields.io/github/stars/moremoban/moban-velocity.svg?style=social&maxAge=3600&label=Star + :target: https://github.com/moremoban/moban-velocity/stargazers With `airspeed` for Python 3, this library allows moban users to have velocity diff --git a/docs/source/conf.py b/docs/source/conf.py index 382190a..7d8d27c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,10 +1,8 @@ -# -*- coding: utf-8 -*- -# # Configuration file for the Sphinx documentation builder. # -# This file does only contain a selection of the most common options. For a -# full list see the documentation: -# http://www.sphinx-doc.org/en/master/config +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- @@ -18,22 +16,16 @@ # -- Project information ----------------------------------------------------- -project = u'' -copyright = u'' -author = u'' - +project = '' +copyright = '' +author = 'Ayan Banerjee, C.W. et al' # The short X.Y version -version = u'' +version = '0.0.1' # The full version, including alpha/beta/rc tags -release = u'' - +release = '0.0.1' # -- General configuration --------------------------------------------------- -# If your documentation needs a minimal Sphinx version, state it here. -# -# needs_sphinx = '1.0' - # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. @@ -51,21 +43,11 @@ # The master toctree document. master_doc = '' -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = '' - # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [] -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = None - # -- Options for HTML output ------------------------------------------------- @@ -74,98 +56,7 @@ # html_theme = 'alabaster' -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# -# html_theme_options = {} - # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['static'] - -# Custom sidebar templates, must be a dictionary that maps document names -# to template names. -# -# The default sidebars (for documents that don't match any pattern) are -# defined by theme itself. Builtin themes are using these templates by -# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', -# 'searchbox.html']``. -# -# html_sidebars = {} - - -# -- Options for HTMLHelp output --------------------------------------------- - -# Output file base name for HTML help builder. -htmlhelp_basename = 'doc' - - -# -- Options for LaTeX output ------------------------------------------------ - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', - - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', - - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', - - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - (master_doc, '.tex', u'', - u'', 'manual'), -] - - -# -- Options for manual page output ------------------------------------------ - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, '', u'', - [author], 1) -] - - -# -- Options for Texinfo output ---------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - (master_doc, '', u'', - author, '', 'One line description of project.', - 'Miscellaneous'), -] - - -# -- Options for Epub output ------------------------------------------------- - -# Bibliographic Dublin Core info. -epub_title = project - -# The unique identifier of the text. This can be a ISBN number -# or the project homepage. -# -# epub_identifier = '' - -# A unique identification for the text. -# -# epub_uid = '' - -# A list of files that should not be packed into the epub file. -epub_exclude_files = ['search.html'] \ No newline at end of file +html_static_path = ['static'] \ No newline at end of file diff --git a/setup.py b/setup.py index 52f21bf..4088e78 100644 --- a/setup.py +++ b/setup.py @@ -1,60 +1,81 @@ #!/usr/bin/env python3 -# Template by pypi-mobans +""" +Template by pypi-mobans +""" + import os import sys import codecs +import locale +import platform from shutil import rmtree from setuptools import Command, setup, find_packages PY2 = sys.version_info[0] == 2 PY26 = PY2 and sys.version_info[1] < 7 - -NAME = 'moban-velocity' -AUTHOR = 'Ayan Banerjee, C.W. et al' -VERSION = '0.0.1' -EMAIL = 'wangc_2011@hotmail.com' -LICENSE = 'MIT' +PY33 = sys.version_info < (3, 4) + +# Work around mbcs bug in distutils. +# http://bugs.python.org/issue10945 +# This work around is only if a project supports Python < 3.4 + +# Work around for locale not being set +try: + lc = locale.getlocale() + pf = platform.system() + if pf != "Windows" and lc == (None, None): + locale.setlocale(locale.LC_ALL, "C.UTF-8") +except (ValueError, UnicodeError, locale.Error): + locale.setlocale(locale.LC_ALL, "en_US.UTF-8") + +NAME = "moban-velocity" +AUTHOR = "Ayan Banerjee, C.W. et al" +VERSION = "0.0.1" +EMAIL = "wangc_2011@hotmail.com" +LICENSE = "MIT" DESCRIPTION = ( - 'Provide velocity templating capability to moban' + "Provide velocity templating capability to moban" ) -URL = 'https://github.com/moremoban/moban-velocity' -DOWNLOAD_URL = '%s/archive/0.0.1.tar.gz' % URL -FILES = ['README.rst', 'CONTRIBUTORS.rst', 'CHANGELOG.rst'] +URL = "https://github.com/moremoban/moban-velocity" +DOWNLOAD_URL = "%s/archive/0.0.1.tar.gz" % URL +FILES = ["README.rst", 'CONTRIBUTORS.rst', "CHANGELOG.rst"] KEYWORDS = [ - 'python', + "python", ] CLASSIFIERS = [ - 'Topic :: Software Development :: Libraries', - 'Programming Language :: Python', - 'Intended Audience :: Developers', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + "Topic :: Software Development :: Libraries", + "Programming Language :: Python", + "Intended Audience :: Developers", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + ] + INSTALL_REQUIRES = [ - 'lml>=0.0.7', - 'airspeed', + "lml>=0.0.7", + "airspeed", ] SETUP_COMMANDS = {} - -PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) +PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests", "tests.*"]) EXTRAS_REQUIRE = { } # You do not need to read beyond this line -PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format( - sys.executable) -GS_COMMAND = ('gs moban-velocity v0.0.1 ' + +PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable) +GS_COMMAND = ("gs moban-velocity v0.0.1 " + "Find 0.0.1 in changelog for more details") -NO_GS_MESSAGE = ('Automatic github release is disabled. ' + - 'Please install gease to enable it.') +NO_GS_MESSAGE = ("Automatic github release is disabled. " + + "Please install gease to enable it.") UPLOAD_FAILED_MSG = ( 'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND) HERE = os.path.abspath(os.path.dirname(__file__)) @@ -63,13 +84,13 @@ class PublishCommand(Command): """Support setup.py upload.""" - description = 'Build and publish the package on github and pypi' + description = "Build and publish the package on github and pypi" user_options = [] @staticmethod def status(s): """Prints things in bold.""" - print('\033[1m{0}\033[0m'.format(s)) + print("\033[1m{0}\033[0m".format(s)) def initialize_options(self): pass @@ -79,14 +100,14 @@ def finalize_options(self): def run(self): try: - self.status('Removing previous builds...') - rmtree(os.path.join(HERE, 'dist')) - rmtree(os.path.join(HERE, 'build')) - rmtree(os.path.join(HERE, 'moban_velocity.egg-info')) + self.status("Removing previous builds...") + rmtree(os.path.join(HERE, "dist")) + rmtree(os.path.join(HERE, "build")) + rmtree(os.path.join(HERE, "moban_velocity.egg-info")) except OSError: pass - self.status('Building Source and Wheel (universal) distribution...') + self.status("Building Source and Wheel (universal) distribution...") run_status = True if has_gease(): run_status = os.system(GS_COMMAND) == 0 @@ -94,13 +115,13 @@ def run(self): self.status(NO_GS_MESSAGE) if run_status: if os.system(PUBLISH_COMMAND) != 0: - self.status(UPLOAD_FAILED_MSG % PUBLISH_COMMAND) + self.status(UPLOAD_FAILED_MSG) sys.exit() SETUP_COMMANDS.update({ - 'publish': PublishCommand + "publish": PublishCommand }) @@ -129,7 +150,7 @@ def read_files(*files): def read(afile): """Read a file into setup""" the_relative_file = os.path.join(HERE, afile) - with codecs.open(the_relative_file, 'r', 'utf-8') as opened_file: + with codecs.open(the_relative_file, "r", "utf-8") as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content @@ -138,11 +159,11 @@ def read(afile): def filter_out_test_code(file_handle): found_test_code = False for line in file_handle.readlines(): - if line.startswith('.. testcode:'): + if line.startswith(".. testcode:"): found_test_code = True continue if found_test_code is True: - if line.startswith(' '): + if line.startswith(" "): continue else: empty_line = line.strip() @@ -152,15 +173,16 @@ def filter_out_test_code(file_handle): found_test_code = False yield line else: - for keyword in ['|version|', '|today|']: + for keyword in ["|version|", "|today|"]: if keyword in line: break else: yield line -if __name__ == '__main__': +if __name__ == "__main__": setup( + test_suite="tests", name=NAME, author=AUTHOR, version=VERSION, @@ -172,7 +194,7 @@ def filter_out_test_code(file_handle): license=LICENSE, keywords=KEYWORDS, extras_require=EXTRAS_REQUIRE, - tests_require=['nose'], + tests_require=["nose"], install_requires=INSTALL_REQUIRES, packages=PACKAGES, include_package_data=True, diff --git a/test.sh b/test.sh index e0fd5d0..3795439 100644 --- a/test.sh +++ b/test.sh @@ -1,2 +1,2 @@ pip freeze -nosetests --with-coverage --cover-package moban_velocity --cover-package tests tests docs/source moban_velocity && flake8 . --exclude=.moban.d,docs --builtins=unicode,xrange,long +nosetests --with-coverage --cover-package moban_velocity --cover-package tests tests docs/source moban_velocity diff --git a/tests/requirements.txt b/tests/requirements.txt index c445df5..080cc1b 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,5 @@ nose -mock +mock;python_version<"3" codecov coverage flake8 From 90db317f0909b39ec5d9cb9be55e5238560a6fc2 Mon Sep 17 00:00:00 2001 From: ayan-b Date: Wed, 3 Jun 2020 10:08:17 +0530 Subject: [PATCH 03/11] :fire: Upgrade to moban 0.6 --- moban_velocity/engine.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/moban_velocity/engine.py b/moban_velocity/engine.py index 4711f3e..7645aa4 100644 --- a/moban_velocity/engine.py +++ b/moban_velocity/engine.py @@ -1,16 +1,18 @@ import codecs from airspeed import Template + +from moban.externals import file_system import moban.utils as utils class EngineVelocity(object): - def __init__(self, template_dirs, extensions=None): - self.template_dirs = template_dirs + def __init__(self, template_fs, extensions=None): + self.template_fs = template_fs def get_template(self, template_file): actual_file = utils.get_template_path( - self.template_dirs, template_file + self.template_fs, template_file ) with codecs.open(actual_file, "r", encoding="utf-8") as source: template = Template(source.read()) From 188e1843c5ead9d0b4c0dcbf0c73c1ff58c37ede Mon Sep 17 00:00:00 2001 From: ayan-b Date: Wed, 3 Jun 2020 10:20:17 +0530 Subject: [PATCH 04/11] :fire: Support moban 0.6 Closes #2 --- moban_velocity/engine.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/moban_velocity/engine.py b/moban_velocity/engine.py index 7645aa4..2cdd0f4 100644 --- a/moban_velocity/engine.py +++ b/moban_velocity/engine.py @@ -3,17 +3,22 @@ from airspeed import Template from moban.externals import file_system -import moban.utils as utils class EngineVelocity(object): - def __init__(self, template_fs, extensions=None): + def __init__(self, template_fs, options=None): + """ + template_fs is a multfs instance and gives you the power to load + a template from equiped template directories. + :param fs.multifs.MultiFS template_fs: a MultiFS instance or a FS instance + :param options: a dictionary of potential parameters. + not used yet. + """ self.template_fs = template_fs def get_template(self, template_file): - actual_file = utils.get_template_path( - self.template_fs, template_file - ) + template_file = file_system.to_unicode(template_file) + actual_file = self.template_fs.readtext(template_file) with codecs.open(actual_file, "r", encoding="utf-8") as source: template = Template(source.read()) return template From a3165be9ea41f25c6b77a31fc07f550b7c9bb485 Mon Sep 17 00:00:00 2001 From: ayan-b Date: Wed, 3 Jun 2020 10:39:29 +0530 Subject: [PATCH 05/11] :fire: Support moban 0.6 Closes #2 --- moban_velocity/engine.py | 10 ++++------ tests/test_velocity_engine.py | 12 ++++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/moban_velocity/engine.py b/moban_velocity/engine.py index 2cdd0f4..2d8707f 100644 --- a/moban_velocity/engine.py +++ b/moban_velocity/engine.py @@ -1,5 +1,3 @@ -import codecs - from airspeed import Template from moban.externals import file_system @@ -10,7 +8,8 @@ def __init__(self, template_fs, options=None): """ template_fs is a multfs instance and gives you the power to load a template from equiped template directories. - :param fs.multifs.MultiFS template_fs: a MultiFS instance or a FS instance + :param fs.multifs.MultiFS template_fs: a MultiFS instance or an FS + instance :param options: a dictionary of potential parameters. not used yet. """ @@ -18,9 +17,8 @@ def __init__(self, template_fs, options=None): def get_template(self, template_file): template_file = file_system.to_unicode(template_file) - actual_file = self.template_fs.readtext(template_file) - with codecs.open(actual_file, "r", encoding="utf-8") as source: - template = Template(source.read()) + template = self.template_fs.readtext(template_file) + template = Template(template) return template def get_template_from_string(self, string): diff --git a/tests/test_velocity_engine.py b/tests/test_velocity_engine.py index 4973641..64648c1 100644 --- a/tests/test_velocity_engine.py +++ b/tests/test_velocity_engine.py @@ -1,20 +1,20 @@ import os +from moban.core import ENGINES, plugins from nose.tools import eq_ -from moban.plugins import ENGINES, BaseEngine -from moban_velocity.engine import EngineVelocity + +plugins.make_sure_all_pkg_are_loaded() def test_velocity_engine_type(): engine = ENGINES.get_engine("velocity", [], "") - assert engine.engine_cls == EngineVelocity - pass + assert engine.engine.__class__.__name__ == "EngineVelocity" def test_velocity_file_test(): output = "test.txt" path = os.path.join("tests", "fixtures", "velocity_tests") - engine = BaseEngine(path, path, EngineVelocity) + engine = ENGINES.get_engine("velocity", [path], path) engine.render_to_file("file_tests.velocity", "file_tests.json", output) with open(output, "r") as output_file: expected_path = os.path.join("tests", "fixtures", "velocity_tests", @@ -30,7 +30,7 @@ def test_velocity_string_template(): string_template = "Hello $hello" output = "test.txt" path = os.path.join("tests", "fixtures", "velocity_tests") - engine = BaseEngine(path, path, EngineVelocity) + engine = ENGINES.get_engine("velocity", [path], path) engine.render_string_to_file(string_template, "file_tests.json", output) with open(output, "r") as output_file: expected = "Hello World!" From 357c7196d078b057380328ae7de1f95dfaa5d048 Mon Sep 17 00:00:00 2001 From: chfw Date: Wed, 3 Jun 2020 21:46:19 +0100 Subject: [PATCH 06/11] :handshake: update the synchronization with pypi-mobans --- .github/workflows/pythonpublish.yml | 26 ++++++++++++++++++++++++++ .isort.cfg | 12 ++++++++++++ .moban.d/custom_travis.yml.jj2 | 8 ++++++++ .moban.yml | 9 +++++++-- .travis.yml | 9 ++------- LICENSE | 2 +- MANIFEST.in | 4 ++++ Makefile | 18 +++++++++++++++--- lint.sh | 2 ++ moban-velocity.yml | 3 ++- 10 files changed, 79 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/pythonpublish.yml create mode 100644 .isort.cfg create mode 100644 .moban.d/custom_travis.yml.jj2 create mode 100644 lint.sh diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml new file mode 100644 index 0000000..9e7ec42 --- /dev/null +++ b/.github/workflows/pythonpublish.yml @@ -0,0 +1,26 @@ +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + - 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/* diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..2d68c3a --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,12 @@ +[settings] +line_length=79 +# Ignore generated files +skip=setup.py, moban/__init__.py +known_third_party=anyconfig, moban, lml,§ mock, nose +indent=' ' +multi_line_output=3 +length_sort=1 +include_trailing_comma=true +default_section=FIRSTPARTY +no_lines_before=LOCALFOLDER +sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER diff --git a/.moban.d/custom_travis.yml.jj2 b/.moban.d/custom_travis.yml.jj2 new file mode 100644 index 0000000..6bbad02 --- /dev/null +++ b/.moban.d/custom_travis.yml.jj2 @@ -0,0 +1,8 @@ +{% extends 'travis.yml.jj2' %} + +{%block custom_python_versions%} +python: + - 3.7 + - 3.6 + - 3.8 +{%endblock%} diff --git a/.moban.yml b/.moban.yml index d561047..c23ea23 100644 --- a/.moban.yml +++ b/.moban.yml @@ -1,6 +1,7 @@ configuration: template_dir: - "git://github.com/moremoban/pypi-mobans?submodule=true&branch=dev!/templates" + - "git://github.com/moremoban/pypi-mobans?submodule=true&branch=dev!/statics" - ".moban.d" configuration: moban-velocity.yml targets: @@ -12,8 +13,12 @@ targets: - test.sh: test.script.jj2 - "moban_velocity/_version.py": "_version.py.jj2" - .gitignore: gitignore.jj2 - - .travis.yml: travis.yml.jj2 + - .travis.yml: custom_travis.yml.jj2 - Pipfile: Pipfile.jj2 - output: CHANGELOG.rst configuration: changelog.yml - template: CHANGELOG.rst.jj2 \ No newline at end of file + template: CHANGELOG.rst.jj2 + - lint.sh: lint.script.jj2 + - LICENSE: "mit_license.jj2" + - MANIFEST.in: MANIFEST.in.jj2 + - ".github/workflows/pythonpublish.yml": "pythonpublish.yml" diff --git a/.travis.yml b/.travis.yml index a3d3387..e83fb22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,13 +4,9 @@ language: python notifications: email: false python: - - &pypy2 pypy2.7-6.0 - - &pypy3 pypy3.5-6.0 - - 3.8 - 3.7 - 3.6 - - 3.5 - - 2.7 + - 3.8 stages: - lint @@ -25,8 +21,7 @@ stages: env: - MINREQ=0 stage: lint - install: pip install flake8 - script: flake8 + script: make install_test lint format git-diff-check .moban: &moban python: 3.6 diff --git a/LICENSE b/LICENSE index 63e84ec..800e2f2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Moremoban dev team. (See Contributors for details) +Copyright (c) 2019-2020 Moremoban dev team and its contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/MANIFEST.in b/MANIFEST.in index 5f13ef0..e86ae54 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,6 @@ include README.rst +include LICENSE include CHANGELOG.rst +include CONTRIBUTORS.rst +recursive-include tests * +recursive-include docs * diff --git a/Makefile b/Makefile index 26d9b68..d7e640e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,19 @@ all: test -test: +test: lint bash test.sh -document: - bash document.sh +install_test: + pip install -r tests/requirements.txt + +git-diff-check: + git diff --exit-code + +lint: + bash lint.sh + +format: + bash format.sh + +git-diff-check: + git diff --exit-code diff --git a/lint.sh b/lint.sh new file mode 100644 index 0000000..976f745 --- /dev/null +++ b/lint.sh @@ -0,0 +1,2 @@ +pip install flake8 +flake8 . --exclude=.moban.d,docs,setup.py --builtins=unicode,xrange,long \ No newline at end of file diff --git a/moban-velocity.yml b/moban-velocity.yml index aa201b5..868aaca 100644 --- a/moban-velocity.yml +++ b/moban-velocity.yml @@ -6,7 +6,8 @@ company: "Moremoban dev team and its contributors" version: "0.0.1" current_version: "0.0.1" release: "0.0.1" -copyright_year: 2019 +copyright_year: 2019-2020 license: MIT dependencies: ["lml>=0.0.7", "airspeed"] description: "Provide velocity templating capability to moban" +lint_command: make install_test lint format git-diff-check \ No newline at end of file From bc94b90a2819623310679dfdd915defb367cffae Mon Sep 17 00:00:00 2001 From: chfw Date: Wed, 3 Jun 2020 21:48:39 +0100 Subject: [PATCH 07/11] :green_heart: make test pass --- format.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 format.sh diff --git a/format.sh b/format.sh new file mode 100644 index 0000000..988dd94 --- /dev/null +++ b/format.sh @@ -0,0 +1,3 @@ +isort -y $(find moban_velocity -name "*.py"|xargs echo) $(find tests -name "*.py"|xargs echo) +black -l 79 moban_velocity +black -l 79 tests From 5dc7af88685d3ce99b517299e6153e255b386540 Mon Sep 17 00:00:00 2001 From: chfw Date: Wed, 3 Jun 2020 22:54:34 +0100 Subject: [PATCH 08/11] :green_heart: make test pass --- .moban.d/tests/custom_requirements.txt.jj2 | 3 +++ tests/requirements.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.moban.d/tests/custom_requirements.txt.jj2 b/.moban.d/tests/custom_requirements.txt.jj2 index a22fe7e..6b56e5a 100644 --- a/.moban.d/tests/custom_requirements.txt.jj2 +++ b/.moban.d/tests/custom_requirements.txt.jj2 @@ -1,4 +1,7 @@ {% extends "tests/requirements.txt.jj2" %} {%block extras %} +moban +black;python_version>="3.6" +isort;python_version>="3.6" {%endblock%} diff --git a/tests/requirements.txt b/tests/requirements.txt index 080cc1b..020e09e 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -3,3 +3,6 @@ mock;python_version<"3" codecov coverage flake8 +moban +black;python_version>="3.6" +isort;python_version>="3.6" From b280e99dd9dfd19ac5083b2527a0ec6cec6b4c90 Mon Sep 17 00:00:00 2001 From: chfw Date: Wed, 3 Jun 2020 22:55:51 +0100 Subject: [PATCH 09/11] :lipstick: run black --- moban_velocity/__init__.py | 8 +++----- moban_velocity/engine.py | 4 ++-- tests/test_velocity_engine.py | 5 +++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/moban_velocity/__init__.py b/moban_velocity/__init__.py index 71e73ee..79835cc 100644 --- a/moban_velocity/__init__.py +++ b/moban_velocity/__init__.py @@ -1,15 +1,13 @@ # flake8: noqa -from lml.plugin import PluginInfo, PluginInfoChain import moban.constants as constants +from lml.plugin import PluginInfo, PluginInfoChain -from moban_velocity._version import __version__ -from moban_velocity._version import __author__ - +from moban_velocity._version import __author__, __version__ PluginInfoChain(__name__).add_a_plugin_instance( PluginInfo( constants.TEMPLATE_ENGINE_EXTENSION, "%s.engine.EngineVelocity" % __name__, - tags=["velocity","vtl",], + tags=["velocity", "vtl",], ) ) diff --git a/moban_velocity/engine.py b/moban_velocity/engine.py index 2d8707f..ebd7178 100644 --- a/moban_velocity/engine.py +++ b/moban_velocity/engine.py @@ -1,7 +1,7 @@ -from airspeed import Template - from moban.externals import file_system +from airspeed import Template + class EngineVelocity(object): def __init__(self, template_fs, options=None): diff --git a/tests/test_velocity_engine.py b/tests/test_velocity_engine.py index 64648c1..02b8c8e 100644 --- a/tests/test_velocity_engine.py +++ b/tests/test_velocity_engine.py @@ -17,8 +17,9 @@ def test_velocity_file_test(): engine = ENGINES.get_engine("velocity", [path], path) engine.render_to_file("file_tests.velocity", "file_tests.json", output) with open(output, "r") as output_file: - expected_path = os.path.join("tests", "fixtures", "velocity_tests", - "expected_output.txt") + expected_path = os.path.join( + "tests", "fixtures", "velocity_tests", "expected_output.txt" + ) with open(expected_path) as expected_file: expected = expected_file.read() content = output_file.read() From 5d6f3d17ef354b54b7c13041fa0dcd622ab57738 Mon Sep 17 00:00:00 2001 From: chfw Date: Wed, 3 Jun 2020 22:58:10 +0100 Subject: [PATCH 10/11] :newspaper: add isort --- .isort.cfg | 2 +- moban_velocity/engine.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index 2d68c3a..8b406be 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -2,7 +2,7 @@ line_length=79 # Ignore generated files skip=setup.py, moban/__init__.py -known_third_party=anyconfig, moban, lml,§ mock, nose +known_third_party=airspeed, moban, lml,§ mock, nose indent=' ' multi_line_output=3 length_sort=1 diff --git a/moban_velocity/engine.py b/moban_velocity/engine.py index ebd7178..e747ae7 100644 --- a/moban_velocity/engine.py +++ b/moban_velocity/engine.py @@ -1,6 +1,5 @@ -from moban.externals import file_system - from airspeed import Template +from moban.externals import file_system class EngineVelocity(object): From a4229432f18cfa2a20f77a53ed4e3742f4532c90 Mon Sep 17 00:00:00 2001 From: chfw Date: Wed, 3 Jun 2020 23:08:26 +0100 Subject: [PATCH 11/11] :eggs: :ferris_wheel: release 0.0.2 --- .moban.d/CUSTOM_README.rst.jj2 | 5 +++- .moban.d/velocity_example.rst.jj2 | 43 ++++++++++++++++++++++++++++ CHANGELOG.rst | 7 +++++ README.rst | 47 ++++++++++++++++++++++++++++++- changelog.yml | 6 ++++ docs/source/conf.py | 4 +-- moban-velocity.yml | 6 ++-- moban_velocity/_version.py | 2 +- moban_velocity/engine.py | 3 ++ setup.py | 8 +++--- 10 files changed, 119 insertions(+), 12 deletions(-) create mode 100644 .moban.d/velocity_example.rst.jj2 diff --git a/.moban.d/CUSTOM_README.rst.jj2 b/.moban.d/CUSTOM_README.rst.jj2 index 09b6cd1..92f630b 100644 --- a/.moban.d/CUSTOM_README.rst.jj2 +++ b/.moban.d/CUSTOM_README.rst.jj2 @@ -5,5 +5,8 @@ {% block features %} With `airspeed` for Python 3, this library allows moban users to have velocity -template in their next documentation endeavour. +template in their next documentation endeavour. + +{%include "velocity_example.rst.jj2" %} + {% endblock %} diff --git a/.moban.d/velocity_example.rst.jj2 b/.moban.d/velocity_example.rst.jj2 new file mode 100644 index 0000000..251c6bb --- /dev/null +++ b/.moban.d/velocity_example.rst.jj2 @@ -0,0 +1,43 @@ +Given the following data.json: + +.. code-block:: + + {"people": + [ + {"name": "Bill", "age": 100}, + {"name": "Bob", "age": 90}, + {"name": "Mark", "age": 25} + ] + } + +And given the following velocity.template: + +.. code-block:: + + Old people: + #foreach ($person in $people) + #if($person.age > 70) + $person.name + #end + #end + + Third person is $people[2].name + +**moban** can do the template: + +.. code-block:: bash + + $ moban --template-type velocity -c data.json -t velocity.template + Velocity-templating vo.t to moban.output + Velocity-templated 1 file. + $ cat moban.output + Old people: + + Bill + + Bob + + + Third person is Mark + + diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 045ebf4..f94fcec 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,13 @@ Change log ================================================================================ +0.0.2 - 03.06.2020 +-------------------------------------------------------------------------------- + +**Added** + +#. Support moban v0.6.0+ + 0.0.1 - 02.02.2018 -------------------------------------------------------------------------------- diff --git a/README.rst b/README.rst index cf1ce07..e26fe44 100644 --- a/README.rst +++ b/README.rst @@ -18,7 +18,52 @@ moban-velocity With `airspeed` for Python 3, this library allows moban users to have velocity -template in their next documentation endeavour. +template in their next documentation endeavour. + +Given the following data.json: + +.. code-block:: + + {"people": + [ + {"name": "Bill", "age": 100}, + {"name": "Bob", "age": 90}, + {"name": "Mark", "age": 25} + ] + } + +And given the following velocity.template: + +.. code-block:: + + Old people: + #foreach ($person in $people) + #if($person.age > 70) + $person.name + #end + #end + + Third person is $people[2].name + +**moban** can do the template: + +.. code-block:: bash + + $ moban --template-type velocity -c data.json -t velocity.template + Velocity-templating vo.t to moban.output + Velocity-templated 1 file. + $ cat moban.output + Old people: + + Bill + + Bob + + + Third person is Mark + + + Installation ================================================================================ diff --git a/changelog.yml b/changelog.yml index 3b83dc5..68644b0 100644 --- a/changelog.yml +++ b/changelog.yml @@ -1,6 +1,12 @@ name: moban-velocity organisation: moremoban releases: +- changes: + - action: Added + details: + - Support moban v0.6.0+ + date: 03.06.2020 + version: 0.0.2 - changes: - action: First release details: diff --git a/docs/source/conf.py b/docs/source/conf.py index 7d8d27c..d7d3d14 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,9 +20,9 @@ copyright = '' author = 'Ayan Banerjee, C.W. et al' # The short X.Y version -version = '0.0.1' +version = '0.0.2' # The full version, including alpha/beta/rc tags -release = '0.0.1' +release = '0.0.2' # -- General configuration --------------------------------------------------- diff --git a/moban-velocity.yml b/moban-velocity.yml index 868aaca..028ffe5 100644 --- a/moban-velocity.yml +++ b/moban-velocity.yml @@ -3,9 +3,9 @@ organisation: "moremoban" author: "Ayan Banerjee, C.W. et al" contact: "wangc_2011@hotmail.com" company: "Moremoban dev team and its contributors" -version: "0.0.1" -current_version: "0.0.1" -release: "0.0.1" +version: "0.0.2" +current_version: "0.0.2" +release: "0.0.2" copyright_year: 2019-2020 license: MIT dependencies: ["lml>=0.0.7", "airspeed"] diff --git a/moban_velocity/_version.py b/moban_velocity/_version.py index e860cec..26e5ab7 100644 --- a/moban_velocity/_version.py +++ b/moban_velocity/_version.py @@ -1,2 +1,2 @@ -__version__ = "0.0.1" +__version__ = "0.0.2" __author__ = "Ayan Banerjee, C.W. et al" diff --git a/moban_velocity/engine.py b/moban_velocity/engine.py index e747ae7..e8a2140 100644 --- a/moban_velocity/engine.py +++ b/moban_velocity/engine.py @@ -3,6 +3,9 @@ class EngineVelocity(object): + ACTION_IN_PRESENT_CONTINUOUS_TENSE = "Velocity-templating" + ACTION_IN_PAST_TENSE = "Velocity-templated" + def __init__(self, template_fs, options=None): """ template_fs is a multfs instance and gives you the power to load diff --git a/setup.py b/setup.py index 4088e78..3a5239a 100644 --- a/setup.py +++ b/setup.py @@ -32,14 +32,14 @@ NAME = "moban-velocity" AUTHOR = "Ayan Banerjee, C.W. et al" -VERSION = "0.0.1" +VERSION = "0.0.2" EMAIL = "wangc_2011@hotmail.com" LICENSE = "MIT" DESCRIPTION = ( "Provide velocity templating capability to moban" ) URL = "https://github.com/moremoban/moban-velocity" -DOWNLOAD_URL = "%s/archive/0.0.1.tar.gz" % URL +DOWNLOAD_URL = "%s/archive/0.0.2.tar.gz" % URL FILES = ["README.rst", 'CONTRIBUTORS.rst', "CHANGELOG.rst"] KEYWORDS = [ "python", @@ -72,8 +72,8 @@ } # You do not need to read beyond this line PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable) -GS_COMMAND = ("gs moban-velocity v0.0.1 " + - "Find 0.0.1 in changelog for more details") +GS_COMMAND = ("gs moban-velocity v0.0.2 " + + "Find 0.0.2 in changelog for more details") NO_GS_MESSAGE = ("Automatic github release is disabled. " + "Please install gease to enable it.") UPLOAD_FAILED_MSG = (