-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 pyjuliacall pyjuliapkg via grayskull #25097
Add pyjuliacall pyjuliapkg via grayskull #25097
Conversation
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipes/pyjuliapkg:
|
@MilesCranmer , I used the following commands to create this recipe, followed by some manual editing.
|
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 ( |
Looks good! So my understanding is Julia will be installed in the user's home directory (i.e., not the conda env) upon first import? (I think this sort of thing is completely fine since you can specify the julia version within the |
I'm still sorting out the details. |
Interpreting the source code, it looks like it juliacall looks for an existing Julia installation before trying to download a new one. If one had the julia conda-forge package installed, it should locate that and try to use it. We'll have to do some more testing. There's also the possibility of depending on the julia conda-forge package. |
@MilesCranmer your job here is to keep prodding me until this goes through. Also checking into https://gitter.im/conda-forge/conda-forge.github.io might also help. |
In retrospect I do think it’s better to let juliapkg (via juliaup) manage julia rather than conda. Then (1) we can automatically support M1/M2 macOS and Windows, (2) juliapkg lets you specify Julia version requirements in the json file (including multiple Julia versions), so it could cause conflicts to also specify it in environment.yml, (3) it’s a much easier maintenance burden on ourselves :) |
I also think that we’ll encounter some issues anyways, so better to just get the simplest viable solution set up, and we can pursue a more complex strategy later if needed. Rather than start complicated, find it doesn’t work, and roll back to the current simpler approach. |
imports: | ||
- juliacall | ||
commands: | ||
- pip check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can try importing and using it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this:
- pip check | |
- pip check | |
- python -c 'from juliacall import Main as jl; assert jl.seval("1 + 1") == 2' |
just to start with. We can always expand later
Ping @mkitti, let me know how it's going |
It's also the documented behaviour :)
Agreed. I like the idea of keeping the installation of julia decoupled from juliacall - the user can always opt in to installing julia with conda. |
One problem I foresee if someone does |
I think even in the presence of a conda version of Julia, we can basically assume that |
You are starting to make a case for this not to be in conda-forge. |
How so? It could depend on |
I guess the existing |
Right, but
If I wanted to just download binaries from wherever and do whatever I wanted I could upload the packages to my own conda channel as follows. https://anaconda.org/julialang/pyjuliacall I probably should convert that into an organization. The packages there are generated by running build-locally.py at b25cc53 and then uploading the resulting packages. |
I don't think installation order matters does it? JuliaCall doesn't find/install Julia until it is imported. |
I believe you can set "compatibilities" in Conda packages instead of "dependencies", which I think are like weak dependencies in Julia, namely it defines a compat bound on the package but doesn't install it unless it's actually a dependency of something else. So if packages at least set a compatibility on Julia correctly, then JuliaCall should pick up the conda-forge version. |
But I agree that it would more be in the spirit of conda-forge to make Julia an explicit dependency of JuliaPkg. Does the Julia package in conda-forge set |
On further reflection, making Julia an explicit dependency makes sense and should be safe. JuliaPkg will only install Julia if neither Julia nor JuliaUp is already installed. If Julia is installed but incompatible, it raises an error. So if Julia is installed in your Conda env it will either be used or raise an error - indicating some package needs to change it's compat bounds on Julia. I think for extra safety I'll change JuliaPkg to also raise an error if Julia is not installed but you are in a Conda environment - since then you almost definitely don't want it automatically installed. Do you have a link to the Julia recipe please? |
https://github.com/conda-forge/julia-feedstock/blob/main/recipe/meta.yaml My main concern with making it a hard dependency (if that's what you mean) is that you would then not be able to install pyjuliacall on Windows or macOS M1/M2, despite these being Tier 1 supported systems. So I am a fan of just letting JuliaUp manage the install. As to why it doesn't support those:
Not to mention that maintaining julia-feedstock is just a lot of additional maintenance work. Even 1.10 is not yet working on any OS: conda-forge/julia-feedstock#267. A working "good" solution > broken perfect solution :) |
Indeed! Those are good points. You can have platform dependent dependencies though, so Julia could be a hard dependency on supported platforms? Instead of building Julia yourself, why not just bundle the official binaries? Are you linking against other Conda packages? Edit: you should probably only depend on a package if you can assure it will stay supported - if the Julia feedstock is hard to maintain, making it a soft dependency would make sense. |
Hm, maybe. I worry it could lead to platform-specific bugs which would be hard to diagnose unless a maintainer owns the right architecture, compared to a uniform installation solution.
I think this could be done by depending on juliaup's feedstock: https://github.com/conda-forge/juliaup-feedstock. There were some discussions about making the Julia feedstock just use juliaup (conda-forge/julia-feedstock#256), but it hasn't progressed further.
👍 |
I'm proposing we have two packages. Within the conda-forge channel, we depend on the julia conda-forge package. Within the julialang channel, we do not depend on Julia. |
I don’t think you can have a dependency on an external (out of conda-forge) dependency within conda-forge, meaning that everybody would need to maintain one package on the JuliaLang channel, and one on the conda-forge channel. Just to get compatibility on macOS ARM and Windows. It just sounds like a huge amount of work to avoid a slightly imperfect solution. Also, I view the best part about conda-forge is to have a hermetic (https://bazel.build/basics/hermeticity) build, but multiple channels breaks this. thoughts? |
As far as I can tell, conda dependencies are usually not qualified based on their channel. If you depend on "pyjuliacall" and the user installed "pyjuliacall" from the "julialang" channel, then that dependency should be satisfied. We could similarly create "julia" and "juliaup" packages in the "julialang" channel that would default to downloading the official JuliaLang.org binaries. Meanwhile the conda-forge versions default to using the conda-forge built julia package Essentially, we are putting the choice into the hands of the users. It's their choice if they want to use the julialang channel or not and at what priority. |
@ngam do you have any thoughts about what we should do here and how to move this forward? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With current rules, you must not depend on non-conda-forge dependencies, so within each feedstock, the only channel you can use is conda-forge. (In the past, things were different and they may change again.)
For the sake of simplicity and all issues that have been stalling the Julia effort within conda-forge, I think the most feasible solution is to make these packages decoupled from the Julia we have in conda-forge. So, I wouldn't depend on Julia here explicitly. As this is the case right now, I am approving the PR. Remember we could iterate and experiment at length once these packages are in their respective feedstocks.
The conda-forge ecosystem for Julia is still in its infancy and I am not sure if it will take off anytime soon, so why delay with complicated design decisions at this junction? We can revisit. One thing we can do is "advertise" the availability of the conda-forge Julia prominently upon installation, but still let the user actively decide if they want to add Julia from conda-forge or get it from somewhere else (juliaup, etc.).
Tangential, do you know who's leading the julialang channel on anaconda.org? |
(I am asking because ... it could be easier to experiment with something like that than experiment here ... Github Actions finally support Apple Silicon, and likely Azure Pipelines will follow suit very soon, so the specific MacOS bottleneck should be eased soon) |
That would be me. |
Ping @mkitti, can this be merged? We can iterate in the feedstock after. |
Ask @ngam or https://matrix.to/#/#conda-forge:matrix.org. I'm not sure what the hold up is. |
Have you tried |
I cannot merge; once ready, we should ping |
To help direct your pull request to the best reviewers, please mention a topic-specifc team if your recipe matches any of the following: conda-forge/help-c-cpp, conda-forge/help-cdts, conda-forge/help-go, conda-forge/help-java, conda-forge/help-julia, conda-forge/help-nodejs, conda-forge/help-perl, conda-forge/help-python, conda-forge/help-python-c, conda-forge/help-r, conda-forge/help-ruby,or conda-forge/help-rust. Thanks! |
Thanks @ocefpaf ❤️ |
Checklist
url
) rather than a repo (e.g.git_url
) is used in your recipe (see here for more details).@conda-forge/help-python @conda-forge/help-julia
This pull request packages julicall and [juliapkg] from pypi as pyjuliacall and pyjuliapkg respectively. pyjuliapkg is a dependency of pyjuliacall.
There also exists a R package called JuliaCall on CRAN.
The "py" prefix is added to disambiguate these packages from the R package with a similar name and potential Julia packages following the deconfliction protocol of
conda-forge/conda-forge.github.io#18 (comment) . Also note that the upstream source repository of juliapkg is called pyjuliapkg.
This pull request is meant so supersede #20379 and #20380 which are both now stale. The main difference between this pull request and those ones is that the added "py" prefix.
The upstream source repositories are as follows.
These recipes were generated by grayskull and modified to add the
py
prefix.