treesearch-ud 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. treesearch_ud-0.1.0/.github/workflows/docs.yml +56 -0
  2. treesearch_ud-0.1.0/.github/workflows/pypi.yml +150 -0
  3. treesearch_ud-0.1.0/.github/workflows/test.yml +49 -0
  4. treesearch_ud-0.1.0/.gitignore +55 -0
  5. treesearch_ud-0.1.0/API.md +550 -0
  6. treesearch_ud-0.1.0/CHANGELOG.md +12 -0
  7. treesearch_ud-0.1.0/Cargo.lock +755 -0
  8. treesearch_ud-0.1.0/Cargo.toml +47 -0
  9. treesearch_ud-0.1.0/LICENSE +21 -0
  10. treesearch_ud-0.1.0/PKG-INFO +157 -0
  11. treesearch_ud-0.1.0/README.md +123 -0
  12. treesearch_ud-0.1.0/benches/coha.rs +140 -0
  13. treesearch_ud-0.1.0/benches/conllu.rs +36 -0
  14. treesearch_ud-0.1.0/collostruct.py +66 -0
  15. treesearch_ud-0.1.0/docs/api.md +148 -0
  16. treesearch_ud-0.1.0/docs/index.md +46 -0
  17. treesearch_ud-0.1.0/docs/internals.md +63 -0
  18. treesearch_ud-0.1.0/docs/query-language.md +195 -0
  19. treesearch_ud-0.1.0/docs/tutorial.md +231 -0
  20. treesearch_ud-0.1.0/examples/UD_English-ParTUT-r2.17/LICENSE.txt +128 -0
  21. treesearch_ud-0.1.0/examples/UD_English-ParTUT-r2.17/README.md +109 -0
  22. treesearch_ud-0.1.0/examples/collostruct.py +71 -0
  23. treesearch_ud-0.1.0/examples/docs.ipynb +1248 -0
  24. treesearch_ud-0.1.0/examples/goget.py +120 -0
  25. treesearch_ud-0.1.0/examples/help.py +93 -0
  26. treesearch_ud-0.1.0/examples/help_bench.rs +22 -0
  27. treesearch_ud-0.1.0/examples/scratch.ipynb +209 -0
  28. treesearch_ud-0.1.0/examples/tryit.py +18 -0
  29. treesearch_ud-0.1.0/mkdocs.yml +23 -0
  30. treesearch_ud-0.1.0/pyproject.toml +61 -0
  31. treesearch_ud-0.1.0/python/treesearch/__init__.py +159 -0
  32. treesearch_ud-0.1.0/python/treesearch/treesearch.pyi +240 -0
  33. treesearch_ud-0.1.0/src/bytes.rs +356 -0
  34. treesearch_ud-0.1.0/src/conllu.rs +611 -0
  35. treesearch_ud-0.1.0/src/iterators.rs +819 -0
  36. treesearch_ud-0.1.0/src/lib.rs +24 -0
  37. treesearch_ud-0.1.0/src/pattern.rs +252 -0
  38. treesearch_ud-0.1.0/src/python.rs +602 -0
  39. treesearch_ud-0.1.0/src/query.rs +882 -0
  40. treesearch_ud-0.1.0/src/query_grammar.pest +70 -0
  41. treesearch_ud-0.1.0/src/searcher.rs +1362 -0
  42. treesearch_ud-0.1.0/src/tree.rs +428 -0
  43. treesearch_ud-0.1.0/tests/test_python_bindings.py +1003 -0
  44. treesearch_ud-0.1.0/uv.lock +894 -0
