From e199fc1ce30dc0d8f65e7e3bbe994e22cf2d5b4e Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 9 Nov 2018 22:01:53 +0000 Subject: [PATCH 01/10] :sparkles: use moban 0.3.3 --- .gitignore | 395 +++++++++++++++++++++++++++++++- .moban.d/tests/requirements.txt | 3 + .moban.yml | 11 +- .travis.yml | 2 +- LICENSE | 6 +- Makefile | 4 + README.rst | 23 +- docs/source/conf.py | 195 ++++++++++++++-- setup.py | 34 +-- test.bat | 2 +- test.sh | 2 +- tests/requirements.txt | 3 + tests/test_bug_fixes.py | 5 +- tests/test_formatters.py | 26 ++- tests/test_stringio.py | 6 +- 15 files changed, 636 insertions(+), 81 deletions(-) diff --git a/.gitignore b/.gitignore index f32c742..d09b336 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ -# April 2016 -# reference: https://github.com/github/gitignore/blob/master/Python.gitignore +# moban hashes +.moban.hashes + +# Extra rules from https://github.com/github/gitignore/ +# Python rules # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] @@ -10,7 +13,6 @@ __pycache__/ # Distribution / packaging .Python -env/ build/ develop-eggs/ dist/ @@ -22,9 +24,11 @@ lib64/ parts/ sdist/ var/ +wheels/ *.egg-info/ .installed.cfg *.egg +MANIFEST # PyInstaller # Usually these files are written by a python script from a template @@ -44,8 +48,9 @@ htmlcov/ .cache nosetests.xml coverage.xml -*,cover +*.cover .hypothesis/ +.pytest_cache/ # Translations *.mo @@ -54,6 +59,7 @@ coverage.xml # Django stuff: *.log local_settings.py +db.sqlite3 # Flask stuff: instance/ @@ -68,7 +74,7 @@ docs/_build/ # PyBuilder target/ -# IPython Notebook +# Jupyter Notebook .ipynb_checkpoints # pyenv @@ -77,23 +83,388 @@ target/ # celery beat schedule file celerybeat-schedule -# dotenv -.env +# SageMath parsed files +*.sage.py -# virtualenv +# Environments +.env +.venv +env/ venv/ ENV/ +env.bak/ +venv.bak/ # Spyder project settings .spyderproject +.spyproject # Rope project settings .ropeproject -# emacs +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +# VirtualEnv rules +# Virtualenv +# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ +.Python +[Bb]in +[Ii]nclude +[Ll]ib +[Ll]ib64 +[Ll]ocal +[Ss]cripts +pyvenv.cfg +.venv +pip-selfcheck.json + +# Linux rules *~ -# moban hashes -.moban.hashes -.DS_store +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# Windows rules +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# macOS rules +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Emacs rules +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# Vim rules +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +# JetBrains rules +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# SublimeText rules +# Cache files for Sublime Text +*.tmlanguage.cache +*.tmPreferences.cache +*.stTheme.cache + +# Workspace files are user-specific +*.sublime-workspace + +# Project files should be checked into the repository, unless a significant +# proportion of contributors will probably not be using Sublime Text +# *.sublime-project + +# SFTP configuration file +sftp-config.json + +# Package control specific files +Package Control.last-run +Package Control.ca-list +Package Control.ca-bundle +Package Control.system-ca-bundle +Package Control.cache/ +Package Control.ca-certs/ +Package Control.merged-ca-bundle +Package Control.user-ca-bundle +oscrypto-ca-bundle.crt +bh_unicode_properties.cache + +# Sublime-github package stores a github token in this file +# https://packagecontrol.io/packages/sublime-github +GitHub.sublime-settings + +# KDevelop4 rules +*.kdev4 +.kdev4/ + +# Kate rules +# Swap Files # +.*.kate-swp +.swp.* + +# TextMate rules +*.tmproj +*.tmproject +tmtags + +# VisualStudioCode rules +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# Xcode rules +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +# Eclipse rules + +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# TortoiseGit rules +# Project-level settings +/.tgitconfig +# Tags rules +# Ignore tags created by etags, ctags, gtags (GNU global) and cscope +TAGS +.TAGS +!TAGS/ +tags +.tags +!tags/ +gtags.files +GTAGS +GRTAGS +GPATH +GSYMS +cscope.files +cscope.out +cscope.in.out +cscope.po.out diff --git a/.moban.d/tests/requirements.txt b/.moban.d/tests/requirements.txt index 3f0c5aa..9b9b656 100644 --- a/.moban.d/tests/requirements.txt +++ b/.moban.d/tests/requirements.txt @@ -2,4 +2,7 @@ {%block extras %} pyexcel pyexcel-xls +moban +black;python_version>="3.6" +isort;python_version>="3.6" {%endblock%} diff --git a/.moban.yml b/.moban.yml index 80e767c..5a63c0b 100644 --- a/.moban.yml +++ b/.moban.yml @@ -1,8 +1,13 @@ +requires: + - type: git + url: https://github.com/moremoban/pypi-mobans + submodule: true + - https://github.com/pyexcel/pyexcel-mobans configuration: - configuration_dir: "commons/config" + configuration_dir: "pyexcel-mobans:config" template_dir: - - "commons/templates" - - "setupmobans/templates" + - "pyexcel-mobans:templates" + - "pypi-mobans:templates" - ".moban.d" configuration: pyexcel_xlsx.yaml targets: diff --git a/.travis.yml b/.travis.yml index daa005a..a72e2ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,10 @@ notifications: email: false python: - pypy-5.3.1 + - 3.7-dev - 3.6 - 3.5 - 3.4 - - 3.3 - 2.7 matrix: include: diff --git a/LICENSE b/LICENSE index 37a338b..60ad78e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2017 by Onni Software Ltd. and its contributors +Copyright (c) 2015-2018 by Onni Software Ltd. and its contributors All rights reserved. Redistribution and use in source and binary forms of the software as well @@ -13,7 +13,7 @@ that the following conditions are met: and/or other materials provided with the distribution. * Neither the name of 'pyexcel-xlsx' nor the names of the contributors - may not be used to endorse or promote products derived from this software + may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND @@ -27,4 +27,4 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. \ No newline at end of file +DAMAGE. diff --git a/Makefile b/Makefile index 10b28ae..4ab07c6 100644 --- a/Makefile +++ b/Makefile @@ -3,3 +3,7 @@ all: test test: bash test.sh +format: + isort -y $(find pyexcel_xlsx -name "*.py"|xargs echo) $(find tests -name "*.py"|xargs echo) + black -l 79 pyexcel_xlsx + black -l 79 tests diff --git a/README.rst b/README.rst index b994654..15f21db 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,10 @@ pyexcel-xlsx - Let you focus on data, instead of xlsx format .. image:: https://raw.githubusercontent.com/pyexcel/pyexcel.github.io/master/images/patreon.png :target: https://www.patreon.com/pyexcel -.. image:: https://api.travis-ci.org/pyexcel/pyexcel-xlsx.svg?branch=master +.. image:: https://api.bountysource.com/badge/team?team_id=288537 + :target: https://salt.bountysource.com/teams/chfw-pyexcel + +.. image:: https://travis-ci.org/pyexcel/pyexcel-xlsx.svg?branch=master :target: http://travis-ci.org/pyexcel/pyexcel-xlsx .. image:: https://codecov.io/gh/pyexcel/pyexcel-xlsx/branch/master/graph/badge.svg @@ -19,7 +22,12 @@ pyexcel-xlsx - Let you focus on data, instead of xlsx format **pyexcel-xlsx** is a tiny wrapper library to read, manipulate and write data in xlsx and xlsm fromat using openpyxl. You are likely to use it with `pyexcel `__. -Please note that `auto_detect_int` flag will not take effect because openpyxl detect integer in python 3 by default. +Please note: + +1. `auto_detect_int` flag will not take effect because openpyxl detect integer in python 3 by default. +2. `skip_hidden_row_and_column` will slow down the read operation. + + Known constraints ================== @@ -49,13 +57,16 @@ Support the project ================================================================================ If your company has embedded pyexcel and its components into a revenue generating -product, please `support me on patreon `_ to -maintain the project and develop it further. +product, please support me on `patreon `_ +or `bounty source `_ to maintain +the project and develop it further. -If you are an individual, you are welcome to support me too on patreon and for however long -you feel like. As a patreon, you will receive +If you are an individual, you are welcome to support me too and for however long +you feel like. As my backer, you will receive `early access to pyexcel related contents `_. +And your issues will get prioritized if you would like to become my patreon as `pyexcel pro user`. + With your financial support, I will be able to invest a little bit more time in coding, documentation and writing interesting posts. diff --git a/docs/source/conf.py b/docs/source/conf.py index 12810c2..4727ab5 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -4,41 +4,187 @@ 'format' + '' ) -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.viewcode', -] +# -*- coding: utf-8 -*- +# +# Configuration file for the Sphinx documentation builder. +# +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/master/config -intersphinx_mapping = { - 'pyexcel': ('http://pyexcel.readthedocs.io/en/latest/', None), -} -spelling_word_list_filename = 'spelling_wordlist.txt' +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + +# -- Project information ----------------------------------------------------- + +project = u'pyexcel-xlsx' +copyright = u'2015-2018 Onni Software Ltd.' +author = u'C.W.' + +# The short X.Y version +version = u'0.5.2' +# The full version, including alpha/beta/rc tags +release = u'0.6.0' + + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode',] + +# Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] source_suffix = '.rst' + +# The master toctree document. master_doc = 'index' -project = u'pyexcel-xlsx' -copyright = u'2015-2017 Onni Software Ltd.' -version = '0.5.2' -release = '0.6.0' +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. exclude_patterns = [] -pygments_style = 'sphinx' -html_theme = 'default' + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = None + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. htmlhelp_basename = 'pyexcel-xlsxdoc' -latex_elements = {} + + +# -- Options for LaTeX output ------------------------------------------------ + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). latex_documents = [ - ('index', 'pyexcel-xlsx.tex', - 'pyexcel-xlsx Documentation', - 'Onni Software Ltd.', 'manual'), + (master_doc, 'pyexcel-xlsx.tex', u'pyexcel-xlsx Documentation', + u'Onni Software Ltd.', 'manual'), ] + + +# -- Options for manual page output ------------------------------------------ + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'pyexcel-xlsx', - 'pyexcel-xlsx Documentation', - [u'Onni Software Ltd.'], 1) + (master_doc, 'pyexcel-xlsx', u'pyexcel-xlsx Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'pyexcel-xlsx', u'pyexcel-xlsx Documentation', + author, 'pyexcel-xlsx', 'One line description of project.', + 'Miscellaneous'), ] + + +# -- Options for Epub output ------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' + +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] + +# -- Extension configuration ------------------------------------------------- +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'https://docs.python.org/': None} +# TODO: html_theme not configurable upstream +html_theme = 'default' + +# TODO: DESCRIPTION not configurable upstream texinfo_documents = [ ('index', 'pyexcel-xlsx', 'pyexcel-xlsx Documentation', @@ -46,3 +192,6 @@ DESCRIPTION, 'Miscellaneous'), ] +intersphinx_mapping.update({ + 'pyexcel': ('http://pyexcel.readthedocs.io/en/latest/', None), +}) diff --git a/setup.py b/setup.py index e8d2d63..61eb884 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,13 @@ -# Template by setupmobans +#!/usr/bin/env python3 + +# Template by pypi-mobans import os import sys import codecs from shutil import rmtree -from setuptools import setup, find_packages, Command + +from setuptools import Command, setup, find_packages + NAME = 'pyexcel-xlsx' AUTHOR = 'C.W.' @@ -11,21 +15,18 @@ EMAIL = 'wangc_2011@hotmail.com' LICENSE = 'New BSD' DESCRIPTION = ( - 'A wrapper library to read, manipulate and write data in xlsx and xlsm ' + - 'format' + - '' + 'A wrapper library to read, manipulate and write data in xlsx and xlsm' + + 'format' ) URL = 'https://github.com/pyexcel/pyexcel-xlsx' DOWNLOAD_URL = '%s/archive/0.5.2.tar.gz' % URL -FILES = ['README.rst', 'CHANGELOG.rst'] +FILES = ['README.rst', 'CHANGELOG.rst'] KEYWORDS = [ + 'python', 'xlsx' - 'python' ] CLASSIFIERS = [ - 'Topic :: Office/Business', - 'Topic :: Utilities', 'Topic :: Software Development :: Libraries', 'Programming Language :: Python', 'Intended Audience :: Developers', @@ -42,6 +43,7 @@ 'openpyxl>=2.4.4', 'pyexcel-io>=0.5.3', ] +SETUP_COMMANDS = {} PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) @@ -80,6 +82,8 @@ def run(self): try: self.status('Removing previous builds...') rmtree(os.path.join(HERE, 'dist')) + rmtree(os.path.join(HERE, 'build')) + rmtree(os.path.join(HERE, 'pyexcel_xlsx.egg-info')) except OSError: pass @@ -96,6 +100,11 @@ def run(self): sys.exit() +SETUP_COMMANDS.update({ + 'publish': PublishCommand +}) + + def has_gease(): """ test if github release command is installed @@ -120,7 +129,8 @@ def read_files(*files): def read(afile): """Read a file into setup""" - with codecs.open(afile, 'r', 'utf-8') as opened_file: + the_relative_file = os.path.join(HERE, afile) + with codecs.open(the_relative_file, 'r', 'utf-8') as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content @@ -169,7 +179,5 @@ def filter_out_test_code(file_handle): include_package_data=True, zip_safe=False, classifiers=CLASSIFIERS, - cmdclass={ - 'publish': PublishCommand, - } + cmdclass=SETUP_COMMANDS ) diff --git a/test.bat b/test.bat index 8bde6de..29f8a33 100644 --- a/test.bat +++ b/test.bat @@ -1,2 +1,2 @@ pip freeze -nosetests --with-coverage --cover-package pyexcel_xlsx --cover-package tests --with-doctest --doctest-extension=.rst README.rst tests docs/source pyexcel_xlsx && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long +nosetests --with-coverage --cover-package pyexcel_xlsx --cover-package tests tests --with-doctest --doctest-extension=.rst README.rst docs/source pyexcel_xlsx && flake8 . --exclude=.moban.d,docs --builtins=unicode,xrange,long diff --git a/test.sh b/test.sh index 8bde6de..29f8a33 100644 --- a/test.sh +++ b/test.sh @@ -1,2 +1,2 @@ pip freeze -nosetests --with-coverage --cover-package pyexcel_xlsx --cover-package tests --with-doctest --doctest-extension=.rst README.rst tests docs/source pyexcel_xlsx && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long +nosetests --with-coverage --cover-package pyexcel_xlsx --cover-package tests tests --with-doctest --doctest-extension=.rst README.rst docs/source pyexcel_xlsx && flake8 . --exclude=.moban.d,docs --builtins=unicode,xrange,long diff --git a/tests/requirements.txt b/tests/requirements.txt index 973f2b9..c722b3c 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -5,3 +5,6 @@ coverage flake8 pyexcel pyexcel-xls +moban +black;python_version>="3.6" +isort;python_version>="3.6" diff --git a/tests/test_bug_fixes.py b/tests/test_bug_fixes.py index c9a0663..ab30132 100644 --- a/tests/test_bug_fixes.py +++ b/tests/test_bug_fixes.py @@ -9,7 +9,6 @@ from textwrap import dedent import pyexcel as pe from nose.tools import eq_ -from nose import SkipTest IN_TRAVIS = 'TRAVIS' in os.environ @@ -101,9 +100,7 @@ def test_issue_8_hidden_sheet_2(): def test_issue_20(): - #if not IN_TRAVIS: - # raise SkipTest() - pe.get_book(url="https://github.com/pyexcel/pyexcel-xlsx/raw/master/tests/fixtures/file_with_an_empty_sheet.xlsx"); # flake8: noqa + pe.get_book(url="https://github.com/pyexcel/pyexcel-xlsx/raw/master/tests/fixtures/file_with_an_empty_sheet.xlsx") # noqa: E501 def get_fixtures(file_name): diff --git a/tests/test_formatters.py b/tests/test_formatters.py index 11f7fd8..4e32b02 100644 --- a/tests/test_formatters.py +++ b/tests/test_formatters.py @@ -1,6 +1,6 @@ import os -from unittest import TestCase from textwrap import dedent +from nose.tools import eq_ import pyexcel as pe @@ -10,7 +10,7 @@ def test_reading_date_format(self): """ date time 25/12/14 11:11:11 - 25/12/14 12:11:11 + 25/12/14 12:12:12 01/01/15 13:13:13 0.0 0.0 """ @@ -18,13 +18,13 @@ def test_reading_date_format(self): r = pe.get_sheet(file_name=os.path.join("tests", "fixtures", "date_field.xlsx"), library='pyexcel-xlsx') - assert isinstance(r[1, 0], datetime.date) is True - assert r[1, 0].strftime("%d/%m/%y") == "25/12/14" + assert isinstance(r[1, 0], datetime.date) + eq_(r[1, 0].strftime("%d/%m/%y"), "25/12/14") assert isinstance(r[1, 1], datetime.time) is True assert r[1, 1].strftime("%H:%M:%S") == "11:11:11" value = r[4, 0].isoformat() - assert value == "1899-12-30T00:00:00" - assert r[4, 1].isoformat() == "1899-12-30T00:00:00" + eq_(value, "1899-12-30T00:00:00") + eq_(r[4, 1].isoformat(), "1899-12-30T00:00:00") def test_writing_date_format(self): import datetime @@ -43,29 +43,31 @@ def test_writing_date_format(self): os.unlink(excel_filename) -class TestAutoDetectInt(TestCase): +class TestAutoDetectInt: def setUp(self): self.content = [[1, 2, 3.1]] self.test_file = "test_auto_detect_init.xlsx" - pe.save_as(array=self.content, dest_file_name=self.test_file) + pe.save_as( + array=self.content, dest_file_name=self.test_file + ) def test_auto_detect_int(self): - sheet = pe.get_sheet(file_name=self.test_file) + sheet = pe.get_sheet(file_name=self.test_file, library="pyexcel-xlsx") expected = dedent(""" pyexcel_sheet1: +---+---+-----+ | 1 | 2 | 3.1 | +---+---+-----+""").strip() - self.assertEqual(str(sheet), expected) + eq_(str(sheet), expected) def test_get_book_auto_detect_int(self): - book = pe.get_book(file_name=self.test_file) + book = pe.get_book(file_name=self.test_file, library="pyexcel-xlsx") expected = dedent(""" pyexcel_sheet1: +---+---+-----+ | 1 | 2 | 3.1 | +---+---+-----+""").strip() - self.assertEqual(str(book), expected) + eq_(str(book), expected) def tearDown(self): os.unlink(self.test_file) diff --git a/tests/test_stringio.py b/tests/test_stringio.py index 2a6b2ac..323a2a6 100644 --- a/tests/test_stringio.py +++ b/tests/test_stringio.py @@ -11,7 +11,8 @@ def test_xlsx_stringio(self): create_sample_file1(testfile) with open(testfile, "rb") as f: content = f.read() - r = pyexcel.get_sheet(file_type="xlsx", file_content=content) + r = pyexcel.get_sheet(file_type="xlsx", file_content=content, + library="pyexcel-xlsx") result = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 1.1, 1] actual = list(r.enumerate()) eq_(result, actual) @@ -25,7 +26,8 @@ def test_xlsx_output_stringio(self): ] io = pyexcel.save_as(dest_file_type="xlsx", array=data) - r = pyexcel.get_sheet(file_type="xlsx", file_content=io.getvalue()) + r = pyexcel.get_sheet(file_type="xlsx", file_content=io.getvalue(), + library="pyexcel-xlsx") result = [1, 2, 3, 4, 5, 6] actual = list(r.enumerate()) eq_(result, actual) From 808c9481b85e5509369296ecc1e73529aa1911b3 Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 9 Nov 2018 22:03:15 +0000 Subject: [PATCH 02/10] :hammer: code refactoring --- .moban.d/tests/base.py | 2 +- .moban.d/tests/test_formatters.py | 2 +- pyexcel_xlsx/__init__.py | 19 +++++++----- pyexcel_xlsx/xlsxr.py | 22 ++++++++------ pyexcel_xlsx/xlsxw.py | 8 +++-- setup.py | 1 - tests/base.py | 17 ++++++----- tests/test_bug_fixes.py | 37 +++++++++++++---------- tests/test_filter.py | 49 ++++++++++++++++++------------- tests/test_formatters.py | 38 +++++++++++++++--------- tests/test_hidden.py | 19 +++++++----- tests/test_multiple_sheets.py | 46 +++++++++++++++++------------ tests/test_stringio.py | 27 +++++++++-------- tests/test_writer.py | 7 +++-- 14 files changed, 173 insertions(+), 121 deletions(-) diff --git a/.moban.d/tests/base.py b/.moban.d/tests/base.py index b7510db..156f96c 100644 --- a/.moban.d/tests/base.py +++ b/.moban.d/tests/base.py @@ -1,4 +1,4 @@ {% extends 'tests/base.py.jj2' %} {%block ods_types%} -{%endblock%} \ No newline at end of file +{%endblock%} diff --git a/.moban.d/tests/test_formatters.py b/.moban.d/tests/test_formatters.py index d56f336..9455f83 100644 --- a/.moban.d/tests/test_formatters.py +++ b/.moban.d/tests/test_formatters.py @@ -1,4 +1,4 @@ {% extends 'tests/test_formatters.py.jj2' %} {%block xlsx_exception%} -{%endblock%} \ No newline at end of file +{%endblock%} diff --git a/pyexcel_xlsx/__init__.py b/pyexcel_xlsx/__init__.py index 4b5ae36..7521a7c 100644 --- a/pyexcel_xlsx/__init__.py +++ b/pyexcel_xlsx/__init__.py @@ -9,18 +9,21 @@ """ from pyexcel_io.plugins import IOPluginInfoChain from pyexcel_io.io import ( - get_data as read_data, isstream, store_data as write_data) + get_data as read_data, + isstream, + store_data as write_data, +) -__FILE_TYPE__ = 'xlsx' +__FILE_TYPE__ = "xlsx" IOPluginInfoChain(__name__).add_a_reader( - relative_plugin_class_path='xlsxr.XLSXBook', - file_types=[__FILE_TYPE__, 'xlsm'], - stream_type='binary' + relative_plugin_class_path="xlsxr.XLSXBook", + file_types=[__FILE_TYPE__, "xlsm"], + stream_type="binary", ).add_a_writer( - relative_plugin_class_path='xlsxw.XLSXWriter', - file_types=[__FILE_TYPE__, 'xlsm'], - stream_type='binary' + relative_plugin_class_path="xlsxw.XLSXWriter", + file_types=[__FILE_TYPE__, "xlsm"], + stream_type="binary", ) diff --git a/pyexcel_xlsx/xlsxr.py b/pyexcel_xlsx/xlsxr.py index 3b0e339..ea0f60f 100644 --- a/pyexcel_xlsx/xlsxr.py +++ b/pyexcel_xlsx/xlsxr.py @@ -8,7 +8,6 @@ :license: New BSD License """ import openpyxl - from pyexcel_io.book import BookReader from pyexcel_io.sheet import SheetReader from pyexcel_io._compact import OrderedDict @@ -18,6 +17,7 @@ class XLSXSheet(SheetReader): """ Iterate through rows """ + @property def name(self): """sheet name""" @@ -44,6 +44,7 @@ class SlowSheet(XLSXSheet): """ This sheet will be slower because it does not use readonly sheet """ + def row_iterator(self): """ skip hidden rows @@ -66,6 +67,7 @@ class XLSXBook(BookReader): """ Open xlsx as read only mode """ + def open(self, file_name, skip_hidden_sheets=True, **keywords): BookReader.open(self, file_name, **keywords) self.skip_hidden_sheets = skip_hidden_sheets @@ -89,21 +91,21 @@ def read_sheet_by_index(self, sheet_index): if sheet_index < length: return self.read_sheet_by_name(names[sheet_index]) else: - raise IndexError("Index %d of out bound %d" % ( - sheet_index, - length)) + raise IndexError( + "Index %d of out bound %d" % (sheet_index, length) + ) def read_all(self): result = OrderedDict() for sheet in self._native_book: - if self.skip_hidden_sheets and sheet.sheet_state == 'hidden': + if self.skip_hidden_sheets and sheet.sheet_state == "hidden": continue data_dict = self.read_sheet(sheet) result.update(data_dict) return result def read_sheet(self, native_sheet): - if self._keywords.get('skip_hidden_row_and_column', False) is True: + if self._keywords.get("skip_hidden_row_and_column", False) is True: sheet = SlowSheet(native_sheet, **self._keywords) else: sheet = XLSXSheet(native_sheet, **self._keywords) @@ -115,8 +117,10 @@ def close(self): def _load_the_excel_file(self, file_alike_object): read_only_flag = True - if self._keywords.get('skip_hidden_row_and_column', False) is True: + if self._keywords.get("skip_hidden_row_and_column", False) is True: read_only_flag = False self._native_book = openpyxl.load_workbook( - filename=file_alike_object, data_only=True, - read_only=read_only_flag) + filename=file_alike_object, + data_only=True, + read_only=read_only_flag, + ) diff --git a/pyexcel_xlsx/xlsxw.py b/pyexcel_xlsx/xlsxw.py index c81751a..bee1f77 100644 --- a/pyexcel_xlsx/xlsxw.py +++ b/pyexcel_xlsx/xlsxw.py @@ -8,7 +8,6 @@ :license: New BSD License """ import openpyxl - from pyexcel_io.book import BookWriter from pyexcel_io.sheet import SheetWriter @@ -17,6 +16,7 @@ class XLSXSheetWriter(SheetWriter): """ Write data into xlsx sheet """ + def set_sheet_name(self, name): self._native_sheet.title = name self.current_row = 1 @@ -32,6 +32,7 @@ class XLSXWriter(BookWriter): """ Write data in write only mode """ + def __init__(self): BookWriter.__init__(self) self.current_sheet = 0 @@ -42,8 +43,9 @@ def open(self, file_name, **keywords): self._native_book = openpyxl.Workbook(write_only=True) def create_sheet(self, name): - return XLSXSheetWriter(self._native_book, - self._native_book.create_sheet(), name) + return XLSXSheetWriter( + self._native_book, self._native_book.create_sheet(), name + ) def close(self): """ diff --git a/setup.py b/setup.py index 61eb884..387d845 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,6 @@ from setuptools import Command, setup, find_packages - NAME = 'pyexcel-xlsx' AUTHOR = 'C.W.' VERSION = '0.6.0' diff --git a/tests/base.py b/tests/base.py index 4339f70..71474a3 100644 --- a/tests/base.py +++ b/tests/base.py @@ -1,11 +1,13 @@ import os # noqa -import pyexcel import datetime # noqa -from nose.tools import raises, eq_ # noqa + +import pyexcel + +from nose.tools import eq_, raises # noqa def create_sample_file1(file): - data = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 1.1, 1] + data = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", 1.1, 1] table = [] table.append(data[:4]) table.append(data[4:8]) @@ -17,10 +19,11 @@ class PyexcelHatWriterBase: """ Abstract functional test for hat writers """ + content = { "X": [1, 2, 3, 4, 5], "Y": [6, 7, 8, 9, 10], - "Z": [11, 12, 13, 14, 15] + "Z": [11, 12, 13, 14, 15], } def test_series_table(self): @@ -36,11 +39,12 @@ class PyexcelWriterBase: testfile and testfile2 have to be initialized before it is used for testing """ + content = [ [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], - [1, 2, 3, 4, 5] + [1, 2, 3, 4, 5], ] def _create_a_file(self, file): @@ -54,7 +58,6 @@ def test_write_array(self): class PyexcelMultipleSheetBase: - def _write_test_file(self, filename): pyexcel.save_book_as(bookdict=self.content, dest_file_name=filename) @@ -80,7 +83,7 @@ def test_reading_through_sheets(self): expected = [[4, 4, 4, 4], [5, 5, 5, 5], [6, 6, 6, 6]] assert data == expected data = list(b["Sheet3"].rows()) - expected = [[u'X', u'Y', u'Z'], [1, 4, 7], [2, 5, 8], [3, 6, 9]] + expected = [[u"X", u"Y", u"Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]] assert data == expected sheet3 = b["Sheet3"] sheet3.name_columns_by_row(0) diff --git a/tests/test_bug_fixes.py b/tests/test_bug_fixes.py index ab30132..0e7dd1d 100644 --- a/tests/test_bug_fixes.py +++ b/tests/test_bug_fixes.py @@ -7,10 +7,12 @@ import sys import datetime from textwrap import dedent + import pyexcel as pe + from nose.tools import eq_ -IN_TRAVIS = 'TRAVIS' in os.environ +IN_TRAVIS = "TRAVIS" in os.environ PY36_ABOVE = sys.version_info[0] == 3 and sys.version_info[1] >= 6 @@ -38,7 +40,8 @@ def test_pyexcel_issue_8_with_physical_file(): s.save_as(tmp_file) s2 = pe.load(tmp_file) eq_(str(s), str(s2)) - content = dedent(""" + content = dedent( + """ CNY: +----------+----------+------+---+-------+ | 01/09/13 | 02/09/13 | 1000 | 5 | 13.89 | @@ -46,7 +49,8 @@ def test_pyexcel_issue_8_with_physical_file(): | 02/09/13 | 03/09/13 | 2000 | 6 | 33.33 | +----------+----------+------+---+-------+ | 03/09/13 | 04/09/13 | 3000 | 7 | 58.33 | - +----------+----------+------+---+-------+""").strip("\n") + +----------+----------+------+---+-------+""" + ).strip("\n") eq_(str(s2), content) os.unlink(tmp_file) @@ -58,11 +62,12 @@ def test_pyexcel_issue_8_with_memory_file(): """ tmp_file = "issue_8_save_as.xlsx" f = open(get_fixtures("test8.xlsx"), "rb") - s = pe.load_from_memory('xlsx', f.read()) + s = pe.load_from_memory("xlsx", f.read()) s.save_as(tmp_file) s2 = pe.load(tmp_file) eq_(str(s), str(s2)) - content = dedent(""" + content = dedent( + """ CNY: +----------+----------+------+---+-------+ | 01/09/13 | 02/09/13 | 1000 | 5 | 13.89 | @@ -70,7 +75,8 @@ def test_pyexcel_issue_8_with_memory_file(): | 02/09/13 | 03/09/13 | 2000 | 6 | 33.33 | +----------+----------+------+---+-------+ | 03/09/13 | 04/09/13 | 3000 | 7 | 58.33 | - +----------+----------+------+---+-------+""").strip("\n") + +----------+----------+------+---+-------+""" + ).strip("\n") eq_(str(s2), content) os.unlink(tmp_file) @@ -83,24 +89,25 @@ def test_excessive_columns(): def test_issue_8_hidden_sheet(): test_file = get_fixtures("hidden_sheets.xlsx") - book_dict = pe.get_book_dict(file_name=test_file, - library="pyexcel-xlsx") + book_dict = pe.get_book_dict(file_name=test_file, library="pyexcel-xlsx") assert "hidden" not in book_dict - eq_(book_dict['shown'], [['A', 'B']]) + eq_(book_dict["shown"], [["A", "B"]]) def test_issue_8_hidden_sheet_2(): test_file = get_fixtures("hidden_sheets.xlsx") - book_dict = pe.get_book_dict(file_name=test_file, - skip_hidden_sheets=False, - library="pyexcel-xlsx") + book_dict = pe.get_book_dict( + file_name=test_file, skip_hidden_sheets=False, library="pyexcel-xlsx" + ) assert "hidden" in book_dict - eq_(book_dict['shown'], [['A', 'B']]) - eq_(book_dict['hidden'], [['a', 'b']]) + eq_(book_dict["shown"], [["A", "B"]]) + eq_(book_dict["hidden"], [["a", "b"]]) def test_issue_20(): - pe.get_book(url="https://github.com/pyexcel/pyexcel-xlsx/raw/master/tests/fixtures/file_with_an_empty_sheet.xlsx") # noqa: E501 + pe.get_book( + url="https://github.com/pyexcel/pyexcel-xlsx/raw/master/tests/fixtures/file_with_an_empty_sheet.xlsx" # noqa: E501 + ) def get_fixtures(file_name): diff --git a/tests/test_filter.py b/tests/test_filter.py index ba47431..6e51059 100644 --- a/tests/test_filter.py +++ b/tests/test_filter.py @@ -1,7 +1,7 @@ import os -from pyexcel_io import get_data, save_data from nose.tools import eq_ +from pyexcel_io import get_data, save_data class TestFilter: @@ -13,49 +13,58 @@ def setUp(self): [3, 23, 33], [4, 24, 34], [5, 25, 35], - [6, 26, 36] + [6, 26, 36], ] save_data(self.test_file, sample) self.sheet_name = "pyexcel_sheet1" def test_filter_row(self): - filtered_data = get_data(self.test_file, start_row=3, - library="pyexcel-xlsx") + filtered_data = get_data( + self.test_file, start_row=3, library="pyexcel-xlsx" + ) expected = [[4, 24, 34], [5, 25, 35], [6, 26, 36]] eq_(filtered_data[self.sheet_name], expected) def test_filter_row_2(self): - filtered_data = get_data(self.test_file, start_row=3, row_limit=1, - library="pyexcel-xlsx") + filtered_data = get_data( + self.test_file, start_row=3, row_limit=1, library="pyexcel-xlsx" + ) expected = [[4, 24, 34]] eq_(filtered_data[self.sheet_name], expected) def test_filter_column(self): - filtered_data = get_data(self.test_file, start_column=1, - library="pyexcel-xlsx") - expected = [[21, 31], [22, 32], [23, 33], - [24, 34], [25, 35], [26, 36]] + filtered_data = get_data( + self.test_file, start_column=1, library="pyexcel-xlsx" + ) + expected = [[21, 31], [22, 32], [23, 33], [24, 34], [25, 35], [26, 36]] eq_(filtered_data[self.sheet_name], expected) def test_filter_column_2(self): - filtered_data = get_data(self.test_file, - start_column=1, column_limit=1, - library="pyexcel-xlsx") + filtered_data = get_data( + self.test_file, + start_column=1, + column_limit=1, + library="pyexcel-xlsx", + ) expected = [[21], [22], [23], [24], [25], [26]] eq_(filtered_data[self.sheet_name], expected) def test_filter_both_ways(self): - filtered_data = get_data(self.test_file, - start_column=1, start_row=3, - library="pyexcel-xlsx") + filtered_data = get_data( + self.test_file, start_column=1, start_row=3, library="pyexcel-xlsx" + ) expected = [[24, 34], [25, 35], [26, 36]] eq_(filtered_data[self.sheet_name], expected) def test_filter_both_ways_2(self): - filtered_data = get_data(self.test_file, - start_column=1, column_limit=1, - start_row=3, row_limit=1, - library="pyexcel-xlsx") + filtered_data = get_data( + self.test_file, + start_column=1, + column_limit=1, + start_row=3, + row_limit=1, + library="pyexcel-xlsx", + ) expected = [[24]] eq_(filtered_data[self.sheet_name], expected) diff --git a/tests/test_formatters.py b/tests/test_formatters.py index 4e32b02..1885dce 100644 --- a/tests/test_formatters.py +++ b/tests/test_formatters.py @@ -1,9 +1,10 @@ import os from textwrap import dedent -from nose.tools import eq_ import pyexcel as pe +from nose.tools import eq_ + class TestDateFormat: def test_reading_date_format(self): @@ -15,9 +16,11 @@ def test_reading_date_format(self): 0.0 0.0 """ import datetime - r = pe.get_sheet(file_name=os.path.join("tests", "fixtures", - "date_field.xlsx"), - library='pyexcel-xlsx') + + r = pe.get_sheet( + file_name=os.path.join("tests", "fixtures", "date_field.xlsx"), + library="pyexcel-xlsx", + ) assert isinstance(r[1, 0], datetime.date) eq_(r[1, 0].strftime("%d/%m/%y"), "25/12/14") assert isinstance(r[1, 1], datetime.time) is True @@ -28,12 +31,17 @@ def test_reading_date_format(self): def test_writing_date_format(self): import datetime + excel_filename = "testdateformat.xlsx" - data = [[datetime.date(2014, 12, 25), + data = [ + [ + datetime.date(2014, 12, 25), datetime.time(11, 11, 11), - datetime.datetime(2014, 12, 25, 11, 11, 11)]] + datetime.datetime(2014, 12, 25, 11, 11, 11), + ] + ] pe.save_as(dest_file_name=excel_filename, array=data) - r = pe.get_sheet(file_name=excel_filename, library='pyexcel-xlsx') + r = pe.get_sheet(file_name=excel_filename, library="pyexcel-xlsx") assert isinstance(r[0, 0], datetime.date) is True assert r[0, 0].strftime("%d/%m/%y") == "25/12/14" assert isinstance(r[0, 1], datetime.time) is True @@ -47,26 +55,28 @@ class TestAutoDetectInt: def setUp(self): self.content = [[1, 2, 3.1]] self.test_file = "test_auto_detect_init.xlsx" - pe.save_as( - array=self.content, dest_file_name=self.test_file - ) + pe.save_as(array=self.content, dest_file_name=self.test_file) def test_auto_detect_int(self): sheet = pe.get_sheet(file_name=self.test_file, library="pyexcel-xlsx") - expected = dedent(""" + expected = dedent( + """ pyexcel_sheet1: +---+---+-----+ | 1 | 2 | 3.1 | - +---+---+-----+""").strip() + +---+---+-----+""" + ).strip() eq_(str(sheet), expected) def test_get_book_auto_detect_int(self): book = pe.get_book(file_name=self.test_file, library="pyexcel-xlsx") - expected = dedent(""" + expected = dedent( + """ pyexcel_sheet1: +---+---+-----+ | 1 | 2 | 3.1 | - +---+---+-----+""").strip() + +---+---+-----+""" + ).strip() eq_(str(book), expected) def tearDown(self): diff --git a/tests/test_hidden.py b/tests/test_hidden.py index 598ed9b..6adb2cd 100644 --- a/tests/test_hidden.py +++ b/tests/test_hidden.py @@ -1,20 +1,25 @@ import os -from nose.tools import eq_ + from pyexcel_xlsx import get_data +from nose.tools import eq_ + def test_hidden_row(): - data = get_data(os.path.join("tests", "fixtures", "hidden.xlsx"), - skip_hidden_row_and_column=True, - library='pyexcel-xlsx') + data = get_data( + os.path.join("tests", "fixtures", "hidden.xlsx"), + skip_hidden_row_and_column=True, + library="pyexcel-xlsx", + ) expected = [[1, 2], [7, 9]] - eq_(data['Sheet1'], expected) + eq_(data["Sheet1"], expected) def test_complex_hidden_sheets(): data = get_data( os.path.join("tests", "fixtures", "complex_hidden_sheets.xlsx"), skip_hidden_row_and_column=True, - library='pyexcel-xlsx') + library="pyexcel-xlsx", + ) expected = [[1, 3, 5, 7, 9], [31, 33, 35, 37, 39], [61, 63, 65, 67]] - eq_(data['Sheet1'], expected) + eq_(data["Sheet1"], expected) diff --git a/tests/test_multiple_sheets.py b/tests/test_multiple_sheets.py index 0dda7e1..2c6d6b8 100644 --- a/tests/test_multiple_sheets.py +++ b/tests/test_multiple_sheets.py @@ -1,9 +1,11 @@ import os import sys + import pyexcel -from nose.tools import raises 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: @@ -42,8 +44,7 @@ def _write_test_file(self, file): 3,3,3,3 """ self.rows = 3 - pyexcel.save_book_as(bookdict=self.content, - dest_file_name=file) + pyexcel.save_book_as(bookdict=self.content, dest_file_name=file) def setUp(self): self.testfile = "multiple3.xlsx" @@ -54,16 +55,20 @@ def setUp(self): self._write_test_file(self.testfile2) def test_load_a_single_sheet(self): - b1 = pyexcel.get_book(file_name=self.testfile, sheet_name="Sheet1", - library="pyexcel-xlsx") + b1 = pyexcel.get_book( + file_name=self.testfile, + sheet_name="Sheet1", + library="pyexcel-xlsx", + ) assert len(b1.sheet_names()) == 1 - assert b1['Sheet1'].to_array() == self.content['Sheet1'] + assert b1["Sheet1"].to_array() == self.content["Sheet1"] def test_load_a_single_sheet2(self): - b1 = pyexcel.get_book(file_name=self.testfile, sheet_index=1, - library="pyexcel-xlsx") + b1 = pyexcel.get_book( + file_name=self.testfile, sheet_index=1, library="pyexcel-xlsx" + ) assert len(b1.sheet_names()) == 1 - assert b1['Sheet2'].to_array() == self.content['Sheet2'] + assert b1["Sheet2"].to_array() == self.content["Sheet2"] @raises(IndexError) def test_load_a_single_sheet3(self): @@ -71,8 +76,11 @@ def test_load_a_single_sheet3(self): @raises(KeyError) def test_load_a_single_sheet4(self): - pyexcel.get_book(file_name=self.testfile, sheet_name="Not exist", - library="pyexcel-xlsx") + pyexcel.get_book( + file_name=self.testfile, + sheet_name="Not exist", + library="pyexcel-xlsx", + ) def test_delete_sheets(self): b1 = pyexcel.load_book(self.testfile) @@ -233,17 +241,17 @@ def setUp(self): self.testfile = "file_with_an_empty_sheet.xlsx" def test_reader_with_correct_sheets(self): - r = pyexcel.BookReader(os.path.join("tests", "fixtures", - self.testfile)) + r = pyexcel.BookReader( + os.path.join("tests", "fixtures", self.testfile) + ) assert r.number_of_sheets() == 3 def _produce_ordered_dict(): data_dict = OrderedDict() - data_dict.update({ - "Sheet1": [[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]]}) - data_dict.update({ - "Sheet2": [[4, 4, 4, 4], [5, 5, 5, 5], [6, 6, 6, 6]]}) - data_dict.update({ - "Sheet3": [[u'X', u'Y', u'Z'], [1, 4, 7], [2, 5, 8], [3, 6, 9]]}) + data_dict.update({"Sheet1": [[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]]}) + data_dict.update({"Sheet2": [[4, 4, 4, 4], [5, 5, 5, 5], [6, 6, 6, 6]]}) + data_dict.update( + {"Sheet3": [[u"X", u"Y", u"Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]]} + ) return data_dict diff --git a/tests/test_stringio.py b/tests/test_stringio.py index 323a2a6..34a9b40 100644 --- a/tests/test_stringio.py +++ b/tests/test_stringio.py @@ -1,33 +1,34 @@ import os + import pyexcel -from nose.tools import eq_ from base import create_sample_file1 +from nose.tools import eq_ -class TestStringIO: +class TestStringIO: def test_xlsx_stringio(self): testfile = "cute.xlsx" create_sample_file1(testfile) with open(testfile, "rb") as f: content = f.read() - r = pyexcel.get_sheet(file_type="xlsx", file_content=content, - library="pyexcel-xlsx") - result = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 1.1, 1] + r = pyexcel.get_sheet( + file_type="xlsx", file_content=content, library="pyexcel-xlsx" + ) + result = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", 1.1, 1] actual = list(r.enumerate()) eq_(result, actual) if os.path.exists(testfile): os.unlink(testfile) def test_xlsx_output_stringio(self): - data = [ - [1, 2, 3], - [4, 5, 6] - ] - io = pyexcel.save_as(dest_file_type="xlsx", - array=data) - r = pyexcel.get_sheet(file_type="xlsx", file_content=io.getvalue(), - library="pyexcel-xlsx") + data = [[1, 2, 3], [4, 5, 6]] + io = pyexcel.save_as(dest_file_type="xlsx", array=data) + r = pyexcel.get_sheet( + file_type="xlsx", + file_content=io.getvalue(), + library="pyexcel-xlsx", + ) result = [1, 2, 3, 4, 5, 6] actual = list(r.enumerate()) eq_(result, actual) diff --git a/tests/test_writer.py b/tests/test_writer.py index 671c107..c354741 100644 --- a/tests/test_writer.py +++ b/tests/test_writer.py @@ -1,7 +1,8 @@ import os -from pyexcel_xlsx.xlsxw import XLSXWriter as Writer -from pyexcel_xlsx.xlsxr import XLSXBook as Reader + from base import PyexcelWriterBase, PyexcelHatWriterBase +from pyexcel_xlsx.xlsxr import XLSXBook as Reader +from pyexcel_xlsx.xlsxw import XLSXWriter as Writer class TestNativeXLSXWriter: @@ -9,7 +10,7 @@ def test_write_book(self): self.content = { "Sheet1": [[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]], "Sheet2": [[4, 4, 4, 4], [5, 5, 5, 5], [6, 6, 6, 6]], - "Sheet3": [[u'X', u'Y', u'Z'], [1, 4, 7], [2, 5, 8], [3, 6, 9]] + "Sheet3": [[u"X", u"Y", u"Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]], } self.testfile = "writer.xlsx" writer = Writer() From f7a8eef5b1da9a96d0d1cb3becb42730fd8e1b10 Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 9 Nov 2018 22:12:34 +0000 Subject: [PATCH 03/10] :newspaper: include initial pipfile --- .moban.yml | 1 + Pipfile | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 Pipfile diff --git a/.moban.yml b/.moban.yml index 5a63c0b..9ebd1ed 100644 --- a/.moban.yml +++ b/.moban.yml @@ -11,6 +11,7 @@ configuration: - ".moban.d" configuration: pyexcel_xlsx.yaml targets: + - Pipfile: Pipfile.jj2 - README.rst: README.rst - setup.py: setup.py - "docs/source/conf.py": "docs/source/conf.py.jj2" diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..0d144b2 --- /dev/null +++ b/Pipfile @@ -0,0 +1,11 @@ +[[source]] +url = 'https://pypi.python.org/simple' +verify_ssl = true +name = 'pypi' + +[requires] +python_version= '3.6' + +[packages] + openpyxl>=2.4.4 + pyexcel-io>=0.5.3 From 372166ecf813e224d19116119b117ce25efe8154 Mon Sep 17 00:00:00 2001 From: chfw Date: Sat, 10 Nov 2018 22:31:27 +0000 Subject: [PATCH 04/10] :hammer: code refactoring --- pyexcel_xlsx/__init__.py | 2 +- pyexcel_xlsx/xlsxr.py | 1 + pyexcel_xlsx/xlsxw.py | 1 + tests/test_hidden.py | 3 +-- tests/test_writer.py | 1 + 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyexcel_xlsx/__init__.py b/pyexcel_xlsx/__init__.py index 7521a7c..c3e72e8 100644 --- a/pyexcel_xlsx/__init__.py +++ b/pyexcel_xlsx/__init__.py @@ -11,7 +11,7 @@ from pyexcel_io.io import ( get_data as read_data, isstream, - store_data as write_data, + save_data as write_data, ) diff --git a/pyexcel_xlsx/xlsxr.py b/pyexcel_xlsx/xlsxr.py index ea0f60f..3b71f9b 100644 --- a/pyexcel_xlsx/xlsxr.py +++ b/pyexcel_xlsx/xlsxr.py @@ -8,6 +8,7 @@ :license: New BSD License """ import openpyxl + from pyexcel_io.book import BookReader from pyexcel_io.sheet import SheetReader from pyexcel_io._compact import OrderedDict diff --git a/pyexcel_xlsx/xlsxw.py b/pyexcel_xlsx/xlsxw.py index bee1f77..a463e50 100644 --- a/pyexcel_xlsx/xlsxw.py +++ b/pyexcel_xlsx/xlsxw.py @@ -8,6 +8,7 @@ :license: New BSD License """ import openpyxl + from pyexcel_io.book import BookWriter from pyexcel_io.sheet import SheetWriter diff --git a/tests/test_hidden.py b/tests/test_hidden.py index 6adb2cd..03de453 100644 --- a/tests/test_hidden.py +++ b/tests/test_hidden.py @@ -1,8 +1,7 @@ import os -from pyexcel_xlsx import get_data - from nose.tools import eq_ +from pyexcel_xlsx import get_data def test_hidden_row(): diff --git a/tests/test_writer.py b/tests/test_writer.py index c354741..d1da852 100644 --- a/tests/test_writer.py +++ b/tests/test_writer.py @@ -1,6 +1,7 @@ import os from base import PyexcelWriterBase, PyexcelHatWriterBase + from pyexcel_xlsx.xlsxr import XLSXBook as Reader from pyexcel_xlsx.xlsxw import XLSXWriter as Writer From 8bf2c96bf2965f061ec80a218476434116250666 Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 15 Feb 2019 21:32:22 +0000 Subject: [PATCH 05/10] :books: sync with latest pypi-mobans --- LICENSE | 2 +- Pipfile | 9 ++++- README.rst | 1 + docs/source/conf.py | 81 +++++--------------------------------------- pyexcel_xlsx.yaml | 4 ++- requirements.txt | 2 +- setup.py | 18 +++++++++- tests/test_hidden.py | 3 +- tests/test_writer.py | 1 - 9 files changed, 41 insertions(+), 80 deletions(-) diff --git a/LICENSE b/LICENSE index 60ad78e..add7ef3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2018 by Onni Software Ltd. and its contributors +Copyright (c) by Onni Software Ltd. and its contributors All rights reserved. Redistribution and use in source and binary forms of the software as well diff --git a/Pipfile b/Pipfile index 0d144b2..e342711 100644 --- a/Pipfile +++ b/Pipfile @@ -7,5 +7,12 @@ name = 'pypi' python_version= '3.6' [packages] - openpyxl>=2.4.4 + openpyxl>=2.4.4,<2.6.0 pyexcel-io>=0.5.3 + +[dev-packages] +nose = "*" +mock = "*" +codecov = "*" +coverage = "*" +flake8 = "*" diff --git a/README.rst b/README.rst index 15f21db..5aab176 100644 --- a/README.rst +++ b/README.rst @@ -373,6 +373,7 @@ Acceptance criteria #. Has all code lines tested #. Passes all Travis CI builds #. Has fair amount of documentation if your change is complex +#. run 'make format' so as to confirm the pyexcel organisation's coding style #. Please update CHANGELOG.rst #. Please add yourself to CONTRIBUTORS.rst #. Agree on NEW BSD License for your contribution diff --git a/docs/source/conf.py b/docs/source/conf.py index 4727ab5..fa98d1c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -4,12 +4,10 @@ 'format' + '' ) -# -*- coding: utf-8 -*- -# # Configuration file for the Sphinx documentation builder. # -# This file does only contain a selection of the most common options. For a -# full list see the documentation: +# This file only contains a selection of the most common options. For a full +# list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup -------------------------------------------------------------- @@ -24,22 +22,18 @@ # -- Project information ----------------------------------------------------- -project = u'pyexcel-xlsx' -copyright = u'2015-2018 Onni Software Ltd.' -author = u'C.W.' +project = 'pyexcel-xlsx' +copyright = 'copyright 2015-2019 Onni Software Ltd.' +author = 'Onni Software Ltd.' # The short X.Y version -version = u'0.5.2' +version = '0.6.0' # The full version, including alpha/beta/rc tags -release = u'0.6.0' +release = '0.5.2' # -- General configuration --------------------------------------------------- -# If your documentation needs a minimal Sphinx version, state it here. -# -# needs_sphinx = '1.0' - # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. @@ -69,9 +63,6 @@ # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [] -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = None - # -- Options for HTML output ------------------------------------------------- @@ -102,63 +93,6 @@ # html_sidebars = {} -# -- Options for HTMLHelp output --------------------------------------------- - -# Output file base name for HTML help builder. -htmlhelp_basename = 'pyexcel-xlsxdoc' - - -# -- Options for LaTeX output ------------------------------------------------ - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', - - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', - - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', - - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - (master_doc, 'pyexcel-xlsx.tex', u'pyexcel-xlsx Documentation', - u'Onni Software Ltd.', 'manual'), -] - - -# -- Options for manual page output ------------------------------------------ - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'pyexcel-xlsx', u'pyexcel-xlsx Documentation', - [author], 1) -] - - -# -- Options for Texinfo output ---------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - (master_doc, 'pyexcel-xlsx', u'pyexcel-xlsx Documentation', - author, 'pyexcel-xlsx', 'One line description of project.', - 'Miscellaneous'), -] - - # -- Options for Epub output ------------------------------------------------- # Bibliographic Dublin Core info. @@ -181,6 +115,7 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'https://docs.python.org/': None} + # TODO: html_theme not configurable upstream html_theme = 'default' diff --git a/pyexcel_xlsx.yaml b/pyexcel_xlsx.yaml index 4fce296..6fcf9e7 100644 --- a/pyexcel_xlsx.yaml +++ b/pyexcel_xlsx.yaml @@ -1,11 +1,13 @@ overrides: "pyexcel.yaml" name: "pyexcel-xlsx" +project: "pyexcel-xlsx" nick_name: xlsx version: 0.6.0 current_version: 0.6.0 release: 0.5.2 file_type: xlsx +gitignore_language: Python dependencies: - - openpyxl>=2.4.4 + - openpyxl>=2.4.4,<2.6.0 - pyexcel-io>=0.5.3 description: A wrapper library to read, manipulate and write data in xlsx and xlsm format diff --git a/requirements.txt b/requirements.txt index fc26690..181b2c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -openpyxl>=2.4.4 +openpyxl>=2.4.4,<2.6.0 pyexcel-io>=0.5.3 diff --git a/setup.py b/setup.py index 387d845..fd24ddd 100644 --- a/setup.py +++ b/setup.py @@ -4,10 +4,25 @@ import os import sys import codecs +import locale +import platform from shutil import rmtree from setuptools import Command, setup, find_packages +# Work around mbcs bug in distutils. +# http://bugs.python.org/issue10945 +# This work around is only if a project supports Python < 3.4 + +# Work around for locale not being set +try: + lc = locale.getlocale() + pf = platform.system() + if pf != 'Windows' and lc == (None, None): + locale.setlocale(locale.LC_ALL, 'C.UTF-8') +except (ValueError, UnicodeError, locale.Error): + locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') + NAME = 'pyexcel-xlsx' AUTHOR = 'C.W.' VERSION = '0.6.0' @@ -39,7 +54,7 @@ ] INSTALL_REQUIRES = [ - 'openpyxl>=2.4.4', + 'openpyxl>=2.4.4,<2.6.0', 'pyexcel-io>=0.5.3', ] SETUP_COMMANDS = {} @@ -161,6 +176,7 @@ def filter_out_test_code(file_handle): if __name__ == '__main__': setup( + test_suite="tests", name=NAME, author=AUTHOR, version=VERSION, diff --git a/tests/test_hidden.py b/tests/test_hidden.py index 03de453..6adb2cd 100644 --- a/tests/test_hidden.py +++ b/tests/test_hidden.py @@ -1,8 +1,9 @@ import os -from nose.tools import eq_ from pyexcel_xlsx import get_data +from nose.tools import eq_ + def test_hidden_row(): data = get_data( diff --git a/tests/test_writer.py b/tests/test_writer.py index d1da852..c354741 100644 --- a/tests/test_writer.py +++ b/tests/test_writer.py @@ -1,7 +1,6 @@ import os from base import PyexcelWriterBase, PyexcelHatWriterBase - from pyexcel_xlsx.xlsxr import XLSXBook as Reader from pyexcel_xlsx.xlsxw import XLSXWriter as Writer From 4433ad7813ee0f9dea9b47f64c81298e1f9f4a96 Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 15 Feb 2019 21:43:20 +0000 Subject: [PATCH 06/10] :bug: pin openpyxl < 2.6. https://github.com/pyexcel/pyexcel-io/issues/66 --- CHANGELOG.rst | 8 ++++++++ changelog.yml | 6 ++++++ docs/source/conf.py | 4 ++-- pyexcel-xlsx.yml | 6 +++--- setup.py | 8 ++++---- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 657cdb2..edc936b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,14 @@ Change log ================================================================================ +0.5.7 - 15.02.2019 +-------------------------------------------------------------------------------- + +Added +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +#. pyexcel-io#66 pin openpyxl < 2.6.0 + 0.5.6 - 26.03.2018 -------------------------------------------------------------------------------- diff --git a/changelog.yml b/changelog.yml index 53d9c6c..5d8e71b 100644 --- a/changelog.yml +++ b/changelog.yml @@ -1,6 +1,12 @@ name: pyexcel-xlsx organisation: pyexcel releases: +- changes: + - action: Added + details: + - 'pyexcel-io#66 pin openpyxl < 2.6.0' + date: 15.02.2019 + version: 0.5.7 - changes: - action: Added details: diff --git a/docs/source/conf.py b/docs/source/conf.py index 44273f5..c34c5df 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -27,9 +27,9 @@ author = 'Onni Software Ltd.' # The short X.Y version -version = '0.5.6' +version = '0.5.7' # The full version, including alpha/beta/rc tags -release = '0.5.6' +release = '0.5.7' # -- General configuration --------------------------------------------------- diff --git a/pyexcel-xlsx.yml b/pyexcel-xlsx.yml index a152761..3cf2d98 100644 --- a/pyexcel-xlsx.yml +++ b/pyexcel-xlsx.yml @@ -2,9 +2,9 @@ overrides: "pyexcel.yaml" name: "pyexcel-xlsx" project: "pyexcel-xlsx" nick_name: xlsx -version: 0.5.6 -current_version: 0.5.6 -release: 0.5.6 +version: 0.5.7 +current_version: 0.5.7 +release: 0.5.7 file_type: xlsx gitignore_language: Python dependencies: diff --git a/setup.py b/setup.py index a5d2442..e41353e 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ NAME = 'pyexcel-xlsx' AUTHOR = 'C.W.' -VERSION = '0.5.6' +VERSION = '0.5.7' EMAIL = 'wangc_2011@hotmail.com' LICENSE = 'New BSD' DESCRIPTION = ( @@ -33,7 +33,7 @@ 'format' ) URL = 'https://github.com/pyexcel/pyexcel-xlsx' -DOWNLOAD_URL = '%s/archive/0.5.6.tar.gz' % URL +DOWNLOAD_URL = '%s/archive/0.5.7.tar.gz' % URL FILES = ['README.rst', 'CHANGELOG.rst'] KEYWORDS = [ 'python', @@ -66,8 +66,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.6 ' + - "Find 0.5.6 in changelog for more details") +GS_COMMAND = ('gs pyexcel-xlsx v0.5.7 ' + + "Find 0.5.7 in changelog for more details") NO_GS_MESSAGE = ('Automatic github release is disabled. ' + 'Please install gease to enable it.') UPLOAD_FAILED_MSG = ( From 0e994d6db43e21848a09d5d19b7a8807bd4d5db2 Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 15 Feb 2019 21:50:55 +0000 Subject: [PATCH 07/10] :sparkles: use python 3.7 for test --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cec9c90..804a10c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ notifications: email: false python: - pypy-5.3.1 - - 3.7-dev + - 3.7 - 3.6 - 3.5 - 3.4 From f9663850fe5f16cb5a89d0810e47b2bf1c104f54 Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 15 Feb 2019 21:53:07 +0000 Subject: [PATCH 08/10] :sparkles: test against 3.8-dev --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 804a10c..395aba9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,10 @@ notifications: email: false python: - pypy-5.3.1 + - 3.8-dev - 3.7 - 3.6 - 3.5 - - 3.4 - 2.7 before_install: - if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install ordereddict; fi From c0e99fed63e93f712fa3086b91ca79a5a957d3fa Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 15 Feb 2019 21:59:08 +0000 Subject: [PATCH 09/10] :bug: use dist: xenial --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 395aba9..6f6045c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ sudo: false +dist: xenial language: python notifications: email: false From 7cb4942b309d411c9f4c8a15c33ac8231686a105 Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 15 Feb 2019 22:09:52 +0000 Subject: [PATCH 10/10] :sparkles: use pypy2 and pypy3 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6f6045c..9cd521f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,8 @@ language: python notifications: email: false python: - - pypy-5.3.1 + - &pypy2 pypy2.7-6.0 + - &pypy3 pypy3.5-6.0 - 3.8-dev - 3.7 - 3.6