Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: use cargo new #453

Merged
merged 1 commit into from
Aug 30, 2021
Merged

rust: use cargo new #453

merged 1 commit into from
Aug 30, 2021

Conversation

adsharma
Copy link
Collaborator

This allows directory mode transpilation to create a Cargo.toml
via cargo new --bin.

Any relative imports are transpiled to mod name instead of
extern create name.

Tested via:

head /tmp/foo/*.py
==> /tmp/foo/foo1.py <==
def foo1():
    return 42

==> /tmp/foo/main.py <==
from .foo1 import foo1

def main():
    print(foo1())

py2many --rust=1 /tmp/foo --outdir /tmp/rustfoo
cd /tmp/rustfoo
cargo run
42

Related to: #408

This allows directory mode transpilation to create a Cargo.toml
via cargo new --bin.

Any relative imports are transpiled to `mod name` instead of
`extern create name`.

Tested via:

```
head /tmp/foo/*.py
==> /tmp/foo/foo1.py <==
def foo1():
    return 42

==> /tmp/foo/main.py <==
from .foo1 import foo1

def main():
    print(foo1())

py2many --rust=1 /tmp/foo --outdir /tmp/rustfoo
cd /tmp/rustfoo
cargo run
42
```

Related to: #408
@adsharma adsharma merged commit be6cfaa into main Aug 30, 2021
@adsharma adsharma deleted the rust_project branch August 30, 2021 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant