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

Add bridge #35

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add bridge #35

wants to merge 3 commits into from

Conversation

hylkedonker
Copy link

@hylkedonker hylkedonker commented Dec 19, 2024

Hi,
I'm collecting some functions to convert Python and Mojo types back and forth.
I use these in other projects, so I thought I might as well share them with others. :-)
Since the project is on Gitlab, I've added a SAST (instead of CodeQL) badge. I hope this is okay.
I didn't know how to test the recipe, so I just hope it works.

Cheers,
Hylke

Checklist

  • License file is packaged (see here for an example).
  • Set the build number to 0 (for new packages, or if the version changed)
  • Bumped the build number (if the version is unchanged)

@carolinefrasca
Copy link
Collaborator

Hi @hylkedonker, thanks so much for submitting this! 🥳 We're asking folks to include at least a basic test file with their package. Here are some examples of packages with tests:

@hylkedonker
Copy link
Author

Thanks for your prompt response.
I have already a few tests in my package, which the recipe should, hopefully, pick up. Or do you prefer me to duplicate the test folder here?

@carolinefrasca
Copy link
Collaborator

carolinefrasca commented Jan 6, 2025

@hylkedonker For now, if you don't mind including the tests in this PR too, that would be great. We're asking folks to include the tests in this repo so that we can automatically run the tests after your package builds.

@hylkedonker
Copy link
Author

hylkedonker commented Jan 8, 2025

@carolinefrasca , I've added the unit tests. Hope this looks okay.

P.s., the command pixi run build <package-name> indicated in the readme doesn't work on my machine:

build: command not found

@carolinefrasca
Copy link
Collaborator

Hey @hylkedonker, thanks so much! I think the source/git field just needs to be updated to https://gitlab.com/hylkedonker/bridge.git rather than [email protected]:hylkedonker/bridge.git

@hylkedonker
Copy link
Author

@carolinefrasca Done!

@carolinefrasca
Copy link
Collaborator

Thanks so much @hylkedonker! I'm now seeing this error from the build script:

 │ ╭─ Running build script
 │ │ + mojo package src/bridge -o $PREFIX/lib/mojo/bridge.mojopkg
 │ │ Included from src/bridge/__init__.🔥:1:
 │ │ $SRC_DIR/src/bridge/numpy.🔥:43:30: error: use of unknown declaration 'float'
 │ │         out_flat[Index(i)] = float(np_flat[i]).cast[T]()
 │ │                              ^~~~~
 │ │ mojo: error: failed to parse the provided Mojo source module
 │ │ × error Script failed with status 1
 │ │ × error Work directory: '/home/runner/work/modular-community/modular-community/output/bld/rattler-build_bridge_1736446029/work'
 │ │ × error To debug the build, run it manually in the work directory (execute the `./conda_build.sh` or `conda_build.bat` script)

Your package is currently being built with both MAX 24.5 and 24.6 – is that right or is it currently compatible with only one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants