Skip to content

Commit e28601d

Browse files
c0llab0rat0rntninja
authored andcommitted
RELEASE.md - describe how to publish to a remote IPFS server
1 parent 2d4b59d commit e28601d

File tree

3 files changed

+58
-33
lines changed

3 files changed

+58
-33
lines changed

RELEASE.md

+48-33
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,91 @@
1-
Since releasing new versions is currently a somewhat complicated task, the current procedure
2-
(17.02.2020) will be outlined in this document.
31

4-
All of this has only been tested on Debian 11 (Linux).
2+
# Release
53

6-
# Prerequirements
4+
The release process uses `flit` to build the package, `Sphinx` to generate documentation,
5+
publishes the documentation to an IPFS server (obtaining an IPFS hash), and then links
6+
the IPFS hash (which varies based on content) to a static IPNS name.
77

8-
## Building and updating the project
8+
The IPNS name requires a private key, which is controlled by the project owners and not
9+
available to the public.
910

10-
### The `flit` project manager
11+
All steps can be completed up through but not including linking the IPFS hash to IPNS.
1112

12-
APT line: `sudo apt install python3-pip && sudo pip3 install flit`
13-
DNF line: `sudo dnf install python3-flit`
1413

15-
*Note*: Version `2.0+` of `flit` is required!
14+
## Pre-Requisites
1615

17-
## Building the documentation
16+
* On Debian
17+
* Python 3.8+ (or typings will be incomplete)
1818

19-
### Sphinx & the `recommonmark` preprocessor
2019

21-
Sphinx is the standard documentation framework for Python. Recommonmark is an extension that allows
22-
Sphinx to process Markdown documentation as if it where reStructuredText.
20+
## One-Time Setup
2321

24-
<!-- APT line: `sudo apt install python3-sphinx python3-recommonmark` -->
25-
<!--DNF line: `sudo dnf install python3-sphinx python3-recommonmark`-->
22+
Install the release tools into your virtual environment:
2623

27-
At least Sphinx 3.0 with the `sphinx_autodoc_typehints` and reCommonMark 0.5 plugins is required,
28-
so install them using PIP:
24+
$ pip install -r tools/release/requirements.txt
2925

30-
`pip3 install Sphinx~=3.0 sphinx_autodoc_typehints recommonmark~=0.5.0`
26+
Source: [tools/release/requirements.txt](tools/release/requirements.txt)
3127

32-
For best results Sphinx should be run with Python 3.8+ or typings will be incomplete.
33-
34-
## Hosting Documentation
35-
36-
**Both of the following need to be on the device that will *host the documentation*, not the one
37-
that will build it**:
3828

3929
### The Go IPFS daemon
4030

4131
Yes, we use IPFS to host our documentation. In case you haven't already you can download it here:
4232
https://ipfs.io/docs/install/
4333

34+
4435
### A dedicated IPNS key for publishing
4536

4637
For publishing the documentation an IPNS key used only for this task should be
4738
generated if there is no such key already:
4839

4940
`ipfs key gen --type ed25519 ipfs-http-client`
5041

51-
This key will need to be copied to all other system if the documentation is to
52-
be published on these as well.
42+
This key will need to be copied to all other servers hosting the IPNS link.
43+
Without the private key, other servers can host the IPFS files, but not the IPNS link.
5344

5445
At the time of writing the officially used key is: *12D3KooWEqnTdgqHnkkwarSrJjeMP2ZJiADWLYADaNvUb6SQNyPF*
5546

5647

57-
# Steps when releasing a new version
48+
# Steps
5849

5950
## Update the source code
6051

61-
1. Make a GIT commit incrementing the version number in `ipfshttpclient/version.py` and completing the currently open `CHANGELOG.md` entry:
62-
`git commit -m "Release version 0.X.Y" ipfshttpclient/version.py CHANGELOG.md`)
63-
2. Tag the GIT commit with the version number using an annotated and signed tag:
52+
1. Make a GIT commit
53+
* Incrementing the version number in `ipfshttpclient/version.py`
54+
* Completing the currently open `CHANGELOG.md` entry
55+
56+
`git commit -m "Release version 0.X.Y" ipfshttpclient/version.py CHANGELOG.md`
57+
58+
2. After the change is merged into master, pull master
59+
60+
3. Tag the GIT commit with the version number using an annotated and signed tag:
61+
6462
`git tag --sign -m "Release version 0.X.Y" 0.X.Y`
65-
3. Push the new version
63+
64+
4. Push the new tag
65+
6666

6767
## Upload the new version to PyPI
6868

69-
Run: `flit build && flit publish`
69+
Run:
70+
71+
$ flit build && flit publish
7072

7173
## Re-generate and publish the documentation
7274

73-
Run: `docs/publish.py ipfs-http-client` (were `ipfs-http-client` is the IPNS key ID)
75+
Run:
76+
77+
$ python docs/publish.py ipns-key-id
7478

7579
The command will also print a commandline that may be used to mirror the generated
7680
documentation on systems other then the current one.
81+
82+
If you don't have the IPNS private key, you can still exercise the documentation
83+
generation and publish process:
84+
85+
$ python docs/publish.py
86+
87+
If you are publishing to an IPFS server that is remote, and protected by an HTTP reverse proxy
88+
with TLS and basic authentication, run this instead:
89+
90+
$ IPFS_API_MULTI_ADDR=/dns/yourserver.tld/tcp/5001/https IPFS_API_USERNAME=basicauthuser IPFS_API_PASSWORD=basicauthpassword python publish.py ipns-key-id
91+

docs/conf.py

+5
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@
371371

372372
import sphinx.ext.autodoc
373373

374+
374375
class ClientClassDocumenterBase(sphinx.ext.autodoc.ClassDocumenter):
375376
directivetype = "class"
376377

@@ -398,17 +399,20 @@ def format_signature(self):
398399
these classes."""
399400
return "({0})".format(self.args) if self.args is not None else ""
400401

402+
401403
class ClientClassDocumenter(ClientClassDocumenterBase):
402404
objtype = "clientclass"
403405
priority = -100
404406

407+
405408
class ClientSubClassDocumenter(ClientClassDocumenterBase):
406409
objtype = "clientsubclass"
407410
priority = 100
408411

409412

410413
import sphinx.util.inspect
411414

415+
412416
def section_property_attrgetter(object, name, default=None):
413417
try:
414418
prop = sphinx.util.inspect.safe_getattr(object, name)
@@ -427,6 +431,7 @@ def section_property_attrgetter(object, name, default=None):
427431
# Nothing found: Return default
428432
return default
429433

434+
430435
# app setup hook for reCommonMark's AutoStructify and our own extension
431436
def setup(app):
432437
# Import the CID library so that its types will be included in the

tools/release/requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
flit>=3.0
2+
Sphinx~=3.0
3+
sphinx_autodoc_typehints
4+
recommonmark~=0.5.0
5+

0 commit comments

Comments
 (0)