Skip to content

Commit 24ecad3

Browse files
authored
Merge pull request #362 from moremoban/dev
Release 0.7.0
2 parents a823a37 + 3f36a29 commit 24ecad3

22 files changed

+174
-126
lines changed

.moban.cd/changelog.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
name: moban
22
organisation: moremoban
33
releases:
4+
- changes:
5+
- action: Removed
6+
details:
7+
- "`#360`: make gitfs2 and pypifs optional."
8+
- "`#303`: python 2.7 support is dropped."
9+
- action: Updated
10+
details:
11+
- "`#360`: show friendlier error when unknown protocol exception was raised."
12+
date: 18.01.2020
13+
version: 0.7.0
414
- changes:
515
- action: Updated
616
details:

.moban.cd/moban.yml

Lines changed: 5 additions & 6 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.6.8
8-
current_version: 0.6.8
9-
release: 0.6.8
7+
version: 0.7.0
8+
current_version: 0.7.0
9+
release: 0.7.0
1010
branch: master
1111
master: index
1212
command_line_interface: "moban"
@@ -27,12 +27,11 @@ dependencies:
2727
- appdirs>=1.4.3
2828
- crayons>= 0.1.0
2929
- fs>=2.4.11
30-
- gitfs2>=0.0.2
31-
- pypifs>=0.0.1
3230
- jinja2-fsloader>=0.2.0
33-
description: Yet another jinja2 cli command for static text generation
31+
description: General purpose static text generator
3432
scm_host: github.com
3533
lint_command: make install_test format git-diff-check lint
3634
moban_command: make update git-diff-check
3735
setup_use_markers: true
3836
setup_use_markers_fix: true
37+
python_requires: ">=3.6"

.moban.d/moban_travis.yml.jj2

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ env:
88

99
{%block custom_python_versions%}
1010
python:
11-
- &pypy2 pypy2.7-6.0
1211
- 3.7
1312
- 3.6
14-
- 3.5
15-
- 2.7
1613
- 3.8
1714
{%endblock%}

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ language: python
44
notifications:
55
email: false
66
python:
7-
- &pypy2 pypy2.7-6.0
87
- 3.7
98
- 3.6
10-
- 3.5
11-
- 2.7
129
- 3.8
1310
env:
1411
- MINREQ=0

CHANGELOG.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
Change log
22
================================================================================
33

4+
0.7.0 - 18.01.2020
5+
--------------------------------------------------------------------------------
6+
7+
**Removed**
8+
9+
#. `#360 <https://github.com/moremoban/moban/issues/360>`_: make gitfs2 and
10+
pypifs optional.
11+
#. `#303 <https://github.com/moremoban/moban/issues/303>`_: python 2.7 support
12+
is dropped.
13+
14+
**Updated**
15+
16+
#. `#360 <https://github.com/moremoban/moban/issues/360>`_: show friendlier
17+
error when unknown protocol exception was raised.
18+
419
0.6.8 - 7.12.2019
520
--------------------------------------------------------------------------------
621

README.rst

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
================================================================================
2-
moban - 模板 Any template, any data in any location
2+
mó bǎn - 模板 General purpose static text generator
33
================================================================================
44

55
.. image:: https://api.travis-ci.org/moremoban/moban.svg?branch=master
@@ -28,6 +28,17 @@ moban - 模板 Any template, any data in any location
2828
:License: MIT
2929

3030

31+
Announcement
32+
================================================================================
33+
34+
For existing moban users, python 2 support has been dropped. Please stay with
35+
versions lower than 0.7.0 if you are still using python 2.
36+
37+
From 2020 onwards, minimum requirement is Python 3.6
38+
39+
Introduction
40+
================================================================================
41+
3142
**moban** started with bringing the high performance template engine (JINJA2) for web
3243
into static text generation. It has been used in `pyexcel` and `coala` project to keep
3344
documentation consistent across the documentations of individual libraries in the same
@@ -38,6 +49,11 @@ haml, slim and tornado, can read other data format: json and yaml, and can acces
3849
template file and configuration file in
3950
any location: zip, git, pypi package, s3, etc.
4051

52+
Vision
53+
================================================================================
54+
55+
Any template, any data in any location
56+
4157
Support
4258
================================================================================
4359

@@ -49,6 +65,11 @@ the project and develop it further.
4965
With your financial support, I will be able to invest
5066
a little bit more time in coding, documentation and writing interesting extensions.
5167

68+
Credit
69+
================================================================================
70+
71+
`jinja2-fsloader` is the key component to enable PyFilesystem2 support in moban
72+
v0.6x. Please show your stars there too!
5273

5374
Installation
5475
================================================================================
@@ -129,7 +150,8 @@ All use cases are documented `here <http://moban.readthedocs.org/en/latest/#tuto
129150
Work with files in a git repo
130151
================================================================================
131152

132-
`gitfs2 <https://github.com/moremoban/gitfs2>`_ is installed by default since v0.6.1
153+
`gitfs2 <https://github.com/moremoban/gitfs2>`_ is optional since v0.7.0 but was
154+
installed by default since v0.6.1
133155

134156

135157
You can do the following with moban:
@@ -150,7 +172,8 @@ You can do the following with moban:
150172
Work with files in a python package
151173
================================================================================
152174

153-
`pypifs <https://github.com/moremoban/pypifs>`_ is installed by default since v0.6.1
175+
`pypifs <https://github.com/moremoban/pypifs>`_ is optional since v0.7.0 but
176+
was installed by default since v0.6.1
154177

155178
You can do the following with moban:
156179

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
DESCRIPTION = (
3-
'Yet another jinja2 cli command for static text generation' +
3+
'General purpose static text generator' +
44
''
55
)
66
# Configuration file for the Sphinx documentation builder.
@@ -25,9 +25,9 @@
2525
copyright = '2017-2019 Onni Software Ltd.'
2626
author = 'C. W.'
2727
# The short X.Y version
28-
version = '0.6.8'
28+
version = '0.7.0'
2929
# The full version, including alpha/beta/rc tags
30-
release = '0.6.8'
30+
release = '0.7.0'
3131

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

min_requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@ lml==0.0.9
77
appdirs==1.4.3
88
crayons== 0.1.0
99
fs==2.4.11
10-
gitfs2==0.0.2
11-
pypifs==0.0.1
1210
jinja2-fsloader==0.2.0

moban/_version.py

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

moban/core/hashstore.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
import sys
21
import json
32
import hashlib
43

54
from moban import constants
65
from moban.externals import file_system
76

8-
PY2 = sys.version_info[0] == 2
9-
107

118
class HashStore:
129
IGNORE_CACHE_FILE = False
1310

1411
def __init__(self):
15-
self.cache_file = file_system.to_unicode(
16-
constants.DEFAULT_MOBAN_CACHE_FILE
17-
)
12+
self.cache_file = constants.DEFAULT_MOBAN_CACHE_FILE
1813
if (
1914
file_system.exists(self.cache_file)
2015
and self.IGNORE_CACHE_FILE is False
@@ -68,13 +63,10 @@ def get_file_hash(afile):
6863

6964
def get_hash(content):
7065
md5 = hashlib.md5()
71-
if PY2 and content.__class__.__name__ == "unicode":
72-
content = content.encode("utf-8")
7366
md5.update(content)
7467
return md5.digest().decode("latin1")
7568

7669

7770
def _mix(content, file_permissions_copy):
78-
if not PY2:
79-
file_permissions_copy = file_permissions_copy.encode("utf-8")
71+
file_permissions_copy = file_permissions_copy.encode("utf-8")
8072
return content + file_permissions_copy

0 commit comments

Comments
 (0)