Skip to content

Commit 62bae04

Browse files
authored
Merge pull request #1659 from minrk/23-docs
Update docs for constant enums
2 parents f30a5cb + 661fc27 commit 62bae04

33 files changed

+1868
-1782
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
exclude: ^zmq/eventloop/minitornado/
22
repos:
3-
- repo: https://github.com/pre-commit/mirrors-prettier
4-
rev: v2.5.1
3+
- repo: https://github.com/executablebooks/mdformat
4+
rev: 0.7.13 # Use the ref you want to point at
55
hooks:
6-
- id: prettier
6+
- id: mdformat
7+
# Optionally add plugins
8+
additional_dependencies:
9+
- mdformat-black
10+
- mdformat-myst
711
- repo: https://github.com/PyCQA/flake8
812
rev: 4.0.1
913
hooks:

AUTHORS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ The following people have contributed to the project:
9292

9393
as reported by:
9494

95-
git log --all --format='- %aN (%aE)' | sort -u | sed 's/@/ AT /1' | sed -e 's/\.\([^ ]\)/ DOT \1/g'
95+
```
96+
git log --all --format='- %aN (%aE)' | sort -u | sed 's/@/ AT /1' | sed -e 's/\.\([^ ]\)/ DOT \1/g'
97+
```
9698

9799
with some adjustments.
98100

CONTRIBUTING.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
For a good bug report:
44

5-
1. [Search][] for existing Issues, both on GitHub and in general with Google/Stack Overflow before posting a duplicate question.
6-
2. Update to pyzmq master, if possible, especially if you are already using git. It's
5+
1. [Search] for existing Issues, both on GitHub and in general with Google/Stack Overflow before posting a duplicate question.
6+
1. Update to pyzmq master, if possible, especially if you are already using git. It's
77
possible that the bug you are about to report has already been fixed.
88

99
Many things reported as pyzmq Issues are often just libzmq-related,
1010
and don't have anything to do with pyzmq itself.
11-
These are better directed to [zeromq-dev][].
11+
These are better directed to [zeromq-dev].
1212

1313
When making a bug report, it is helpful to tell us as much as you can about your system
1414
(such as pyzmq version, libzmq version, Python version, OS Version, how you built/installed pyzmq and libzmq, etc.)
@@ -26,13 +26,12 @@ print("Python-%s" % sys.version)
2626

2727
Which will give something like:
2828

29-
libzmq-3.3.0
30-
pyzmq-2.2dev
31-
Python-2.7.2 (default, Jun 20 2012, 16:23:33)
32-
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
33-
34-
[search]: https://github.com/zeromq/pyzmq/issues
35-
[zeromq-dev]: mailto:[email protected]
29+
```
30+
libzmq-4.3.4
31+
pyzmq-22.3.0
32+
Python-3.9.9 | packaged by conda-forge | (main, Dec 20 2021, 02:38:53)
33+
[Clang 11.1.0 ]
34+
```
3635

3736
# Licensing and contributing to PyZMQ
3837

@@ -58,28 +57,35 @@ When you contribute to PyZMQ, your contributions are made under the same
5857
license as the file you are working on. Any new, original code should be BSD
5958
licensed.
6059

61-
We don't enforce strict style, but when in doubt [PEP8][] is a good guideline.
62-
The only thing we really don't like is mixing up 'cleanup' in real work.
60+
We use [pre-commit] for autoformatting,
61+
so you hopefully don't need to worry too much about style.
6362

64-
Examples are copyright their respective authors, and BSD unless otherwise
65-
specified by the author. You can LGPL (or GPL or MIT or Apache, etc.) your own new
66-
examples if you like, but we strongly encourage using the default BSD license.
63+
To install pre-commit:
64+
65+
```
66+
pip install pre-commit
67+
pre-commit install
68+
```
6769

68-
[pep8]: http://www.python.org/dev/peps/pep-0008
70+
Examples are copyright their respective authors, and BSD unless otherwise
71+
specified by the author.
6972

7073
## Inherited licenses in pyzmq
7174

7275
Some code outside the core is taken from other open-source projects, and
7376
inherits that project's license.
7477

75-
- zmq/eventloop contains files inherited and adapted from [tornado][], and inherits the Apache license
78+
- zmq/eventloop contains files inherited and adapted from [tornado], and inherits the Apache license
7679

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

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

8285
- perf examples are (c) iMatix, and LGPL
8386

84-
[tornado]: http://www.tornadoweb.org
8587
[paramiko]: http://www.lag.net/paramiko
88+
[pre-commit]: https://pre-commit.com
89+
[search]: https://github.com/zeromq/pyzmq/issues
90+
[tornado]: http://www.tornadoweb.org
91+
[zeromq-dev]: mailto:[email protected]

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://github.com/zeromq/pyzmq/actions/workflows/test.yml/badge.svg)](https://github.com/zeromq/pyzmq/actions/workflows/test.yml)
44

5-
This package contains Python bindings for [ØMQ](http://www.zeromq.org).
5+
This package contains Python bindings for [ØMQ](https://zeromq.org).
66
ØMQ is a lightweight and fast messaging implementation.
77

88
PyZMQ should work with any reasonable version of Python (≥ 3.4),
@@ -36,7 +36,7 @@ Python version of every example. We also have some information on our
3636

3737
Unless you specifically want to develop PyZMQ, we recommend downloading
3838
the PyZMQ source code or wheels from
39-
[PyPI](https://pypi.io/project/pyzmq),
39+
[PyPI](https://pypi.io/project/pyzmq/),
4040
or install with conda.
4141

4242
You can also get the latest source code from our GitHub repository, but
@@ -48,7 +48,9 @@ For more detail on building pyzmq, see [our Wiki](https://github.com/zeromq/pyzm
4848

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

51-
pip install pyzmq
51+
```
52+
pip install pyzmq
53+
```
5254

5355
but compiling from source with `pip install pyzmq` should work in most environments.
5456
Especially on macOS, make sure you are using the latest pip (≥ 8), or it may not find the right wheels.
@@ -57,17 +59,21 @@ If the wheel doesn't work for some reason, or you want to force pyzmq to be comp
5759
(this is often preferable if you already have libzmq installed and configured the way you want it),
5860
you can force installation with:
5961

60-
pip install --no-binary=:all: pyzmq
62+
```
63+
pip install --no-binary=:all: pyzmq
64+
```
6165

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

66-
# Debian-based
67-
sudo apt-get install libzmq3-dev
70+
```
71+
# Debian-based
72+
sudo apt-get install libzmq3-dev
6873
69-
# RHEL-based
70-
sudo yum install libzmq3-devel
74+
# RHEL-based
75+
sudo yum install libzmq3-devel
76+
```
7177

7278
If this is not available, pyzmq will _try_ to build libzmq as a Python Extension,
7379
though this is not guaranteed to work.
@@ -79,9 +85,11 @@ Building pyzmq from the git repo (including release tags on GitHub) requires Cyt
7985
pyzmq 16 drops support Python 2.6 and 3.2.
8086
If you need to use one of those Python versions, you can pin your pyzmq version to before 16:
8187

82-
pip install 'pyzmq<16'
88+
```
89+
pip install 'pyzmq<16'
90+
```
8391

84-
For libzmq 2.0.x, use 'pyzmq<2.1'
92+
For libzmq 2.0.x, use 'pyzmq\<2.1'
8593

8694
pyzmq-2.1.11 was the last version of pyzmq to support Python 2.5,
8795
and pyzmq ≥ 2.2.0 requires Python ≥ 2.6.

docs/requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
cython>=0.29
2+
enum-tools[sphinx]>=0.9
23
gevent
3-
pygments==2.4.2
4+
myst-parser[linkify]
5+
pydata_sphinx_theme
6+
pygments>=2.6
47
sphinx>=3.0.4
58
sphinx-rtd-theme==0.5.*
69
tornado

docs/source/api/zmq.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,42 @@ Polling
8888

8989
.. autofunction:: zmq.select
9090

91+
Constants
92+
---------
93+
94+
All libzmq constants are available as top-level attributes
95+
(``zmq.PUSH``, etc.),
96+
as well as via enums (``zmq.SocketType.PUSH``, etc.).
97+
98+
.. versionchanged:: 23
99+
100+
constants for unavailable socket types
101+
or draft features will always be defined in pyzmq,
102+
whether the features themselves are available or not.
103+
104+
.. versionadded:: 23
105+
106+
Each category of zmq constant is now available as an IntEnum.
107+
108+
.. autoenum:: SocketType
109+
110+
.. autoenum:: SocketOption
111+
112+
.. autoenum:: Flag
113+
114+
.. autoenum:: PollEvent
115+
116+
.. autoenum:: ContextOption
117+
118+
.. autoenum:: MessageOption
119+
120+
.. autoenum:: Event
121+
122+
.. autoenum:: SecurityMechanism
123+
124+
.. autoenum:: DeviceType
125+
126+
.. autoenum:: Errno
91127

92128
Exceptions
93129
----------

0 commit comments

Comments
 (0)