blob: d94abf482ed860a86ae01804338dc620e1970975 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
|
.. include:: ../icons.rst
.. _devenv:
##################################
Creating a Development Environment
##################################
This describes how to setup a development environment for working on a project
that uses PyGObject, or for working on PyGObject itself. Please follow the
instructions on ":ref:`gettingstarted`" first, as they are a pre-requirement.
.. _pipenv-setup:
************
Pipenv Setup
************
.. _install-dependencies:
Install Dependencies
====================
In order to compile Python and pip install pygobject, dependencies are need for
your operating system.
=========================================== ======================================== ==============================================
|ubuntu-logo| :ref:`Ubuntu <ubuntu-dep>` |fedora-logo| :ref:`Fedora <fedora-dep>` |arch-logo| :ref:`Arch Linux <arch-dep>`
|windows-logo| :ref:`Windows <windows-dep>` |macosx-logo| :ref:`macOS <macosx-dep>` |opensuse-logo| :ref:`openSUSE <opensuse-dep>`
=========================================== ======================================== ==============================================
.. _ubuntu-dep:
|ubuntu-logo| Ubuntu / |debian-logo| Debian
-------------------------------------------
.. code:: console
sudo apt-get install -y python3-venv python3-wheel
sudo apt-get install -y libgirepository1.0-dev build-essential \
libbz2-dev libreadline-dev libssl-dev zlib1g-dev libsqlite3-dev wget \
curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev
.. _fedora-dep:
|fedora-logo| Fedora
--------------------
.. code:: console
sudo dnf install -y python3-venv python3-wheel
sudo dnf install -y gcc zlib-devel bzip2 bzip2-devel readline-devel \
sqlite sqlite-devel openssl-devel tk-devel git python3-cairo-devel \
cairo-gobject-devel gobject-introspection-devel
.. _arch-dep:
|arch-logo| Arch Linux
----------------------
.. code:: console
sudo pacman -S --noconfirm python-virtualenv python-wheel
sudo pacman -S --noconfirm base-devel openssl zlib git gobject-introspection
.. _opensuse-dep:
|opensuse-logo| openSUSE
------------------------
.. code:: console
sudo zypper install -y python3-venv python3-wheel gobject-introspection \
python3-cairo-devel openssl zlib git
sudo zypper install --type pattern devel_basis
.. _windows-dep:
|windows-logo| Windows
----------------------
.. code:: console
pacman -S --needed --noconfirm base-devel mingw-w64-i686-toolchain git \
mingw-w64-i686-python3 mingw-w64-i686-python3-cairo \
mingw-w64-i686-gobject-introspection mingw-w64-i686-libffi
.. _macosx-dep:
|macosx-logo| macOS
-------------------
No extra dependencies needed.
.. _install-pyenv:
Install `pyenv`_
================
`pyenv`_ lets you easily switch between multiple versions of Python.
============================================= =========================================
|linux-logo| :ref:`Linux <linux-pyenv>` |macosx-logo| :ref:`macOS <macosx-pyenv>`
|windows-logo| :ref:`Windows <windows-pyenv>`
============================================= =========================================
.. _linux-pyenv:
|linux-logo| Linux
------------------
.. code:: console
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
source ~/.bashrc
pyenv install 3.6.4
.. _windows-pyenv:
|windows-logo| Windows
----------------------
TODO: currently no way to install `pyenv`_ in Windows. So we'll use a normal
`virtualenv`_ instead.
.. code:: console
virtualenv --python 3 myvenv
source myvenv/bin/activate
.. _macosx-pyenv:
|macosx-logo| macOS
-------------------
.. code:: console
brew install pyenv
pyenv install 3.6.4
.. _install-pipsi:
Install `pipsi`_
================
`pipsi`_ is a wrapper around virtualenv and pip which installs
scripts provided by python packages into separate virtualenvs to shield them
from your system and each other. We'll use this to install pipenv.
============================================= =========================================
|linux-logo| :ref:`Linux <linux-pipsi>` |macosx-logo| :ref:`macOS <macosx-pipsi>`
|windows-logo| :ref:`Windows <windows-pipsi>`
============================================= =========================================
.. _linux-pipsi:
|linux-logo| Linux
------------------
.. code:: console
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python3 - --src=git+https://github.com/mitsuhiko/pipsi.git\#egg=pipsi
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
pipsi install pew
pipsi install pipenv
.. _windows-pipsi:
|windows-logo| Windows
----------------------
.. code:: console
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python3 - --src=git+https://github.com/mitsuhiko/pipsi.git\#egg=pipsi
Add C:/\Users/\.local/\bin to your path via Control Panel->All Control Panel
Items->System->Advanced System Setttings->Environment Variables
.. code:: console
pipsi install pew
pipsi install pipenv
.. _macosx-pipsi:
|macosx-logo| macOS
-------------------
With homebrew:
.. code:: console
brew install pipenv
With pipsi:
.. code:: console
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python3 - --src=git+https://github.com/mitsuhiko/pipsi.git\#egg=pipsi
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
pipsi install pew
pipsi install pipenv
.. _projects-pygobject-dependencies:
************************************
Projects with PyGObject Dependencies
************************************
If you are going to work on a project that has PyGObject as a dependency, then
do the following additional steps:
.. code:: console
git clone <url/projectname.git>
cd projectname
pipenv --python 3
pipenv install pycairo
pipenv install pygobject
pipenv shell
.. _work-on-pygobject:
*****************
Work on PyGObject
*****************
.. _platform-ind-steps:
Platform Independent Steps
==========================
If you are going to work on developing PyGObject itself, then do the following
additional steps:
.. code:: console
git clone https://gitlab.gnome.org/GNOME/pygobject.git
cd pygobject
pipenv --python 3
pipenv install pytest
pipenv install flake8
pipenv shell
.. _additional-platform-steps:
Additional Steps Per Platform
=============================
================================================= ============================================== ====================================================
|ubuntu-logo| :ref:`Ubuntu <ubuntu-pygobject>` |fedora-logo| :ref:`Fedora <fedora-pygobject>` |arch-logo| :ref:`Arch Linux <arch-pygobject>`
|windows-logo| :ref:`Windows <windows-pygobject>` |macosx-logo| :ref:`macOS <macosx-pygobject>` |opensuse-logo| :ref:`openSUSE <opensuse-pygobject>`
================================================= ============================================== ====================================================
.. _ubuntu-pygobject:
|ubuntu-logo| Ubuntu / |debian-logo| Debian
-------------------------------------------
.. code:: console
sudo apt build-pygobject pygobject
sudo apt install autoconf-archive
./autogen.sh
make
make check
.. _fedora-pygobject:
|fedora-logo| Fedora
--------------------
.. code:: console
sudo dnf build pygobject
./autogen.sh
make
make check
.. _arch-pygobject:
|arch-logo| Arch Linux
----------------------
.. code:: console
makepkg -s pygobject
./autogen.sh
make
make check
.. _opensuse-pygobject:
|opensuse-logo| openSUSE
------------------------
.. code:: console
sudo zypper si -d python3-gobject
./autogen.sh
make
make check
.. _windows-pygobject:
|windows-logo| Windows
----------------------
.. code:: console
pacman -S --needed --noconfirm autoconf-archive
./autogen.sh
make
make check
.. _macosx-pygobject:
|macosx-logo| macOS
-------------------
.. code:: console
./autogen.sh
make
make check
.. _pyenv: https://github.com/pyenv/pyenv
.. _pipsi: https://github.com/mitsuhiko/pipsi
.. _pipenv: https://github.com/pypa/pipenv
.. _virtualenv: https://www.virtualenv.org
|