diff --git a/doc/install.rst b/doc/install.rst index 2bc815f372a..4993fc54a1b 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -19,7 +19,7 @@ Which Python? You'll need **Python 3.6 or greater** to run PyGMT. -We recommend using the `Anaconda `__ Python +We recommend using the `Anaconda `__ Python distribution to ensure you have all dependencies installed and the ``conda`` package manager available. Installing Anaconda does not require administrative rights to your computer and @@ -29,14 +29,23 @@ doesn't interfere with any other Python installations in your system. Which GMT? ---------- -You'll need the latest development version available from -`the GitHub repository `__. -PyGMT is based on GMT 6, **which has not yet been officially released**. +PyGMT requires GMT 6 as a minimum, which you can find the latest development version +at `this GitHub repository `__. We need the very latest GMT since there are many changes being made to GMT itself in response to the development of PyGMT, mainly the new -`modern execution mode `__. +`modern execution mode `__. +**GMT 6 has not been officially released yet**, but will be soon! +In the meantime, GMT does provide compiled conda packages of their development version +for Linux, Mac and Windows through +`conda-forge `__. +Advanced users can also +`build GMT from source `__ +instead, which is not so recommended but we would love to get feedback from anyone who +tries. + +We recommend following the instructions further on to install GMT 6. Dependencies ------------ @@ -53,44 +62,38 @@ The following are optional (but recommended) dependencies: * `IPython `__: For embedding the figures in Jupyter notebooks. -Installing GMT --------------- - -Unfortunately, you'll have to build GMT from source in order to get PyGMT working. -Please follow the `GMT Building Instructions `__. - -For Windows users, you can also try to install the binaries of -GMT development version, available from http://w3.ualg.pt/~jluis/mirone/downloads/gmt.html. -Currently, we don't have tests running on Windows yet, so things might be broken. -Please report any errors by `creating an issue on Github `__. - -.. note:: - - We used to maintain conda packages for the latest GMT. That caused many problems and - was very difficult to maintain updated. We have opted to not do that anymore so that - we can develop more quickly. Once GMT 6 is officially released, we'll have conda - packages available again. Please bear with us. - -Installing dependencies ------------------------ +Installing GMT and other dependencies +------------------------------------- -Before installing PyGMT, we must install its dependencies. +Before installing PyGMT, we must install GMT itself along with the other dependencies. The easiest way to do this is using the ``conda`` package manager. We recommend working in an isolated -`conda environment `__ +`conda environment `__ to avoid issues with competing versions of its dependencies. -We can create a new conda environment with Python and all our dependencies installed +First, we must configure conda to get packages from the +`conda-forge channel `__ (the order is important):: + + conda config --prepend channels conda-forge/label/dev + conda config --prepend channels conda-forge + +Now we can create a new conda environment with Python and all our dependencies installed (we'll call it ``pygmt`` but you can change it to whatever you want):: - conda create --name pygmt python=3.6 pip numpy pandas xarray packaging + conda create --name pygmt python=3.6 pip numpy pandas xarray packaging gmt=6.0.0rc* Activate the environment by running:: - source activate pygmt + conda activate pygmt + +From now on, all commands will take place inside the conda virtual environment and won't +affect your default installation. + +.. note:: -From now on, all commands will take place inside the environment and won't affect your -default installation. + **Currently, this has only been tested to work on Linux and macOS.** + We don't have tests running on Windows yet, so things might be broken. + Please report any errors by `creating an issue on Github `__. Installing PyGMT ---------------- diff --git a/pygmt/clib/session.py b/pygmt/clib/session.py index c641c5d8a57..b03c3cdfa0a 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.0rc1. + version < 6.0.0rc4. 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.0rc1" + required_version = "6.0.0rc4" @property def session_pointer(self): @@ -463,7 +463,7 @@ def call_module(self, module, args): Parameters ---------- module : str - Module name (``'pscoast'``, ``'psbasemap'``, etc). + Module name (``'coast'``, ``'basemap'``, etc). args : str String with the command line arguments that will be passed to the module (for example, ``'-R0/5/0/10 -JM'``). diff --git a/pygmt/tests/test_clib.py b/pygmt/tests/test_clib.py index 2014ae70917..f1955e1eed8 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.0rc1") + assert Version(lib.get_default("API_VERSION")) >= Version("6.0.0rc4") def test_get_default_fails(): diff --git a/pygmt/tests/test_session_management.py b/pygmt/tests/test_session_management.py index 880ccd45c77..e69f24ec49b 100644 --- a/pygmt/tests/test_session_management.py +++ b/pygmt/tests/test_session_management.py @@ -15,7 +15,7 @@ def test_begin_end(): end() # Kill the global session begin() with Session() as lib: - lib.call_module("psbasemap", "-R10/70/-3/8 -JX4i/3i -Ba") + lib.call_module("basemap", "-R10/70/-3/8 -JX4i/3i -Ba") end() begin() # Restart the global session assert os.path.exists("pygmt-session.pdf") diff --git a/requirements.txt b/requirements.txt index 7fa49cc889a..f5ba5f87988 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # Requirements for installing with conda -gmt=6.0.0rc1 +gmt=6.0.0rc4 numpy pandas xarray