Skip to content

Docs updates #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .bumpversion.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ coverage.xml
# Sphinx documentation
docs/_build/

# File just for checking my RST syntax
readme.html

# PyBuilder
target/

Expand Down
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
History
=======

.. towncrier release notes start

0.0.7 (2019-5-8)
----------------

Expand Down
49 changes: 26 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ endef
export BROWSER_PYSCRIPT
BROWSER := python -c "$$BROWSER_PYSCRIPT"

help:
@echo "clean - remove all build, test, coverage and Python artifacts"
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "clean-test - remove test and coverage artifacts"
@echo "lint - check style with ruff"
@echo "test - run tests quickly with the default Python"
@echo "test-all - run tests on every Python version with tox"
@echo "coverage - check code coverage quickly with the default Python"
@echo "docs - generate Sphinx HTML documentation, including API docs"
@echo "release - package and upload a release"
@echo "dist - package"
@echo "install - install the package to the active Python's site-packages"

clean: clean-build clean-pyc clean-test

clean-build:
Expand Down Expand Up @@ -81,24 +67,41 @@ docs:
servedocs: docs
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .

readme.html: README.rst
rst2html.py README.rst > readme.html

.PHONY: authors
authors:
git shortlog --numbered --summary --email | cut -f 2 > AUTHORS

dist: clean
python setup.py sdist
python setup.py bdist_wheel
python -m build
ls -l dist

install: clean
python setup.py install

bump:
bumpversion --tag-name "{new_version}" patch

deploy-prep: clean authors readme.html docs dist
# build newsfragments into release notes and verify docs build correctly
notes: check-bump validate-newsfragments
# Let UPCOMING_VERSION be the version that is used for the current bump
$(eval UPCOMING_VERSION=$(shell bump-my-version bump --dry-run $(bump) -v | awk -F"'" '/New version will be / {print $$2}'))
# Now generate the release notes to have them included in the release commit
towncrier build --yes --version $(UPCOMING_VERSION)
# Before we bump the version, make sure that the towncrier-generated docs will build
make docs
git commit -m "Compile release notes for v$(UPCOMING_VERSION)"

deploy-prep: clean authors docs dist
@echo "Did you remember to bump the version?"
@echo "If not, run 'bumpversion {patch, minor, major}' and run this target again"
@echo "Don't forget to update HISTORY.rst"

# helpers

# verify that newsfragments are valid and towncrier can build them
validate-newsfragments:
python ./newsfragments/validate_files.py
towncrier build --draft --version preview

# verify that a bump argument is set to be passed to bump-my-version
check-bump:
ifndef bump
$(error bump must be set, typically: major, minor, patch, or devnum)
endif
36 changes: 18 additions & 18 deletions docs/multiaddr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ Subpackages
-----------

.. toctree::
:maxdepth: 4

multiaddr.codecs
multiaddr.resolvers
multiaddr.codecs
multiaddr.resolvers

Submodules
----------
Expand All @@ -16,39 +17,38 @@ multiaddr.exceptions module
---------------------------

.. automodule:: multiaddr.exceptions
:members:
:undoc-members:
:show-inheritance:
:members:
:show-inheritance:
:undoc-members:

multiaddr.multiaddr module
--------------------------

.. automodule:: multiaddr.multiaddr
:members:
:undoc-members:
:show-inheritance:
:members:
:show-inheritance:
:undoc-members:

multiaddr.protocols module
--------------------------

.. automodule:: multiaddr.protocols
:members:
:undoc-members:
:show-inheritance:
:members:
:show-inheritance:
:undoc-members:

multiaddr.transforms module
---------------------------

.. automodule:: multiaddr.transforms
:members:
:undoc-members:
:show-inheritance:

:members:
:show-inheritance:
:undoc-members:

Module contents
---------------

.. automodule:: multiaddr
:members:
:undoc-members:
:show-inheritance:
:members:
:show-inheritance:
:undoc-members:
1 change: 0 additions & 1 deletion multiaddr/multiaddr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flake8: noqa: F811
import collections.abc
from collections.abc import Iterator, Sequence
from typing import Any, Optional, TypeVar, Union, overload
Expand Down
1 change: 1 addition & 0 deletions newsfragments/65.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for CIDv1 format and improved sequence protocol handling with enhanced indexing and slicing operations.
1 change: 1 addition & 0 deletions newsfragments/65.internal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enhanced type safety with comprehensive type hints, improved validation, and expanded test coverage for better code reliability and maintainability.
1 change: 1 addition & 0 deletions newsfragments/68.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds DNSADDR protocol support.
1 change: 1 addition & 0 deletions newsfragments/74.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds support for p2p-circuit addresses.
1 change: 1 addition & 0 deletions newsfragments/75.docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds example of DNS address resolution.
29 changes: 29 additions & 0 deletions newsfragments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
This directory collects "newsfragments": short files that each contain
a snippet of ReST-formatted text that will be added to the next
release notes. This should be a description of aspects of the change
(if any) that are relevant to users. (This contrasts with the
commit message and PR description, which are a description of the change as
relevant to people working on the code itself.)

Each file should be named like `<ISSUE>.<TYPE>.rst`, where
`<ISSUE>` is an issue number, and `<TYPE>` is one of:

- `breaking`
- `bugfix`
- `deprecation`
- `docs`
- `feature`
- `internal`
- `misc`
- `performance`
- `removal`

So for example: `123.feature.rst`, `456.bugfix.rst`

If the PR fixes an issue, use that number here. If there is no issue,
then open up the PR first and use the PR number for the newsfragment.

Note that the `towncrier` tool will automatically
reflow your text, so don't try to do any fancy formatting. Run
`towncrier build --draft` to get a preview of what the release notes entry
will look like in the final release notes.
43 changes: 43 additions & 0 deletions newsfragments/validate_files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env python3

# Towncrier silently ignores files that do not match the expected ending.
# We use this script to ensure we catch these as errors in CI.

import pathlib
import sys

ALLOWED_EXTENSIONS = {
".breaking.rst",
".bugfix.rst",
".deprecation.rst",
".docs.rst",
".feature.rst",
".internal.rst",
".misc.rst",
".performance.rst",
".removal.rst",
}

ALLOWED_FILES = {
"validate_files.py",
"README.md",
}

THIS_DIR = pathlib.Path(__file__).parent

num_args = len(sys.argv) - 1
assert num_args in {0, 1}
if num_args == 1:
assert sys.argv[1] in ("is-empty",)

for fragment_file in THIS_DIR.iterdir():
if fragment_file.name in ALLOWED_FILES:
continue
elif num_args == 0:
full_extension = "".join(fragment_file.suffixes)
if full_extension not in ALLOWED_EXTENSIONS:
raise Exception(f"Unexpected file: {fragment_file}")
elif sys.argv[1] == "is-empty":
raise Exception(f"Unexpected file: {fragment_file}")
else:
raise RuntimeError(f"Strange: arguments {sys.argv} were validated, but not found")
Loading