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

[Feature] Please add jrun install -r requirements.jrun syntax #13

Open
jleaders opened this issue Aug 17, 2018 · 8 comments
Open

[Feature] Please add jrun install -r requirements.jrun syntax #13

jleaders opened this issue Aug 17, 2018 · 8 comments
Assignees
Milestone

Comments

@jleaders
Copy link

jleaders commented Aug 17, 2018

I know jrun is primarily for running java, but it strikes me as being a possibly remarkably simple dependency manager. (groovy, gradle, ant, maven all seem quite complex)

This request is not without precedent, see the following technologies who employ this pattern:

  • gem
  • npm
  • bower
  • pip
  • composer
  • ansible-galaxy

You could make it pip-like "one line, multi-depeandancy install" behavior, similar to pip install -r requirements.txt. What do you think of creating a jrun install that does the same thing that jrun is currently doing, but also copies the downloaded artifacts to a specified folder (--out)?

I'm imagining:

$ cat requirements.jrun

net.razorvine:pyrolite
# insert more dependancies here... also support PURL syntax?

$jrun install --requirements requirements.jrun --out ./lib
is the same as
$jrun install -r requirements.jrun -o ./lib
Which then results in:
$tree ./lib

./lib
└── net.razorvine
    └── pyrolite
        ├── pom.xml
        ├── pyrolite-4.21.jar
        └── serpent-1.23.jar



Then any java project could just add ./lib as it's library path, and just create a jrun.requirements for all their dependency management

This will satisfy the heart of this request which has 25,000 views
https://stackoverflow.com/questions/2710266/is-there-a-package-manager-for-java-like-easy-install-for-python

@jleaders
Copy link
Author

Alternatively you could an additional binary called jip or jpkg that does this, so jrun is still seperated

@ctrueden
Copy link
Member

ctrueden commented Aug 20, 2018

Nice idea, @jleaders.

I am naturally reluctant to complexify jrun, but on the other hand being able to specify a composite endpoint using a requirements file is compelling. And adding an option to not actually run the resulting environment would also be very easy. As would adding an option to configure the destination directory of the environment.

Before we dive into it further, I'd like to mention a conversation started on conda-forge about how best to package Java components for conda: conda-forge/conda-forge.github.io#590. If we can establish some best practices and/or tooling for wrapping Maven artifacts as conda packages, it might fulfill what you are looking for. What do you think?

@hanslovsky
Copy link
Member

And adding an option to not actually run the resulting environment would also be very easy.

The python port (#12) does that already (albeit only within python code) and I use that to be more flexible in imglyb.

@ctrueden
Copy link
Member

@jleaders Does the python port fulfill your needs here? Shall we close this? Or do you think there is value in implementing something that works with the shell script version as well?

@jleaders
Copy link
Author

jleaders commented Oct 8, 2018

If from your readme I can easily know how to install packages with CLI one liners then yes

@hanslovsky
Copy link
Member

The python script does not expose dependency resolution to the command line, only as a utility method to be called from other python projects. If you would like to (change and) expose that as CLI functionality, PRs are always welcome.

@ctrueden ctrueden added the to do label Oct 15, 2018
@hanslovsky
Copy link
Member

#37 adds a --resolve-only options which prints the directory containing all the jars to the command line. You could then just copy all the jars in that directory to where you need them.

$ ls `jgo --resolve-only net.imglib2:imglib2-algorithm`
ejml-0.24.jar  imglib2-5.6.0.jar  imglib2-algorithm-0.11.1.jar  imglib2-realtransform-2.0.1.jar  imglib2-roi-0.6.0.jar  jama-1.0.3.jar  jitk-tps-3.0.0.jar  log4j-1.2.17.jar  ojalgo-45.1.1.jar  pom.xml  trove4j-3.0.3.jar
$ cp `jgo --resolve-only net.imglib2:imglib2-algorithm`/*.jar <target-dir>

@ctrueden ctrueden self-assigned this Jun 28, 2019
@ctrueden ctrueden added this to the 1.0.0 milestone Jun 28, 2019
@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/installing-imagej-plugins-with-python/68368/2

@ctrueden ctrueden modified the milestones: 1.0.0, unscheduled Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants