Skip to content

Commit dfe2066

Browse files
authored
Merge pull request #264 from moremoban/dev
release 0.4.3
2 parents c2085cd + 01599ba commit dfe2066

File tree

20 files changed

+142
-89
lines changed

20 files changed

+142
-89
lines changed

.moban.cd/changelog.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
name: moban
22
organisation: moremoban
33
releases:
4+
- changes:
5+
- action: Removed
6+
details:
7+
- "`#253`: symbolic link in regression pack causes python setup.py to do recursive include"
8+
- action: Added
9+
details:
10+
- "`#209`: Alert moban user when `git` is not available and is used."
11+
- action: Updated
12+
details:
13+
- "`#261`: since moban group template files per template type, this fill use first come first register to order moban group"
14+
date: 16.03.2019
15+
version: 0.4.3
416
- changes:
517
- action: Added
618
details:
719
- "`#234`: Define template parameters on the fly inside `targets` section"
8-
- "`#180`: No longer two statistics will be shown in v0.4.x. legacy copy targets are injected into a normal targets. cli target is made a clear priority."
920
- "`#62`: select a group target to run"
21+
- action: Updated
22+
details:
23+
- "`#180`: No longer two statistics will be shown in v0.4.x. legacy copy targets are injected into a normal targets. cli target is made a clear priority."
1024
- "`#244`: version 0.4.2 is first version which would work perfectly on windows since 17 Nov 2018. Note that: file permissions are not used on windows. Why the date? because samefile is not avaiable on windows, causing unit tests to fail hence it lead to my conclusion that moban version between 17 Nov 2018 and March 2019 wont work well on Windows."
1125
date: 08.03.2019
1226
version: 0.4.2
@@ -21,7 +35,7 @@ releases:
2135
- action: Added
2236
details:
2337
- "`#165`: Copy as plugins"
24-
- action: Added
38+
- action: Updated
2539
details:
2640
- "`#219`: git clone depth set to 2"
2741
- "`#186`: lowest dependecy on ruamel.yaml is 0.15.5, Jun 2017"

.moban.cd/moban.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ organisation: moremoban
44
author: C. W.
55
contact: wangc_2011@hotmail.com
66
license: MIT
7-
version: 0.4.2
8-
current_version: 0.4.2
9-
release: 0.4.2
7+
version: 0.4.3
8+
current_version: 0.4.3
9+
release: 0.4.3
1010
branch: master
1111
master: index
1212
command_line_interface: "moban"

CHANGELOG.rst

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
Change log
22
================================================================================
33

4+
0.4.3 - 16.03.2019
5+
--------------------------------------------------------------------------------
6+
7+
Removed
8+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9+
10+
#. `#253 <https://github.com/moremoban/moban/issues/253>`_: symbolic link in
11+
regression pack causes python setup.py to do recursive include
12+
13+
Added
14+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
16+
#. `#209 <https://github.com/moremoban/moban/issues/209>`_: Alert moban user
17+
when `git` is not available and is used.
18+
19+
Updated
20+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21+
22+
#. `#261 <https://github.com/moremoban/moban/issues/261>`_: since moban group
23+
template files per template type, this fill use first come first register to
24+
order moban group
25+
426
0.4.2 - 08.03.2019
527
--------------------------------------------------------------------------------
628

@@ -9,11 +31,15 @@ Added
931

1032
#. `#234 <https://github.com/moremoban/moban/issues/234>`_: Define template
1133
parameters on the fly inside `targets` section
34+
#. `#62 <https://github.com/moremoban/moban/issues/62>`_: select a group target
35+
to run
36+
37+
Updated
38+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39+
1240
#. `#180 <https://github.com/moremoban/moban/issues/180>`_: No longer two
1341
statistics will be shown in v0.4.x. legacy copy targets are injected into a
1442
normal targets. cli target is made a clear priority.
15-
#. `#62 <https://github.com/moremoban/moban/issues/62>`_: select a group target
16-
to run
1743
#. `#244 <https://github.com/moremoban/moban/issues/244>`_: version 0.4.2 is
1844
first version which would work perfectly on windows since 17 Nov 2018. Note
1945
that: file permissions are not used on windows. Why the date? because
@@ -42,7 +68,7 @@ Added
4268

