diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index 6dd14a6..46f341c 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -26,7 +26,13 @@ jobs: python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] include: - os: windows-latest - python-version: 3.7 + python-version: 2.7 + - os: windows-latest + python-version: 3.9 + - os: macos-latest + python-version: 2.7 + - os: macos-latest + python-version: 3.9 steps: - uses: actions/checkout@v2 @@ -58,7 +64,7 @@ jobs: - name: run unit tests run: | - pytest -v --cov=gridData --cov-report=xml ./gridData/tests + pytest -v --cov=gridData --cov-report=xml --color=yes ./gridData/tests - name: codecov uses: codecov/codecov-action@v2 diff --git a/CHANGELOG b/CHANGELOG index 7fc696c..e3a7805 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,15 +13,20 @@ The rules for this file: * accompany each entry with github issue/PR number (Issue #xyz) ------------------------------------------------------------------------------ -??/??/2019 eloyfelix, renehamburger1993, lilyminium, jvermaas +10/10/2021 eloyfelix, renehamburger1993, lilyminium, jvermaas, xiki-tempula, + IAlibay, orbeckst * 0.6.0 + Changes + * macOS and Windows are also tested (min and max supported Python, #97) + * switched CI to using GitHub actions (#86) + Enhancements - * Allow parsing/writing gzipped DX files + * Allow parsing/writing gzipped DX files (PR #70, #99) * Update doc theme to use sphinx-rtd-theme (#80) - * Delta of OpenDX writes 7 significant figures (#89) + * Delta of OpenDX writes 7 significant figures (#88) Fixes diff --git a/gridData/OpenDX.py b/gridData/OpenDX.py index 3099e1f..97d6174 100644 --- a/gridData/OpenDX.py +++ b/gridData/OpenDX.py @@ -174,6 +174,17 @@ import warnings +# Python 2/3 compatibility (see issue #99) +# and https://bugs.python.org/issue30012 +import sys +if sys.version_info >= (3, ): + def _gzip_open(filename, mode="rt"): + return gzip.open(filename, mode) +else: + def _gzip_open(filename, mode="rt"): + return gzip.open(filename) +del sys + class DXclass(object): """'class' object as defined by OpenDX""" def __init__(self,classid): @@ -707,7 +718,7 @@ def parse(self, DXfield): self.tokens = [] # token buffer if self.filename.endswith('.gz'): - with gzip.open(self.filename, 'rt') as self.dxfile: + with _gzip_open(self.filename, 'rt') as self.dxfile: self.use_parser('general') else: with open(self.filename, 'r') as self.dxfile: diff --git a/setup.py b/setup.py index 6d5f518..b12b739 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ cmdclass=versioneer.get_cmdclass(), description="Reading and writing of data on regular grids in Python", long_description=long_description, + long_description_content_type="text/x-rst", author="Oliver Beckstein", author_email="orbeckst@gmail.com", license="LGPLv3",