Skip to content

Commit

Permalink
Use caravel locally (#98)
Browse files Browse the repository at this point in the history
* use local caravel

* update linking to use cp instead

* fix bugs

* update multi file selection
  • Loading branch information
UnsignedByte authored Mar 17, 2024
1 parent a3efc77 commit 7679ecc
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 158 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ venv.bak/

.hypothesis/

core.*
caravel
core.*
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pytest==8.0.1
pytest-custom_exit_code
pytest-xdist==3.5.0
psutil
fabric
invoke
halo
pyyaml
matplotlib
Expand Down
12 changes: 5 additions & 7 deletions tools/flow/install.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# install caravel
from utils.cmdline import SubCommand
from utils.remote import caravel_dir, caravel_installed
from utils.invoke import caravel_dir, caravel_installed, run
import logging as log


Expand All @@ -19,22 +19,20 @@ def args(subparsers):
help="Overwrite existing caravel installation",
)

def run(connection, args):
def run(args):
"""Install caravel in a custom location."""

# Check if caravel is installed
if not args.force and caravel_installed(connection):
if not args.force and caravel_installed():
log.error(
"Caravel is already installed. Run `caravel install --force` to reinstall."
)
connection.close()
return 1

log.info("Installing caravel in %s", caravel_dir())

connection.run(f"rm -rf {caravel_dir()}")
connection.run(f"mkdir -p {caravel_dir()}")
connection.run(
run(f"rm -rf {caravel_dir()} && mkdir -p {caravel_dir()}")
run(
f"""
cd {caravel_dir()} && \
git clone --depth 1 --branch mpw-9g https://github.com/efabless/caravel_user_project.git . && \
Expand Down
6 changes: 1 addition & 5 deletions tools/flow/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
from utils.remote import connect
from tools.flow.utils.logging import setup_logging
from os import path
import logging as log
Expand Down Expand Up @@ -31,14 +30,11 @@
args = parser.parse_args()

setup_logging(args)
connection = connect()
for subcommand in subcommands:
if subcommand.name() == args.command:
err_code = subcommand.run(connection, args)
err_code = subcommand.run(args)
if err_code:
log.error(
"Subcommand %s failed with error code %d", args.command, err_code
)
break

connection.close()
Loading

0 comments on commit 7679ecc

Please sign in to comment.