-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/embeddings-benchmark/mteb
- Loading branch information
Showing
233 changed files
with
7,196 additions
and
3,658 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# GitHub action to run linting | ||
|
||
name: run-linting | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8" | ||
cache: "pip" | ||
|
||
- name: Install dependencies | ||
run: make install | ||
|
||
- name: Lint | ||
id: lint | ||
run: | | ||
make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# This workflow will | ||
# - Find the latest version tag based on the commit history | ||
# - Create a git tag for the new version | ||
# - Update the version number in pyproject.toml based on the commit history | ||
# - Upload the package to PyPI | ||
# - Create a release on GitHub | ||
|
||
# This workflow required the following secrets to be set: | ||
# - a GitHub personal access token with the `repo` scope called `RELEASE` | ||
# - and that you setup trusted publishing using PyPI as described here: https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ | ||
|
||
name: Release | ||
on: | ||
workflow_run: | ||
workflows: ["tests"] | ||
types: | ||
- completed | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
concurrency: release | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing using PyPI | ||
|
||
|
||
if: ${{ github.ref == 'refs/heads/main' && github.event.workflow_run.conclusion == 'success'}} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.RELEASE }} | ||
|
||
- name: Python Semantic Release | ||
id: release | ||
uses: python-semantic-release/python-semantic-release@v8.0.4 | ||
with: | ||
github_token: ${{ secrets.RELEASE }} | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: steps.release.outputs.released == 'true' | ||
# This action supports PyPI's trusted publishing implementation, which allows authentication to PyPI without a manually | ||
# configured API token or username/password combination. To perform trusted publishing with this action, your project's | ||
# publisher must already be configured on PyPI. | ||
|
||
- name: Publish package distributions to GitHub Releases | ||
uses: python-semantic-release/upload-to-gh-release@main | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
github_token: ${{ secrets.RELEASE }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# This workflow will: | ||
# 1) install Python dependencies | ||
# 2) run make test | ||
|
||
|
||
name: Tests | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
pytest: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] #, macos-latest, windows-latest] | ||
python-version: ["3.8", "3.9", "3.10"] | ||
|
||
# This allows a subsequently queued workflow run to interrupt previous runs | ||
concurrency: | ||
group: "${{ github.workflow }}-${{ matrix.python-version}}-${{ matrix.os }} @ ${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
make install | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,3 +133,6 @@ dmypy.json | |
|
||
# error logs | ||
error_logs.txt | ||
|
||
# tests | ||
tests/results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,17 @@ | ||
.PHONY: modified_only_fixup quality style fixup tests | ||
|
||
check_dirs := tests mteb scripts | ||
|
||
modified_only_fixup: | ||
$(eval modified_py_files := $(shell python utils/get_modified_files.py $(check_dirs))) | ||
@if test -n "$(modified_py_files)"; then \ | ||
echo "Checking/fixing $(modified_py_files)"; \ | ||
black --preview $(modified_py_files); \ | ||
isort $(modified_py_files); \ | ||
flake8 $(modified_py_files); \ | ||
else \ | ||
echo "No library .py files were modified"; \ | ||
fi | ||
|
||
# Super fast fix and check target that only works on relevant modified files since the branch was made | ||
fixup: modified_only_fixup | ||
|
||
|
||
# This installs all the required dependencies | ||
install: | ||
@echo "--- 🚀 Installing project dependencies ---" | ||
pip install -e ".[dev]" | ||
|
||
# this target runs checks on all files | ||
quality: | ||
black --check --preview $(check_dirs) | ||
isort --check-only $(check_dirs) | ||
flake8 $(check_dirs) | ||
|
||
|
||
# this target runs checks on all files and potentially modifies some of them | ||
style: | ||
black --preview $(check_dirs) | ||
isort $(check_dirs) | ||
|
||
# runs the same lints as the github actions | ||
lint: | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
@echo "--- 🧹 Running linters ---" | ||
ruff format . # running ruff formatting | ||
ruff check . --fix # running ruff linting | ||
|
||
# Run tests for the library | ||
test: | ||
@echo "--- 🧪 Running tests ---" | ||
pytest | ||
|
||
# add parllel test for faster execution (can sometimes cause issues with some tests) | ||
test-parallel: | ||
pytest -n auto --dist=loadfile -s -v | ||
@echo "--- 🧪 Running tests ---" | ||
@echo "Note that parallel tests can sometimes cause issues with some tests." | ||
pytest -n auto --dist=loadfile -s -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.