From 091e283f64428f18d55adb65506627d2992474c9 Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 07:38:07 -0600 Subject: [PATCH 01/30] exclude eccodes dir from installation --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 70c72a4c..ee12f46c 100755 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,6 +5,7 @@ include setup.py include README.md include utils/*grib* include Changelog +exclude eccodes recursive-include src *pyx recursive-include src *py recursive-include docs * From d11204463d14165e6dccdf861d2b7d1cb23b00c1 Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 07:38:27 -0600 Subject: [PATCH 02/30] prepare for 2.1.4 release --- Changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog b/Changelog index bb6cf81b..8d695994 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,4 @@ -version 2.1.4 (not yet released) +version 2.1.4 (git tag v2.1.4rel)( ================================ * move conftest.py to test dir (so tests can be run from there) * add check-manifest test to github actions workflow. From 38196458723009fc5e7e67f8f2561fb56ba9f92e Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 07:39:37 -0600 Subject: [PATCH 03/30] update --- Changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index 8d695994..e6f6c93a 100644 --- a/Changelog +++ b/Changelog @@ -7,6 +7,7 @@ version 2.1.4 (git tag v2.1.4rel)( * add windows and macos x tests. * make sure gribmessage.__repr__ doesn't fail is shapeOfTheEarth parameter is missing (issue #177). +* make sure eccodes dir doesn't get installed version 2.1.3 (git tag v2.1.3rel) ================================ From cec4241c988f899c02aba223cd481e4d3fcb6343 Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 08:42:55 -0600 Subject: [PATCH 04/30] don't try to use internal definitions path --- src/pygrib/_pygrib.pyx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/pygrib/_pygrib.pyx b/src/pygrib/_pygrib.pyx index 376e590b..0aeccc99 100644 --- a/src/pygrib/_pygrib.pyx +++ b/src/pygrib/_pygrib.pyx @@ -262,14 +262,16 @@ def set_definitions_path(object eccodes_definition_path): if 'ECCODES_DEFINITION_PATH' in os.environ: _eccodes_datadir = os.environ['ECCODES_DEFINITION_PATH'] else: - _tmp_path = os.path.join('eccodes','definitions') - _definitions_path = os.path.join(os.path.join(os.path.dirname(__file__),'..'),_tmp_path) - # if definitions path exists inside pygrib installation (as it does when installed - # via a binary wheel) tell eccodes to use internal eccodes definitions. - if os.path.isdir(_definitions_path): - _eccodes_datadir = os.sep.join([_definitions_path]) - else: - _eccodes_datadir = None + #_tmp_path = os.path.join('eccodes','definitions') + #_definitions_path = os.path.join(os.path.join(os.path.dirname(__file__),'..'),_tmp_path) + ## if definitions path exists inside pygrib installation (as it does when installed + ## via a binary wheel) tell eccodes to use internal eccodes definitions. + #if os.path.isdir(_definitions_path): + # _eccodes_datadir = os.sep.join([_definitions_path]) + #else: + # _eccodes_datadir = None + _eccodes_datadir = None + if _eccodes_datadir is not None: set_definitions_path(_eccodes_datadir) From d0e7a7802be490e52dc1484fc1064c5a08a1cc13 Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 08:56:17 -0600 Subject: [PATCH 05/30] print a message if definitions path is set --- src/pygrib/_pygrib.pyx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pygrib/_pygrib.pyx b/src/pygrib/_pygrib.pyx index 0aeccc99..92d2b792 100644 --- a/src/pygrib/_pygrib.pyx +++ b/src/pygrib/_pygrib.pyx @@ -262,17 +262,17 @@ def set_definitions_path(object eccodes_definition_path): if 'ECCODES_DEFINITION_PATH' in os.environ: _eccodes_datadir = os.environ['ECCODES_DEFINITION_PATH'] else: - #_tmp_path = os.path.join('eccodes','definitions') - #_definitions_path = os.path.join(os.path.join(os.path.dirname(__file__),'..'),_tmp_path) - ## if definitions path exists inside pygrib installation (as it does when installed - ## via a binary wheel) tell eccodes to use internal eccodes definitions. - #if os.path.isdir(_definitions_path): - # _eccodes_datadir = os.sep.join([_definitions_path]) - #else: - # _eccodes_datadir = None - _eccodes_datadir = None + _tmp_path = os.path.join('eccodes','definitions') + _definitions_path = os.path.join(os.path.join(os.path.dirname(__file__),'..'),_tmp_path) + # if definitions path exists inside pygrib installation (as it does when installed + # via a binary wheel) tell eccodes to use internal eccodes definitions. + if os.path.isdir(_definitions_path): + _eccodes_datadir = os.sep.join([_definitions_path]) + else: + _eccodes_datadir = None if _eccodes_datadir is not None: + print('setting definitions path to %s' % _eccodes_datadir) set_definitions_path(_eccodes_datadir) def get_definitions_path(): From ab2937df6d78ef5cf871ea222cafe84b51bc5998 Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 11:11:38 -0600 Subject: [PATCH 06/30] move eccodes dir inside share dir --- MANIFEST.in | 2 +- {eccodes => share/eccodes}/template.3.32769.def | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {eccodes => share/eccodes}/template.3.32769.def (100%) diff --git a/MANIFEST.in b/MANIFEST.in index ee12f46c..b52cbcfe 100755 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,7 +5,7 @@ include setup.py include README.md include utils/*grib* include Changelog -exclude eccodes +exclude share recursive-include src *pyx recursive-include src *py recursive-include docs * diff --git a/eccodes/template.3.32769.def b/share/eccodes/template.3.32769.def similarity index 100% rename from eccodes/template.3.32769.def rename to share/eccodes/template.3.32769.def From 8944507ab56e37a7ae3d4da3c5c78a11c35a470e Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 11:12:15 -0600 Subject: [PATCH 07/30] look for definitions inside share dir --- src/pygrib/_pygrib.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pygrib/_pygrib.pyx b/src/pygrib/_pygrib.pyx index 92d2b792..134b7230 100644 --- a/src/pygrib/_pygrib.pyx +++ b/src/pygrib/_pygrib.pyx @@ -262,7 +262,7 @@ def set_definitions_path(object eccodes_definition_path): if 'ECCODES_DEFINITION_PATH' in os.environ: _eccodes_datadir = os.environ['ECCODES_DEFINITION_PATH'] else: - _tmp_path = os.path.join('eccodes','definitions') + _tmp_path = os.path.join('share',os.path.join('eccodes','definitions')) _definitions_path = os.path.join(os.path.join(os.path.dirname(__file__),'..'),_tmp_path) # if definitions path exists inside pygrib installation (as it does when installed # via a binary wheel) tell eccodes to use internal eccodes definitions. From ec24e2558d9d39a6dbd93b6521570a73197af22d Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 11:13:28 -0600 Subject: [PATCH 08/30] update --- Changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog b/Changelog index e6f6c93a..0349eee3 100644 --- a/Changelog +++ b/Changelog @@ -7,7 +7,7 @@ version 2.1.4 (git tag v2.1.4rel)( * add windows and macos x tests. * make sure gribmessage.__repr__ doesn't fail is shapeOfTheEarth parameter is missing (issue #177). -* make sure eccodes dir doesn't get installed +* move private eccodes dir inside 'share', so `import eccodes` doesn't import an empty package. version 2.1.3 (git tag v2.1.3rel) ================================ From ab433ba7635100c39e644f967ef11aef71905f68 Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 13:20:59 -0600 Subject: [PATCH 09/30] change path to definitions in package_data --- MANIFEST.in | 1 - setup.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index b52cbcfe..70c72a4c 100755 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,7 +5,6 @@ include setup.py include README.md include utils/*grib* include Changelog -exclude share recursive-include src *pyx recursive-include src *py recursive-include docs * diff --git a/setup.py b/setup.py index 3c50a970..15ad261a 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ def package_files(directory): package_data = {} if os.environ.get("PYGRIB_WHEEL") is not None: - package_data[""] = package_files("eccodes") + package_data[""] = package_files("share") cmdclass = {"build_ext": NumpyBuildExtCommand} From 05bd8d147c568a936e34ac6acc55e39c3fd2464f Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 16:58:46 -0600 Subject: [PATCH 10/30] update to avoid spurious imports --- setup.py | 5 +++-- src/pygrib/_pygrib.pyx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 15ad261a..ad83fd28 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -import os, sys +import os, sys, shutil import glob import setuptools from Cython.Distutils import build_ext @@ -31,10 +31,11 @@ def extract_version(CYTHON_FNAME): def package_files(directory): + shutil.copytree(directory, os.path.join("src", "pygrib", directory), dirs_exist_ok=True) paths = [] for (path, directories, filenames) in os.walk(directory): for filename in filenames: - paths.append(os.path.join("..", path, filename)) + paths.append(os.path.join(path, filename)) return paths diff --git a/src/pygrib/_pygrib.pyx b/src/pygrib/_pygrib.pyx index 134b7230..96d32385 100644 --- a/src/pygrib/_pygrib.pyx +++ b/src/pygrib/_pygrib.pyx @@ -263,7 +263,7 @@ if 'ECCODES_DEFINITION_PATH' in os.environ: _eccodes_datadir = os.environ['ECCODES_DEFINITION_PATH'] else: _tmp_path = os.path.join('share',os.path.join('eccodes','definitions')) - _definitions_path = os.path.join(os.path.join(os.path.dirname(__file__),'..'),_tmp_path) + _definitions_path = os.path.join(os.path.dirname(__file__),_tmp_path) # if definitions path exists inside pygrib installation (as it does when installed # via a binary wheel) tell eccodes to use internal eccodes definitions. if os.path.isdir(_definitions_path): From 3928f4cf7da7e18c57bcfadf6a6a3eb3b5bac04c Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 18:15:08 -0600 Subject: [PATCH 11/30] remove dir_exists_ok from shutil.copytree call (new in python 3.8) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ad83fd28..32105cbe 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ def extract_version(CYTHON_FNAME): def package_files(directory): - shutil.copytree(directory, os.path.join("src", "pygrib", directory), dirs_exist_ok=True) + shutil.copytree(directory, os.path.join("src", "pygrib", directory)) paths = [] for (path, directories, filenames) in os.walk(directory): for filename in filenames: From f5698d0a1fe2bac04bb444def0645cbd768c0318 Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 18:24:56 -0600 Subject: [PATCH 12/30] ignore message on pygrib import --- test/test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test.py b/test/test.py index e9e5ea8c..bab606b4 100644 --- a/test/test.py +++ b/test/test.py @@ -3,7 +3,8 @@ def test(): demonstrates basic pygrib functionality. open a grib file, create an iterator. - >>> import pygrib + >>> import pygrib #doctest: +ELLIPSIS + ... >>> list(pygrib.open('../sampledata/flux.grb')) [1:Precipitation rate:kg m**-2 s**-1 (avg):regular_gg:surface:level 0:fcst time 108-120 hrs (avg):from 200402291200, 2:Surface pressure:Pa (instant):regular_gg:surface:level 0:fcst time 120 hrs:from 200402291200, 3:Maximum temperature:K (instant):regular_gg:heightAboveGround:level 2 m:fcst time 108-120 hrs:from 200402291200, 4:Minimum temperature:K (instant):regular_gg:heightAboveGround:level 2 m:fcst time 108-120 hrs:from 200402291200] >>> pygrib.open('../sampledata/flux.grb').read() From 363c9561080393999ae81fe3778203f373d044db Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 19:02:58 -0600 Subject: [PATCH 13/30] avoid file exists error --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 32105cbe..76a950f5 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ def extract_version(CYTHON_FNAME): def package_files(directory): + shutil.rmtree(os.path.join("src", "pygrib", directory)) shutil.copytree(directory, os.path.join("src", "pygrib", directory)) paths = [] for (path, directories, filenames) in os.walk(directory): From 6e44bb9cfd25e17498e638216f904d68987e7ceb Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 19:18:25 -0600 Subject: [PATCH 14/30] move data files to src/pygrib --- {share => src/pygrib/share}/eccodes/template.3.32769.def | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {share => src/pygrib/share}/eccodes/template.3.32769.def (100%) diff --git a/share/eccodes/template.3.32769.def b/src/pygrib/share/eccodes/template.3.32769.def similarity index 100% rename from share/eccodes/template.3.32769.def rename to src/pygrib/share/eccodes/template.3.32769.def From 0179c05062f0e57169a787751d5573273acdd943 Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 19:34:50 -0600 Subject: [PATCH 15/30] revert changes to eccodes definitions path --- setup.py | 9 ++++----- src/pygrib/_pygrib.pyx | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 76a950f5..2d5baf79 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -import os, sys, shutil +import os, sys import glob import setuptools from Cython.Distutils import build_ext @@ -31,8 +31,6 @@ def extract_version(CYTHON_FNAME): def package_files(directory): - shutil.rmtree(os.path.join("src", "pygrib", directory)) - shutil.copytree(directory, os.path.join("src", "pygrib", directory)) paths = [] for (path, directories, filenames) in os.walk(directory): for filename in filenames: @@ -40,9 +38,10 @@ def package_files(directory): return paths -package_data = {} if os.environ.get("PYGRIB_WHEEL") is not None: - package_data[""] = package_files("share") + package_data={'':package_files('share')} +else: + package_data={} cmdclass = {"build_ext": NumpyBuildExtCommand} diff --git a/src/pygrib/_pygrib.pyx b/src/pygrib/_pygrib.pyx index 96d32385..134b7230 100644 --- a/src/pygrib/_pygrib.pyx +++ b/src/pygrib/_pygrib.pyx @@ -263,7 +263,7 @@ if 'ECCODES_DEFINITION_PATH' in os.environ: _eccodes_datadir = os.environ['ECCODES_DEFINITION_PATH'] else: _tmp_path = os.path.join('share',os.path.join('eccodes','definitions')) - _definitions_path = os.path.join(os.path.dirname(__file__),_tmp_path) + _definitions_path = os.path.join(os.path.join(os.path.dirname(__file__),'..'),_tmp_path) # if definitions path exists inside pygrib installation (as it does when installed # via a binary wheel) tell eccodes to use internal eccodes definitions. if os.path.isdir(_definitions_path): From 2b5896ea5d787e9b6f54588b4796194c3f414b2f Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 19:47:01 -0600 Subject: [PATCH 16/30] move files --- {src/pygrib/share => share}/eccodes/template.3.32769.def | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {src/pygrib/share => share}/eccodes/template.3.32769.def (100%) diff --git a/src/pygrib/share/eccodes/template.3.32769.def b/share/eccodes/template.3.32769.def similarity index 100% rename from src/pygrib/share/eccodes/template.3.32769.def rename to share/eccodes/template.3.32769.def From f6ee9d6637e51efe5edd38fc65f0dba228158d5f Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 20:03:29 -0600 Subject: [PATCH 17/30] update --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2d5baf79..339d0dc3 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,8 @@ def package_files(directory): paths = [] for (path, directories, filenames) in os.walk(directory): for filename in filenames: - paths.append(os.path.join(path, filename)) + paths.append(os.path.join("..", path, filename)) + #paths.append(os.path.join(path, filename)) return paths From 85fa8852981a62e433ee250fa988a2cfe69fb8c5 Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 20:55:28 -0600 Subject: [PATCH 18/30] move definitions inside package --- setup.py | 7 ++++--- src/pygrib/_pygrib.pyx | 5 +++-- {share => src/pygrib/share}/eccodes/template.3.32769.def | 0 3 files changed, 7 insertions(+), 5 deletions(-) rename {share => src/pygrib/share}/eccodes/template.3.32769.def (100%) diff --git a/setup.py b/setup.py index 339d0dc3..7578e338 100644 --- a/setup.py +++ b/setup.py @@ -31,14 +31,15 @@ def extract_version(CYTHON_FNAME): def package_files(directory): + owd = os.getcwd() + os.chdir(os.path.join('src','pygrib')) paths = [] for (path, directories, filenames) in os.walk(directory): for filename in filenames: - paths.append(os.path.join("..", path, filename)) - #paths.append(os.path.join(path, filename)) + paths.append(os.path.join(path, filename)) + os.chdir(owd) return paths - if os.environ.get("PYGRIB_WHEEL") is not None: package_data={'':package_files('share')} else: diff --git a/src/pygrib/_pygrib.pyx b/src/pygrib/_pygrib.pyx index 134b7230..ba336b25 100644 --- a/src/pygrib/_pygrib.pyx +++ b/src/pygrib/_pygrib.pyx @@ -262,8 +262,9 @@ def set_definitions_path(object eccodes_definition_path): if 'ECCODES_DEFINITION_PATH' in os.environ: _eccodes_datadir = os.environ['ECCODES_DEFINITION_PATH'] else: - _tmp_path = os.path.join('share',os.path.join('eccodes','definitions')) - _definitions_path = os.path.join(os.path.join(os.path.dirname(__file__),'..'),_tmp_path) + # definitions at level of package dir + _tmp_path = os.path.join('share','eccodes','definitions')) + _definitions_path = os.path.join(os.path.dirname(__file__),_tmp_path) # if definitions path exists inside pygrib installation (as it does when installed # via a binary wheel) tell eccodes to use internal eccodes definitions. if os.path.isdir(_definitions_path): diff --git a/share/eccodes/template.3.32769.def b/src/pygrib/share/eccodes/template.3.32769.def similarity index 100% rename from share/eccodes/template.3.32769.def rename to src/pygrib/share/eccodes/template.3.32769.def From 20cf35e28c2af5cefa510aae701e04ec895aa52b Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 21:18:32 -0600 Subject: [PATCH 19/30] fix typo --- src/pygrib/_pygrib.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pygrib/_pygrib.pyx b/src/pygrib/_pygrib.pyx index ba336b25..0060cd93 100644 --- a/src/pygrib/_pygrib.pyx +++ b/src/pygrib/_pygrib.pyx @@ -263,7 +263,7 @@ if 'ECCODES_DEFINITION_PATH' in os.environ: _eccodes_datadir = os.environ['ECCODES_DEFINITION_PATH'] else: # definitions at level of package dir - _tmp_path = os.path.join('share','eccodes','definitions')) + _tmp_path = os.path.join('share','eccodes','definitions') _definitions_path = os.path.join(os.path.dirname(__file__),_tmp_path) # if definitions path exists inside pygrib installation (as it does when installed # via a binary wheel) tell eccodes to use internal eccodes definitions. From 730fc457c464f400eaa7845d9e0c13a1e7ef1597 Mon Sep 17 00:00:00 2001 From: jswhit Date: Thu, 16 Sep 2021 21:31:40 -0600 Subject: [PATCH 20/30] don't print message --- src/pygrib/_pygrib.pyx | 1 - test/test.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pygrib/_pygrib.pyx b/src/pygrib/_pygrib.pyx index 0060cd93..121c2074 100644 --- a/src/pygrib/_pygrib.pyx +++ b/src/pygrib/_pygrib.pyx @@ -273,7 +273,6 @@ else: _eccodes_datadir = None if _eccodes_datadir is not None: - print('setting definitions path to %s' % _eccodes_datadir) set_definitions_path(_eccodes_datadir) def get_definitions_path(): diff --git a/test/test.py b/test/test.py index bab606b4..e9e5ea8c 100644 --- a/test/test.py +++ b/test/test.py @@ -3,8 +3,7 @@ def test(): demonstrates basic pygrib functionality. open a grib file, create an iterator. - >>> import pygrib #doctest: +ELLIPSIS - ... + >>> import pygrib >>> list(pygrib.open('../sampledata/flux.grb')) [1:Precipitation rate:kg m**-2 s**-1 (avg):regular_gg:surface:level 0:fcst time 108-120 hrs (avg):from 200402291200, 2:Surface pressure:Pa (instant):regular_gg:surface:level 0:fcst time 120 hrs:from 200402291200, 3:Maximum temperature:K (instant):regular_gg:heightAboveGround:level 2 m:fcst time 108-120 hrs:from 200402291200, 4:Minimum temperature:K (instant):regular_gg:heightAboveGround:level 2 m:fcst time 108-120 hrs:from 200402291200] >>> pygrib.open('../sampledata/flux.grb').read() From 02a7ee39baf84a0f7272108fe57b0fb8702d46dc Mon Sep 17 00:00:00 2001 From: jswhit Date: Fri, 17 Sep 2021 06:24:00 -0600 Subject: [PATCH 21/30] disable cartopy tests for now --- .github/workflows/build.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d368561..b9277a7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,14 +39,14 @@ jobs: python -m pip install twine python -m pip install wheel # below here only needed for mpl/cartopy based tests - python -m pip install pytest-mpl - python -m pip install pyshp - python -m pip install six - python -m pip install shapely --no-binary shapely - python -m pip install matplotlib - python -m pip install cartopy - python -m pip install scipy - python -m pip install pyspharm + #python -m pip install pytest-mpl + #python -m pip install pyshp + #python -m pip install six + #python -m pip install shapely --no-binary shapely + #python -m pip install matplotlib + #python -m pip install cartopy + #python -m pip install scipy + #python -m pip install pyspharm - name: Install pygrib run: | @@ -55,9 +55,9 @@ jobs: run: | export MPLBACKEND=agg cd test - pytest test*py --mpl --mpl-baseline-path=baseline_images + #pytest test*py --mpl --mpl-baseline-path=baseline_images # if no mpl/cartopy run this - #pytest test.py test_latlons.py + pytest test.py test_latlons.py - name: Tarball run: | From 38c67e03952612834ef04780b37b1f28eb9bda3f Mon Sep 17 00:00:00 2001 From: jswhit Date: Fri, 17 Sep 2021 07:04:51 -0600 Subject: [PATCH 22/30] set zorder=2 in coastlines (issue #188) --- test/test_gaussian.py | 2 +- test/test_reglatlon.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test_gaussian.py b/test/test_gaussian.py index 8accf574..078f93a6 100644 --- a/test/test_gaussian.py +++ b/test/test_gaussian.py @@ -19,7 +19,7 @@ def test_gaussian(): fig = plt.figure() ax = plt.axes(projection=ccrs.PlateCarree(central_longitude=0)) - ax.coastlines() + ax.coastlines(zorder=2) ax.contourf(lons,lats,data,15) # plot location of every 4th grid point plt.scatter(lons[::4,::4].ravel(),lats[::4,::4].ravel(),1,marker='o',color='k',zorder=10) diff --git a/test/test_reglatlon.py b/test/test_reglatlon.py index 9784c5e7..bfd11a40 100644 --- a/test/test_reglatlon.py +++ b/test/test_reglatlon.py @@ -22,7 +22,7 @@ def test_reglatlon1(): fig = plt.figure() ax = plt.axes(projection=ccrs.PlateCarree(central_longitude=0)) - ax.coastlines() + ax.coastlines(zorder=2) ax.contourf(lons,lats,data,15,cmap=plt.cm.hot_r) plt.title('%s Global Lat/Lon Grid' % grb.name) return fig @@ -31,7 +31,7 @@ def test_reglatlon1(): def test_reglatlon2(): fig = plt.figure() ax = plt.axes(projection=ccrs.PlateCarree(central_longitude=0)) - ax.coastlines() + ax.coastlines(zorder=2) ax.contourf(lons,lats,data2,15) plt.title('%s Global Lat/Lon Grid' % grb2.name) return fig @@ -44,7 +44,7 @@ def test_reglatlon3(): fig = plt.figure() ax = plt.axes(projection=ccrs.PlateCarree(central_longitude=0)) ax.set_extent([lon1,lon2,lat1,lat2],crs=ccrs.PlateCarree()) - ax.coastlines() + ax.coastlines(zorder=2) ax.contourf(lonsubset,latsubset,datsubset,15,cmap=plt.cm.hot_r) plt.title('%s Regional Lat/Lon Grid' % grb.name) return fig From 981deb8aaf3059112b9262925ea30d7efc7d7c1e Mon Sep 17 00:00:00 2001 From: jswhit Date: Fri, 17 Sep 2021 07:06:04 -0600 Subject: [PATCH 23/30] update --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9277a7c..0b9ec8a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,8 +53,8 @@ jobs: python setup.py install - name: Test run: | - export MPLBACKEND=agg cd test + #export MPLBACKEND=agg #pytest test*py --mpl --mpl-baseline-path=baseline_images # if no mpl/cartopy run this pytest test.py test_latlons.py From b79717e59aa8f7d32c1a0da82e9baca95b683131 Mon Sep 17 00:00:00 2001 From: jswhit Date: Fri, 17 Sep 2021 07:21:04 -0600 Subject: [PATCH 24/30] linux builds not finding eccodes, try to debug --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b9ec8a1..12df1069 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,6 +50,9 @@ jobs: - name: Install pygrib run: | + pushd /usr + find ./ -name grib_api.h -print + popd python setup.py install - name: Test run: | From 0be5781769e24ddfda7cb79fd8190f24fe3f48f7 Mon Sep 17 00:00:00 2001 From: jswhit Date: Fri, 17 Sep 2021 07:35:24 -0600 Subject: [PATCH 25/30] build using conda on all platforms --- .github/workflows/build-conda.yml | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build-conda.yml diff --git a/.github/workflows/build-conda.yml b/.github/workflows/build-conda.yml new file mode 100644 index 00000000..61877bed --- /dev/null +++ b/.github/workflows/build-conda.yml @@ -0,0 +1,50 @@ +name: Build and Test Windows/MacOSX + +on: + pull_request: + push: + branches: [master] + +jobs: + run: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [ "3.7", "3.8", "3.9"] + os: [ubuntu-latest, windows-latest, macos-latest] + platform: [x64, x32] +# debug on a single os/platform/python version +# python-version: [ "3.9"] +# os: [ubuntu-latest] +# platform: [x64] + exclude: + - os: macos-latest + platform: x32 + steps: + - uses: actions/checkout@v2 + + - name: Setup Conda + uses: s-weigand/setup-conda@v1 + with: + activate-conda: false + conda-channels: conda-forge + + - name: Python ${{ matrix.python-version }} + shell: bash -l {0} + run: | + conda create --name TEST python=${{ matrix.python-version }} numpy cython pip pytest wheel pyproj eccodes --strict-channel-priority + source activate TEST + pip install -e . --no-deps --force-reinstall + conda info --all + conda list + + - name: Tests + shell: bash -l {0} + run: | + source activate TEST + if [ "windows-latest" == "${{ matrix.os }}" ]; then + export ECCODES_DEFINITION_PATH=$CONDA_PREFIX/Library/share/eccodes/definitions + fi + cd test + python test.py + pytest -vv test_latlons.py From e4c94cb9c7beff3136f6de3fa2154463590249c5 Mon Sep 17 00:00:00 2001 From: jswhit Date: Fri, 17 Sep 2021 07:37:01 -0600 Subject: [PATCH 26/30] update --- .github/workflows/build-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-conda.yml b/.github/workflows/build-conda.yml index 61877bed..2328c7e9 100644 --- a/.github/workflows/build-conda.yml +++ b/.github/workflows/build-conda.yml @@ -1,4 +1,4 @@ -name: Build and Test Windows/MacOSX +name: Build and Test Linux/Windows/MacOSX on: pull_request: From 8fbf9560a02d2a078f66f017c9c272529a54e3be Mon Sep 17 00:00:00 2001 From: jswhit Date: Fri, 17 Sep 2021 07:58:39 -0600 Subject: [PATCH 27/30] update --- .github/workflows/build-conda.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-conda.yml b/.github/workflows/build-conda.yml index 2328c7e9..ecc862d8 100644 --- a/.github/workflows/build-conda.yml +++ b/.github/workflows/build-conda.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [ "3.7", "3.8", "3.9"] + python-version: [ "3.6", "3.7", "3.8", "3.9"] os: [ubuntu-latest, windows-latest, macos-latest] platform: [x64, x32] # debug on a single os/platform/python version @@ -20,6 +20,12 @@ jobs: exclude: - os: macos-latest platform: x32 + exclude: + - os: macos-latest + python-version: "3.6" + exclude: + - os: windows-latest + python-version: "3.6" steps: - uses: actions/checkout@v2 From 6f12557fddfdbce7a026332a533a10a3f277ffd0 Mon Sep 17 00:00:00 2001 From: jswhit Date: Fri, 17 Sep 2021 08:08:07 -0600 Subject: [PATCH 28/30] update --- .github/workflows/build-conda.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-conda.yml b/.github/workflows/build-conda.yml index ecc862d8..29ce6526 100644 --- a/.github/workflows/build-conda.yml +++ b/.github/workflows/build-conda.yml @@ -20,10 +20,8 @@ jobs: exclude: - os: macos-latest platform: x32 - exclude: - os: macos-latest python-version: "3.6" - exclude: - os: windows-latest python-version: "3.6" steps: @@ -48,9 +46,9 @@ jobs: shell: bash -l {0} run: | source activate TEST - if [ "windows-latest" == "${{ matrix.os }}" ]; then - export ECCODES_DEFINITION_PATH=$CONDA_PREFIX/Library/share/eccodes/definitions - fi + #if [ "windows-latest" == "${{ matrix.os }}" ]; then + # export ECCODES_DEFINITION_PATH=$CONDA_PREFIX/Library/share/eccodes/definitions + #fi cd test python test.py pytest -vv test_latlons.py From bacf8f6b600b9165ebc697e41ffad9d2c1c1f979 Mon Sep 17 00:00:00 2001 From: jswhit Date: Fri, 17 Sep 2021 09:01:00 -0600 Subject: [PATCH 29/30] just run python 3.9 and enable matplotlib test --- .github/workflows/build.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12df1069..b9bad71d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,8 @@ jobs: PROJ_LIB: /usr/share/proj strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9"] + #python-version: ["3.6", "3.7", "3.8", "3.9"] + python-version: ["3.9"] steps: - uses: actions/checkout@v2 @@ -39,14 +40,14 @@ jobs: python -m pip install twine python -m pip install wheel # below here only needed for mpl/cartopy based tests - #python -m pip install pytest-mpl - #python -m pip install pyshp - #python -m pip install six - #python -m pip install shapely --no-binary shapely - #python -m pip install matplotlib - #python -m pip install cartopy - #python -m pip install scipy - #python -m pip install pyspharm + python -m pip install pytest-mpl + python -m pip install pyshp + python -m pip install six + python -m pip install shapely --no-binary shapely + python -m pip install matplotlib + python -m pip install cartopy + python -m pip install scipy + python -m pip install pyspharm - name: Install pygrib run: | @@ -57,10 +58,10 @@ jobs: - name: Test run: | cd test - #export MPLBACKEND=agg - #pytest test*py --mpl --mpl-baseline-path=baseline_images + export MPLBACKEND=agg + pytest test*py --mpl --mpl-baseline-path=baseline_images # if no mpl/cartopy run this - pytest test.py test_latlons.py + #pytest test.py test_latlons.py - name: Tarball run: | From b6b80746b674c19c124b2c58e22f07d1686fbb48 Mon Sep 17 00:00:00 2001 From: jswhit Date: Fri, 17 Sep 2021 09:13:15 -0600 Subject: [PATCH 30/30] update --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9bad71d..0b6989ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,9 +51,6 @@ jobs: - name: Install pygrib run: | - pushd /usr - find ./ -name grib_api.h -print - popd python setup.py install - name: Test run: |