Browse Source

New Sphinx theme and better docs

Luke Murphy 1 month ago
parent
commit
9321539803
No account linked to committer's email address

+ 17
- 0
CHANGELOG.rst View File

@@ -0,0 +1,17 @@
1
+Hypercore_Crypto 0.0.1a2 (2019-11-03)
2
+=====================================
3
+
4
+Improved Documentation
5
+---------------------
6
+
7
+- New Sphinx theme.
8
+- Add a changelog.
9
+
10
+
11
+Hypercore_Crypto 0.0.1a1 (2019-10-05)
12
+=====================================
13
+
14
+Project Announcements
15
+---------------------
16
+
17
+- The first alpha development release is made!

+ 30
- 2
CONTRIBUTING.rst View File

@@ -33,8 +33,36 @@ Type check source
33 33
 
34 34
     tox -e type
35 35
 
36
-Release Process
37
----------------
36
+Build the documentation
37
+-----------------------
38
+
39
+.. code-block:: bash
40
+
41
+    $ tox -e docs
42
+    $ tox -e docs-livereload
43
+
44
+Make a new release
45
+------------------
46
+
47
+Ensure metadata for packaging is correct.
48
+
49
+.. code-block:: bash
50
+
51
+    $ tox -e metadata-release
52
+
53
+Generate the changelog with the next target version.
54
+
55
+.. code-block:: bash
56
+
57
+    $ export VERSION=1.0.1 tox -e changelog
58
+
59
+Make a new Git tag.
60
+
61
+.. code-block:: bash
62
+
63
+    $ git tag  -a 1.0.1
64
+
65
+And finally, make a new release.
38 66
 
39 67
 .. code-block:: bash
40 68
 

+ 3
- 23
README.rst View File

@@ -29,22 +29,11 @@ hypercore-crypto
29 29
 Cryptography primitives for Hypercore
30 30
 -------------------------------------
31 31
 
32
-Cryptography primitives for `Hypercore`_ (WIP).
32
+Cryptography primitives for Hypercore.
33 33
 
34
-.. _Hypercore: https://hypercore.readthedocs.io
34
+Part of the `Datpy`_ project.
35 35
 
36
-.. _example:
37
-
38
-Example
39
-*******
40
-
41
-.. code-block:: python
42
-
43
-    from hypercore_crypto import key_pair, sign, verify
44
-
45
-    public_key, secret_key = key_pair()
46
-    signature = sign(b'hello world', secret_key)
47
-    verify(message, signature, public_key)
36
+.. _Datpy: https://datpy.decentral1.se/
48 37
 
49 38
 .. _documentation:
50 39
 
@@ -54,12 +43,3 @@ Documentation
54 43
 * `hypercore-crypto.readthedocs.io`_
55 44
 
56 45
 .. _hypercore-crypto.readthedocs.io: https://hypercore-crypto.readthedocs.io/
57
-
58
-Mirroring
59
-*********
60
-
61
-* `hack.decentral1.se/datpy/hypercore-crypto`_
62
-* `github.com/datpy/hypercore-crypto`_
63
-
64
-.. _hack.decentral1.se/datpy/hypercore-crypto: https://hack.decentral1.se/datpy/hypercore-crypto
65
-.. _github.com/datpy/hypercore-crypto: https://github.com/datpy/hypercore-crypto

+ 1
- 1
documentation/source/conf.py View File

@@ -1,7 +1,7 @@
1 1
 author = 'decentral1se'
2 2
 copyright = '2019, decentral1se'
3 3
 html_static_path = ['_static']
4
-html_theme = 'alabaster'
4
+html_theme = 'sphinx_rtd_theme'
5 5
 master_doc = 'index'
6 6
 project = 'hypercore-crypto'
7 7
 templates_path = ['_templates']

+ 13
- 0
documentation/source/example.rst View File

@@ -0,0 +1,13 @@
1
+.. _example:
2
+
3
+*******
4
+Example
5
+*******
6
+
7
+.. code-block:: python
8
+
9
+    from hypercore_crypto import key_pair, sign, verify
10
+
11
+    public_key, secret_key = key_pair()
12
+    signature = sign(b'hello world', secret_key)
13
+    verify(message, signature, public_key)

+ 5
- 4
documentation/source/index.rst View File

