From c8794b2a24fbb967243d104bfcdfe6dedad6d391 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Sun, 10 Oct 2021 03:50:19 -0700 Subject: [PATCH 1/3] test on Windows and macOS, too - test 3.8 on Windows and macOS - colorful tests - setup.py: add long description type explicitly to make twine happy --- .github/workflows/gh-ci.yaml | 10 ++++++++-- setup.py | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) 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/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", From ea46d69f711c0eb1f1e5539f6f6b8cd590d4855b Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Sun, 10 Oct 2021 04:17:35 -0700 Subject: [PATCH 2/3] workaround for gzip.open() failure in Windows Python 2.7 - fix #99 - implement workaround from https://bugs.python.org/issue30012 : for Python 3, use mode="rt", for Python 2, just use default ("r") --- gridData/OpenDX.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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: From 2a4f6670ccde685dc15a15bc82d3c463e327af5a Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Sun, 10 Oct 2021 03:44:53 -0700 Subject: [PATCH 3/3] finalized CHANGELOG for 0.6.0 - for #97 - note tests on Windows and macOS - add @xiki-tempula for #88 and add @IAlibay for #86 - added missing issue/PR numbers where necessary - release date for 0.6.0 --- CHANGELOG | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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