Skip to content

Commit

Permalink
♻️ Code refactor, include mypy support, and workflow_dispatch tri…
Browse files Browse the repository at this point in the history
…gger (#11)
  • Loading branch information
alvarobartt authored Sep 30, 2022
2 parents 06ac27b + e0c45e5 commit 5b3e81f
Show file tree
Hide file tree
Showing 12 changed files with 558 additions and 525 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: ci-cd

on:
workflow_dispatch:
push:
branches:
- main
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/push-docker.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: push-docker

on:
workflow_dispatch:
push:
branches:
- main
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: quality style tests
.PHONY: quality style types tests

quality:
black --check --target-version py39 --preview src/wandbfsspec tests
Expand All @@ -9,5 +9,8 @@ style:
black --target-version py39 --preview src/wandbfsspec tests
isort src/wandbfsspec tests

types:
mypy src/wandbfsspec tests

tests:
pytest tests/ --durations 0 -s
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The `wandbfsspec` implementation is based on https://github.com/fsspec/filesyste
Here's an example on how to locate and open a file from the File System:

```python
>>> from wandbfsspec.core import WandbFileSystem
>>> from wandbfsspec.spec import WandbFileSystem
>>> fs = WandbFileSystem(api_key="YOUR_API_KEY")
>>> fs.ls("alvarobartt/wandbfsspec-tests/3s6km7mp")
['alvarobartt/wandbfsspec-tests/3s6km7mp/config.yaml', 'alvarobartt/wandbfsspec-tests/3s6km7mp/file.yaml', 'alvarobartt/wandbfsspec-tests/3s6km7mp/files', 'alvarobartt/wandbfsspec-tests/3s6km7mp/output.log', 'alvarobartt/wandbfsspec-tests/3s6km7mp/requirements.txt', 'alvarobartt/wandbfsspec-tests/3s6km7mp/wandb-metadata.json', 'alvarobartt/wandbfsspec-tests/3s6km7mp/wandb-summary.json']
Expand All @@ -37,7 +37,7 @@ b'some: data\nfor: testing'
Which is similar to how to locate and open a file from the Artifact Storage (just changing the class and the path):

```python
>>> from wandbfsspec.core import WandbArtifactStore
>>> from wandbfsspec.spec import WandbArtifactStore
>>> fs = WandbArtifactStore(api_key="YOUR_API_KEY")
>>> fs.ls("wandb/yolo-chess/model/run_1dnrszzr_model/v8")
['wandb/yolo-chess/model/run_1dnrszzr_model/v8/last.pt']
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ repository = "https://github.com/alvarobartt/wandbfsspec"
license = "MIT License"

[tool.poetry.plugins."fsspec.specs"]
wandbfs = "wandbfsspec.core.WandbFileSystem"
wandbas = "wandbfsspec.core.WandbArtifactStore"
wandbfs = "wandbfsspec.spec.WandbFileSystem"
wandbas = "wandbfsspec.spec.WandbArtifactStore"

[tool.poetry.dependencies]
python = ">=3.7,<3.10"
Expand Down Expand Up @@ -52,6 +52,10 @@ implicit_reexport = false
strict_equality = true
# --strict end

[[tool.mypy.overrides]]
module = ["fsspec.*"]
ignore_missing_imports = true

[tool.pytest.ini_options]
log_cli = true
log_cli_level = "INFO"
Expand Down
Loading

0 comments on commit 5b3e81f

Please sign in to comment.