@@ -1,12 +1,13 @@
1 1
 .. include:: ../../README.rst
2
-  :end-before: _documentation
3
-
4
-Table of Contents
5
-*****************
2
+   :end-before: _documentation
6 3
 
7 4
 .. toctree::
5
+   :maxdepth: 1
6
+   :hidden:
8 7
 
9 8
    install
9
+   upgrade
10
+   example
10 11
    modules-api
11 12
    other-impls
12 13
    contribute

+ 6
- 2
documentation/source/other-impls.rst View File

@@ -1,7 +1,11 @@
1 1
 .. _other-implementations:
2 2
 
3
+*********************
3 4
 Other Implementations
4 5
 *********************
5 6
 
6
-* https://github.com/mafintosh/hypercore-crypto
7
-* https://github.com/datcxx/hypercore-crypto
7
+* `mafintosh/hypercore-crypto`_
8
+* `datcxx/hypercore-crypto`_
9
+
10
+.. _mafintosh/hypercore-crypto: https://github.com/mafintosh/hypercore-crypto
11
+.. _datcxx/hypercore-crypto: https://github.com/datcxx/hypercore-crypto

+ 7
- 0
documentation/source/upgrade.rst View File

@@ -0,0 +1,7 @@
1
+*******
2
+Upgrade
3
+*******
4
+
5
+.. code-block:: bash
6
+
7
+    $ pip install --upgrade hypercore-crypto

+ 2
- 2
pyproject.toml View File

@@ -15,8 +15,8 @@ include = '\.pyi?$'
15 15
 [tool.towncrier]
16 16
 directory = 'changelog/'
17 17
 filename = 'CHANGELOG.rst'
18
-package = 'hypercore-crypto'
19
-package_dir = 'hypercore-crypto'
18
+package = 'hypercore_crypto'
19
+package_dir = 'hypercore_crypto'
20 20
 
21 21
   [[tool.towncrier.type]]
22 22
   directory = 'removal'

+ 1
- 0
setup.cfg View File

@@ -58,6 +58,7 @@ warning-is-error = True
58 58
 [options.extras_require]
59 59
 docs =
60 60
   sphinx
61
+  sphinx_rtd_theme
61 62
   sphinx-autodoc-typehints >= 1.6.0, < 2.0
62 63
 changelog =
63 64
   towncrier <= 19.2.0, < 20.0

+ 22
- 5
tox.ini View File

@@ -52,20 +52,37 @@ skipdist = True
52 52
 extras = docs
53 53
 commands = python -m setup build_sphinx
54 54
 
55
+[testenv:docs-livereload]
56
+description = invoke sphinx-autobuild to build and reload the documentation
57
+commands = python -m sphinx_autobuild documentation/source documentation/build
58
+deps = sphinx-autobuild>=0.7.1,<1.0
59
+extras = docs
60
+
55 61
 [testenv:changelog]
56
-description = draft the changelog
62
+description = draw up the new changelog
57 63
 skipdist = True
58
-extras = changelog
59
-commands = towncrier --draft
64
+passenv = VERSION
65
+deps = towncrier
66
+commands = towncrier --version={env:VERSION} {posargs}
60 67
 
61 68
 [testenv:metadata-release]
62 69
 description = validate the package metadata
63 70
 deps = twine
64
-commands = twine check {toxworkdir}/dist/*
71
+commands = 
72
+  rm -rf {toxworkdir}/dist
73
+  python -m setup sdist --dist-dir {toxworkdir}/dist bdist_wheel
74
+  python -m setup sdist --dist-dir {toxworkdir}/dist bdist_egg
75
+  twine check {toxworkdir}/dist/*
76
+whitelist_externals =
77
+    rm
65 78
 
66 79
 [testenv:release]
67 80
 description = make a release
68 81
 deps = {[testenv:metadata-release]deps}
69 82
 commands =
70
-    python -m setup sdist bdist_wheel
83
+    rm -rf {toxworkdir}/dist
84
+    python -m setup sdist --dist-dir {toxworkdir}/dist bdist_wheel
85
+    python -m setup sdist --dist-dir {toxworkdir}/dist bdist_egg
71 86
     twine upload {toxworkdir}/dist/*
87
+whitelist_externals =
88
+    rm

Loading…
Cancel
Save