Skip to content

Commit

Permalink
add arrow to running tests and change the way we flip to raphtory-arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianmurariu committed May 24, 2024
1 parent f0921cc commit d054d89
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_rust_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
with:
cache-all-crates: true
- name: Flip raphtory-arrow in Cargo.toml
run: python ./scripts/flip_ra.py Cargo.toml
run: python ./scripts/flip_ra.py
- name: Install bininstall
uses: cargo-bins/cargo-binstall@main
- name: Install nextest
Expand All @@ -63,7 +63,7 @@ jobs:
RUSTFLAGS: -Awarnings
TEMPDIR: ${{ runner.temp }}
run: |
cargo nextest run --all --no-default-features
cargo nextest run --all --no-default-features --features "arrow"
- name: Run Tests (features=io)
env:
RUSTFLAGS: -Awarnings
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ rust-build-docs:
cargo doc --no-deps -p raphtory -q

rust-build-readthedocs:
./scripts/hide_arrow_dep.sh
cargo doc --no-deps -p raphtory -q --target-dir $(RUST_READTHEDOCS_DOCS_TARGET)
rm -rf $(RUST_READTHEDOCS_DOCS_TARGET)/debug
mv $(RUST_READTHEDOCS_DOCS_TARGET)/doc/* $(RUST_READTHEDOCS_DOCS_TARGET)
Expand Down
35 changes: 18 additions & 17 deletions scripts/flip_ra.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
#!/usr/bin/env python3
import sys
import tempfile
import shutil
import os, stat
import subprocess

directory = "./raphtory-arrow"

if len(sys.argv) != 2:
print("Usage: flip_ra.py <file>")
sys.exit(1)
def remove_readonly(func, path, _):
"Clear the readonly bit and reattempt the removal"
os.chmod(path, stat.S_IWRITE)
func(path)

file = sys.argv[1]
shutil.rmtree(directory, onerror=remove_readonly)

with tempfile.NamedTemporaryFile(delete=False, mode='w') as tmp:
tmp_file_name = tmp.name
with open(file, 'r') as f:
for line in f:
if line.startswith("#flip raphtory-arrow"):
line = line.replace("#flip raphtory-arrow", "raphtory-arrow", 1)
elif line.startswith("raphtory-arrow"):
line = line.replace("raphtory-arrow", "#flip raphtory-arrow", 1)
tmp.write(line)

shutil.move(tmp_file_name, file)
subprocess.run(
[
"git",
"clone",
"--depth",
"1",
"[email protected]:Pometry/raphtory-arrow.git",
"raphtory-arrow",
]
)

0 comments on commit d054d89

Please sign in to comment.