Skip to content

Commit

Permalink
Merge pull request #10 from fsspec/async
Browse files Browse the repository at this point in the history
async implementation
  • Loading branch information
d70-t committed Mar 11, 2022
2 parents cc8230d + 5c9bca4 commit 7a0de7d
Show file tree
Hide file tree
Showing 12 changed files with 587 additions and 12 deletions.
File renamed without changes.
34 changes: 34 additions & 0 deletions .github/workflows/default_gateways.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test without local gateway

on: [push]

jobs:
test:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.9]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# The GitHub editor is 127 chars wide
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pip install pytest pytest-asyncio
pytest -m "not local_gw"
17 changes: 12 additions & 5 deletions .github/workflows/local_gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
ipfs-version: ["0.8.0"]
python-version: ["3.8", "3.9", "3.10"]
ipfs-version: ["0.12.0"]
include:
- python-version: "3.10"
ipfs-version: "0.9.1"
env:
IPFSSPEC_GATEWAYS: "http://127.0.0.1:8080" # use only localhost as gateway
steps:
Expand All @@ -27,12 +30,16 @@ jobs:
run: |
wget https://dist.ipfs.io/go-ipfs/v${{ matrix.ipfs-version }}/go-ipfs_v${{ matrix.ipfs-version }}_linux-amd64.tar.gz
tar -xvzf go-ipfs_v${{ matrix.ipfs-version }}_linux-amd64.tar.gz
cd go-ipfs
pushd go-ipfs
sudo bash install.sh
sudo sysctl -w net.core.rmem_max=2500000
popd
ipfs --version
ipfs init --profile server
ipfs daemon > ipfs.log &
ipfs daemon 2>ipfs.log | grep -i -o -m1 'Daemon is ready' & tail -f --pid=$! ipfs.log
ipfs cat /ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme
ipfs dag import test/testdata.car
- name: Test with pytest
run: |
pip install pytest
pip install pytest pytest-asyncio
pytest
6 changes: 4 additions & 2 deletions ipfsspec/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from .core import IPFSFileSystem
from .async_ipfs import AsyncIPFSFileSystem
from fsspec import register_implementation

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions

register_implementation(IPFSFileSystem.protocol, IPFSFileSystem)
# register_implementation(IPFSFileSystem.protocol, IPFSFileSystem)
register_implementation(AsyncIPFSFileSystem.protocol, AsyncIPFSFileSystem)

__all__ = ["__version__", "IPFSFileSystem"]
__all__ = ["__version__", "IPFSFileSystem", "AsyncIPFSFileSystem"]

0 comments on commit 7a0de7d

Please sign in to comment.