@@ -0,0 +1,56 @@
1
+ name: Deploy Documentation
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ paths:
8
+ - 'docs/**'
9
+ - 'mkdocs.yml'
10
+ - '.github/workflows/docs.yml'
11
+ workflow_dispatch:
12
+
13
+ permissions:
14
+ contents: read
15
+ pages: write
16
+ id-token: write
17
+
18
+ concurrency:
19
+ group: "pages"
20
+ cancel-in-progress: false
21
+
22
+ jobs:
23
+ build:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - name: Checkout repository
27
+ uses: actions/checkout@v4
28
+
29
+ - name: Set up Python
30
+ uses: actions/setup-python@v5
31
+ with:
32
+ python-version: '3.12'
33
+ cache: 'pip'
34
+
35
+ - name: Install dependencies
36
+ run: |
37
+ pip install mkdocs mkdocs-material
38
+
39
+ - name: Build documentation
40
+ run: mkdocs build --strict
41
+
42
+ - name: Upload artifact
43
+ uses: actions/upload-pages-artifact@v3
44
+ with:
45
+ path: ./site
46
+
47
+ deploy:
48
+ environment:
49
+ name: github-pages
50
+ url: ${{ steps.deployment.outputs.page_url }}
51
+ runs-on: ubuntu-latest
52
+ needs: build
53
+ steps:
54
+ - name: Deploy to GitHub Pages
55
+ id: deployment
56
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,150 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - '*'
9
+ pull_request:
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ env:
16
+ RUSTFLAGS: "-Dwarnings"
17
+
18
+ jobs:
19
+
20
+ linux:
21
+ runs-on: ${{ matrix.platform.runner }}
22
+ strategy:
23
+ matrix:
24
+ platform:
25
+ - runner: ubuntu-latest
26
+ target: x86_64
27
+ - runner: ubuntu-latest
28
+ target: aarch64
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: '3.12'
34
+ - name: Build wheels
35
+ uses: PyO3/maturin-action@v1
36
+ with:
37
+ target: ${{ matrix.platform.target }}
38
+ args: --release --out dist --find-interpreter
39
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/v') }}
40
+ manylinux: auto
41
+ - name: Upload wheels
42
+ uses: actions/upload-artifact@v4
43
+ with:
44
+ name: wheels-linux-${{ matrix.platform.target }}
45
+ path: dist
46
+
47
+ windows:
48
+ runs-on: ${{ matrix.platform.runner }}
49
+ strategy:
50
+ matrix:
51
+ platform:
52
+ - runner: windows-latest
53
+ target: x64
54
+ steps:
55
+ - uses: actions/checkout@v4
56
+ - uses: actions/setup-python@v5
57
+ with:
58
+ python-version: '3.12'
59
+ architecture: ${{ matrix.platform.target }}
60
+ - name: Build wheels
61
+ uses: PyO3/maturin-action@v1
62
+ with:
63
+ target: ${{ matrix.platform.target }}
64
+ args: --release --out dist --find-interpreter
65
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/v') }}
66
+ - name: Upload wheels
67
+ uses: actions/upload-artifact@v4
68
+ with:
69
+ name: wheels-windows-${{ matrix.platform.target }}
70
+ path: dist
71
+
72
+ macos:
73
+ runs-on: ${{ matrix.platform.runner }}
74
+ strategy:
75
+ matrix:
76
+ platform:
77
+ - runner: macos-latest
78
+ target: x86_64
79
+ - runner: macos-latest
80
+ target: aarch64
81
+ steps:
82
+ - uses: actions/checkout@v4
83
+ - uses: actions/setup-python@v5
84
+ with:
85
+ python-version: '3.12'
86
+ - name: Build wheels
87
+ uses: PyO3/maturin-action@v1
88
+ with:
89
+ target: ${{ matrix.platform.target }}
90
+ args: --release --out dist --find-interpreter
91
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/v') }}
92
+ - name: Upload wheels
93
+ uses: actions/upload-artifact@v4
94
+ with:
95
+ name: wheels-macos-${{ matrix.platform.target }}
96
+ path: dist
97
+
98
+ sdist:
99
+ runs-on: ubuntu-latest
100
+ steps:
101
+ - uses: actions/checkout@v4
102
+ - name: Build sdist
103
+ uses: PyO3/maturin-action@v1
104
+ with:
105
+ command: sdist
106
+ args: --out dist
107
+ - name: Upload sdist
108
+ uses: actions/upload-artifact@v4
109
+ with:
110
+ name: wheels-sdist
111
+ path: dist
112
+
113
+ release:
114
+ name: Release
115
+ runs-on: ubuntu-latest
116
+ if: ${{ startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' }}
117
+ needs: [ linux, windows, macos, sdist ]
118
+ environment: pypi
119
+ permissions:
120
+ # Use to sign the release artifacts
121
+ id-token: write
122
+ # Used to upload release artifacts
123
+ contents: write
124
+ # Used to generate artifact attestation
125
+ attestations: write
126
+ steps:
127
+ - uses: actions/download-artifact@v4
128
+ - name: Generate artifact attestation
129
+ uses: actions/attest-build-provenance@v2
130
+ with:
131
+ subject-path: 'wheels-*/*'
132
+ - name: Publish to PyPI
133
+ if: ${{ startsWith(github.ref, 'refs/tags/v') }}
134
+ uses: PyO3/maturin-action@v1
135
+ with:
136
+ command: upload
137
+ args: --non-interactive --skip-existing wheels-*/*
138
+ - name: Create GitHub Release
139
+ if: ${{ startsWith(github.ref, 'refs/tags/v') }}
140
+ uses: softprops/action-gh-release@v2
141
+ with:
142
+ files: |
143
+ wheels-*/*
144
+ body: |
145
+ **Install (PyPI):**
146
+
147
+ `pip install treesearch-ud`
148
+
149
+ **PyPI:** https://pypi.org/project/treesearch/
150
+
@@ -0,0 +1,49 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - '*'
9
+ pull_request:
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ env:
16
+ RUSTFLAGS: "-Dwarnings"
17
+
18
+ jobs:
19
+ linux-test-only:
20
+ runs-on: ubuntu-22.04
21
+ strategy:
22
+ matrix:
23
+ python-version: ['3.14']
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - uses: actions/setup-python@v5
27
+ with:
28
+ python-version: ${{ matrix.python-version }}
29
+ - uses: mozilla-actions/sccache-action@v0.0.9
30
+ - name: Build Python package
31
+ uses: PyO3/maturin-action@v1
32
+ with:
33
+ args: --release --out dist
34
+ sccache: true
35
+ rust-toolchain: stable
36
+ - name: Run Rust and Python tests
37
+ shell: bash
38
+ run: |
39
+ set -e
40
+ # Run Rust tests
41
+ cargo test
42
+ # Install uv and set up Python environment
43
+ pip install uv
44
+ uv venv
45
+ source .venv/bin/activate
46
+ uv pip install treesearch --find-links dist --force-reinstall
47
+ uv pip install pytest
48
+ # Run Python tests
49
+ pytest
@@ -0,0 +1,55 @@
1
+ # Rust
2
+ /target
3
+ Cargo.lock
4
+ **/*.rs.bk
5
+ *.pdb
6
+
7
+ # Python
8
+ __pycache__/
9
+ *.py[cod]
10
+ *$py.class
11
+ *.so
12
+ *.egg-info/
13
+ dist/
14
+ build/
15
+ .pytest_cache/
16
+ .python-version
17
+ venv/
18
+ env/
19
+ *.whl
20
+
21
+ # Maturin
22
+ .maturin/
23
+
24
+ # IDE
25
+ .vscode/
26
+ .idea/
27
+ *.swp
28
+ *.swo
29
+ *~
30
+ .DS_Store
31
+
32
+ # Jupyter
33
+ .ipynb_checkpoints/
34
+
35
+ # Testing and coverage
36
+ htmlcov/
37
+ .coverage
38
+ .tox/
39
+
40
+ # Documentation
41
+ docs/_build/
42
+
43
+ # Data files
44
+ # Large corpus files should not be committed
45
+ *.conllu
46
+ *.conllu.gz
47
+ *.conll
48
+ *.conll.gz
49
+ *.parquet
50
+
51
+ CLAUDE.md
52
+ plans/
53
+ .env
54
+ .claude/
55
+