Josep Pon Farreny commited on
Commit
68b2c16
·
1 Parent(s): dbdd109

chore: Add project configuration files

Browse files
Files changed (8) hide show
  1. .gitignore +130 -0
  2. .pre-commit-config.yaml +118 -0
  3. README.md +24 -2
  4. pyproject.toml +125 -0
  5. requirements-dev.txt +97 -0
  6. requirements.txt +72 -1
  7. tdagent/__init__.py +0 -0
  8. uv.lock +0 -0
.gitignore ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ env/
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+
28
+ # PyInstaller
29
+ # Usually these files are written by a python script from a template
30
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ .hypothesis/
48
+ .pytest_cache/
49
+
50
+ # Translations
51
+ *.mo
52
+ *.pot
53
+
54
+ # PyBuilder
55
+ target/
56
+
57
+ # Jupyter Notebook
58
+ .ipynb_checkpoints
59
+
60
+ # pyenv
61
+ .python-version
62
+
63
+ # dotenv
64
+ .env
65
+
66
+ # virtualenv
67
+ .venv
68
+ venv/
69
+ ENV/
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # mkdocs documentation
75
+ /site
76
+ docs/*.png
77
+
78
+ # mypy
79
+ .mypy_cache/
80
+
81
+ # vscode cache
82
+ .vscode
83
+
84
+ # Pycharm files
85
+ .idea
86
+
87
+ ### macOS template
88
+ *.DS_Store
89
+ .AppleDouble
90
+ .LSOverride
91
+
92
+ # serverless
93
+ **/.serverless
94
+ **/node_modules
95
+
96
+ # terraform
97
+ **/.terraform
98
+ *.tfstate*
99
+
100
+ # exclude temp files from source control
101
+ temp/
102
+ tmp/
103
+
104
+ # exclude data from source control by default
105
+ /data/*
106
+
107
+ !/data/sat2023-sample/
108
+ !/data/cnf-sample/
109
+
110
+ !/data/sat2023-cos-similarity-dataset/
111
+ /data/sat2023-cos-similarity-dataset/*
112
+ !/data/sat2023-cos-similarity-dataset/results_main_detailed.csv
113
+
114
+ # Configurations
115
+ /config/
116
+
117
+ # Logs
118
+ lightning_logs/
119
+
120
+ # Models
121
+ /models/
122
+
123
+
124
+ # Poetry code artifact settings
125
+ .poetry/
126
+ poetry.toml
127
+
128
+ # Mise
129
+ .mise.toml
130
+ mise.toml
.pre-commit-config.yaml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v2.4.0
4
+ hooks:
5
+ - id: requirements-txt-fixer
6
+ files: requirements.txt|requirements-dev.txt|requirements-test.txt
7
+ - id: trailing-whitespace
8
+ exclude: |
9
+ (?x)^(
10
+ notebooks/
11
+ )
12
+ args: [--markdown-linebreak-ext=md]
13
+ - id: end-of-file-fixer
14
+ exclude: |
15
+ (?x)^(
16
+ notebooks/
17
+ )
18
+ - id: check-yaml
19
+ - id: check-symlinks
20
+ - id: check-toml
21
+ - id: check-added-large-files
22
+ args: ["--maxkb=1000"]
23
+ - repo: https://github.com/asottile/add-trailing-comma
24
+ rev: v3.1.0
25
+ hooks:
26
+ - id: add-trailing-comma
27
+ - repo: https://github.com/psf/black
28
+ rev: 23.1.0
29
+ hooks:
30
+ - id: black
31
+ exclude: |
32
+ (?x)^(
33
+ notebooks/
34
+ )
35
+ - repo: https://github.com/pycqa/isort
36
+ rev: "5.12.0"
37
+ hooks:
38
+ - id: isort
39
+ exclude: |
40
+ (?x)^(
41
+ notebooks/
42
+ )
43
+ - repo: https://github.com/astral-sh/ruff-pre-commit
44
+ rev: v0.9.7
45
+ hooks:
46
+ - id: ruff # linter
47
+ exclude: |
48
+ (?x)^(
49
+ scripts/|
50
+ notebooks/
51
+ )
52
+ # - id: ruff-format
53
+ - repo: local
54
+ hooks:
55
+ - id: update-req
56
+ name: Update requirements.txt
57
+ stages: [pre-commit]
58
+ language: system
59
+ entry: uv
60
+ files: uv.lock|requirements.txt
61
+ pass_filenames: false
62
+ args:
63
+ [
64
+ "export",
65
+ "--format",
66
+ "requirements-txt",
67
+ "--no-hashes",
68
+ "--no-dev",
69
+ "-o",
70
+ "requirements.txt",
71
+ ]
72
+ - id: update-dev-req
73
+ name: Update requirements-dev.txt
74
+ stages: [pre-commit]
75
+ language: system
76
+ entry: uv
77
+ files: uv.lock|requirements-dev.txt
78
+ pass_filenames: false
79
+ args:
80
+ [
81
+ "export",
82
+ "--format",
83
+ "requirements-txt",
84
+ "--no-hashes",
85
+ "--group",
86
+ "dev",
87
+ "--group",
88
+ "test",
89
+ "-o",
90
+ "requirements-dev.txt",
91
+ ]
92
+ - id: mypy
93
+ name: Running mypy
94
+ stages: [commit]
95
+ language: system
96
+ entry: uv run mypy
97
+ args: [--install-types, --non-interactive]
98
+ types: [python]
99
+ exclude: |
100
+ (?x)^(
101
+ scripts/|
102
+ notebooks/
103
+ )
104
+
105
+ # - id: pytest
106
+ # name: pytest
107
+ # stages: [commit]
108
+ # language: system
109
+ # entry: poetry run pytest
110
+ # types: [python]
111
+
112
+ # - id: pytest-cov
113
+ # name: pytest
114
+ # stages: [push]
115
+ # language: system
116
+ # entry: poetry run pytest --cov --cov-fail-under=100
117
+ # types: [python]
118
+ # pass_filenames: false
README.md CHANGED
@@ -7,7 +7,29 @@ sdk: gradio
7
  sdk_version: 5.0.1
8
  app_file: app.py
9
  pinned: false
10
- short_description: TBD
 
11
  ---
12
 
13
- An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  sdk_version: 5.0.1
8
  app_file: app.py
9
  pinned: false
10
+ license: apache-2.0
11
+ short_description: tdb
12
  ---
13
 
14
+ # TDA Agent Tools
15
+
16
+ # Development setup
17
+
18
+ To start developing you need the following tools:
19
+
20
+ * [uv](https://docs.astral.sh/uv/)
21
+
22
+ To start, sync all the dependencies with `uv sync --all-groups`.
23
+ Then, install the pre-commit hooks (`uv run pre-commit install`) to
24
+ ensure that future commits comply with the bare minimum to keep
25
+ code _readable_.
26
+
27
+ Once `uv` has installed all the dependencies, install the `pre-commit`
28
+ hooks to run linting and requirement files update, etc., before creating
29
+ new commits:
30
+
31
+ ```bash
32
+ uv run pre-commit install
33
+ ````
34
+
35
+ # Add a new tool
pyproject.toml ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [project]
2
+ name = "tdagent"
3
+ version = "0.1.0"
4
+ description = "TDA Agent Tools implemented for huggingface hackathon."
5
+ authors = [
6
+ { name = "Pedro Completo Bento", email = "[email protected]" },
7
+ { name = "Josep Pon Farreny", email = "[email protected]" },
8
+ { name = "Miguel Rodin Rodriguez", email = "[email protected]" },
9
+ { name = "Sofia Jeronimo dos Santos", email = "[email protected]" },
10
+ { name = "Rodrigo Dominguez Sanz", email = "[email protected]" },
11
+ ]
12
+ requires-python = ">=3.10,<4"
13
+ readme = "README.md"
14
+ license = ""
15
+ dependencies = ["gradio[mcp]>=5.32.1", "requests>=2.32.3"]
16
+
17
+ [project.scripts]
18
+
19
+
20
+ [dependency-groups]
21
+ dev = ["mypy~=1.14", "ruff>=0.9,<1", "pre-commit~=3.4", "pip-audit>=2.9.0"]
22
+ test = [
23
+ "pytest>=7.4.4,<8",
24
+ "pytest-cov>=4.1.0,<5",
25
+ "pytest-randomly>=3.15.0,<4",
26
+ "xdoctest>=1.1.2,<2",
27
+ ]
28
+
29
+ [build-system]
30
+ requires = ["hatchling"]
31
+ build-backend = "hatchling.build"
32
+
33
+ [tool.uv]
34
+ package = false
35
+ default-groups = ["dev", "test"]
36
+
37
+ [tool.uv.workspace]
38
+ members = ["test"]
39
+
40
+ [tool.black]
41
+ target-version = ["py39", "py310", "py311"]
42
+ line-length = 88
43
+
44
+ [tool.isort]
45
+ profile = "black"
46
+ lines_after_imports = 2
47
+
48
+ [tool.mypy]
49
+ cache_dir = ".cache/mypy/"
50
+ ignore_missing_imports = true
51
+ no_implicit_optional = true
52
+ check_untyped_defs = true
53
+ strict_equality = true
54
+ disallow_any_generics = true
55
+ disallow_subclassing_any = true
56
+ disallow_untyped_calls = true
57
+ disallow_untyped_defs = true
58
+ disallow_incomplete_defs = true
59
+ disallow_untyped_decorators = true
60
+ warn_redundant_casts = true
61
+ warn_unused_ignores = true
62
+ exclude = "docs/"
63
+ plugins = ["pydantic.mypy"] # ["numpy.typing.mypy_plugin"]
64
+
65
+ [[tool.mypy.overrides]]
66
+ module = "tests.*"
67
+ disallow_untyped_defs = false
68
+ disallow_incomplete_defs = false
69
+
70
+ [tool.pytest.ini_options]
71
+ cache_dir = ".cache"
72
+ testpaths = ["tests", "tda_agent"]
73
+ addopts = [
74
+ "--strict",
75
+ "-r sxX",
76
+ "--cov-report=html",
77
+ "--cov-report=term-missing:skip-covered",
78
+ "--no-cov-on-fail",
79
+ "--xdoc",
80
+ ]
81
+ console_output_style = "count"
82
+ markers = ""
83
+ filterwarnings = ["ignore::DeprecationWarning"]
84
+
85
+ [tool.ruff]
86
+ cache-dir = ".cache/ruff"
87
+ exclude = [
88
+ ".git",
89
+ "__pycache__",
90
+ "docs/source/conf.py",
91
+ "old",
92
+ "build",
93
+ "dist",
94
+ ".venv",
95
+ "scripts",
96
+ ]
97
+ line-length = 88
98
+
99
+ [tool.ruff.lint]
100
+ select = ["ALL"]
101
+ ignore = ["D100", "D104", "D107", "D401", "EM102", "ERA001", "TRY003"]
102
+
103
+ [tool.ruff.lint.flake8-quotes]
104
+ inline-quotes = "double"
105
+
106
+ [tool.ruff.lint.flake8-bugbear]
107
+ # Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`.
108
+ extend-immutable-calls = ["typer.Argument", "typer.Option"]
109
+
110
+ [tool.ruff.lint.pep8-naming]
111
+ ignore-names = ["F", "L"]
112
+
113
+ [tool.ruff.lint.isort]
114
+ lines-after-imports = 2
115
+
116
+ [tool.ruff.lint.mccabe]
117
+ max-complexity = 18
118
+
119
+ [tool.ruff.lint.pydocstyle]
120
+ convention = "google"
121
+
122
+ [tool.ruff.lint.per-file-ignores]
123
+ "*/__init__.py" = ["F401"]
124
+ "tdagent/cli/**/*.py" = ["D103", "T201"]
125
+ "tests/*.py" = ["D103", "PLR2004", "S101"]
requirements-dev.txt ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was autogenerated by uv via the following command:
2
+ # uv export --format requirements-txt --no-hashes --group dev --group test -o requirements-dev.txt
3
+ aiofiles==24.1.0
4
+ annotated-types==0.7.0
5
+ anyio==4.9.0
6
+ audioop-lts==0.2.1 ; python_full_version >= '3.13'
7
+ boolean-py==5.0
8
+ cachecontrol==0.14.3
9
+ certifi==2025.4.26
10
+ cfgv==3.4.0
11
+ charset-normalizer==3.4.2
12
+ click==8.2.1 ; sys_platform != 'emscripten'
13
+ colorama==0.4.6 ; sys_platform == 'win32'
14
+ coverage==7.8.2
15
+ cyclonedx-python-lib==9.1.0
16
+ defusedxml==0.7.1
17
+ distlib==0.3.9
18
+ exceptiongroup==1.3.0 ; python_full_version < '3.11'
19
+ fastapi==0.115.12
20
+ ffmpy==0.6.0
21
+ filelock==3.18.0
22
+ fsspec==2025.5.1
23
+ gradio==5.32.1
24
+ gradio-client==1.10.2
25
+ groovy==0.1.2
26
+ h11==0.16.0
27
+ hf-xet==1.1.2 ; platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'
28
+ httpcore==1.0.9
29
+ httpx==0.28.1
30
+ httpx-sse==0.4.0
31
+ huggingface-hub==0.32.4
32
+ identify==2.6.12
33
+ idna==3.10
34
+ iniconfig==2.1.0
35
+ jinja2==3.1.6
36
+ license-expression==30.4.1
37
+ markdown-it-py==3.0.0
38
+ markupsafe==3.0.2
39
+ mcp==1.9.0
40
+ mdurl==0.1.2
41
+ msgpack==1.1.0
42
+ mypy==1.16.0
43
+ mypy-extensions==1.1.0
44
+ nodeenv==1.9.1
45
+ numpy==2.2.6
46
+ orjson==3.10.18
47
+ packageurl-python==0.16.0
48
+ packaging==25.0
49
+ pandas==2.2.3
50
+ pathspec==0.12.1
51
+ pillow==11.2.1
52
+ pip==25.1.1
53
+ pip-api==0.0.34
54
+ pip-audit==2.9.0
55
+ pip-requirements-parser==32.0.1
56
+ platformdirs==4.3.8
57
+ pluggy==1.6.0
58
+ pre-commit==3.8.0
59
+ py-serializable==2.0.0
60
+ pydantic==2.11.5
61
+ pydantic-core==2.33.2
62
+ pydantic-settings==2.9.1
63
+ pydub==0.25.1
64
+ pygments==2.19.1
65
+ pyparsing==3.2.3
66
+ pytest==7.4.4
67
+ pytest-cov==4.1.0
68
+ pytest-randomly==3.16.0
69
+ python-dateutil==2.9.0.post0
70
+ python-dotenv==1.1.0
71
+ python-multipart==0.0.20
72
+ pytz==2025.2
73
+ pyyaml==6.0.2
74
+ requests==2.32.3
75
+ rich==14.0.0
76
+ ruff==0.11.12
77
+ safehttpx==0.1.6
78
+ semantic-version==2.10.0
79
+ shellingham==1.5.4 ; sys_platform != 'emscripten'
80
+ six==1.17.0
81
+ sniffio==1.3.1
82
+ sortedcontainers==2.4.0
83
+ sse-starlette==2.3.6
84
+ starlette==0.46.2
85
+ toml==0.10.2
86
+ tomli==2.2.1 ; python_full_version <= '3.11'
87
+ tomlkit==0.13.2
88
+ tqdm==4.67.1
89
+ typer==0.16.0 ; sys_platform != 'emscripten'
90
+ typing-extensions==4.14.0
91
+ typing-inspection==0.4.1
92
+ tzdata==2025.2
93
+ urllib3==2.4.0
94
+ uvicorn==0.34.3 ; sys_platform != 'emscripten'
95
+ virtualenv==20.31.2
96
+ websockets==15.0.1
97
+ xdoctest==1.2.0
requirements.txt CHANGED
@@ -1 +1,72 @@
1
- huggingface_hub==0.25.2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was autogenerated by uv via the following command:
2
+ # uv export --format requirements-txt --no-hashes --no-dev -o requirements.txt
3
+ aiofiles==24.1.0
4
+ annotated-types==0.7.0
5
+ anyio==4.9.0
6
+ audioop-lts==0.2.1 ; python_full_version >= '3.13'
7
+ certifi==2025.4.26
8
+ charset-normalizer==3.4.2
9
+ click==8.2.1 ; sys_platform != 'emscripten'
10
+ colorama==0.4.6 ; sys_platform == 'win32'
11
+ coverage==7.8.2
12
+ exceptiongroup==1.3.0 ; python_full_version < '3.11'
13
+ fastapi==0.115.12
14
+ ffmpy==0.6.0
15
+ filelock==3.18.0
16
+ fsspec==2025.5.1
17
+ gradio==5.32.1
18
+ gradio-client==1.10.2
19
+ groovy==0.1.2
20
+ h11==0.16.0
21
+ hf-xet==1.1.2 ; platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'
22
+ httpcore==1.0.9
23
+ httpx==0.28.1
24
+ httpx-sse==0.4.0
25
+ huggingface-hub==0.32.4
26
+ idna==3.10
27
+ iniconfig==2.1.0
28
+ jinja2==3.1.6
29
+ markdown-it-py==3.0.0 ; sys_platform != 'emscripten'
30
+ markupsafe==3.0.2
31
+ mcp==1.9.0
32
+ mdurl==0.1.2 ; sys_platform != 'emscripten'
33
+ numpy==2.2.6
34
+ orjson==3.10.18
35
+ packaging==25.0
36
+ pandas==2.2.3
37
+ pillow==11.2.1
38
+ pluggy==1.6.0
39
+ pydantic==2.11.5
40
+ pydantic-core==2.33.2
41
+ pydantic-settings==2.9.1
42
+ pydub==0.25.1
43
+ pygments==2.19.1 ; sys_platform != 'emscripten'
44
+ pytest==7.4.4
45
+ pytest-cov==4.1.0
46
+ pytest-randomly==3.16.0
47
+ python-dateutil==2.9.0.post0
48
+ python-dotenv==1.1.0
49
+ python-multipart==0.0.20
50
+ pytz==2025.2
51
+ pyyaml==6.0.2
52
+ requests==2.32.3
53
+ rich==14.0.0 ; sys_platform != 'emscripten'
54
+ ruff==0.11.12 ; sys_platform != 'emscripten'
55
+ safehttpx==0.1.6
56
+ semantic-version==2.10.0
57
+ shellingham==1.5.4 ; sys_platform != 'emscripten'
58
+ six==1.17.0
59
+ sniffio==1.3.1
60
+ sse-starlette==2.3.6
61
+ starlette==0.46.2
62
+ tomli==2.2.1 ; python_full_version <= '3.11'
63
+ tomlkit==0.13.2
64
+ tqdm==4.67.1
65
+ typer==0.16.0 ; sys_platform != 'emscripten'
66
+ typing-extensions==4.14.0
67
+ typing-inspection==0.4.1
68
+ tzdata==2025.2
69
+ urllib3==2.4.0
70
+ uvicorn==0.34.3 ; sys_platform != 'emscripten'
71
+ websockets==15.0.1
72
+ xdoctest==1.2.0
tdagent/__init__.py ADDED
File without changes
uv.lock ADDED
The diff for this file is too large to render. See raw diff