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 vegafusion-python-embed package #18081

Merged
merged 9 commits into from Mar 5, 2022
Merged

Add vegafusion-python-embed package #18081

merged 9 commits into from Mar 5, 2022

Conversation

jonmmease
Copy link
Contributor

This PR adds a recipe for the vegafusion-python-embed package. Project hompage is at https://vegafusion.io/.

This is a native Python package that wraps Rust logic using PyO3, compiled with the maturin build tool. The conda recipe pulls the official source from PyPI and builds it using maturin. This source distribution contains the project's own LICENSE file. A Thirdparty.yml file containing the licenses for third-party Rust dependencies (which are statically linked during the build process) is generated using cargo-bundle-licenses during the build processes.

For context, this package will rarely be used directly and after it is published two additional pure-python packages that depend on this one will follow (vegafusion and vegafusion-jupyter).

I'll ping once CI is passing. Thanks!

Checklist

  • Title of this PR is meaningful: e.g. "Adding my_nifty_package", not "updated meta.yaml".
  • License file is packaged (see here for an example).
  • Source is from official source.
  • Package does not vendor other packages. (If a package uses the source of another package, they should be separate packages or the licenses of all packages need to be packaged).
  • If static libraries are linked in, the license of the static library is packaged.
  • Build number is 0.
  • A tarball (url) rather than a repo (e.g. git_url) is used in your recipe (see here for more details).
  • GitHub users listed in the maintainer section have posted a comment confirming they are willing to be listed there.
  • When in trouble, please check our knowledge base documentation before pinging a team.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/vegafusion-python-embed) and found it was in an excellent condition.

@jonmmease jonmmease changed the title WIP: Add vegafusion-python-embed package Add vegafusion-python-embed package Feb 17, 2022
@jonmmease
Copy link
Contributor Author

CI passing and artifact packages look good from my end.

Ready for review @conda-forge/help-python, @conda-forge/help-python-c.

Thanks!!

@dhirschfeld
Copy link
Member

I'm excited to see this package available from CF! 🎉

@conda-forge/staged-recipes and @conda-forge/rust might be good to ping too.

@dhirschfeld
Copy link
Member

dhirschfeld commented Feb 18, 2022

The pertinent error seems to be:

error: invalid `--cfg` argument: `--target` (expected `key` or `key="value"`)

From:

...
+HOST=x86_64-conda-linux-gnu
+LDFLAGS=-Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,$PREFIX/lib -Wl,-rpath-link,$PREFIX/lib -L$PREFIX/lib
Error: `cargo metadata` exited with an error: error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --cfg --target x86_64-unknown-linux-gnu --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit status: 1)
  --- stderr
  error: invalid `--cfg` argument: `--target` (expected `key` or `key="value"`)

@jonmmease
Copy link
Contributor Author

Thanks @dhirschfeld. It looks like conda didn't like the space in the environment variable value. I think replacing it with an equal sign will work...

@jonmmease
Copy link
Contributor Author

Ok, build is green again

- python
- pip
- maturin
- cargo-bundle-licenses
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cargo-bundle-licenses appears to usually go in build

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me!

number: 0
script: |
export RUSTFLAGS="--cfg unsound_local_offset" # [not win]
set RUSTFLAGS=--cfg unsound_local_offset # [win]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the "safe way" is to put a quotes around the entire env var plus value, like set "RUSTFLAGS=--cfg unsound_local_offset"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Giving that a try now

@@ -0,0 +1,57 @@
{% set name = "vegafusion-python-embed" %}
{% set name_under = "vegafusion_python_embed" %}
{% set version = "0.0.4_rc.1" %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this an RC?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @wolfv! I agree this should build from an actual release if at all possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is an RC because the current stable version doesn't have sdist bundles published. If this approach looks good otherwise, I can publish a new version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you're ready to release 0.0.4 proper then this recipe is in good shape to be merged.

Ofc, it's always possible further 👀 will pick up some more issues but it's easier for others to review when it's ready to merge (otherwise it would need a further review when it was ready)

Copy link
Contributor Author

@jonmmease jonmmease Feb 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI running on version 0.0.4

@jonmmease
Copy link
Contributor Author

Thanks for the reviews. Now built against version 0.0.4 final

@jonmmease
Copy link
Contributor Author

friendly ping @wolfv @bollwyvl Is there anything else you'd like to see here? Thanks again for taking a look!

@bollwyvl
Copy link
Contributor

bollwyvl commented Mar 1, 2022

Seems alright to me: i can't merge, though!

@dhirschfeld
Copy link
Member

Seems alright to me: i can't merge, though!

Ping @conda-forge/staged-recipes!

Copy link
Member

@tdegeus tdegeus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a member of the core, but I saw your message on gitter.
Mostly thing looks good, though:

  • I would consider a different name, that keeps together the name of the package. E.g. vegafusion_embed-python, python-vegafusion_embed, or python-vegafusion-embed
  • I'm not sure that run_test.py is actually evaluated. But in any case I would avoid it all-together as indicated

Comment on lines +37 to +38
commands:
- pip check
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
commands:
- pip check
commands:
- pip check
- python -c "import vegafusion_embed; vegafusion_embed.PyTaskGraphRuntime(4)"

@chrisburr chrisburr merged commit 665af07 into conda-forge:main Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants