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

maturin init creates Cargo.toml incorrectly #1120

Closed
2 tasks
OWissett opened this issue Sep 22, 2022 · 1 comment · Fixed by #1109
Closed
2 tasks

maturin init creates Cargo.toml incorrectly #1120

OWissett opened this issue Sep 22, 2022 · 1 comment · Fixed by #1109
Labels
bug Something isn't working

Comments

@OWissett
Copy link

OWissett commented Sep 22, 2022

Bug Description

When running maturin init, the Cargo.toml is missing the [lib] tag, leading to maturin build (and all other commands) to fail.

Example output:

[package]
name = "getting_started"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html[lib]
name = "getting_started"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.17.1", features = ["extension-module"] }

Expected:

[package]
name = "getting_started"
version = "0.1.0"
edition = "2021"

[lib]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html[lib]
name = "getting_started"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.17.1", features = ["extension-module"] }

OS: MacOS, Monterey 12.0.1
Arch: Arm64, M1 2020

Your Python version (python -V)

3.10.6

Your pip version (pip -V)

22.2.2

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  1. create virtualenv: python3.10 -m virtualenv .venv; ./.venv/bin/activate
  2. install maturin: pip install maturin
  3. create project: maturin init
  4. done.
@OWissett OWissett added the bug Something isn't working label Sep 22, 2022
@messense
Copy link
Member

Already fixed in #1109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants