Skip to content

Commit

Permalink
update docs for new build system
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Feb 16, 2024
1 parent 9521cc7 commit 6b85c04
Show file tree
Hide file tree
Showing 8 changed files with 485 additions and 46 deletions.
21 changes: 1 addition & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,6 @@ Python-3.9.9 | packaged by conda-forge | (main, Dec 20 2021, 02:38:53)
[Clang 11.1.0 ]
```

## Licensing and contributing to PyZMQ

PyZMQ uses different licenses for different parts of the code.

The 'core' of PyZMQ (located in zmq/core) is licensed under LGPLv3.
This just means that if you make any changes to how that code works,
you must release those changes under the LGPL.
If you just _use_ pyzmq, then you can use any license you want for your own code.

We don't feel that the restrictions imposed by the LGPL make sense for the
'non-core' functionality in pyzmq (derivative code must _also_ be LGPL or GPL),
especially for examples and utility code, so we have relicensed all 'non-core'
code under the more permissive BSD (specifically Modified BSD aka New BSD aka
3-clause BSD), where possible. This means that you can copy this code and build
your own apps without needing to license your own code with the LGPL or GPL.

### Your contributions

**Pull Requests are welcome!**
Expand Down Expand Up @@ -85,10 +69,7 @@ inherits that project's license.

- zmq/ssh/forward.py is from [paramiko], and inherits LGPL

- zmq/devices/monitoredqueue.pxd is derived from the zmq_device function in
libzmq, and inherits LGPL

- perf examples are (c) iMatix, and LGPL
- perf examples are (c) iMatix, and MPL

[paramiko]: http://www.lag.net/paramiko
[pre-commit]: https://pre-commit.com
Expand Down
25 changes: 4 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ building from the repository will require that you install recent Cython.

## Building and installation

For more detail on building pyzmq, see [our Wiki](https://github.com/zeromq/pyzmq/wiki/Building-and-Installing-PyZMQ).
For more detail on building pyzmq, see [our docs](https://pyzmq.readthedocs.io/en/latest/howto/build.html).

We build wheels for macOS, Windows, and Linux, so you can get a binary on those platforms with:

Expand All @@ -50,33 +50,16 @@ pip install pyzmq
```

but compiling from source with `pip install pyzmq` should work in most environments.
Especially on macOS, make sure you are using the latest pip (≥ 8), or it may not find the right wheels.
Make sure you are using the latest pip, or it may not find the right wheels.

If the wheel doesn't work for some reason, or you want to force pyzmq to be compiled
(this is often preferable if you already have libzmq installed and configured the way you want it),
you can force installation with:
you can force installation from source with:

```
pip install --no-binary=:all: pyzmq
pip install --no-binary=pyzmq pyzmq
```

When compiling pyzmq (e.g. installing with pip on Linux),
it is generally recommended that zeromq be installed separately,
via homebrew, apt, yum, etc:

```
# Debian-based
sudo apt-get install libzmq3-dev
# RHEL-based
sudo yum install libzmq3-devel
```

If this is not available, pyzmq will _try_ to build libzmq as a Python Extension,
though this is not guaranteed to work.

Building pyzmq from the git repo (including release tags on GitHub) requires Cython.

## Old versions

pyzmq 16 drops support Python 2.6 and 3.2.
Expand Down
20 changes: 17 additions & 3 deletions docs/source/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,27 @@ For a full changelog, consult the [git log](https://github.com/zeromq/pyzmq/comm

## 26

pyzmq 26 is a small release, but with some big changes nobody should notice.
The Cython backend has been rewritten using Cython 3's pure Python mode.
pyzmq 26 is a small release, but with some big changes _hopefully_ nobody will notice.
The highlights are:

- The Cython backend has been rewritten using Cython 3's pure Python mode.
- The build system has been rewritten to use CMake via [scikit-build-core] instead of setuptools (setup.py is gone!).
- Bundled libzmq is updated to 4.3.5, which changes its license from LGPL to MPL.

This means:

1. Cython >=3.0 is now a build requirement (if omitted, source distributions _should_ still build from Cython-generated .c files without any Cython present)
1. pyzmq's Cython backend is a single extension module, which should improve install size, import time, compile time, etc.
1. pyzmq's Cython backend is now BSD-licensed, matching the rest of pyzmq.
1. The license of the libzmq library (included in pyzmq wheels) starting with 4.3.5 is now Mozilla Public License 2.0 (MPL-2.0).
1. when building pyzmq from source and it falls back on bundled libzmq, libzmq and libsodium are built as static libraries using their own build systems (CMake for libzmq, autotools for libsodium except on Windows where it uses msbuild)
rather than bundling libzmq with tweetnacl as a Python Extension.

Since the new build system uses libzmq and libsodium's own build systems, evaluated at install time, building pyzmq with bundled libzmq from source should be much more likely to succeed on a variety of platforms than the previous method, where their build system was skipped and approximated as a Python extension.
But I would also be _very_ surprised if I didn't break anything in the process of replacing 14 years of setup.py from scratch, especially cases like cross-compiling.
Please [report](https://github.com/zeromq/pyzmq/issues/new) any issues you encounter building pyzmq.

The license of the libzmq library (included in pyzmq wheels and sources included but may not be used in pyzmq tarballs) remains unchanged and has its own LGPL license.
See [build docs](building-pyzmq) for more info.

__Enhancements__:

Expand All @@ -30,6 +42,7 @@ __Breaking changes__:
`bytes(Frame)` remains unchanged, and utf-8 text strings can still be produced with:
`bytes(Frame).decode("utf8")`,
which works in all versions of pyzmq and does the same thing.
- Stop building Python 3.7 wheels for manylinux1, which reached EOL in January, 2022. The new build system doesn't seem to be able to find cmake in that environment.

## 25

Expand Down Expand Up @@ -1041,3 +1054,4 @@ s.linger

[cython-build-requires]: https://groups.google.com/g/cython-users/c/ZqKFQmS0JdA/m/1FrK1ApYBAAJ
[pyczmq]: https://github.com/zeromq/pyczmq
[scikit-build-core]: https://scikit-build-core.readthedocs.io
Loading

0 comments on commit 6b85c04

Please sign in to comment.