ebelski / rust-copter

A quadcopter build using a Teensy running Rust and some other cool stuff that's yet to be determined.
MIT License
6 stars 1 forks source link

Error in task.py #13

Closed ebelski closed 4 years ago

ebelski commented 4 years ago
python task.py demo pwm-control
error: Invalid character `{` in pkgid: `{crate}`
Traceback (most recent call last):
  File "task.py", line 165, in <module>
    args.func(args)
  File "task.py", line 114, in demo
    target = _cargo_build(crate, args.release)
  File "task.py", line 96, in _cargo_build
    subprocess.run(cmd, shell=True, check=True, env=env)
  File "C:\Anaconda3\lib\subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'cargo build --target thumbv7em-none-eabihf --release --package {crate}' returned non-zero exit status 101.
mciantyre commented 4 years ago

Which version of Python is bundled with your Anaconda distribution?

python --version

Is it yelling about the f-string interpolation character, {? f-strings are a Python 3.6 feature.

ebelski commented 4 years ago

3.6.5.

It's not passing the actual crate name, instead it's getting a literal {crate} in the command line

ebelski commented 4 years ago

I think the issue lies with line 96 in task.py?

mciantyre commented 4 years ago

This is a good catch! Just reproduced on master. But, I can't reproduce it on the feature/esc-protocols brach...?

ebelski commented 4 years ago

There was no f prefix in front of the string on line 93 so it should now read if crate: cmd += f" --package {crate}"

I'm trying that to see if it works

mciantyre commented 4 years ago

Looks like it! Want to push a fix? Otherwise I can grab it.

I'll add some automated tests that will run

python task.py demo pwm-control

on PRs, so these kinds of bugs don't happen again.

ebelski commented 4 years ago

I'll push an update to the repo