Skip to content

Commit 632ca86

Browse files
Fixes CI errors.
1 parent a1236f2 commit 632ca86

File tree

9 files changed

+28
-15
lines changed

9 files changed

+28
-15
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Install dependencies
3333
run: |
3434
python -m pip install --upgrade pip
35-
pip install -e ".[dev]"
35+
pip install -e ".[dev,viz]"
3636
3737
- name: Run tests with pytest (including slow tests)
3838
run: |
@@ -65,7 +65,8 @@ jobs:
6565
- name: Run ruff
6666
run: |
6767
# Check only for errors (E) and critical failures (F), not style warnings
68-
ruff check . --select E,F
68+
# Exclude tests directory from linting
69+
ruff check . --select E,F --exclude tests/
6970
# Format check is optional - only fail on critical issues
7071
ruff format --check . || true
7172
@@ -119,6 +120,9 @@ jobs:
119120
- name: Install dependencies
120121
run: |
121122
python -m pip install --upgrade pip
123+
# Install the package first
124+
pip install -e .
125+
# Then install documentation dependencies
122126
pip install -r docs/requirements.txt
123127
124128
- name: Build documentation

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Overview
22

3+
[![GitHub](https://img.shields.io/badge/github-decomp-blue?logo=github)](https://github.com/decompositional-semantics-initiative/decomp)
34
[![CI](https://github.com/decompositional-semantics-initiative/decomp/actions/workflows/ci.yml/badge.svg)](https://github.com/decompositional-semantics-initiative/decomp/actions/workflows/ci.yml)
45
[![Documentation](https://readthedocs.org/projects/decomp/badge/?version=latest)](https://decomp.readthedocs.io/en/latest/?badge=latest)
5-
[![GitHub](https://img.shields.io/badge/github-decomp-blue?logo=github)](https://github.com/decompositional-semantics-initiative/decomp)
66
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
77

88
[Decomp](https://github.com/decompositional-semantics-initiative/decomp)

decomp/semantics/predpatt/parsing/loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def load_conllu(filename_or_content: str) -> Iterator[tuple[str, UDParse]]:
114114
sent_num += 1
115115

116116

117-
def get_tags(tokenization: Tokenization, tagging_type: str = 'POS') -> list[str]:
117+
def get_tags(tokenization: 'Tokenization', tagging_type: str = 'POS') -> list[str]:
118118
"""Extract tags of a specific type from a tokenization.
119119
120120
Parameters
@@ -138,7 +138,7 @@ def get_tags(tokenization: Tokenization, tagging_type: str = 'POS') -> list[str]
138138
return []
139139

140140

141-
def get_udparse(sent: Sentence, tool: str) -> UDParse:
141+
def get_udparse(sent: 'Sentence', tool: str) -> UDParse:
142142
"""Create a ``UDParse`` from a sentence extracted from a Communication.
143143
144144
Parameters

decomp/semantics/predpatt/parsing/udparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def pprint(self, color: bool = False, k: int = 1) -> str:
167167
# add padding to columns because zip stops at shortest iterator.
168168
for col in cols:
169169
col.extend("" for _ in range(len(cols[0]) - len(col)))
170-
return tabulate(zip(*cols, strict=False), tablefmt="plain")
170+
return str(tabulate(zip(*cols, strict=False), tablefmt="plain"))
171171

172172
def latex(self) -> bytes:
173173
"""Generate LaTeX code for dependency diagram.

decomp/semantics/predpatt/utils/visualization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def colored(
5555
attrs: list[str] | None = None,
5656
) -> str:
5757
"""Wrap termcolor.colored with consistent signature."""
58-
return _termcolor_colored(text, color, on_color, attrs)
58+
return str(_termcolor_colored(text, color, on_color, attrs))
5959
except ImportError:
6060
# fallback if termcolor is not available
6161
def colored(
@@ -302,4 +302,4 @@ def pprint_ud_parse(
302302
for col in cols:
303303
col.extend("" for _ in range(len(cols[0]) - len(col)))
304304

305-
return tabulate(zip(*cols, strict=False), tablefmt="plain")
305+
return str(tabulate(zip(*cols, strict=False), tablefmt="plain"))

decomp/vis/uds_vis.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ def serve(self, do_return: bool = False) -> dash.Dash | None:
924924
children=[
925925
dcc.Checklist(
926926
id="subspace-list",
927-
options=self._get_uds_subspaces(), # type: ignore[arg-type]
927+
options=self._get_uds_subspaces()
928928
value=[
929929
x['label']
930930
for x in self._get_uds_subspaces()
@@ -948,7 +948,7 @@ def serve(self, do_return: bool = False) -> dash.Dash | None:
948948
])
949949

950950

951-
@app.callback(dash.dependencies.Output('my-graph', 'figure'),
951+
@app.callback(dash.dependencies.Output('my-graph', 'figure'), # type: ignore[misc]
952952
[dash.dependencies.Input('subspace-list', 'value')])
953953
def update_output(value: list[str]) -> LayoutUpdate:
954954
"""Update ontology based on which subspaces are checked.
@@ -1047,7 +1047,7 @@ def serve_parser(parser: Parser, with_syntax: bool = False) -> None:
10471047
children=[
10481048
dcc.Checklist(
10491049
id="subspace-list",
1050-
options=vis._get_uds_subspaces(), # type: ignore[arg-type]
1050+
options=vis._get_uds_subspaces()
10511051
value=[
10521052
x['label']
10531053
for x in vis._get_uds_subspaces()
@@ -1078,7 +1078,7 @@ def serve_parser(parser: Parser, with_syntax: bool = False) -> None:
10781078
])
10791079

10801080

1081-
@app.callback(dash.dependencies.Output('vis-hidden', 'children'),
1081+
@app.callback(dash.dependencies.Output('vis-hidden', 'children'), # type: ignore[misc]
10821082
[dash.dependencies.Input('submit-button', 'n_clicks')],
10831083
[
10841084
dash.dependencies.State('input_text', 'value'),
@@ -1115,7 +1115,7 @@ def parse_new_sentence(
11151115
vis.from_prediction = True
11161116
return [vis.to_json()]
11171117

1118-
@app.callback(dash.dependencies.Output("my-graph", "figure"),
1118+
@app.callback(dash.dependencies.Output("my-graph", "figure"), # type: ignore[misc]
11191119
[dash.dependencies.Input('vis-hidden', 'children'),
11201120
dash.dependencies.Input('subspace-list', 'value')])
11211121
def update_graph_from_vis(

docs/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ This directory contains the source files for building the Decomp documentation u
44

55
## Prerequisites
66

7-
Install the required dependencies using the provided requirements file:
7+
First, install the decomp package in development mode from the parent directory:
8+
9+
```bash
10+
cd ..
11+
pip install -e ".[dev]"
12+
cd docs
13+
```
14+
15+
Then install the documentation-specific dependencies:
816

917
```bash
1018
pip install -r requirements.txt

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ sphinx-copybutton>=0.5.2
55
sphinx-design>=0.5.0
66
sphinx-togglebutton>=0.3.2
77
myst-parser>=2.0.0
8-
-e ..

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ dev = [
4141
"ruff>=0.12.0",
4242
"mypy>=1.17.0",
4343
"types-requests>=2.31.0",
44+
"types-tabulate>=0.9.0",
4445
]
4546
viz = [
4647
"dash[testing]>=1.9.1",
48+
"setuptools>=64.0.0", # Required for pkg_resources in dash
4749
"selenium>=4.6.1",
4850
"jsonpickle>=1.4.1",
4951
"matplotlib>=3.2.1",

0 commit comments

Comments
 (0)