From 86c8e153653956cc516c78bcf70475e0abdc12dc Mon Sep 17 00:00:00 2001 From: Claudio Satriano Date: Wed, 19 Jun 2019 22:28:01 +0200 Subject: [PATCH 1/3] Fix for GMT 6.0.0rc1 Also fixes the error message on incompatible GMT version. --- pygmt/clib/session.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pygmt/clib/session.py b/pygmt/clib/session.py index 9ab37a33445..c641c5d8a57 100644 --- a/pygmt/clib/session.py +++ b/pygmt/clib/session.py @@ -73,7 +73,7 @@ class Session: library in the directory specified by it. A ``GMTVersionError`` exception will be raised if the GMT shared library reports a - version < 6.0.0. + version < 6.0.0rc1. The ``session_pointer`` attribute holds a ctypes pointer to the currently open session. @@ -112,7 +112,7 @@ class Session: """ # The minimum version of GMT required - required_version = "6.0.0" + required_version = "6.0.0rc1" @property def session_pointer(self): @@ -177,7 +177,7 @@ def __enter__(self): if Version(version) < Version(self.required_version): self.destroy() raise GMTVersionError( - "Using an incompatible GMT version {}. Must be newer than {}.".format( + "Using an incompatible GMT version {}. Must be equal or newer than {}.".format( version, self.required_version ) ) From 58e84fac1d91110e2d4945f699c9399ff2b00c2c Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Wed, 19 Jun 2019 11:47:50 -1000 Subject: [PATCH 2/3] Tell Travis to update homebrew --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5100e17ae8e..40e44ca7788 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ addons: - ghostscript - curl homebrew: + update: true packages: - cmake - ninja From a67d4ce7c22b801ee81983dd628637d47501d15c Mon Sep 17 00:00:00 2001 From: Leonardo Uieda Date: Wed, 19 Jun 2019 17:10:17 -1000 Subject: [PATCH 3/3] Use the conda-forge provided 6.0.0rc1 --- .travis.yml | 49 +++---------------------------------- environment.yml | 4 ++- helpers/build-gmt-master.sh | 16 ------------ pygmt/tests/test_clib.py | 2 +- requirements-dev.txt | 2 +- requirements.txt | 2 ++ 6 files changed, 10 insertions(+), 65 deletions(-) delete mode 100644 helpers/build-gmt-master.sh diff --git a/.travis.yml b/.travis.yml index 40e44ca7788..8660266096f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,6 @@ language: generic # Use the container builds so we don't need sudo privileges sudo: false -cache: - directories: - - gmt-master/build - # Only build pushes to the master branch and tags. This avoids the double # builds than happen when working on a branch instead of a fork. branches: @@ -18,36 +14,6 @@ branches: # Regex to build tagged commits with version numbers - /\d+\.\d+(\.\d+)?(\S*)?$/ -# Set the Ubuntu version for the Linux builds -dist: xenial - -# GMT dependencies for the Linux and OSX builds -addons: - apt: - packages: - - cmake - - build-essential - - ninja-build - - libcurl4-gnutls-dev - - libnetcdf-dev - - libgdal-dev - - libfftw3-dev - - libpcre3-dev - - liblapack-dev - - ghostscript - - curl - homebrew: - update: true - packages: - - cmake - - ninja - - netcdf - - gdal - - fftw - - pcre2 - - ghostscript - - curl - # Define environment variables common to all builds env: global: @@ -57,15 +23,11 @@ env: # TWINE_PASSWORD to deploy to PyPI - secure: "md4fgPt9RC/sCoN5//5PcNHLUd9gWQGewV5hFpWW88MRTjxTng1Zfs8r7SqlF2AkEEepFfyzq0BEe9c3FMAnFbec3KmqdlQen4V8xDbLrcTlvkPlTrYGbAScUvdhhqojB//hMHoTD4KvxAv9CiUwFBO4hCMmj2buWHUbV9Ksu5WCW9mF/gkt/hIuYAU6Mbwt8PiYyMgUpzMHO1vruofcWRaVnvKwmBqHB0ae86D4/drpwn4CWjlM12WUnphT2bssiyPkw24FZtCN6kPVta6bLZKBxu0bZpw2vbXuUG+Yh19Q4mp8wNYT3XSHJf8Hl5LfujF48+cLWu+6rlCkdcelyVylhWLFc3rGOONAv4G8jWW2yNSz/bLQfJnMpd81fQEu5eySmFxB7mdB0uyKpvIG1jMJQ73LlYKakKLAPdYhMFyQAHoX9gvCE3S4QR95DBMi5gM/pZubOCcMLdjPHB5JKpJHSjxbOzyVwgmsUIEgd5Bi2vZvvYQXn1plk4xpQ3PhXc+/gi33bzY89mKcfOn0HJ2pD1vLqDXRCBsMCakoLZ0JB/6bacaz4FngbsGWuQ+I1cz20lJGL/MSi9bW1G7Uoidt3GXXWDmXrWt70vIXlLIxr8XV0Mu/rPbauGgWE+ZSYEfvdM5sP+FNF7vQ5de+Fkvzg5Z3tTfR+O1W+d7+vM4=" - TWINE_USERNAME=Leonardo.Uieda - # Paths for GMT installation - - INSTALLDIR="$HOME/gmt-install-dir" - - COASTLINEDIR="$INSTALLDIR/coast" - - PATH="$INSTALLDIR/bin:$PATH" - - LD_LIBRARY_PATH="$INSTALLDIR/lib:$LD_LIBRARY_PATH" - - GMT_LIBRARY_PATH="$INSTALLDIR/lib" # The file with the listed requirements to be installed by conda - CONDA_REQUIREMENTS=requirements.txt - CONDA_REQUIREMENTS_DEV=requirements-dev.txt + # Enable the development channel so we can get GMT 6.0.0 before it's released + - CONDA_EXTRA_CHANNEL=conda-forge/label/dev # These variables control which actions are performed in a build - TEST=false - CHECK=false @@ -79,7 +41,7 @@ matrix: - name: "Style checks" os: linux env: - - PYTHON=3.6 + - PYTHON=3.7 - CHECK=true - CONDA_INSTALL_EXTRA="black flake8 pylint=2.2.2" - CONDA_REQUIREMENTS="" @@ -113,11 +75,6 @@ matrix: - BUILD_DOCS=true before_install: - # Build and install GMT from the master branch - - if [ "$TEST" == "true" ]; then - bash helpers/build-gmt-master.sh; - fi - - cd "$TRAVIS_BUILD_DIR" # Get the Fatiando CI scripts - git clone --branch=1.1.1 --depth=1 https://github.com/fatiando/continuous-integration.git # Download and install miniconda and setup dependencies diff --git a/environment.yml b/environment.yml index 990306c000b..d01c994f6f8 100644 --- a/environment.yml +++ b/environment.yml @@ -1,8 +1,10 @@ name: pygmt channels: - conda-forge + - defaults + - conda-forge/label/dev dependencies: - - python=3.6 + - python=3.7 - pip - numpy - pandas diff --git a/helpers/build-gmt-master.sh b/helpers/build-gmt-master.sh deleted file mode 100644 index 2fbbba405b0..00000000000 --- a/helpers/build-gmt-master.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Download and build the GMT master branch. Used by TravisCI. - -set -e - -mkdir -p "$INSTALLDIR" -mkdir -p "$COASTLINEDIR" -git clone --depth=1 --branch=master https://github.com/GenericMappingTools/gmt.git tmp -mkdir -p gmt-master -cp -r tmp/* gmt-master -rm -rf tmp -cd gmt-master -bash ci/download-coastlines.sh -TEST=false bash ci/build-gmt.sh - -set +e diff --git a/pygmt/tests/test_clib.py b/pygmt/tests/test_clib.py index f507f16d034..2014ae70917 100644 --- a/pygmt/tests/test_clib.py +++ b/pygmt/tests/test_clib.py @@ -791,7 +791,7 @@ def test_get_default(): with clib.Session() as lib: assert lib.get_default("API_GRID_LAYOUT") in ["rows", "columns"] assert int(lib.get_default("API_CORES")) >= 1 - assert Version(lib.get_default("API_VERSION")) >= Version("6.0.0") + assert Version(lib.get_default("API_VERSION")) >= Version("6.0.0rc1") def test_get_default_fails(): diff --git a/requirements-dev.txt b/requirements-dev.txt index e800709af5a..5c9c72a185f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -# The following are required for development purposes +# Requirements for development using conda ipython matplotlib jupyter diff --git a/requirements.txt b/requirements.txt index a48d04757a9..7fa49cc889a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ +# Requirements for installing with conda +gmt=6.0.0rc1 numpy pandas xarray