Skip to content
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

Refactor to incorporate latest py-hamt changes #17

Closed
wants to merge 6 commits into from
Closed
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
35 changes: 35 additions & 0 deletions .github/workflows/pages-main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy static site generated by pdoc to GitHub Pages
on:
push:
branches: ["main"]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Create project environment
run: uv sync
- name: Build with pdoc
run: uv run pdoc ipldstore -o ./_site
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
41 changes: 41 additions & 0 deletions .github/workflows/pages-preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Adapted from https://github.com/github/opensource.guide/blob/main/.github/workflows/jekyll-preview.yml

name: Deploy static site generated by pdoc to GitHub Pages preview environment
on: pull_request
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
environment:
name: "Pages Preview"
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
# For PRs make sure to checkout the PR branch
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Create project environment
run: uv sync
- name: Build with pdoc
run: uv run pdoc ipldstore -o ./_site
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
with:
preview: "true"
38 changes: 38 additions & 0 deletions .github/workflows/run-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Run checks
run-name: Triggered on push from ${{ github.actor }} to branch/tag ${{ github.ref_name }}
on: push
# Should be the same as ipldstore/run-checks.sh

jobs:
run_checks:
name: Create project environment, run all checks
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Create project environment
run: uv sync

- name: Install IPFS
uses: ibnesayeed/setup-ipfs@master
with:
ipfs_version: "0.32.1"
run_daemon: true
id: ipfs_setup

- name: Run pytest with coverage
run: uv run pytest --cov=ipldstore tests/

- name: Check coverage
run: uv run coverage report --fail-under=100 --show-missing

- name: Check linting with ruff
run: uv run ruff check

- name: Check formatting with ruff
run: uv run ruff format --check
25 changes: 0 additions & 25 deletions .github/workflows/tox.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.DS_Store
memray*
*.prof

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
9 changes: 0 additions & 9 deletions .pylintrc

This file was deleted.

1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
23 changes: 3 additions & 20 deletions ipldstore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
"""
IPLD stores for zarr
"""

from .ipldstore import IPLDStore
from .contentstore import ContentAddressableStore, MappingCAStore, IPFSStore


def get_ipfs_mapper(
host: str = "http://127.0.0.1:5001",
max_nodes_per_level: int = 10000,
chunker: str = "size-262144",
should_async_get: bool = True,
) -> IPLDStore:
"""
Get an IPLDStore for IPFS running on the given host.
"""
return IPLDStore(
host,
IPFSStore(host, chunker=chunker, max_nodes_per_level=max_nodes_per_level),
should_async_get=should_async_get,
)
__all__ = [
"IPLDStore",
]
116 changes: 0 additions & 116 deletions ipldstore/car.py

This file was deleted.

60 changes: 0 additions & 60 deletions ipldstore/car_reference_fs.py

This file was deleted.

Loading
Loading