Skip to content

Python: Imports of package names with numbers get extra underscores #80

@mairas

Description

@mairas

I am calling postcard_bindgen as follows:

fn main() {
    python::build_package(
        std::env::current_dir().unwrap().as_path(),
        PackageInfo {
            name: "halpi2-fw-i2c-postcard".into(),
            version: "0.1.0".try_into().unwrap(),
        },
        python::GenerationSettings::enable_all(),
        generate_bindings!(FlashUpdateCommand, FlashUpdateResponse, FlashUpdateState),
    )
    .unwrap();
}

In the resulting code, the package name is as defined but the imports get extra underscores around numbers:

from halpi_2_fw_i_2_c_postcard.types._flash_update_state import FlashUpdateState as _FlashUpdateState

Despite this, a very useful package - thank you!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions