Skip to content

Commit 7a0de7d

Browse files
authored
Merge pull request #10 from fsspec/async
async implementation
2 parents cc8230d + 5c9bca4 commit 7a0de7d

File tree

12 files changed

+587
-12
lines changed

12 files changed

+587
-12
lines changed
File renamed without changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test without local gateway
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
max-parallel: 4
11+
matrix:
12+
python-version: [3.9]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -e .
24+
- name: Lint with flake8
25+
run: |
26+
pip install flake8
27+
# stop the build if there are Python syntax errors or undefined names
28+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
29+
# The GitHub editor is 127 chars wide
30+
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics
31+
- name: Test with pytest
32+
run: |
33+
pip install pytest pytest-asyncio
34+
pytest -m "not local_gw"

.github/workflows/local_gateway.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ jobs:
99
strategy:
1010
max-parallel: 4
1111
matrix:
12-
python-version: [3.9]
13-
ipfs-version: ["0.8.0"]
12+
python-version: ["3.8", "3.9", "3.10"]
13+
ipfs-version: ["0.12.0"]
14+
include:
15+
- python-version: "3.10"
16+
ipfs-version: "0.9.1"
1417
env:
1518
IPFSSPEC_GATEWAYS: "http://127.0.0.1:8080" # use only localhost as gateway
1619
steps:
@@ -27,12 +30,16 @@ jobs:
2730
run: |
2831
wget https://dist.ipfs.io/go-ipfs/v${{ matrix.ipfs-version }}/go-ipfs_v${{ matrix.ipfs-version }}_linux-amd64.tar.gz
2932
tar -xvzf go-ipfs_v${{ matrix.ipfs-version }}_linux-amd64.tar.gz
30-
cd go-ipfs
33+
pushd go-ipfs
3134
sudo bash install.sh
35+
sudo sysctl -w net.core.rmem_max=2500000
36+
popd
3237
ipfs --version
3338
ipfs init --profile server
34-
ipfs daemon > ipfs.log &
39+
ipfs daemon 2>ipfs.log | grep -i -o -m1 'Daemon is ready' & tail -f --pid=$! ipfs.log
40+
ipfs cat /ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme
41+
ipfs dag import test/testdata.car
3542
- name: Test with pytest
3643
run: |
37-
pip install pytest
44+
pip install pytest pytest-asyncio
3845
pytest

ipfsspec/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from .core import IPFSFileSystem
2+
from .async_ipfs import AsyncIPFSFileSystem
23
from fsspec import register_implementation
34

45
from ._version import get_versions
56
__version__ = get_versions()['version']
67
del get_versions
78

8-
register_implementation(IPFSFileSystem.protocol, IPFSFileSystem)
9+
# register_implementation(IPFSFileSystem.protocol, IPFSFileSystem)
10+
register_implementation(AsyncIPFSFileSystem.protocol, AsyncIPFSFileSystem)
911

10-
__all__ = ["__version__", "IPFSFileSystem"]
12+
__all__ = ["__version__", "IPFSFileSystem", "AsyncIPFSFileSystem"]

0 commit comments

Comments
 (0)