Use custom Python modules from a Git repository
In some cases, you will want to use your own and already existing Python code
Objective
In some cases, you will want to use your own and already existing Python code.
In order to import your custom Python modules and use it in a Custom action, you may refer to an external Git repository that will be pulled before each build of your job.
Here are the steps in order to use an external Git repository as a Python module:
- Adapt your module so that its compatible with
pip install
- Your Python module must be hosted on an accessible host, if repository is private, you need to get an
access token. For instance, in GitHub, you must generate a personal access token (Other providers may have similar procedures)
- Check that downloading of the package works well with your token
- Zip Archive:
https://<access_token>@github.com/<myorg>/<myProject>/archive/<ref>.zip - Git:
git+https://<access_token>@github.com/<myorg>/<myProject>.git - Git with a tag name or commit hash:
git+https://<access_token>@github.com/<myorg>/<myProject>.git@<tag> - Git with automatic latest release:
git+https://<access_token>@github.com/<myorg>/<myProject>.git@latest
- Check that
pip installworks with your URL on your local computer
- In your project, in a custom action, add the dependencies in the Advanced Mode in
forepaas.json:
- with a HTTPS Zip archive
- with a Git+HTTPS repository
- with a Git+HTTPS repository, including a
tagname or acommit hash
- with a Git+HTTPS repository, automatically using the latest release
Auto-resolving the latest release: Using @latest at the end of a git+ dependency URL instructs the platform to automatically fetch and substitute the most recent release tag before installing. This removes the need to update each action's dependency manually when a new version of your module is published, click Force Build to pick up the new release. Note that the latest release is not detected automatically at runtime, a manual Force Build is always required.
Pinning a specific tag or commit hash gives you precise control over which version is used at execution time and is recommended for production workloads.
- In your custom action python code, you can now import and use it!
Go further
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for a custom analysis of your project.
Ask questions, give your feedback and interact directly with the team building the Data Platform on the dedicated Discord channel.
If you need support with your OVHcloud services, create a request in our Help Centre.
Join our community of users.

