Skip to content

Commit fe16557

Browse files
authored
Merge pull request #843 from tach-org/merge-dtach
Merge dtach
2 parents 57c1d37 + 9323156 commit fe16557

File tree

109 files changed

+25605
-1893
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+25605
-1893
lines changed

.basedpyright/baseline.json

Lines changed: 13519 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/ci.yml

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
15+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1616

1717
steps:
1818
- uses: actions/checkout@v4
@@ -23,47 +23,46 @@ jobs:
2323
python-version: ${{ matrix.python-version }}
2424
check-latest: true
2525

26-
- name: Cache Python dependencies
27-
uses: actions/cache@v3
28-
with:
29-
path: ~/.cache/pip
30-
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
31-
restore-keys: |
32-
${{ runner.os }}-pip-
33-
34-
- name: Cache Rust dependencies
35-
uses: actions/cache@v3
36-
with:
37-
path: |
38-
~/.cargo/registry
39-
~/.cargo/git
40-
target
41-
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
42-
4326
- name: Install dependencies
44-
run: |
45-
python -m pip install --upgrade pip
46-
pip install -e ".[dev]"
27+
run: ./pw uv sync --all-groups
4728

4829
- name: Check ruff
4930
run: |
50-
ruff check
51-
ruff format --check
31+
./pw uv run ruff check
32+
./pw uv run ruff format --check
5233
- name: Test with cargo
5334
run: |
54-
cargo test --no-default-features
35+
./pw uv run cargo test --no-default-features
5536
- name: Test with pytest and report coverage
5637
run: |
57-
coverage run --branch --source=python -m pytest
58-
coverage report
59-
- name: Check types with pyright
38+
./pw uv run coverage run --branch --source=python -m pytest
39+
./pw uv run coverage report
40+
- name: Check types with basedpyright
6041
run: |
61-
pyright --pythonversion ${{ matrix.python-version }}
42+
./pw uv run basedpyright
6243
- name: Check tach
63-
run: tach check
44+
run: ./pw uv run tach check
6445
- name: Check Rust linting
65-
run: cargo clippy
46+
run: ./pw uv run cargo clippy
6647
- name: Check Rust formatting
67-
run: cargo fmt --all --check
48+
run: ./pw uv run cargo fmt --all --check
6849
- name: Check Rust
69-
run: cargo check
50+
run: ./pw uv run cargo check
51+
- name: Check docs
52+
run: make docs-build
53+
54+
# for some insane reason it's impossible to configure github actions to require that all checks pass before merging.
55+
# you have to create a rule eith every single job in your ci, and remember to manually update that rule when they change.
56+
# so instead we need this job at the end that checks the status of all the previous jobs so we don't need to constantly
57+
# worry about keeping the rule up to date.
58+
all-checks:
59+
runs-on: ubuntu-latest
60+
needs: build
61+
if: always()
62+
steps:
63+
- name: Check previous job results
64+
run: |
65+
if [ "${{ needs.build.result }}" != "success" ]; then
66+
echo "previous jobs failed"
67+
exit 1
68+
fi

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
- uses: actions/setup-python@v5
1919
with:
2020
python-version: 3.x
21-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
21+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
2222
- uses: actions/cache@v4
2323
with:
2424
key: mkdocs-material-${{ env.cache_id }}
25-
path: .cache
25+
path: .cache
2626
restore-keys: |
2727
mkdocs-material-
28-
- run: pip install -r docs/requirements.txt
29-
- run: mkdocs gh-deploy --force
28+
- run: ./pw uv sync --only-group docs
29+
- run: ./pw uv run mkdocs gh-deploy --force

.github/workflows/publish.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
name: Publish tach
1+
name: build & publish tach
22

33
on:
4+
pull_request:
45
release:
56
types: [published]
67

78
permissions:
89
contents: read
10+
id-token: write
911

