Skip to content

How to configure a private PyPI repository? #504

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

Open
ivangfr opened this issue May 26, 2025 · 3 comments
Open

How to configure a private PyPI repository? #504

ivangfr opened this issue May 26, 2025 · 3 comments

Comments

@ivangfr
Copy link

ivangfr commented May 26, 2025

Hi,

I am creating a Spring Boot Java application that calls a private Python library. This private Python library is hosted in a private PyPI repository. How can I configure the GraalPy Maven plugin to use this private PyPI repository?

Currently, I believe that adding libraries inside <configuration><packages><package> fetches them from the public Python Package Index (PyPI), which is the official repository of open-source Python packages maintained by the Python Software Foundation. I want to know how to set it up so it fetches packages from my private PyPI repository instead.

Thank you!

@msimacek
Copy link
Contributor

Hi, you should be able to achieve that by setting PIP_INDEX_URL environment variable. Additionally, GraalPy has a second index for pre-built wheels on graalvm.org, you can disable that by setting PIP_EXTRA_INDEX_URL to something nonexistent.

@ivangfr
Copy link
Author

ivangfr commented May 27, 2025

Thanks @msimacek for the fast response.

I am new to GraalPy and Python. But, I have some experience with Spring Boot and Java.

I am trying to call a Python library (H3 Geo) from a Spring Boot Java application.

When running locally, it works, I mean, using ./mvnw spring-boot:run.

Now, I am trying to dockerize the app, unfortunately, without success. I've created this issue graalvm/graal-languages-demos#34

My question are:

  • In case I use Dockerfile, I suppose PIP_INDEX_URL and PIP_EXTRA_INDEX_URL should be there, right?
  • Do you know an example where building a Docker image for a Spring Boot Java app that uses GraalPy works? It can be using Dockerfile, or even better, Paketo Buildpacks.

Thanks!

@msimacek
Copy link
Contributor

In case I use Dockerfile, I suppose PIP_INDEX_URL and PIP_EXTRA_INDEX_URL should be there, right?

Only if you actually build the application or the virtualenv in the dockerfile (AFAICS, you don't). You need it wherever you run maven or pip. If you just copy the JAR/native-image into the docker image, then you don't need it there.

I replied re: docker in the other issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants