Skip to content

Commit 18de0ef

Browse files
authored
Docs: simplified installation instructions (#567)
Also: - improved contributing instructions - updated deps (including fix for pytest-benchmark compatibility with pytest 7.2)
1 parent 9619919 commit 18de0ef

File tree

6 files changed

+167
-240
lines changed

6 files changed

+167
-240
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ Release date: UNRELEASED
99
* The `layout` command now properly handles the `tight` special case by fitting the page size around the existing geometries, accommodating for a margin if provided (#556)
1010
* Added new units (`yd`, `mi`, and `km`) (#541)
1111
* Added `inch` unit as a synonym to `in`, useful for expressions (in which `in` is a reserved keyword) (#541)
12-
* Migrated to PySide6 (from PySide2), which simplifies installation on Apple silicon Macs (#552, #559)
12+
* Migrated to PySide6 (from PySide2), which simplifies installation on Apple silicon Macs (#552, #559, #567)
1313

1414
### Bug fixes
1515

1616
* Fixed a viewer issue where page width/height of 0 would lead to errors and a blank display (#555)
17-
* Fixed a viewer issue where fitting the document bounds would be lost when bounds change (*vsketch* only) (#564)
17+
* Fixed a viewer issue where fitting the view to the document would not adjust when page size changes (*vsketch* only) (#564)
1818

1919
### API changes
2020

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,13 @@ TL;DR:
194194
```bash
195195
pipx install "vpype[all]"
196196
```
197-
- Installing on M1 Mac requires special care — check the [installation instruction](https://vpype.readthedocs.io/en/latest/install.html#installing-using-pipx-apple-silicon-m1).
198-
- A Windows installer is available [here](https://github.com/abey79/vpype/releases) (plug-ins cannot be installed
199-
when using this installation method).
197+
- A Windows installer is available [here](https://github.com/abey79/vpype/releases), but plug-ins cannot be installed
198+
when using this method).
200199
- A CLI-only version of *vpype* can be installed using the following command:
201200
```bash
202201
pipx install vpype
203202
```
204-
This version does not include the [`show`](https://vpype.readthedocs.io/en/latest/reference.html#show) command but does not require some of the dependencies which are more difficult or impossible to install on some platforms (such as matplotlib, PySide2, and ModernGL).
203+
This version does not include the [`show`](https://vpype.readthedocs.io/en/latest/reference.html#show) command but does not require some of the dependencies which are more difficult or impossible to install on some platforms (such as matplotlib, PySide6, and ModernGL).
205204

206205

207206
## Documentation

docs/contributing.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Contributions are most welcome and there are many ways you can help regardless
1111

1212
* First and foremost, do provide feedback on what you do with *vpype* and how you do it, either on the `DrawingBots Discord server`_ or by filling an `issue`_. This knowledge is critically important to improve *vpype*.
1313
* Write an `issue`_ for any problem or friction point you encounter during the installation or use of *vpype* or for any feature you feel is missing.
14-
* Make the present documentation better by fixing typos and improve the quality of the text (English is *not* the main author's native language).
14+
* Make the present documentation better by fixing typos and improve the quality of the text (English is *not* the main author's native language). `This issue <https://github.com/abey79/vpype/issues/400>`__ maintains a list of possible improvements.
1515
* Write cookbook recipes for new workflows.
1616
* Improving the test coverage and contributing to CI/CD aspects is welcome — and a good way to become familiar with the code.
1717
* Improve existing features or contribute entirely new ones with a `pull request`_. If you plan on creating new commands, consider making a :ref:`plugin <plugins>` first — it will be easy to integrate it into *vpype*'s codebase later on if it makes sense.
@@ -40,33 +40,34 @@ Development environment
4040
<https://python-poetry.org/docs/#installation>`_ is required to prepare the development environment. It can be
4141
installed either using an install script, or using pipx. Run this command to use the install script::
4242

43-
$ curl -sSL https://install.python-poetry.org | python3 -
43+
curl -sSL https://install.python-poetry.org | python3 -
4444
4545
Run this command for a pipx install::
4646

47-
$ pipx install poetry
47+
pipx install poetry
4848

4949
See Poetry's `installation instructions <https://python-poetry.org/docs/#installation>`__ for more information.
5050

5151
You can then download *vpype*, prepare a virtual environment and install all dependencies with a few commands::
5252

53-
$ git clone https://github.com/abey79/vpype.git
54-
$ cd vpype
55-
$ poetry install -E all
53+
git clone https://github.com/abey79/vpype
54+
cd vpype
55+
poetry install -E all --with docs
5656

5757
You can execute *vpype* (which installed in the project's virtual environment managed by Poetry) with the ``poetry
5858
run`` command::
5959

60-
$ poetry run vpype --help
60+
poetry run vpype --help
6161

6262
Alternatively, you can activate the virtual environment and then directly use *vpype*::
6363

64-
$ poetry shell
65-
$ vpype --help
64+
poetry shell
65+
vpype --help
6666

6767
Running the tests
6868
=================
6969

7070
You can run tests with the following command::
7171

72-
$ poetry run pytest
72+
poetry run pytest
73+

docs/install.rst

Lines changed: 58 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -9,152 +9,70 @@ This page explain how to install *vpype* for end-users. If you intend to develop
99

1010
.. note::
1111

12-
The recommended Python version is 3.10.2 or later (except for macOS/M1 computer, for which Python 3.9 is recommended). *vpype* is also compatible with Python 3.8 and 3.9.
12+
The recommended Python version is 3.10.2 or later. *vpype* is also compatible with Python 3.8 and 3.9.
1313

14-
..
15-
Overview
16-
========
14+
.. warning::
1715

18-
This table provides an overview of the available methods to install *vpype*. The recommended method is using `pipx`_.
19-
20-
.. csv-table::
21-
:header: Installation Method, macOS, Windows, Linux, Note
22-
:widths: 12, 5, 5, 5, 18
23-
24-
`pipx`_, ✅ , ✅, ✅, "| ✅ recommended method
25-
| ⚠️ see instruction for macOS/M1"
26-
`pip`_ (global installation), ✅, ✅, ✅, ⚠️⚠️⚠️ **strongly discouraged**
27-
`pip`_ (virtual environment), ✅, ✅, ✅, a virtual environment must be manually created *and* activated
28-
installer, 🚫, ✅, 🚫, does not support plug-ins
29-
`MacPorts`_, ✅️, 🚫, 🚫, ⚠️ plug-ins must be installed globally (not recommended)
30-
31-
Installing Python and a Python-based package can be overwhelming for new users. The following glossary shortly defines a few of the key terms and notions.
32-
33-
Python interpreter
34-
Any Python-based package needs a Python interpreter to be executed. A major version of the Python interpreter is released every year. The current one is the Python 3.10 series. In general, using the latest version is recommended but using an older version is sometime necessary. For example, *vpype* requires Python 3.9 to run on macOS/M1 computers.
35-
36-
`pip`_
37-
`pip`_ is the fundamental tool to download and install publicly-available packages like *vpype*. These package are stored in the `Python Package Archive <PyPI>`_ where they can be found by pip. pip automatically download and install all the dependencies required by the package.
38-
39-
Global installation
40-
By default, pip installs packages globally, next to the Python interpreter. Such package become available to all users and software on the computer. Although doing so may sound reasonable, it is in general strongly discouraged because of the very likely risk of conflicts when different packages relies on different version of the same dependencies.
41-
42-
`Virtual Environments <venv>`_
43-
To avoid the conflict issue, packages and their dependencies, a `virtual environments <venv>`_ may be created. They behave like isolated, self-contained directory which contains both the Python interpreter, the desired package, and its dependencies. Multiple virtual environments can be used for different tasks, avoiding all risks of conflicts. When using `pip`_, packages will be installed in a given virtual environment *if (and only if)* said virtual environment was previously activated (activating a virtual environment makes its content available to the current terminal session). Managing and using virtual environments can either be done manually (using the `venv`_ standard Python package), or can be done automatically using some high-level tool.
44-
45-
`pipx`_
46-
`pipx`_ is such a high-level tool and is made to install Python-based CLI software such as *vpype*. Specifically, it automates two important tasks: (1) it automatically creates and manages a virtual environment for every software installed with it and (2) it ensures that the installed software is in the path and thus available in terminal windows.
47-
48-
`MacPorts`_
49-
`MacPorts`_ is a package manager dedicated to the installation of various open-source software and libraries on the Mac platform. It is similar to the packages manager typically found in Linux distributions.
16+
*vpype* is not yet compatible with Python 3.11.
5017

5118

5219
macOS
5320
=====
5421

55-
.. caution::
56-
57-
**macOS/M1 note**: Due to the restricted availability of an ARM-compatible PySide2 library, installing *vpype* on a macOS/M1 computers requires the specific steps described bellow. Using alternative ways to install Python and *vpype* may work, but typically don't and are thus discouraged.
58-
5922
.. highlight:: bash
6023

61-
`MacPorts`_ is the recommended way to install the Python interpreter on macOS.
62-
63-
Following the `installation instructions <https://www.macports.org/install.php>`__ to install MacPorts. Then, make sure its port database is up-to-date::
64-
65-
$ sudo port selfupdate
66-
$ sudo port upgrade outdated
67-
68-
69-
Installing using the MacPorts port
70-
----------------------------------
71-
72-
.. note::
73-
74-
Although this is the easiest way to install *vpype*, it is discouraged when using :ref:`plug-ins <plugins>` because they would have to be globally installed.
75-
76-
Installing *vpype* using the port can be done with the following command::
77-
78-
$ sudo port install vpype
79-
80-
This installation method works for both Intel- and M1-based Macs.
8124

25+
Installing Python
26+
-----------------
8227

83-
Installing using pipx (Apple silicon/M1)
84-
----------------------------------------
28+
The official installer is the recommended way to install Python on your computer. It can be downloaded `here <https://www.python.org/downloads/>`__.
8529

86-
Installing *vpype* on Macs with Apple Silicon requires specific steps because some its dependencies are not yet fully supported on this architecture. Using `pipx`_ is the recommended method when using plug-ins.
87-
88-
First, install the required ports using MacPorts::
89-
90-
$ sudo port install python39 py39-shapely py39-scipy py39-numpy py39-pyside2
91-
92-
Then, install pipx::
93-
94-
$ sudo port install pipx +python39
95-
$ pipx ensurepath
96-
97-
The second command above ensures that both pipx and the software it will install are available the terminal. You may need to close and re-open the terminal window for this to take effect.
30+
.. caution::
9831

99-
Finally, install *vpype*::
32+
When install Python, make sure to select version that is compatible with *vpype*. See the :doc:`top of this page <install>` for more information.
10033

101-
$ pipx install "vpype[all]" --system-site-packages
10234

103-
Note the use of the ``--system-site-packages`` option. This is important because because *vpype* relies the version of PySide2 that was installed earlier with MacPort.
35+
You can ensure that the installed Python interpreter is properly installed by running this command::
10436

105-
*vpype* should now be installed and ready to use. You may check that it is fully functional by checking its version and displaying some random lines::
37+
python3 --version
10638

107-
$ vpype --version
108-
vpype 1.9.0
109-
$ vpype random show
39+
It should produce an output similar to::
11040

41+
Python 3.10.8
11142

112-
Installing using pipx (Intel)
113-
-----------------------------
43+
The version number should match the installer you used.
11444

115-
.. note::
45+
Note that installing Python from `Homebrew <https://brew.sh>`__ or `MacPorts`_ is possible as well.
11646

117-
The instructions for Apple silicon/M1 Macs also apply, but since dependencies have better support for Intel-based Macs, some steps may be simplified.
11847

119-
First, install pipx::
48+
Installing pipx
49+
---------------
12050

121-
$ sudo port install pipx
122-
$ pipx ensurepath
123-
124-
The second command above ensures that both pipx and the software it will install are available the terminal. You may need to close and re-open the terminal window for this to take effect.
51+
`pipx`_ is a tool that allows you to install Python applications in isolated environments. It is the recommended way to install *vpype* on macOS. It can be installed with the following commands::
12552

126-
Then, install *vpype*::
53+
python3 -m pip install pipx
54+
python3 -m pipx ensurepath
12755

128-
$ pipx install "vpype[all]"
56+
After this, restart your terminal and ensure that pipx is properly installed by running this command::
12957

130-
*vpype* should now be installed and ready to use. You may check that it is fully functional by checking its version and displaying some random lines::
58+
pipx --version
13159

132-
$ vpype --version
133-
vpype 1.9.0
134-
$ vpype random show
60+
It should print out the current version of pipx without error::
13561

62+
1.1.0
13663

137-
Installing using pipx and the official Python distribution
138-
----------------------------------------------------------
13964

140-
For Intel-based Macs, the official Python distribution may be used as an alternative to MacPorts. It can be downloaded from the `official Python website <https://www.python.org/downloads/>`_.
65+
Installing *vpype*
66+
------------------
14167

142-
After running the Python installer, install pipx with the following command::
68+
Once pipx is properly installed, you can install *vpype* with the following command::
14369

144-
$ sudo python3 -m pip install pipx
145-
$ pipx ensurepath
70+
pipx install "vpype[all]"
14671

147-
The second command above ensures that both pipx and the software it will install are available the terminal. You may need to close and re-open the terminal window for this to take effect.
72+
*vpype* should now be installed and ready to use. You may check that it is fully functional by checking its version or displaying some random lines::
14873

149-
Then, install *vpype*::
150-
151-
$ pipx install "vpype[all]"
152-
153-
*vpype* should now be installed and ready to use. You may check that it is fully functional by checking its version and displaying some random lines::
154-
155-
$ vpype --version
156-
vpype 1.9.0
157-
$ vpype random show
74+
vpype --version
75+
vpype random show
15876

15977

16078
Windows
@@ -165,88 +83,88 @@ Windows
16583
Installing using the installer
16684
------------------------------
16785

168-
A Windows installer for *vpype* is `available here <https://github.com/abey79/vpype/releases>`__. Although this installation method is the easiest, it **does not** allow plug-ins to be installed. If plug-ins are required, installing using pipx is recommended.
86+
A Windows installer for *vpype* is `available here <https://github.com/abey79/vpype/releases>`__. Although this installation method is the easiest, it **does not** allow :doc:`plug-ins <plugins>` to be installed. If plug-ins are required, installing using pipx is recommended.
16987

17088
Installing using pipx
17189
---------------------
17290

173-
First, Python must be installed. Python 3.10 is recommended, although *vpype* it is also compatible with Python 3.8 and later. The official Python distribution for Windows can be `downloaded here <https://www.python.org/downloads/>`__ or installed from the `App Store <https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5>`_. When installing Python, make sure you enable adding Python to the path.
91+
First, install Python. The official Python distribution for Windows can be `downloaded here <https://www.python.org/downloads/>`__ or installed from the `App Store <https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5>`_. When installing Python, make sure you enable adding Python to the path.
92+
93+
.. caution::
94+
95+
When install Python, make sure to select version that is compatible with *vpype*. See the :doc:`top of this page <install>` for more information.
17496

175-
First, install pipx::
97+
Then, install pipx::
17698

177-
> python -m pip install --user pipx
178-
> pipx ensurepath
99+
python -m pip install --user pipx
100+
pipx ensurepath
179101

180102
In the first command, replace ``python`` by ``python3`` if you installed Python from the App Store. The second command above ensures that both pipx and the software it will install are available the terminal. You may need to close and re-open the terminal for this to take effect.
181103

182-
Then, install *vpype*::
104+
Finally, install *vpype*::
183105

184-
> pipx install "vpype[all]"
106+
pipx install "vpype[all]"
185107

186108
*vpype* should now be installed and ready to use. You may check that it is fully functional by checking its version and displaying some random lines::
187109

188-
> vpype --version
189-
vpype 1.9.0
190-
> vpype random show
110+
vpype --version
111+
vpype random show
191112

192113
Linux
193114
=====
194115

195116
.. highlight:: bash
196117

197-
First, install `pipx`_ with your system's package manager. On Debian/ubuntu flavored installation, this is typically done as follows::
118+
First, install `pipx`_ with your system's package manager. On Debian/Ubuntu flavored installation, this is typically done as follows::
198119

199-
$ sudo apt-get install pipx
120+
sudo apt-get install pipx
200121

201122
Then run the following command to ensure your path variable is properly set::
202123

203-
$ pipx ensurepath
124+
pipx ensurepath
204125

205126
You may need to close and re-open the terminal window for this to take effect.
206127

207128
Finally, install *vpype*::
208129

209-
$ pipx install "vpype[all]"
130+
pipx install "vpype[all]"
210131

211132
*vpype* should now be installed and ready to use. You may check that it is fully functional by checking its version and displaying some random lines::
212133

213-
$ vpype --version
214-
vpype 1.9.0
215-
$ vpype random show
216-
134+
vpype --version
135+
vpype random show
217136

218137

219138
Raspberry Pi
220139
============
221140

222-
Full installation including the viewer on the Raspberry Pi is no longer supported. Expert users may succeed with ``pip install vpype[all]`` provided that a suitable version of the PySide2 package is available. Also, the new viewer requires OpenGL 3.3, which the Raspberry Pi does not support. The classic viewer should work correctly::
141+
Full installation including the viewer on the Raspberry Pi is no longer supported. Expert users may succeed with ``pipx install "vpype[all]"``. Also, the new viewer requires OpenGL 3.3, which the Raspberry Pi does not support. The classic viewer should work correctly::
223142

224-
$ vpype [...] show --classic
143+
vpype [...] show --classic
225144

226145
Installing the CLI-only version described in the next section is easier and should be favored whenever possible. Here are the recommended steps to do so.
227146

228147
Some packages and their dependencies are easier to install at the system level::
229148

230-
$ sudo apt-get install python3-shapely python3-numpy python3-scipy
149+
sudo apt-get install python3-shapely python3-numpy python3-scipy
231150

232151
Then, install pipx::
233152

234-
$ sudo apt-get install pipx
235-
$ pipx ensurepath
153+
sudo apt-get install pipx
154+
pipx ensurepath
236155

237156
Finally, install and run *vpype*::
238157

239-
$ pipx install vpype
240-
$ vpype --version
241-
vpype 1.9.0
158+
pipx install vpype
159+
vpype --version
242160

243161

244162
CLI-only install
245163
================
246164

247-
For special cases where the :ref:`cmd_show` is not needed and dependencies such as matplotlib, PySide2, or ModernGL are difficult to install, a CLI-only version of *vpype* can be installed using this command::
165+
For special cases where the :ref:`cmd_show` is not needed and dependencies such as matplotlib, PySide6, or ModernGL are difficult to install, a CLI-only version of *vpype* can be installed using this command::
248166

249-
$ pipx install vpype
167+
pipx install vpype
250168

251169
Note the missing ``[all]`` compared the instructions above.
252170

0 commit comments

Comments
 (0)