-
Notifications
You must be signed in to change notification settings - Fork 57
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 perl
test section?
#790
Comments
That magic lives here: https://github.com/conda/conda-build/blob/3cf75b660e73babd4772d2cf65ac0026406ca558/conda_build/create_test.py, and it actually supports R and Lua as well. I've been mass migrating all my personal recipes and feedstocks I manage in conda-forge over to A couple of thoughts on this:
What is needed for this to be implemented? I'm not a rust expert but happy to help as I can! |
Hi @danielnachun thanks for stopping by! Yes, I sorta looked through all that magic as well back in the days, but for my taste it's too much magic :) I would propose two things: Like script:
interpreter: perl
contents: |
use strict;
use warnings;
use Config;
print "Hello World!\n";
print "Perl prefix: $Config{prefix}\n"; That would also give an "easy" way to roll your own import tests. When that works, we could use this to create a |
@danielnachun I started the implementation for using To add a perl-specific test section we should come up with a list of entries we would like, for example: tests:
- perl:
imports: [ ... ]? # is imports the right word for perl?
check_version: true/false? And that would be just a convenience wrapper around the |
Indeed upon examining that code in
This is a great idea, and I'll write up below potential specifications for how this can be done with R, Ruby, Lua and NodeJS.
This is exactly what I had in mind. I'll write out specifications below for what I think make sense for the different languages. |
These are my current thoughts on how we could call various scripting languages as interpreters and what language-specific test sections could look like. One overall decision that probably needs to be made is whether we would want to consolidate all the "import" tests to a single script, or to use single command invocations for each test. I don't feel strongly about this either way - maybe we should just go by what is easiest to implement and maintain. PerlPerl scripts can be invoked simply by call
I'm not sure yet if the version check is actually worth adding. The situation is even more complex than I first mentioned above because in modules specified by multiple files, the author may not keep the versions across these files in sync. This has resulted in partial test failures where some module/submodules did have the right version and others did not. It may be possible to have a syntax that allows the user to explicitly enable/disable the version check, but given that version checking isn't even done for other languages, I'm not sure it's important to do here. RR scripts can be invoked with
RubyRuby scripts can be invoked with
LuaLua scripts can be invoked with
NodeJSNodeJS scripts can be invoked with
I'll note here that as I mentioned above, there isn't a lot of value in bundling standalone NodeJS libraries, as the standard NodeJS practice is to bundle all the libraries together. Most NodeJS recipes are CLI executables that can just be tested with a shell command, but the one scenario where it can be useful to package libraries is when they include native code to avoid vendoring pre-compiled native code in other packages that depend on that library. I'm happy to explain this in more detail if needed. Sorry for the huge info dump here, but I figured that all of these could probably end up being implemented more or less the same way aside from the minor syntactic differences |
Apparently conda-build has some magic that makes the
test.import
section also work forperl
.For example here:
The text was updated successfully, but these errors were encountered: