Skip to content

Commit 7698276

Browse files
authored
Migrate to py-cid v0.4.0: Update dependencies (#54)
* Migrate to py-cid v0.4.0: Update dependencies and migrate base58 to py-multicodec - Update dependencies: py-multibase>=2.0.0, py-multicodec>=1.0.0, py-multihash>=3.0.0 - Remove local base58 module and migrate to py-multicodec's b58encode/b58decode - Update version to 0.4.0 - Add newsfragments for breaking changes, features, and internal changes - Remove base58 from ruff known-third-party config * Restore base58 package dependency - Add base58>=1.0.2,<2.0 to dependencies - Revert code to use base58 package instead of py-multicodec - Add base58 back to ruff known-third-party config * Fix linting and documentation issues - Fix import sorting in cid/cid.py (ruff) - Update Makefile to use --separate flag for sphinx-apidoc and remove modules.rst - Add cid.rst to toctree in docs/index.rst to fix documentation warning * Fix CI linting issues - Fix import order in cid/cid.py (ruff isort) - Remove trailing blank lines from newsfragments files (end-of-file-fixer) * Remove newsfragments for non-existent issue 48 * Simplify docs generation: use --no-toc instead of removing modules.rst - Use --no-toc flag to prevent generating modules.rst - Remove redundant rm -f docs/modules.rst commands - Cleaner approach similar to py-libp2p pattern * Restore local base58.py and revert version to 0.3.1 - Restore cid/base58.py (copied from base58 package) - Remove base58 package dependency from pyproject.toml - Update imports to use local base58 module - Revert version from 0.4.0 to 0.3.1 (version bump handled by release process) - Remove base58 from ruff known-third-party config
1 parent 99724e9 commit 7698276

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,14 @@ coverage: ## check code coverage quickly with the default Python
7373

7474
docs: ## generate Sphinx HTML documentation, including API docs
7575
rm -f docs/cid.rst
76-
rm -f docs/modules.rst
77-
sphinx-apidoc -o docs/ cid
76+
sphinx-apidoc -o docs/ --separate --no-toc cid
7877
$(MAKE) -C docs clean
7978
$(MAKE) -C docs html
8079
$(BROWSER) docs/_build/html/index.html
8180

8281
check-docs-ci: ## check documentation for CI
8382
rm -f docs/cid.rst
84-
rm -f docs/modules.rst
85-
sphinx-apidoc -o docs/ cid
83+
sphinx-apidoc -o docs/ --separate --no-toc cid
8684
$(MAKE) -C docs clean
8785
$(MAKE) -C docs html
8886

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Table of contents
1414
installation
1515
usage
1616
api_reference
17+
cid
1718
contributing
1819
authors
1920
history

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ classifiers = [
3232
requires-python = ">=3.10"
3333
dependencies = [
3434
"py-multibase>=1.0.0",
35-
"py-multicodec>=0.3.0",
35+
"py-multicodec>=1.0.0",
3636
"morphys>=1.0,<2.0",
37-
"py-multihash>=2.0.0",
37+
"py-multihash>=3.0.0",
3838
]
3939

4040
[project.urls]
@@ -149,7 +149,7 @@ combine-as-imports = true
149149
extra-standard-library = []
150150
force-sort-within-sections = true
151151
known-first-party = ["cid", "tests"]
152-
known-third-party = ["base58", "multibase", "multicodec", "morphys", "multihash"]
152+
known-third-party = ["multibase", "multicodec", "morphys", "multihash"]
153153
force-to-top = ["pytest"]
154154

155155
[tool.ruff.format]

tests/test_cid.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import string
33

44
import pytest
5-
import base58
65
from hypothesis import (
76
given,
87
strategies as st,
@@ -13,7 +12,7 @@
1312
import multicodec
1413
import multihash
1514

16-
from cid import CIDv0, CIDv1, from_string, is_cid, make_cid
15+
from cid import CIDv0, CIDv1, base58, from_string, is_cid, make_cid
1716

1817
ALLOWED_ENCODINGS = [encoding for encoding in ENCODINGS if encoding.code != b"\x00"]
1918

0 commit comments

Comments
 (0)