Skip to content

Commit

Permalink
🔬 more test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed Oct 8, 2020
1 parent 5ca4d3e commit bb57139
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 36 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Change log
================================================================================

0.6.0 - tbd
0.6.0 - 9.10.2020
--------------------------------------------------------------------------------

**Updated**
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2019 by Onni Software Ltd. and its contributors
Copyright (c) 2015-2020 by Onni Software Ltd. and its contributors
All rights reserved.

Redistribution and use in source and binary forms of the software as well
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python_version= '3.6'

[packages]
openpyxl = '>=2.6.1'
pyexcel-io = '>=0.5.3'
pyexcel-io = '>=0.6.2'

[dev-packages]
nose = "*"
Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ pyexcel-xlsx - Let you focus on data, instead of xlsx format
.. image:: https://img.shields.io/gitter/room/gitterHQ/gitter.svg
:target: https://gitter.im/pyexcel/Lobby

.. 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
:target: https://moban.readthedocs.io/en/latest/#at-scale-continous-templating-for-open-source-projects

.. image:: https://img.shields.io/static/v1?label=coding%20style&message=black&color=black&style=flat-square
:target: https://github.com/psf/black

**pyexcel-xlsx** is a tiny wrapper library to read, manipulate and write data in xlsx and xlsm format using `read_only` mode reader, `write_only` mode writer from openpyxl. You are likely to use it with `pyexcel <https://github.com/pyexcel/pyexcel>`__.

Expand Down
2 changes: 1 addition & 1 deletion changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ releases:
- action: Updated
details:
- 'New style xlsx plugins, promoted by pyexcel-io v0.6.0.'
date: tbd
date: 9.10.2020
version: 0.6.0
- changes:
- action: Updated
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
# -- Project information -----------------------------------------------------

project = 'pyexcel-xlsx'
copyright = '2015-2019 Onni Software Ltd.'
copyright = '2015-2020 Onni Software Ltd.'
author = 'chfw'
# The short X.Y version
version = '0.6.0'
# The full version, including alpha/beta/rc tags
release = '0.5.8'
release = '0.6.0'

# -- General configuration ---------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions pyexcel-xlsx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ project: "pyexcel-xlsx"
nick_name: xlsx
version: 0.6.0
current_version: 0.6.0
release: 0.5.8
release: 0.6.0
file_type: xlsx
gitignore_language: Python
is_on_conda: true
dependencies:
- openpyxl>=2.6.1
- pyexcel-io>=0.5.3
- pyexcel-io>=0.6.2
test_dependencies:
- pyexcel-xls
- pyexcel
Expand Down
14 changes: 0 additions & 14 deletions pyexcel_xlsx/xlsxr.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ class FastSheet(ISheet):
def __init__(self, sheet, **_):
self.xlsx_sheet = sheet

@property
def name(self):
"""sheet name"""
return self.xlsx_sheet.title

def row_iterator(self):
"""
openpyxl row iterator
Expand Down Expand Up @@ -156,15 +151,6 @@ def read_sheet(self, sheet_index):
sheet = FastSheet(native_sheet, **self.keywords)
return sheet

def read_all(self):
result = OrderedDict()
for index, sheet in enumerate(self.xlsx_book):
if self.skip_hidden_sheets and sheet.sheet_state == "hidden":
continue
sheet = self.read_sheet(index)
result.update({sheet.name: sheet.to_array()})
return result

def close(self):
self.xlsx_book.close()
self.xlsx_book = None
Expand Down
4 changes: 1 addition & 3 deletions pyexcel_xlsx/xlsxw.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ class XLSXSheetWriter(ISheetWriter):
Write data into xlsx sheet
"""

def __init__(self, xlsx_sheet, sheet_name):
if sheet_name is None:
sheet_name = constants.DEFAULT_SHEET_NAME
def __init__(self, xlsx_sheet, sheet_name=constants.DEFAULT_SHEET_NAME):
self._xlsx_sheet = xlsx_sheet
self._xlsx_sheet.title = sheet_name

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
openpyxl>=2.6.1
pyexcel-io>=0.5.3
pyexcel-io>=0.6.2
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"format"
)
URL = "https://github.com/pyexcel/pyexcel-xlsx"
DOWNLOAD_URL = "%s/archive/0.5.8.tar.gz" % URL
DOWNLOAD_URL = "%s/archive/0.6.0.tar.gz" % URL
FILES = ["README.rst", "CHANGELOG.rst"]
KEYWORDS = [
"python",
Expand All @@ -63,7 +63,7 @@

INSTALL_REQUIRES = [
"openpyxl>=2.6.1",
"pyexcel-io>=0.5.3",
"pyexcel-io>=0.6.2",
]
SETUP_COMMANDS = {}

Expand All @@ -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 pyexcel-xlsx v0.5.8 " +
"Find 0.5.8 in changelog for more details")
GS_COMMAND = ("gs pyexcel-xlsx v0.6.0 " +
"Find 0.6.0 in changelog for more details")
NO_GS_MESSAGE = ("Automatic github release is disabled. " +
"Please install gease to enable it.")
UPLOAD_FAILED_MSG = (
Expand Down
7 changes: 1 addition & 6 deletions tests/test_multiple_sheets.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import os
import sys
from collections import OrderedDict

import pyexcel
from base import PyexcelMultipleSheetBase

from nose.tools import raises

if sys.version_info[0] == 2 and sys.version_info[1] < 7:
from ordereddict import OrderedDict
else:
from collections import OrderedDict


class TestXlsmNxlsMultipleSheets(PyexcelMultipleSheetBase):
def setUp(self):
Expand Down

0 comments on commit bb57139

Please sign in to comment.