1012
jobs:
1113
test:
@@ -14,7 +16,7 @@ jobs:
1416
- uses: actions/checkout@v4
1517
- uses: actions/setup-python@v5
1618
with:
17-
python-version: 3.13
19+
python-version: 3.14
1820
- name: Install dependencies
1921
run: |
2022
python -m pip install --upgrade pip
@@ -46,7 +48,7 @@ jobs:
4648
- uses: actions/checkout@v4
4749
- uses: actions/setup-python@v5
4850
with:
49-
python-version: 3.13
51+
python-version: 3.14
5052
- name: Build wheels
5153
uses: PyO3/maturin-action@v1
5254
with:
@@ -74,7 +76,7 @@ jobs:
7476
- uses: actions/checkout@v4
7577
- uses: actions/setup-python@v5
7678
with:
77-
python-version: 3.13
79+
python-version: 3.14
7880
architecture: ${{ matrix.platform.target }}
7981
- name: Build wheels
8082
uses: PyO3/maturin-action@v1
@@ -102,7 +104,7 @@ jobs:
102104
- uses: actions/checkout@v4
103105
- uses: actions/setup-python@v5
104106
with:
105-
python-version: 3.13
107+
python-version: 3.14
106108
- name: Build wheels
107109
uses: PyO3/maturin-action@v1
108110
with:
@@ -134,14 +136,12 @@ jobs:
134136
release:
135137
name: Release
136138
runs-on: ubuntu-22.04
137-
if: startsWith(github.ref, 'refs/tags/')
139+
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' && github.event.action == 'published'
138140
needs: [linux, windows, macos, sdist]
139141
steps:
140142
- uses: actions/download-artifact@v4
141143
- name: Publish to PyPI
142144
uses: PyO3/maturin-action@v1
143-
env:
144-
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
145145
with:
146146
maturin-version: v1.7.1
147147
command: upload
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: publish_vscode
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
defaults:
8+
run:
9+
working-directory: vscode
10+
11+
env:
12+
dist_path: ./vscode/dist
13+
14+
jobs:
15+
# Build the extension on all platforms.
16+
build:
17+
strategy:
18+
matrix:
19+
include:
20+
- os: windows-latest
21+
target: x86_64-pc-windows-msvc
22+
code-target: win32-x64
23+
- os: windows-latest
24+
target: aarch64-pc-windows-msvc
25+
code-target: win32-arm64
26+
- os: ubuntu-latest
27+
target: x86_64-unknown-linux-gnu
28+
code-target: linux-x64
29+
- os: ubuntu-latest
30+
target: aarch64-unknown-linux-gnu
31+
code-target: linux-arm64
32+
arch: aarch64
33+
- os: ubuntu-latest
34+
target: arm-unknown-linux-gnueabihf
35+
code-target: linux-armhf
36+
arch: armv7
37+
- os: macos-13
38+
target: x86_64-apple-darwin
39+
code-target: darwin-x64
40+
- os: macos-14
41+
target: aarch64-apple-darwin
42+
code-target: darwin-arm64
43+
arch: x86_64
44+
45+
name: Build (${{ matrix.target }})
46+
runs-on: ${{ matrix.os }}
47+
container: ${{ matrix.container }}
48+
49+
steps:
50+
- name: Checkout repository
51+
uses: actions/checkout@v4
52+
53+
- uses: actions/setup-python@v5
54+
- run: ../pw uv run nox --session build_package
55+
56+
# Build the extension.
57+
- name: Package Extension (release)
58+
run: |
59+
../pw npx vsce package -o "./dist/tach-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
60+
# Upload the extension.
61+
- name: Upload artifacts
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: dist-${{ matrix.target }}
65+
path: ${{ env.dist_path }}
66+
67+
# Publish the built extension to the Marketplace.
68+
publish:
69+
name: "Publish"
70+
needs: ["build"]
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Checkout repository
74+
uses: actions/checkout@v4
75+
76+
# Download all built artifacts.
77+
- uses: actions/download-artifact@v4
78+
with:
79+
name: dist-aarch64-apple-darwin
80+
path: ${{ env.dist_path }}
81+
- uses: actions/download-artifact@v4
82+
with:
83+
name: dist-x86_64-apple-darwin
84+
path: ${{ env.dist_path }}
85+
- uses: actions/download-artifact@v4
86+
with:
87+
name: dist-x86_64-unknown-linux-gnu
88+
path: ${{ env.dist_path }}
89+
- uses: actions/download-artifact@v4
90+
with:
91+
name: dist-aarch64-unknown-linux-gnu
92+
path: ${{ env.dist_path }}
93+
- uses: actions/download-artifact@v4
94+
with:
95+
name: dist-arm-unknown-linux-gnueabihf
96+
path: ${{ env.dist_path }}
97+
- uses: actions/download-artifact@v4
98+
with:
99+
name: dist-x86_64-pc-windows-msvc
100+
path: ${{ env.dist_path }}
101+
- uses: actions/download-artifact@v4
102+
with:
103+
name: dist-aarch64-pc-windows-msvc
104+
path: ${{ env.dist_path }}
105+
- run: ls -al ./dist
106+
107+
- name: Install dependencies
108+
run: ../pw uv run --only-group vscode npm ci
109+
110+
- name: Publish Extension - visual studio marketplace
111+
run: |
112+
../pw uv run --only-group vscode npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ./dist/tach-*.vsix
113+
114+
- name: Publish Extension - open VSX
115+
run: |
116+
../pw uv run npx ovsx publish --pat ${{ secrets.OPEN_VSX_TOKEN }} --packagePath ./dist/tach-*.vsix

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Byte-compiled / optimized / DLL files
2-
.vscode/
32
.pyirc
43
.python-version
54
__pycache__/
@@ -186,3 +185,6 @@ profile.json
186185

187186
# Scratchpad
188187
.scratch/
188+
189+
# pyprojectx
190+
.pyprojectx

.vscode/extensions.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"recommendations": [
3+
"ms-python.python",
4+
"detachhead.basedpyright",
5+
"charliermarsh.ruff",
6+
"mhutchie.git-graph",
7+
"tamasfe.even-better-toml",
8+
"redhat.vscode-yaml",
9+
"github.vscode-github-actions",
10+
"rust-lang.rust-analyzer",
11+
"carlos-algms.make-task-provider",
12+
"vadimcn.vscode-lldb",
13+
]
14+
}

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "tach check",
9+
"type": "lldb",
10+
"request": "launch",
11+
"program": "${workspaceRoot}/.venv/bin/python",
12+
"args": ["-m", "tach", "check"],
13+
"cwd": "${workspaceRoot}"
14+
}
15+
]
16+
}

0 commit comments

Comments
 (0)