Skip to content

Commit

Permalink
Merge branch 'master' into feature/mypy-types-cleanlab-internal-util
Browse files Browse the repository at this point in the history
  • Loading branch information
elisno committed Jun 29, 2023
2 parents c6022d4 + 5eb89fc commit c2eb833
Show file tree
Hide file tree
Showing 164 changed files with 20,437 additions and 1,620 deletions.
15 changes: 15 additions & 0 deletions .github/get_min_dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""This script fetches minimum dependencies of cleanlab package and writes them to the file requirements-min.txt"""
import json


if __name__ == "__main__":
with open("./deps.json", "r") as f:
deps = json.load(f)

for package in deps:
if package["package"]["package_name"] == "cleanlab":
for dep in package["dependencies"]:
req_version = dep["required_version"]
with open("requirements-min.txt", "a") as f:
if req_version.startswith(">="):
f.write(f"{dep['package_name']}=={req_version[2:]}\n")
79 changes: 76 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,53 @@ on:
schedule:
- cron: '0 12 * * 1'
jobs:
test37:
name: "Test: Python 3.7 on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.7.16
- name: Install cleanlab
run: pip install -e .
- name: Install development dependencies
run: pip install -r requirements-dev.txt
- name: Install fasttext for non-Windows machines
if: matrix.os != 'windows-latest'
run: |
pip install fasttext
- name: Test with coverage
run: pytest --verbose --cov=cleanlab/ --cov-config .coveragerc --cov-report=xml
env:
TEST_FASTTEXT: true
- uses: codecov/codecov-action@v3
test37-windows:
name: "Test: Python 3.7 on windows"
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.7.9
- name: Install cleanlab
run: pip install -e .
- name: Install development dependencies
run: pip install -r requirements-dev.txt
- name: Overwrite tensorflow version on Windows
run: |
pip uninstall -y tensorflow
pip install tensorflow-cpu
- name: Test with coverage
run: pytest --verbose --cov=cleanlab/ --cov-config .coveragerc --cov-report=xml
env:
TEST_FASTTEXT: true
- uses: codecov/codecov-action@v3
test:
name: "Test: Python ${{ matrix.python }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
Expand All @@ -15,7 +62,6 @@ jobs:
- macos-latest
- windows-latest
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
Expand All @@ -26,18 +72,45 @@ jobs:
python-version: ${{ matrix.python }}
- name: Install cleanlab
run: pip install -e .
- name: Check cleanlab runs without optional dependencies
run: python3 -c "import cleanlab"
- name: Install development dependencies
run: pip install -r requirements-dev.txt
- name: Install fasttext for non-Windows machines
if: matrix.os != 'windows-latest'
run: |
pip install fasttext
- name: Overwrite tensorflow version on Windows
if: matrix.os == 'windows-latest'
run: |
pip uninstall -y tensorflow
pip install tensorflow-cpu
- name: Test with coverage
run: pytest --verbose --cov=cleanlab/ --cov-config .coveragerc --cov-report=xml
env:
TEST_FASTTEXT: true
- uses: codecov/codecov-action@v3
test-without-extras-min-versions:
name: Test without optional dependencies and with minimum compatible versions of dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Install cleanlab
run: |
python -m pip install --upgrade pip
pip install .
- name: Install test dependencies
run: |
pip install pytest pytest-lazy-fixture pipdeptree
pipdeptree -j > deps.json
- name: Install minimum versions
run: |
python ./.github/get_min_dependencies.py
pip install -r requirements-min.txt
- name: Run tests
run: |
pytest tests/test_multilabel_classification.py tests/test_multiannotator.py tests/test_filter_count.py
typecheck:
name: Type check
runs-on: ubuntu-latest
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ jobs:
find . -name '*.html' -delete
- run: |
find . -name '*.md' -exec pandoc -i {} -o {}.html \;
- uses: anishathalye/proof-html@v1
- uses: anishathalye/proof-html@v2
with:
directory: .
check_html: false
check_favicon: false
empty_alt_ignore: true
url_ignore_re: |
^https:\/\/docs\.github\.com\/
^https:\/\/github\.com\/cleanlab\/cleanlab\/projects
ignore_missing_alt: true
tokens: |
{"https://github.com": "${{ secrets.GITHUB_TOKEN }}"}
swap_urls: |
{"^\.\/\(.*\).md": "\\1.md.html"}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ venv.bak/
/docs/source/notebooks/*.gz
/docs/source/notebooks/spoken_digits
/docs/source/notebooks/pretrained_models
/docs/source/tutorials/datalab/datalab-files/

# Editor files
.vscode/
Expand Down
9 changes: 9 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ ignore_missing_imports = True

[mypy-tqdm.*]
ignore_missing_imports = True

[mypy-matplotlib.*]
ignore_missing_imports = True

[mypy-datasets.*]
ignore_missing_imports = True

[mypy-scipy.*]
ignore_missing_imports = True
Loading

0 comments on commit c2eb833

Please sign in to comment.