diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b904c2c..c2a4407 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,12 @@ +Merkle_Tree_Stream 0.0.1a4 (2019-11-03) +======================================= + +Improved Documentation +---------------------- + +- New Sphinx theme. Improved clarity with documentation. + + Merkle_Tree_Stream 0.0.1a3 (2019-10-08) ======================================= diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 86c7812..25c8ff4 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -33,8 +33,36 @@ Type check source tox -e type -Release Process ---------------- +Build the documentation +----------------------- + +.. code-block:: bash + + $ tox -e docs + $ tox -e docs-livereload + +Make a new release +------------------ + +Ensure metadata for packaging is correct. + +.. code-block:: bash + + $ tox -e metadata-release + +Generate the changelog with the next target version. + +.. code-block:: bash + + $ export VERSION=1.0.1 tox -e changelog + +Make a new Git tag. + +.. code-block:: bash + + $ git tag -a 1.0.1 + +And finally, make a new release. .. code-block:: bash diff --git a/README.rst b/README.rst index 0ecba71..b5d10b4 100644 --- a/README.rst +++ b/README.rst @@ -48,6 +48,10 @@ See the following for more: .. _Merkle Tree: https://datprotocol.github.io/book/ch01-02-merkle-tree.html .. _Merkle Tree Stream: https://datprotocol.github.io/book/ch02-02-merkle-tree-stream.html +Part of the `Datpy`_ project. + +.. _Datpy: https://datpy.decentral1.se/ + A note on naming ================ @@ -60,30 +64,6 @@ generator only. A `stream`_ implementation may follow. .. _merkle-tree-stream: https://github.com/mafintosh/merkle-tree-stream .. _stream: https://docs.python.org/3/library/asyncio-stream.html -.. _example: - -Example -******* - -.. code-block:: python - - from hashlib import sha256 - from merkle_tree_stream import MerkleTreeGenerator - - def leaf(node, roots=None): - return sha256(node.data).digest() - - def parent(first, second): - sha256 = hashlib.sha256() - sha256.update(first.data) - sha256.update(second.data) - return sha256.digest() - - merkle = MerkleTreeGenerator(leaf=leaf, parent=parent) - merkle.write('hello') - merkle.write('hashed') - merkle.write('world') - .. _documentation: Documentation @@ -92,12 +72,3 @@ Documentation * `merkle-tree-stream.readthedocs.io`_ .. _merkle-tree-stream.readthedocs.io: https://merkle-tree-stream.readthedocs.io/ - -Mirroring -********* - -* `hack.decentral1.se/datpy/merkle-tree-stream`_ -* `github.com/datpy/merkle-tree-stream`_ - -.. _hack.decentral1.se/datpy/merkle-tree-stream: https://hack.decentral1.se/datpy/merkle-tree-stream -.. _github.com/datpy/merkle-tree-stream: https://github.com/datpy/merkle-tree-stream diff --git a/documentation/source/conf.py b/documentation/source/conf.py index 68007d8..31c9da7 100644 --- a/documentation/source/conf.py +++ b/documentation/source/conf.py @@ -1,7 +1,7 @@ author = 'decentral1se' copyright = '2019, decentral1se' html_static_path = ['_static'] -html_theme = 'alabaster' +html_theme = 'sphinx_rtd_theme' master_doc = 'index' project = 'merkle-tree-stream' templates_path = ['_templates'] diff --git a/documentation/source/example.rst b/documentation/source/example.rst new file mode 100644 index 0000000..a1bf143 --- /dev/null +++ b/documentation/source/example.rst @@ -0,0 +1,24 @@ +.. _example: + +******* +Example +******* + +.. code-block:: python + + from hashlib import sha256 + from merkle_tree_stream import MerkleTreeGenerator + + def leaf(node, roots=None): + return sha256(node.data).digest() + + def parent(first, second): + sha256 = hashlib.sha256() + sha256.update(first.data) + sha256.update(second.data) + return sha256.digest() + + merkle = MerkleTreeGenerator(leaf=leaf, parent=parent) + merkle.write('hello') + merkle.write('hashed') + merkle.write('world') diff --git a/documentation/source/index.rst b/documentation/source/index.rst index 19199c2..b3b11a7 100644 --- a/documentation/source/index.rst +++ b/documentation/source/index.rst @@ -1,12 +1,13 @@ .. include:: ../../README.rst - :end-before: _documentation - -Table of Contents -***************** + :end-before: _documentation .. toctree:: + :maxdepth: 1 + :hidden: install + upgrade + example modules-api other-impls contribute diff --git a/documentation/source/other-impls.rst b/documentation/source/other-impls.rst index f1db98c..e40a717 100644 --- a/documentation/source/other-impls.rst +++ b/documentation/source/other-impls.rst @@ -3,6 +3,10 @@ Other Implementations ********************* -* https://github.com/mafintosh/merkle-tree-stream -* https://github.com/datrs/merkle-tree-stream -* https://github.com/datcxx/merkle-tree-stream +* `mafintosh/merkle-tree-stream`_ +* `datrs/merkle-tree-stream`_ +* `datcxx/merkle-tree-stream`_ + +.. _mafintosh/merkle-tree-stream: https://github.com/mafintosh/merkle-tree-stream +.. _datrs/merkle-tree-stream: https://github.com/datrs/merkle-tree-stream +.. _datcxx/merkle-tree-stream: https://github.com/datcxx/merkle-tree-stream diff --git a/documentation/source/upgrade.rst b/documentation/source/upgrade.rst new file mode 100644 index 0000000..0c8178a --- /dev/null +++ b/documentation/source/upgrade.rst @@ -0,0 +1,7 @@ +******* +Upgrade +******* + +.. code-block:: bash + + $ pip install --upgrade merkle-tree-stream diff --git a/setup.cfg b/setup.cfg index a8d051f..e79bde2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -61,6 +61,7 @@ warning-is-error = True [options.extras_require] docs = sphinx + sphinx_rtd_theme sphinx-autodoc-typehints >= 1.6.0, < 2.0 changelog = towncrier <= 19.2.0, < 20.0 diff --git a/tox.ini b/tox.ini index ef1705a..8643c66 100644 --- a/tox.ini +++ b/tox.ini @@ -50,19 +50,30 @@ extras = docs commands = python -m setup build_sphinx [testenv:changelog] -description = draft the changelog +description = draw up the new changelog skipdist = True -extras = changelog -commands = towncrier --draft +passenv = VERSION +deps = towncrier +commands = towncrier --version={env:VERSION} {posargs} [testenv:metadata-release] description = validate the package metadata deps = twine -commands = twine check {toxworkdir}/dist/* +commands = + rm -rf {toxworkdir}/dist + python -m setup sdist --dist-dir {toxworkdir}/dist bdist_wheel + python -m setup sdist --dist-dir {toxworkdir}/dist bdist_egg + twine check {toxworkdir}/dist/* +whitelist_externals = + rm [testenv:release] description = make a release deps = {[testenv:metadata-release]deps} commands = - python -m setup sdist bdist_wheel + rm -rf {toxworkdir}/dist + python -m setup sdist --dist-dir {toxworkdir}/dist bdist_wheel + python -m setup sdist --dist-dir {toxworkdir}/dist bdist_egg twine upload {toxworkdir}/dist/* +whitelist_externals = + rm