4369
#. `#165 <https://github.com/moremoban/moban/issues/165>`_: Copy as plugins
4470

45-
Added
71+
Updated
4672
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4773

4874
#. `#219 <https://github.com/moremoban/moban/issues/219>`_: git clone depth set

README.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ moban - 模板 Yet another jinja2 cli command for static text generation
2525

2626

2727
**moban** brings the high performance template engine (JINJA2) for web into
28-
static text generation. It is used in pyexcel project to keep documentation
28+
static text generation. It is used in `pyexcel` and `coala` project to keep documentation
2929
consistent across the documentations of individual libraries.
3030

31+
Our vision is: any template, any data. Our current architecture enables moban
32+
to plugin any python template engine: mako, handlebars, velocity, haml, slim and tornado
33+
and to plugin any data format: json and yaml. Please look at our issues. We have many
34+
more template engines and data format on the road map.
3135

3236
Installation
3337
================================================================================

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
copyright = '2017-2019 Onni Software Ltd. and its contributors'
2626
author = 'Onni Software Ltd.'
2727
# The short X.Y version
28-
version = '0.4.2'
28+
version = '0.4.3'
2929
# The full version, including alpha/beta/rc tags
30-
release = '0.4.2'
30+
release = '0.4.3'
3131

3232
# -- General configuration ---------------------------------------------------
3333

docs/index.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ examples folder.
3535
level-18-user-defined-template-types/README.rst
3636
level-19-moban-a-sub-group-in-targets/README.rst
3737

38-
In pratice, the following use cases were found interesting to go along with.
39-
40-
.. toctree::
41-
:maxdepth: 1
42-
43-
misc-1-copying-templates/README.rst
44-
4538

4639
For more complex use case, please look at `its usage in pyexcel project <http://pyexcel.readthedocs.io/en/latest/guide.html>`_
4740

moban/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.4.2"
1+
__version__ = "0.4.3"
22
__author__ = "C. W."

moban/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ class IncorrectDataInput(Exception):
2424

2525
class GroupTargetNotFound(Exception):
2626
pass
27+
28+
29+
class NoGitCommand(Exception):
30+
pass

moban/mobanfile/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import re
33
import sys
4-
from collections import defaultdict
4+
from collections import OrderedDict
55

66
from lml.utils import do_import
77

@@ -112,7 +112,7 @@ def _iterate_list_of_dicts(list_of_dict):
112112

113113
def handle_targets(merged_options, targets):
114114
list_of_templating_parameters = parse_targets(merged_options, targets)
115-
jobs_for_each_engine = defaultdict(list)
115+
jobs_for_each_engine = OrderedDict()
116116

117117
for target in list_of_templating_parameters:
118118
forced_template_type = merged_options.get(
@@ -129,6 +129,9 @@ def handle_targets(merged_options, targets):
129129
]
130130
target.set_template_type(primary_template_type)
131131

132+
if primary_template_type not in jobs_for_each_engine:
133+
jobs_for_each_engine[primary_template_type] = []
134+
132135
jobs_for_each_engine[primary_template_type].append(target)
133136

134137
count = 0

moban/repo.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
import os
2+
import sys
3+
import subprocess
24

3-
from moban import reporter, constants
5+
from moban import reporter, constants, exceptions
46
from moban.utils import mkdir_p
57

68

79
def git_clone(requires):
810
from git import Repo
911

12+
if sys.platform != "win32":
13+
# Unfortunately for windows user, the following function
14+
# needs shell=True, which expose security risk. I would
15+
# rather not to trade it with its marginal benefit
16+
make_sure_git_is_available()
17+
1018
moban_home = get_moban_home()
1119
mkdir_p(moban_home)
1220

@@ -51,3 +59,10 @@ def get_moban_home():
5159

5260
home_dir = user_cache_dir(appname=constants.PROGRAM_NAME)
5361
return os.path.join(home_dir, constants.MOBAN_REPOS_DIR_NAME)
62+
63+
64+
def make_sure_git_is_available():
65+
try:
66+
subprocess.check_output(["git", "--help"])
67+
except Exception:
68+
raise exceptions.NoGitCommand("Please install git command")

0 commit comments

Comments
 (0)