[pygobject] Make pip install the default and add dependencies



commit 58a4681362ebdbc6918b0f479cc87f30ee6fca75
Author: Dan Yeaw <dan yeaw me>
Date:   Sun Mar 4 15:16:44 2018 -0500

    Make pip install the default and add dependencies
    
    Signed-off-by: Dan Yeaw <dan yeaw me>

 docs/getting_started.rst | 80 +++++++++++++++++++++++++++---------------------
 1 file changed, 45 insertions(+), 35 deletions(-)
---
diff --git a/docs/getting_started.rst b/docs/getting_started.rst
index fe2a6a44..030af55e 100644
--- a/docs/getting_started.rst
+++ b/docs/getting_started.rst
@@ -22,8 +22,15 @@ the following content and save it somewhere:
     window.connect("destroy", Gtk.main_quit)
     Gtk.main()
 
-Before we can run the example application we need to install PyGObject, GTK+
-and their dependencies. Follow the instructions for your platform below.
+
+.. _pypi:
+
+|python-logo| From PyPI
+-----------------------
+Before we can run the example application we need to install PyGObject, GTK+ and
+their dependencies. Although not strictly required, the recommend way to run
+PyGObject is from within a virtual environment and using pip. Follow the
+instructions for your platform below.
 
 ======================================= ==================================== 
==================================== ==========================================
 |ubuntu-logo| :ref:`Ubuntu <ubuntu>`    |fedora-logo| :ref:`Fedora <fedora>` |arch-logo| :ref:`Arch Linux 
<arch>` |opensuse-logo| :ref:`openSUSE <opensuse>`
@@ -39,7 +46,7 @@ and their dependencies. Follow the instructions for your platform below.
 1) Go to http://www.msys2.org/ and download the x86_64 installer
 2) Follow the instructions on the page for setting up the basic environment
 3) Run ``C:\msys64\mingw32.exe`` - a terminal window should pop up
-4) Execute ``pacman -S mingw-w64-i686-gtk3 mingw-w64-i686-python2-gobject mingw-w64-i686-python3-gobject``
+4) Execute ``pacman -S mingw-w64-i686-gtk3 mingw-w64-i686-python2-gobject mingw-w64-i686-python3-gobject 
mingw-w64-i686-gobject-introspection``
 5) To test that GTK+3 is working you can run ``gtk3-demo``
 6) Copy the ``hello.py`` script you created to ``C:\msys64\home\<username>``
 7) In the mingw32 terminal execute ``python3 hello.py`` - a window should appear.
@@ -54,9 +61,13 @@ and their dependencies. Follow the instructions for your platform below.
 -------------------------------------------
 
 1) Open a terminal
-2) Execute ``sudo apt install python-gi python-gi-cairo python3-gi python3-gi-cairo gir1.2-gtk-3.0``
-3) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``)
-4) Run ``python3 hello.py``
+2) Execute ``sudo apt install python-gi python-gi-cairo python3-gi python3-gi-cairo gir1.2-gtk-3.0 
libgirepository1.0-dev``
+3) Execute ``virtualenv --python=python3 myvenv``
+4) Execute ``source myvenv/bin/activate``
+5) Execute ``pip install pycairo``
+6) Execute ``pip install pygobject``
+7) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``)
+8) Run ``python3 hello.py``
 
 .. figure:: images/start_linux.png
     :scale: 60%
@@ -68,9 +79,13 @@ and their dependencies. Follow the instructions for your platform below.
 --------------------
 
 1) Open a terminal
-2) Execute ``sudo dnf install pygobject3 python3-gobject gtk3``
-3) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``)
-4) Run ``python3 hello.py``
+2) Execute ``sudo dnf install pygobject3 python3-gobject gtk3 gobject-introspection-devel 
python3-cairo-devel cairo-gobject-devel``
+3) Execute ``virtualenv --python=python3 myvenv``
+4) Execute ``source myvenv/bin/activate``
+5) Execute ``pip install pycairo``
+6) Execute ``pip install pygobject``
+7) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``)
+8) Run ``python3 hello.py``
 
 
 .. _arch:
@@ -79,9 +94,13 @@ and their dependencies. Follow the instructions for your platform below.
 ----------------------
 
 1) Open a terminal
-2) Execute ``sudo pacman -S python-gobject python2-gobject gtk3``
-3) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``)
-4) Run ``python3 hello.py``
+2) Execute ``sudo pacman -S python-gobject python2-gobject gtk3 gobject-introspection``
+3) Execute ``virtualenv --python=python3 myvenv``
+4) Execute ``source myvenv/bin/activate``
+5) Execute ``pip install pycairo``
+6) Execute ``pip install pygobject``
+7) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``)
+8) Run ``python3 hello.py``
 
 
 .. _opensuse:
@@ -90,9 +109,13 @@ and their dependencies. Follow the instructions for your platform below.
 ------------------------
 
 1) Open a terminal
-2) Execute ``sudo zypper install python-gobject python3-gobject gtk3``
-3) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``)
-4) Run ``python3 hello.py``
+2) Execute ``sudo zypper install python-gobject python3-gobject gtk3 gobject-introspection 
python3-cairo-devel cairo-gobject-devel``
+3) Execute ``virtualenv --python=python3 myvenv``
+4) Execute ``source myvenv/bin/activate``
+5) Execute ``pip install pycairo``
+6) Execute ``pip install pygobject``
+7) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``)
+8) Run ``python3 hello.py``
 
 
 .. _macosx:
@@ -103,26 +126,13 @@ and their dependencies. Follow the instructions for your platform below.
 1) Go to https://brew.sh/ and install homebrew
 2) Open a terminal
 3) Execute ``brew install pygobject3 --with-python3 gtk+3`` to install for both python2 and python3
-4) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``)
-5) Run ``python3 hello.py``
+4) Execute ``brew install gobject-introspection``
+5) Execute ``virtualenv --python=python3 myvenv``
+6) Execute ``source myvenv/bin/activate``
+7) Execute ``pip install pycairo``
+8) Execute ``pip install pygobject``
+9) Change the directory to where your ``hello.py`` script can be found (e.g. ``cd Desktop``)
+10) Run ``python3 hello.py``
 
 .. figure:: images/start_macos.png
     :scale: 70%
-
-
-.. _pypi:
-
-|python-logo| From PyPI
------------------------
-
-PyGObject is also available on PyPI: https://pypi.org/project/PyGObject
-
-For this approach you have to make sure that all runtime and build
-dependencies are present yourself as pip will only take care of pycairo.
-
-.. code::
-
-    virtualenv --python=python3 myvenv
-    source myvenv/bin/activate
-    pip install pygobject
-    python hello.py


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]