Skip to content

Commit 9d70e97

Browse files
authored
Merge pull request #98 from pyexcel/dev
Release 0.6.3
2 parents aa5e1b0 + 7adcec9 commit 9d70e97

13 files changed

+75
-56
lines changed

Diff for: CHANGELOG.rst

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Change log
22
================================================================================
33

4+
0.6.3 - 12.10.2020
5+
--------------------------------------------------------------------------------
6+
7+
**fixed**
8+
9+
#. `#96 <https://github.com/pyexcel/pyexcel-io/issues/96>`_: regression: unknown
10+
file type shall trigger NoSupportingPluginFound
11+
12+
**updated**
13+
14+
#. extra dependencies uses 0.6.0 based plugins
15+
416
0.6.2 - 7.10.2020
517
--------------------------------------------------------------------------------
618

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ that the following conditions are met:
1313
and/or other materials provided with the distribution.
1414

1515
* Neither the name of 'pyexcel-io' nor the names of the contributors
16-
may be used to endorse or promote products derived from this software
16+
may not be used to endorse or promote products derived from this software
1717
without specific prior written permission.
1818

1919
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND

Diff for: README.rst

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ pyexcel-io - Let you focus on data, instead of file formats
2929
.. image:: https://img.shields.io/gitter/room/gitterHQ/gitter.svg
3030
:target: https://gitter.im/pyexcel/Lobby
3131

32+
.. image:: https://img.shields.io/static/v1?label=continuous%20templating&message=%E6%A8%A1%E7%89%88%E6%9B%B4%E6%96%B0&color=blue&style=flat-square
33+
:target: https://moban.readthedocs.io/en/latest/#at-scale-continous-templating-for-open-source-projects
34+
35+
.. image:: https://img.shields.io/static/v1?label=coding%20style&message=black&color=black&style=flat-square
36+
:target: https://github.com/psf/black
3237
.. image:: https://readthedocs.org/projects/pyexcel-io/badge/?version=latest
3338
:target: http://pyexcel-io.readthedocs.org/en/latest/
3439

Diff for: changelog.yml

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
name: pyexcel-io
22
organisation: pyexcel
33
releases:
4+
- changes:
5+
- action: fixed
6+
details:
7+
- "`#96`: regression: unknown file type shall trigger NoSupportingPluginFound"
8+
- action: updated
9+
details:
10+
- "extra dependencies uses 0.6.0 based plugins"
11+
version: 0.6.3
12+
date: 12.10.2020
413
- changes:
514
- action: updated
615
details:

Diff for: docs/source/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
copyright = '2015-2020 Onni Software Ltd.'
2727
author = 'chfw'
2828
# The short X.Y version
29-
version = '0.6.2'
29+
version = '0.6.3'
3030
# The full version, including alpha/beta/rc tags
31-
release = '0.6.2'
31+
release = '0.6.3'
3232

3333
# -- General configuration ---------------------------------------------------
3434

Diff for: pyexcel-io.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ overrides: "pyexcel.yaml"
22
project: "pyexcel-io"
33
name: pyexcel-io
44
nick_name: io
5-
version: 0.6.2
6-
current_version: 0.6.2
7-
release: 0.6.2
5+
version: 0.6.3
6+
current_version: 0.6.3
7+
release: 0.6.3
88
copyright_year: 2015-2020
99
moban_command: false
1010
is_on_conda: true
@@ -17,11 +17,11 @@ test_dependencies:
1717
- pyexcel-xlsxw
1818
extra_dependencies:
1919
- xls:
20-
- pyexcel-xls>=0.5.0
20+
- pyexcel-xls>=0.6.0
2121
- xlsx:
22-
- pyexcel-xlsx>=0.5.0
22+
- pyexcel-xlsx>=0.6.0
2323
- ods:
24-
- pyexcel-ods3>=0.5.0
24+
- pyexcel-ods3>=0.6.0
2525
keywords:
2626
- API
2727
- tsv

Diff for: pyexcel_io/exceptions.py

-6
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ class SupportingPluginAvailableButNotInstalled(Exception):
2121
pass
2222

2323

24-
class UpgradePlugin(Exception):
25-
"""raised when a known plugin is not compatible"""
26-
27-
pass
28-
29-
3024
class IntegerAccuracyLossError(Exception):
3125
"""
3226
When an interger is greater than 999999999999999, ods loses its accuracy.

Diff for: pyexcel_io/reader.py

+7-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from pyexcel_io import exceptions
2-
from pyexcel_io.book import _convert_content_to_stream
31
from pyexcel_io.sheet import SheetReader
42
from pyexcel_io.plugins import NEW_READERS
53
from pyexcel_io._compact import OrderedDict
@@ -53,23 +51,14 @@ def open(self, file_name, **keywords):
5351

5452
def open_content(self, file_content, **keywords):
5553
self.keywords, native_sheet_keywords = clean_keywords(keywords)
56-
try:
57-
if self.reader_class is None:
58-
self.reader_class = NEW_READERS.get_a_plugin(
59-
self.file_type, location="content", library=self.library
60-
)
61-
self.reader = self.reader_class(
62-
file_content, self.file_type, **native_sheet_keywords
63-
)
64-
return self.reader
65-
except (
66-
exceptions.NoSupportingPluginFound,
67-
exceptions.SupportingPluginAvailableButNotInstalled,
68-
):
69-
file_stream = _convert_content_to_stream(
70-
file_content, self.file_type
54+
if self.reader_class is None:
55+
self.reader_class = NEW_READERS.get_a_plugin(
56+
self.file_type, location="content", library=self.library
7157
)
72-
return self.open_stream(file_stream, **native_sheet_keywords)
58+
self.reader = self.reader_class(
59+
file_content, self.file_type, **native_sheet_keywords
60+
)
61+
return self.reader
7362

7463
def open_stream(self, file_stream, **keywords):
7564
self.keywords, native_sheet_keywords = clean_keywords(keywords)

Diff for: pyexcel_io/readers/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,9 @@
2929
file_types=["csvz", "tsvz"],
3030
locations=["file", "memory"],
3131
stream_type="binary",
32+
).add_a_reader(
33+
relative_plugin_class_path="csvz.ContentReader",
34+
file_types=["csvz", "tsvz"],
35+
locations=["content"],
36+
stream_type="binary",
3237
)

Diff for: pyexcel_io/readers/csvz.py

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import zipfile
11+
from io import BytesIO
1112

1213
import chardet
1314
from pyexcel_io import constants
@@ -48,6 +49,12 @@ def read_sheet(self, index):
4849
return CSVinMemoryReader(NamedContent(name, sheet), **self.keywords)
4950

5051

52+
class ContentReader(FileReader):
53+
def __init__(self, file_content, file_type, **keywords):
54+
io = BytesIO(file_content)
55+
super().__init__(io, file_type, **keywords)
56+
57+
5158
def _get_sheet_name(filename):
5259
len_of_a_dot = 1
5360
len_of_csv_word = 3

Diff for: setup.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232

3333
NAME = "pyexcel-io"
3434
AUTHOR = "chfw"
35-
VERSION = "0.6.2"
35+
VERSION = "0.6.3"
3636
3737
LICENSE = "New BSD"
3838
DESCRIPTION = (
3939
"A python library to read and write structured data in csv, zipped csv" +
4040
"format and to/from databases"
4141
)
4242
URL = "https://github.com/pyexcel/pyexcel-io"
43-
DOWNLOAD_URL = "%s/archive/0.6.2.tar.gz" % URL
43+
DOWNLOAD_URL = "%s/archive/0.6.3.tar.gz" % URL
4444
FILES = ["README.rst", "CHANGELOG.rst"]
4545
KEYWORDS = [
4646
"python",
@@ -79,14 +79,14 @@
7979

8080
PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests", "tests.*"])
8181
EXTRAS_REQUIRE = {
82-
"xls": ['pyexcel-xls>=0.5.0'],
83-
"xlsx": ['pyexcel-xlsx>=0.5.0'],
84-
"ods": ['pyexcel-ods3>=0.5.0'],
82+
"xls": ['pyexcel-xls>=0.6.0'],
83+
"xlsx": ['pyexcel-xlsx>=0.6.0'],
84+
"ods": ['pyexcel-ods3>=0.6.0'],
8585
}
8686
# You do not need to read beyond this line
8787
PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable)
88-
GS_COMMAND = ("gs pyexcel-io v0.6.2 " +
89-
"Find 0.6.2 in changelog for more details")
88+
GS_COMMAND = ("gs pyexcel-io v0.6.3 " +
89+
"Find 0.6.3 in changelog for more details")
9090
NO_GS_MESSAGE = ("Automatic github release is disabled. " +
9191
"Please install gease to enable it.")
9292
UPLOAD_FAILED_MSG = (

Diff for: tests/test_issues.py

+8-16
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
3-
41
import os
52

63
import pyexcel as p
74
from pyexcel_io import get_data, save_data
5+
from pyexcel_io.exceptions import NoSupportingPluginFound
86

97
from nose import SkipTest
10-
from nose.tools import eq_
8+
from nose.tools import eq_, raises
119

1210
IN_TRAVIS = "TRAVIS" in os.environ
1311

@@ -41,17 +39,6 @@ def test_issue_23():
4139
eq_(data["issue23.csv"], expected)
4240

4341

44-
# def test_issue_28():
45-
# from pyexcel_io.plugins import readers
46-
# from pyexcel_io.exceptions import UpgradePlugin
47-
# expected = "Please upgrade the plugin '%s' according to "
48-
# expected += "plugin compactibility table."
49-
# try:
50-
# readers.load_me_later('pyexcel_test')
51-
# except UpgradePlugin as e:
52-
# eq_(str(e), expected % 'pyexcel_test')
53-
54-
5542
def test_issue_33_34():
5643
import mmap
5744

@@ -64,7 +51,7 @@ def test_issue_33_34():
6451

6552

6653
def test_issue_30_utf8_BOM_header():
67-
content = [[u"人有悲歡離合", u"月有陰晴圓缺"]]
54+
content = [["人有悲歡離合", "月有陰晴圓缺"]]
6855
test_file = "test-utf8-BOM.csv"
6956
save_data(test_file, content, encoding="utf-8-sig", lineterminator="\n")
7057
custom_encoded_content = get_data(test_file, encoding="utf-8-sig")
@@ -154,5 +141,10 @@ def test_pyexcel_issue_138():
154141
os.unlink("test.csv")
155142

156143

144+
@raises(NoSupportingPluginFound)
145+
def test_issue_96():
146+
get_data("foo-bar-data", file_type="Idonotexist")
147+
148+
157149
def get_fixture(file_name):
158150
return os.path.join("tests", "fixtures", file_name)

Diff for: tests/test_service.py

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pyexcel_io.service import (
44
date_value,
55
time_value,
6+
float_value,
67
boolean_value,
78
ods_bool_value,
89
ods_date_value,
@@ -162,3 +163,8 @@ def test_time_value():
162163
test_time_value = "PT23H00M01S"
163164
delta = time_value(test_time_value)
164165
eq_(delta, time(23, 0, 1))
166+
167+
168+
def test_float_value():
169+
a = float_value("1.2")
170+
eq_(a, 1.2)

0 commit comments

Comments
 (0)