File: platforms.rst

package info (click to toggle)
plotpy 2.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,332 kB
  • sloc: python: 36,341; cpp: 2,005; sh: 32; makefile: 3
file content (164 lines) | stat: -rw-r--r-- 4,902 bytes parent folder | download
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
.. _platforms:

Reference test platforms
------------------------

The following sections describe the reference platforms for the project.

.. note::

    The officially supported Python versions are 3.9, 3.10, 3.11, 3.12 and 3.13.

    The officially supported Qt binding is PyQt5. However, efforts have been
    made and will continue to be made to support PyQt6 and PySide6 as well.

    The project is currently tested on the following platforms:

    * Microsoft Windows 10 (64-bit)
    * Microsoft Windows 11 (64-bit)
    * CentOS Stream 8.8 (64-bit)
    * Ubuntu 22.04 LTS (64-bit)

    However, it should work on any other platform supported by its dependencies.

About requirements
^^^^^^^^^^^^^^^^^^

The ``requirements.txt`` mentioned in the following sections is a text file which
contains the list of all the Python packages required for building up the projet
environment. It is used by the ``pip`` command to install all the dependencies.

The ``requirements.txt`` file is generated automatically by the
``toml-to-requirements`` tool. It is based on the ``pyproject.toml`` file
which is the reference file for the project dependencies.

.. warning::

    Please note that the generation is not systematic and the ``requirements.txt``
    file may not be up-to-date.

To update the ``requirements.txt`` file, you need to install the
``toml-to-requirements`` and execute the following command:

.. code-block:: bash

    toml-to-req --toml-file .\pyproject.toml --include-optional


Microsoft Windows 10
^^^^^^^^^^^^^^^^^^^^

First, install the latest version of Python 3.10 from the WinPython project.

.. note::

    At the time of writing, the latest version is 3.10.11.1 which can be
    download from `here <https://sourceforge.net/projects/winpython/files/WinPython_3.10/3.10.11.1/Winpython64-3.10.11.1dot.exe/download>`_.

Then install all the requirements using the following command from the WinPython
command prompt:

.. code-block:: bash

    pip install -r requirements.txt

Finally, build the Cython and C++ extensions using the following command (at this
stage, you may need to install the Microsoft Visual C++ Build Tools):

.. code-block:: bash

    python setup.py build_ext --inplace

That's it, you can now run the tests using the following command:

.. code-block:: bash

    pytest plotpy

If you want to rely on Visual Studio Code for editing and take advantage of the
project settings and tasks, you will need to set the following environment variable:

.. code-block:: bash

    set PPSTACK_PYTHONEXE=C:\WPy64-31110\python-3.11.1.amd64\python.exe

CentOS Stream 8.8
^^^^^^^^^^^^^^^^^

.. note::

    The following instructions have been tested on CentOS Stream which is the
    reference platform for the project. However, they should work on
    any other Linux distribution relying on the ``yum`` package manager.
    As for the other distributions, you may need to adapt the instructions
    to your specific environment (e.g. use ``apt-get`` instead of ``yum``).

First, install the prerequisites:

.. code-block:: bash

    sudo yum install groupinstall "Development Tools" -y
    sudo yum install openssl-devel.i686 libffi-devel.i686 bzip2-devel.i686 sqlite-devel -y

Check that ``gcc`` is installed and available in the ``PATH`` environment variable:

.. code-block:: bash

    gcc --version

Install OpenSSL 1.1.1:

.. code-block:: bash

    wget https://www.openssl.org/source/openssl-1.1.1v.tar.gz
    tar -xvf openssl-1.1.1v.tar.gz
    cd openssl-1.1.1v
    ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic
    make
    sudo make install
    openssl version
    which openssl
    cd ..

Install Python 3.10.13 (the latest 3.10 version at the time of writing):

.. code-block:: bash

    wget https://www.python.org/ftp/python/3.10.13/Python-3.10.13.tgz
    tar -xvf Python-3.10.13.tgz
    cd Python-3.10.13
    ./configure --enable-optimizations --with-openssl=/usr --enable-loadable-sqlite-extensions
    sudo make altinstall
    cd ..

Eventually add the ``/usr/local/bin`` directory to the ``PATH`` environment variable
if Python has warned you about it:

.. code-block:: bash

    sudo echo 'pathmunge /usr/local/bin' > /etc/profile.d/py310.sh
    chmod +x /etc/profile.d/py310.sh
    . /etc/profile  # or logout and login again (reload the environment variables)
    echo $PATH  # check that /usr/local/bin is in the PATH

Create a virtual environment and install the requirements:

.. code-block:: bash

    python3.10 -m venv plotpy-venv
    source plotpy-venv/bin/activate
    pip install --upgrade pip
    pip install -r requirements.txt

Finally, build the Cython and C++ extensions using the following command:

.. code-block:: bash

    cd ~/path_to_plotpy_repo
    python setup.py build_ext --inplace

That's it, you can now run the tests using the following command:

.. code-block:: bash

    pytest plotpy