From cd66928b22584cce26ca8ec532c97e8b53c4ea66 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 10 Oct 2020 14:10:11 +0100 Subject: [PATCH 1/2] :bug: fix regression issue on writing to memory stream. fix #9 --- CHANGELOG.rst | 8 ++++++++ changelog.yml | 6 ++++++ docs/source/conf.py | 4 ++-- pyexcel-xlsxw.yml | 6 +++--- pyexcel_xlsxw/__init__.py | 2 +- setup.py | 8 ++++---- 6 files changed, 24 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2d83a49..efbeadb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,14 @@ Change log ================================================================================ +0.6.1 - 8.10.2020 +-------------------------------------------------------------------------------- + +**Updated** + +#. `#9 `_: pyexcel-xlsxw + 0.6.0 failed to write to a stream + 0.6.0 - 8.10.2020 -------------------------------------------------------------------------------- diff --git a/changelog.yml b/changelog.yml index 2be3c4d..d84ed10 100644 --- a/changelog.yml +++ b/changelog.yml @@ -1,6 +1,12 @@ name: pyexcel-xlsxw organisation: pyexcel releases: +- changes: + - action: Updated + details: + - '`#9`: pyexcel-xlsxw 0.6.0 failed to write to a stream' + date: 8.10.2020 + version: 0.6.1 - changes: - action: Updated details: diff --git a/docs/source/conf.py b/docs/source/conf.py index 4012be9..b939786 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -25,9 +25,9 @@ copyright = '2015-2020 Onni Software Ltd.' author = 'chfw' # The short X.Y version -version = '0.6.0' +version = '0.6.1' # The full version, including alpha/beta/rc tags -release = '0.6.0' +release = '0.6.1' # -- General configuration --------------------------------------------------- diff --git a/pyexcel-xlsxw.yml b/pyexcel-xlsxw.yml index 687b960..fbe10f3 100644 --- a/pyexcel-xlsxw.yml +++ b/pyexcel-xlsxw.yml @@ -1,9 +1,9 @@ overrides: "pyexcel.yaml" name: "pyexcel-xlsxw" nick_name: xlsxw -version: 0.6.0 -current_version: 0.6.0 -release: 0.6.0 +version: 0.6.1 +current_version: 0.6.1 +release: 0.6.1 file_type: xlsx dependencies: - XlsxWriter>=0.9.3 diff --git a/pyexcel_xlsxw/__init__.py b/pyexcel_xlsxw/__init__.py index 40ae384..a7eba57 100644 --- a/pyexcel_xlsxw/__init__.py +++ b/pyexcel_xlsxw/__init__.py @@ -19,7 +19,7 @@ __FILE_TYPE__ = "xlsx" IOPluginInfoChainV2(__name__).add_a_writer( relative_plugin_class_path="xlsxw.XLSXWriter", - locations=["file"], + locations=["file", "memory"], file_types=[__FILE_TYPE__], stream_type="binary", ) diff --git a/setup.py b/setup.py index 26589bb..df763f7 100644 --- a/setup.py +++ b/setup.py @@ -29,14 +29,14 @@ NAME = "pyexcel-xlsxw" AUTHOR = "chfw" -VERSION = "0.6.0" +VERSION = "0.6.1" EMAIL = "info@pyexcel.org" LICENSE = "New BSD" DESCRIPTION = ( "A wrapper library to write data in xlsx and xlsm format" ) URL = "https://github.com/pyexcel/pyexcel-xlsxw" -DOWNLOAD_URL = "%s/archive/0.6.0.tar.gz" % URL +DOWNLOAD_URL = "%s/archive/0.6.1.tar.gz" % URL FILES = ["README.rst", "CHANGELOG.rst"] KEYWORDS = [ "python", @@ -73,8 +73,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 pyexcel-xlsxw v0.6.0 " + - "Find 0.6.0 in changelog for more details") +GS_COMMAND = ("gs pyexcel-xlsxw v0.6.1 " + + "Find 0.6.1 in changelog for more details") NO_GS_MESSAGE = ("Automatic github release is disabled. " + "Please install gease to enable it.") UPLOAD_FAILED_MSG = ( From 41512fc8ce2e7c3b55d3c3cef90d90baa2249beb Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 10 Oct 2020 14:26:03 +0100 Subject: [PATCH 2/2] :lipstick: update coding style --- .isort.cfg | 10 ++++++++++ pyexcel_xlsxw/xlsxw.py | 2 +- tests/base.py | 1 + tests/test_bug_fixes.py | 3 +-- tests/test_formatters.py | 2 +- tests/test_multiple_sheets.py | 3 ++- tests/test_stringio.py | 1 + tests/test_writer.py | 3 +-- 8 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 .isort.cfg diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..752b708 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,10 @@ +[settings] +line_length=79 +known_first_party=pyexcel_io, xlsxwriter +known_third_party=mock,nose +indent=' ' +multi_line_output=3 +length_sort=1 +default_section=FIRSTPARTY +no_lines_before=LOCALFOLDER +sections=FUTURE,STDLIB,FIRSTPARTY,THIRDPARTY,LOCALFOLDER diff --git a/pyexcel_xlsxw/xlsxw.py b/pyexcel_xlsxw/xlsxw.py index 2a7f09b..affb18b 100644 --- a/pyexcel_xlsxw/xlsxw.py +++ b/pyexcel_xlsxw/xlsxw.py @@ -8,7 +8,7 @@ :license: New BSD License """ import xlsxwriter -from pyexcel_io.plugin_api import ISheetWriter, IWriter +from pyexcel_io.plugin_api import IWriter, ISheetWriter class XLSXSheetWriter(ISheetWriter): diff --git a/tests/base.py b/tests/base.py index 52cf49f..523b5ee 100644 --- a/tests/base.py +++ b/tests/base.py @@ -1,6 +1,7 @@ import os import pyexcel + from nose.tools import eq_ diff --git a/tests/test_bug_fixes.py b/tests/test_bug_fixes.py index 5bd86d4..4d3cf4b 100644 --- a/tests/test_bug_fixes.py +++ b/tests/test_bug_fixes.py @@ -3,13 +3,12 @@ This file keeps all fixes for issues found """ -import datetime import os +import datetime from textwrap import dedent from unittest import TestCase import pyexcel as pe - from pyexcel_xlsxw import save_data diff --git a/tests/test_formatters.py b/tests/test_formatters.py index 2ff32bd..ed039d7 100644 --- a/tests/test_formatters.py +++ b/tests/test_formatters.py @@ -1,5 +1,5 @@ -import datetime import os +import datetime import pyexcel as pe diff --git a/tests/test_multiple_sheets.py b/tests/test_multiple_sheets.py index c1c08e3..8570043 100644 --- a/tests/test_multiple_sheets.py +++ b/tests/test_multiple_sheets.py @@ -3,6 +3,7 @@ import pyexcel from base import PyexcelMultipleSheetBase + from nose.tools import raises if sys.version_info[0] == 2 and sys.version_info[1] < 7: @@ -60,7 +61,7 @@ def test_load_a_single_sheet2(self): def test_load_a_single_sheet3(self): pyexcel.get_book(file_name=self.testfile, sheet_index=10000) - @raises(KeyError) + @raises(ValueError) def test_load_a_single_sheet4(self): pyexcel.get_book(file_name=self.testfile, sheet_name="Not exist") diff --git a/tests/test_stringio.py b/tests/test_stringio.py index 204f64c..870b8bc 100644 --- a/tests/test_stringio.py +++ b/tests/test_stringio.py @@ -2,6 +2,7 @@ import pyexcel from base import create_sample_file1 + from nose.tools import eq_ diff --git a/tests/test_writer.py b/tests/test_writer.py index 02203ce..1c940d0 100644 --- a/tests/test_writer.py +++ b/tests/test_writer.py @@ -1,8 +1,7 @@ import os -from base import PyexcelHatWriterBase, PyexcelWriterBase +from base import PyexcelWriterBase, PyexcelHatWriterBase from pyexcel_xls import get_data - from pyexcel_xlsxw import xlsxw as xlsx