#messed up trying to build a python module

52 messages · Page 1 of 1 (latest)

pseudo rose
young dew
#

yeah I can't do anything with that on mobile

wheat oxide
#

i got it, i got it

#

builds just fine

pseudo rose
#

what did you do?

wheat oxide
# pseudo rose what did you do?
Downloaded/extracted folder

python -m venv .venv

.\.venv\Scripts\activate

cargo add pyo3 --features extension-module

edit package name to have a _

maturin develop
pseudo rose
#

in cmd not vscode right?

wheat oxide
#

are the versions of everything i am using

young dew
#

compiler 2 versions behind ferrisHmm

pseudo rose
wheat oxide
pseudo rose
#

do i just copy-paste these?

wheat oxide
#

in the Cargo.toml

#
[package]
name = "snes_apu"
version = "0.1.12"
authors = ["ferris <[email protected]>"]
description = "A Super Nintendo audio unit emulator."
homepage = "https://github.com/emu-rs/snes-apu"
repository = "https://github.com/emu-rs/snes-apu"
keywords = ["snes", "super", "nintendo", "spc", "emulator"]
license = "BSD-2-Clause"

[dependencies]
pyo3 = { version = "0.25.1", features = ["extension-module"] }
spc = "0.1.0"

[dev-dependencies]
cpal = "0.4.4"
futures = "0.1.1"
pseudo rose
#

ok

wheat oxide
pseudo rose
wheat oxide
#

the compiler checked

pseudo rose
#

where are my functions 😭
i had smp's read function on there!

wheat oxide
pseudo rose
#

wait what?

wheat oxide
#

oh wait there is a sndEMU folder?

pseudo rose
#

yeah...

wheat oxide
#

whats that from

pseudo rose
#

i thought i had to make this folder to develop it as a package...... (turns out i didnt need to)

#

did i even put smp's function correctly?

wheat oxide
#

so you just copied all the .rs files to a new project?

#

yeah thats not going to work

#

well at least i understand how you got the errors you got

#

if you want a new crate you should use snes-apu as a path dependency

#

not copy all it's code over

pseudo rose
wheat oxide
#

its private

pseudo rose
wheat oxide
#

no

pseudo rose
wheat oxide
#
fn read(&mut self, addr: u16) -> u8 {
    self.cycles(1);
    self.emulator().read_u8(addr as u32)
}

you use the library like it was ment to be used (as shown in the example binary) or you actually go modify the code to be what you want

wheat oxide
#

have you by chance read the rust book?

pseudo rose
wheat oxide