diff --git a/.github/workflows/components_instructor_embedders b/.github/workflows/components_instructor_embedders.yml similarity index 82% rename from .github/workflows/components_instructor_embedders rename to .github/workflows/components_instructor_embedders.yml index 884302d6d..710776d12 100644 --- a/.github/workflows/components_instructor_embedders +++ b/.github/workflows/components_instructor_embedders.yml @@ -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 \ No newline at end of file + pytest diff --git a/components/instructor-embedders/pyproject.toml b/components/instructor-embedders/pyproject.toml index d419e3de8..bea7cc53a 100644 --- a/components/instructor-embedders/pyproject.toml +++ b/components/instructor-embedders/pyproject.toml @@ -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" @@ -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:", -] diff --git a/components/instructor-embedders/tests/test_instructor_embedders.py b/components/instructor-embedders/tests/test_instructor_embedders.py new file mode 100644 index 000000000..129c33f3c --- /dev/null +++ b/components/instructor-embedders/tests/test_instructor_embedders.py @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2023-present deepset GmbH +# +# SPDX-License-Identifier: Apache-2.0 + +def test_instructor_embedders(): + assert True