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

Use functools.lru_cache instead of functools.cache (for python 3.8) and add github actions CI #7

Merged
merged 4 commits into from
Jul 14, 2023
Merged
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
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: ci

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install wsinfer-zoo
run: python -m pip install -e .[dev]
- name: Check style (flake8)
run: python -m flake8 wsinfer_zoo/
- name: Check style (black)
run: python -m black --check wsinfer_zoo/
- name: Check types
run: python -m mypy --install-types --non-interactive wsinfer_zoo/
- name: Run the command line
run: |
wsinfer-zoo --help
wsinfer-zoo ls
- name: Attempt to download a model
run: wsinfer-zoo get prostate-tumor-resnet34.tcga-prad
6 changes: 5 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ classifiers =
packages = find:
python_requires = >= 3.7
install_requires =
click>=8.0,<9
click>=8.0,<9,!=8.1.4,!=8.1.5
huggingface_hub
jsonschema
tabulate
Expand All @@ -58,6 +58,10 @@ max-line-length = 88
extend-ignore = E203
exclude = wsinfer_zoo/_version.py

[mypy]
[mypy-huggingface_hub]
ignore_missing_imports = True

[versioneer]
VCS = git
style = pep440
Expand Down
2 changes: 1 addition & 1 deletion wsinfer_zoo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def from_dict(cls, config: Dict) -> "ModelRegistry":
return cls(models=models)


@functools.cache
@functools.lru_cache()
def load_registry(registry_file: Optional[Union[str, Path]] = None) -> ModelRegistry:
"""Load model registry.

Expand Down