Skip to content

Commit e24879f

Browse files
claudiodsfleouieda
authored andcommitted
Fixes for using GMT 6.0.0rc1 (#311)
Update the required version check to match the release candidate. Use the conda-forge provided packages when testing on CI and in the conda environment. Fixes #310
1 parent 997b88c commit e24879f

File tree

7 files changed

+13
-67
lines changed

7 files changed

+13
-67
lines changed

.travis.yml

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ language: generic
66
# Use the container builds so we don't need sudo privileges
77
sudo: false
88

9-
cache:
10-
directories:
11-
- gmt-master/build
12-
139
# Only build pushes to the master branch and tags. This avoids the double
1410
# builds than happen when working on a branch instead of a fork.
1511
branches:
@@ -18,35 +14,6 @@ branches:
1814
# Regex to build tagged commits with version numbers
1915
- /\d+\.\d+(\.\d+)?(\S*)?$/
2016

21-
# Set the Ubuntu version for the Linux builds
22-
dist: xenial
23-
24-
# GMT dependencies for the Linux and OSX builds
25-
addons:
26-
apt:
27-
packages:
28-
- cmake
29-
- build-essential
30-
- ninja-build
31-
- libcurl4-gnutls-dev
32-
- libnetcdf-dev
33-
- libgdal-dev
34-
- libfftw3-dev
35-
- libpcre3-dev
36-
- liblapack-dev
37-
- ghostscript
38-
- curl
39-
homebrew:
40-
packages:
41-
- cmake
42-
- ninja
43-
- netcdf
44-
- gdal
45-
- fftw
46-
- pcre2
47-
- ghostscript
48-
- curl
49-
5017
# Define environment variables common to all builds
5118
env:
5219
global:
@@ -56,15 +23,11 @@ env:
5623
# TWINE_PASSWORD to deploy to PyPI
5724
- secure: "md4fgPt9RC/sCoN5//5PcNHLUd9gWQGewV5hFpWW88MRTjxTng1Zfs8r7SqlF2AkEEepFfyzq0BEe9c3FMAnFbec3KmqdlQen4V8xDbLrcTlvkPlTrYGbAScUvdhhqojB//hMHoTD4KvxAv9CiUwFBO4hCMmj2buWHUbV9Ksu5WCW9mF/gkt/hIuYAU6Mbwt8PiYyMgUpzMHO1vruofcWRaVnvKwmBqHB0ae86D4/drpwn4CWjlM12WUnphT2bssiyPkw24FZtCN6kPVta6bLZKBxu0bZpw2vbXuUG+Yh19Q4mp8wNYT3XSHJf8Hl5LfujF48+cLWu+6rlCkdcelyVylhWLFc3rGOONAv4G8jWW2yNSz/bLQfJnMpd81fQEu5eySmFxB7mdB0uyKpvIG1jMJQ73LlYKakKLAPdYhMFyQAHoX9gvCE3S4QR95DBMi5gM/pZubOCcMLdjPHB5JKpJHSjxbOzyVwgmsUIEgd5Bi2vZvvYQXn1plk4xpQ3PhXc+/gi33bzY89mKcfOn0HJ2pD1vLqDXRCBsMCakoLZ0JB/6bacaz4FngbsGWuQ+I1cz20lJGL/MSi9bW1G7Uoidt3GXXWDmXrWt70vIXlLIxr8XV0Mu/rPbauGgWE+ZSYEfvdM5sP+FNF7vQ5de+Fkvzg5Z3tTfR+O1W+d7+vM4="
5825
- TWINE_USERNAME=Leonardo.Uieda
59-
# Paths for GMT installation
60-
- INSTALLDIR="$HOME/gmt-install-dir"
61-
- COASTLINEDIR="$INSTALLDIR/coast"
62-
- PATH="$INSTALLDIR/bin:$PATH"
63-
- LD_LIBRARY_PATH="$INSTALLDIR/lib:$LD_LIBRARY_PATH"
64-
- GMT_LIBRARY_PATH="$INSTALLDIR/lib"
6526
# The file with the listed requirements to be installed by conda
6627
- CONDA_REQUIREMENTS=requirements.txt
6728
- CONDA_REQUIREMENTS_DEV=requirements-dev.txt
29+
# Enable the development channel so we can get GMT 6.0.0 before it's released
30+
- CONDA_EXTRA_CHANNEL=conda-forge/label/dev
6831
# These variables control which actions are performed in a build
6932
- TEST=false
7033
- CHECK=false
@@ -78,7 +41,7 @@ matrix:
7841
- name: "Style checks"
7942
os: linux
8043
env:
81-
- PYTHON=3.6
44+
- PYTHON=3.7
8245
- CHECK=true
8346
- CONDA_INSTALL_EXTRA="black flake8 pylint=2.2.2"
8447
- CONDA_REQUIREMENTS=""
@@ -112,11 +75,6 @@ matrix:
11275
- BUILD_DOCS=true
11376

11477
before_install:
115-
# Build and install GMT from the master branch
116-
- if [ "$TEST" == "true" ]; then
117-
bash helpers/build-gmt-master.sh;
118-
fi
119-
- cd "$TRAVIS_BUILD_DIR"
12078
# Get the Fatiando CI scripts
12179
- git clone --branch=1.1.1 --depth=1 https://github.com/fatiando/continuous-integration.git
12280
# Download and install miniconda and setup dependencies

environment.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: pygmt
22
channels:
33
- conda-forge
4+
- defaults
5+
- conda-forge/label/dev
46
dependencies:
5-
- python=3.6
7+
- python=3.7
68
- pip
79
- numpy
810
- pandas

helpers/build-gmt-master.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

pygmt/clib/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Session:
7373
library in the directory specified by it.
7474
7575
A ``GMTVersionError`` exception will be raised if the GMT shared library reports a
76-
version < 6.0.0.
76+
version < 6.0.0rc1.
7777
7878
The ``session_pointer`` attribute holds a ctypes pointer to the currently open
7979
session.
@@ -112,7 +112,7 @@ class Session:
112112
"""
113113

114114
# The minimum version of GMT required
115-
required_version = "6.0.0"
115+
required_version = "6.0.0rc1"
116116

117117
@property
118118
def session_pointer(self):
@@ -177,7 +177,7 @@ def __enter__(self):
177177
if Version(version) < Version(self.required_version):
178178
self.destroy()
179179
raise GMTVersionError(
180-
"Using an incompatible GMT version {}. Must be newer than {}.".format(
180+
"Using an incompatible GMT version {}. Must be equal or newer than {}.".format(
181181
version, self.required_version
182182
)
183183
)

pygmt/tests/test_clib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ def test_get_default():
791791
with clib.Session() as lib:
792792
assert lib.get_default("API_GRID_LAYOUT") in ["rows", "columns"]
793793
assert int(lib.get_default("API_CORES")) >= 1
794-
assert Version(lib.get_default("API_VERSION")) >= Version("6.0.0")
794+
assert Version(lib.get_default("API_VERSION")) >= Version("6.0.0rc1")
795795

796796

797797
def test_get_default_fails():

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# The following are required for development purposes
1+
# Requirements for development using conda
22
ipython
33
matplotlib
44
jupyter

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Requirements for installing with conda
2+
gmt=6.0.0rc1
13
numpy
24
pandas
35
xarray

0 commit comments

Comments
 (0)