Sign inSign up

attxproject/pypirepo

By attxproject

•Updated about 9 years ago

PypiRepo for PyGradle

Image
0

450

attxproject/pypirepo repository overview

PypiRepo for PyGradle - Python Gradle builds

Dockerfile @ https://github.com/ATTX-project/development-environment/blob/dev/pivy-repo/Dockerfile⁠

Copy of docker image from https://github.com/blankdots/ivy-pypi-repo⁠.

Build and Run

Build with gradle:

gradle wrapper for Gradle 3.3 provided - use ./gradlew; build the ivy-pypi-repo - ./gradlew build a.k.a. your own artifact for the API; run the ivy-pypi-repo - ./gradlew run build the docker image - ./gradlew buildpypiImage it will generate the attx-dev/pypirepo at build (use it to run the container) - based on gradle-dcompose-plugin - see for more tasks. Other commands:

./gradlew run on the ivy-pypi-repo to run the server locally for adding dependencies ./gradlew tasks --all - see all tasks Running the docker image:

without persistance: docker run -p 5039:5039 -p 5639:5639 -d attx-dev/pypirepo with persistance: docker run -p 5039:5039 -p 5639:5639 -d -v /data:/data attx-dev/pypirepo PyGradle usage

In order to use this Ivy repository with PyGradle one can set it up in the build.grale as:

repositories { // the webrepository ivy{ name 'pypi-repo' url "http://pypirepo:5039/⁠" layout 'pattern' , { artifact '[organisation]/[module]/[revision]/[artifact]-revision⁠.[ext]' ivy '[organisation]/[module]/[revision]/[module]-[revision].ivy' } } } Endpoints

The following endpoints are available:

http://localhost:5039/pypi⁠ - for retrieving depenencies; http://localhost:5639/init-⁠ for initialising the repository with depenencies; http://localhost:5639/add-⁠ for adding depenencies. The init dependencies can be manged in resources/init.json file.

Adding new repository can be achieved by http://localhost:5639/add⁠ endpoint. JSON Request example:

{ "dependencies": [ { "name" : "dependency", "version" : "1.0.0" } ], "replace" : [ { "name": "dependency", "oldVersion": "0.1", "newVersion": "0.1.1" } ] } Example of curl requests:

curl -X GET -H http://localhost:5039/pypi/{dependencyName}/{version}/dependencyName-version.tar.gz⁠ to retrieve dependency with a specific version number

curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 434b0f96-728d-f97e-c016-ffcf61b3f54a" -d '{ "dependencies": [ { "name" : "pytest", "version" : "3.0.5" }, { "name" : "elizabeth", "version" : "0.3.11" } ], "replace" : [ { "name": "alabaster", "oldVersion": "0.7", "newVersion": "0.7.1" } ] }' "http://localhost:5639/add⁠" - for adding dependencies

Tag summary

Content type

Image

Digest

Size

100.4 MB

Last updated

about 9 years ago

docker pull attxproject/pypirepo