0

I have project, that runs has python and scala components. I want to distribute it as a pip-package.

The current install-routine is:

git clone <project>
cd <project>
mvn package
pip install -r requirements.txt

and I want it to be just

pip install <project>.zip

The problem here is, as far as I can see, that I need to define mvn as a dependency, and then invoke it during install.

phd
  • 82,685
  • 13
  • 120
  • 165
wotanii
  • 2,470
  • 20
  • 38
  • You can only declare python dependencies for a python distribution. If you need maven dependency, you are better served by creating a `deb` or `rpm` package or an `msi` installer for windows etc. – hoefling Aug 09 '18 at 09:50
  • 1
    some ideas that come to mind are: have an install-step, that calls mvn, or include all mvn dependencies in the package. Or maybe there is even some kind of mvn-for-pip package, that I could use – wotanii Aug 09 '18 at 09:59
  • 1
    Maven is not necessarily available on the target OS. You'd need to bundle some kind of portable maven distribution in the python package, along with the JRE for target architecture, just to install the java libs. Not sure that's a good idea. Another thing is that wheels don't have install steps you can hook yourself into; they simply copy files from the archive to site-packages dir. Copying files to `$HOME/.m2` will also be an error-prone task with wheels. They are just not for installing arbitrary stuff. – hoefling Aug 09 '18 at 10:09
  • 1
    Create a custom install command ([example](https://stackoverflow.com/a/45985306/7976758)) and run `mvn` from it. – phd Aug 09 '18 at 10:33

0 Answers0