Skip to content

Commit 1a2fb07

Browse files
[docs] Fix the incorrect API docs generation steps in the release process (#131)
### Motivation #126 adds the instruction to include the `_pulsar` C module when generating the API docs. However, it does not work when the library is installed from `pip`. It only works when the wheel is installed from `dist/*.whl` that is generated by the `python3 setup.py bdist_wheel` command in the README. The reason is the official Python wheel uses `auditwheel` to package all dynamic libraries, so the `_pulsar.so` depends on another dynamic library in the relative path. e.g. ```bash $ ldd ~/.local/lib/python3.8/site-packages/_pulsar.cpython-38-x86_64-linux-gnu.so libpulsar-b6dad138.so => /home/xyz/.local/lib/python3.8/site-packages/pulsar_client.libs/libpulsar-b6dad138.so (0x00007f8dc09b3000) ... ``` If we copy the `_pulsar.cpython-38-x86_64-linux-gnu.so` into the project directory, the `libpulsar-b6dad138.so` will not be found. ### Modifications In `RELEASE.md`, specify the path of `_pulsar.so` directly.
1 parent f84931c commit 1a2fb07

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

RELEASE.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -219,29 +219,37 @@ Then, create a PR in [`pulsar-site`](https://github.com/apache/pulsar-site) repo
219219
For minor releases, skip this section. For major releases, you should generate the HTML files into the [`pulsar-site`](https://github.com/apache/pulsar-site) repo:
220220

221221
```bash
222+
# Use the first two version numbers, e.g. export VERSION=3.2
223+
VERSION=X.Y
224+
225+
# You need to install the wheel to have the _pulsar.so installed
226+
# It's better to run the following commands in an empty directory
227+
python3 -m pip install pulsar-client==$VERSION.0 --force-reinstall
228+
C_MODULE_PATH=$(python3 -c 'import _pulsar, os; print(_pulsar.__file__)')
229+
222230
git clone [email protected]:apache/pulsar-client-python.git
223231
cd pulsar-client-python
224-
git checkout vX.Y.0
225-
# It's better to replace this URL with the URL of your own fork
232+
git checkout v$VERSION.0
233+
# You can skip this step if you already have the `pulsar-site` repository in your local env.
234+
# In this case, you only need to modify the `--html-output` parameter in the following command.
226235
git clone [email protected]:apache/pulsar-site.git
227236
sudo python3 -m pip install pydoctor
228-
cp $(python3 -c 'import _pulsar, os; print(_pulsar.__file__)') ./_pulsar.so
229237
pydoctor --make-html \
230-
--html-viewsource-base=https://github.com/apache/pulsar-client-python/tree/vX.Y.0 \
238+
--html-viewsource-base=https://github.com/apache/pulsar-client-python/tree/v$VERSION.0 \
231239
--docformat=numpy --theme=readthedocs \
232240
--intersphinx=https://docs.python.org/3/objects.inv \
233-
--html-output=./pulsar-site/site2/website-next/static/api/python/X.Y.x \
241+
--html-output=./pulsar-site/static/api/python/$VERSION.x \
234242
--introspect-c-modules \
235-
./_pulsar.so \
243+
$C_MODULE_PATH \
236244
pulsar
237245
cd pulsar-site
238-
git checkout -b py-docs-X.Y
246+
git checkout -b py-docs-$VERSION
239247
git add .
240-
git commit -m "Generate Python client X.Y.0 doc"
241-
git push origin py-docs-X.Y
248+
git commit -m "Generate Python client $VERSION.0 doc"
249+
git push origin py-docs-$VERSION
242250
```
243251

244-
Then open a PR like: https://github.com/apache/pulsar-site/pull/342
252+
Then open a PR like: https://github.com/apache/pulsar-site/pull/600
245253

246254
## Announce the release
247255

0 commit comments

Comments
 (0)