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

Fix instructor-embedders workflow #33

Merged
merged 15 commits into from
Oct 2, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ jobs:
with:
python-version: '3.10'

- name: Ruff
uses: chartboost/ruff-action@v1
with:
src: components/instructor-embedders

- name: Install instructor-embedders
run: |
pip install -e .[dev]

- name: Pylint
run: |
pylint -ry -j 0 ./instructor_embedders

- name: Run tests
run: |
pytest
pytest
82 changes: 23 additions & 59 deletions components/instructor-embedders/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,61 +46,34 @@ dependencies = [
"InstructorEmbedding"
]

[project.optional-dependencies]
dev = ["pytest"]

[project.urls]
Documentation = "https://github.com/deepset-ai/haystack-extras/tree/main/components/instructor-embedders#readme"
Issues = "https://github.com/deepset-ai/haystack-extras/issues"
Source = "https://github.com/deepset-ai/haystack-extras/tree/main/components/text2speech"
Source = "https://github.com/deepset-ai/haystack-extras/tree/main/components/instructor-embedders"

[tool.hatch.version]
path = "instructor_embedders/__about__.py"

[tool.hatch.envs.default]
dependencies = [
"coverage[toml]>=6.5",
"pytest",
]
dependencies = ["pytest", "pytest-cov"]

[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-report = [
"- coverage combine",
"coverage report",
]
cov = [
"test-cov",
"cov-report",
]
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=instructor-embedders --cov=tests"
no-cov = "cov --no-cov"

[[tool.hatch.envs.all.matrix]]
python = ["3.7", "3.8", "3.9", "3.10", "3.11"]
[[tool.hatch.envs.test.matrix]]
python = ["37", "38", "39", "310", "311"]

[tool.hatch.envs.lint]
detached = true
dependencies = [
"black>=23.1.0",
"mypy>=1.0.0",
"ruff>=0.0.243",
]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive {args:instructor_embedders tests}"
style = [
"ruff {args:.}",
"black --check --diff {args:.}",
]
fmt = [
"black {args:.}",
"ruff --fix {args:.}",
"style",
]
all = [
"style",
"typing",
]
[tool.coverage.run]
branch = true
parallel = true
omit = ["instructor_embedders/__about__.py"]

[tool.black]
target-version = ["py37"]
line-length = 120
skip-string-normalization = true
[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]

[tool.ruff]
target-version = "py37"
Expand Down Expand Up @@ -157,21 +130,12 @@ ban-relative-imports = "all"
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]

[tool.coverage.run]
source_pkgs = ["instructor_embedders", "tests"]
branch = true
parallel = true
omit = [
"instructor_embedders/__about__.py",
]
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--strict-markers"
markers = ["integration: integration tests", "unit: unit tests"]
log_cli = true

[tool.coverage.paths]
instructor_embedders = ["instructor_embedders", "*/instructor-embedders/instructor_embedders"]
tests = ["tests", "*/instructor-embedders/tests"]
[tool.black]
line-length = 120

[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-FileCopyrightText: 2023-present deepset GmbH <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0

def test_instructor_embedders():
assert True