-
Notifications
You must be signed in to change notification settings - Fork 20
/
pyproject.toml
83 lines (72 loc) · 3.75 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "dc-custom-component"
description = 'Custom Haystack component to be used with deepset Cloud'
readme = "README.md"
requires-python = ">=3.10,<3.13" # deepset cloud at the moment uses 3.10
license = "MIT"
keywords = []
authors = [{ name = "deepset", email = "[email protected]" }]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"haystack-ai>=2.0.0"
]
dynamic = ["version"]
[tool.hatch.version]
path = "src/dc_custom_component/__about__.py"
[[tool.hatch.envs.all.matrix]]
python = ["3.10", "3.11"]
[tool.hatch.envs.default]
dependencies = [
"pytest==7.4.2",
]
[tool.hatch.envs.default.scripts]
tests = "pytest -vv tests"
[tool.hatch.envs.dc]
detached = true
[tool.hatch.envs.dc.scripts]
build = "mkdir -p dist && zip -r dist/custom_component.zip ./* -x 'dist/*' '**/__pycache__/*'"
push = "curl --request POST --url https://api.cloud.deepset.ai/api/v2/custom_components --header 'accept: application/json' --header \"Authorization: Bearer $API_KEY\" --form 'file=@dist/custom_component.zip;type=application/zip'"
build-and-push = "hatch run code-quality:all && mkdir -p dist && zip -r dist/custom_component.zip ./* -x 'dist/*' '**/__pycache__/*' && curl --request POST --url https://api.cloud.deepset.ai/api/v2/custom_components --header 'accept: application/json' --header \"Authorization: Bearer $API_KEY\" --form 'file=@dist/custom_component.zip;type=application/zip'"
list = "curl --request GET --url https://api.cloud.deepset.ai/api/v2/custom_components --header 'accept: application/json' --header \"Authorization: Bearer $API_KEY\""
build-windows = "powershell -Command \"& {{ if (-Not (Test-Path dist)) {{mkdir dist}}; if (Test-Path dist/custom_component.zip) {{ Remove-Item dist/custom_component.zip }}; Get-ChildItem -Path . | Where-Object {{ $_.FullName -notlike '*\\dist*' }} | Compress-Archive -DestinationPath dist/custom_component.zip -Update }}"
push-windows = "curl --request POST --url https://api.cloud.deepset.ai/api/v2/custom_components --header \"accept: application/json\" --header \"Authorization: Bearer %API_KEY%\" --form \"file=@dist/custom_component.zip;type=application/zip\""
list-windows = "curl --request GET --url https://api.cloud.deepset.ai/api/v2/custom_components --header \"accept: application/json\" --header \"Authorization: Bearer %API_KEY%\""
logs = "curl --request GET --url https://api.cloud.deepset.ai/api/v2/custom_components/logs --header 'accept: text/plain' --header \"Authorization: Bearer $API_KEY\""
logs-windows = "curl --request GET --url https://api.cloud.deepset.ai/api/v2/custom_components/logs --header \"accept: text/plain\" --header \"Authorization: Bearer %API_KEY%\""
[tool.hatch.envs.code-quality]
python = "3.11"
detached = true
dependencies = [
"black==23.9.1",
"mypy==1.9.0",
"ruff==0.3.2",
]
[tool.hatch.build.targets.wheel]
packages = ["src/dc_custom_component"]
[tool.hatch.envs.code-quality.scripts]
format = "black src tests --check"
format-fix = "black src tests"
lint = "ruff check . --output-format=github"
lint-ci = "ruff check . --output-format=github"
lint-fix = "ruff check . --fix --output-format=github"
hooks = "pre-commit install"
docstrings = "pydocstyle src"
all = "mypy src tests && black src tests && ruff check --fix ."
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true
disallow_incomplete_defs = true
disallow_untyped_defs = true