diff --git a/.ci/whl-package.bash b/.ci/whl-package.bash new file mode 100644 index 0000000000000000000000000000000000000000..221e552a5ab9430160e95bd186cbd679d82507ce --- /dev/null +++ b/.ci/whl-package.bash @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +# Build package +git fetch --tags +PYNRP_VERSION=$(git describe --tags --always) + +echo "${PYNRP_VERSION}" +echo "VERSION = \"${PYNRP_VERSION}\"" > hbp_nrp_virtual_coach/pynrp/version.py + +pushd hbp_nrp_virtual_coach +python3 setup.py sdist bdist_wheel +popd diff --git a/Jenkinsfile b/Jenkinsfile index 4c909367194855491a6c629c25aa27371874b519..4c67b04715807f9b3c94c88b518768e967b85786 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,6 +34,8 @@ pipeline { TOPIC_BRANCH = "${TOPIC_BRANCH}" DEFAULT_BRANCH = "${DEFAULT_BRANCH}" + NexusPyPiRepoUrl = "https://nexus.neurorobotics.ebrains.eu/repository/nrp-pypi-internal/" + CODE_COVERAGE_LINE = 74 } agent { @@ -107,6 +109,23 @@ pipeline { } } } + + stage('Create package') { + steps { + bitbucketStatusNotify(buildState: 'INPROGRESS', buildName: 'Building pynrp') + + dir(env.GIT_CHECKOUT_DIR){ + // tbuild package + sh 'bash ./.ci/whl-package.bash' + // upload package + withCredentials([usernamePassword(credentialsId: 'nexusadmin', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) + { + sh 'pip3 install twine' + sh 'twine upload -u $USER -p $PASSWORD --repository-url ${NexusPyPiRepoUrl} hbp_nrp_virtual_coach/dist/*.whl' + } + } + } + } } post { diff --git a/hbp_nrp_virtual_coach/doc/source/developer_manual.rst b/hbp_nrp_virtual_coach/doc/source/developer_manual.rst index f8b9788b8b7056ac27d1790d086c59ee840b64ff..1e2833fb9c0b8ee022eac9b59649ab0e0d7b5eb9 100644 --- a/hbp_nrp_virtual_coach/doc/source/developer_manual.rst +++ b/hbp_nrp_virtual_coach/doc/source/developer_manual.rst @@ -14,4 +14,5 @@ Virtual Coach developer space .. toctree:: :maxdepth: 2 - python_api \ No newline at end of file + python_api + pypi \ No newline at end of file diff --git a/hbp_nrp_virtual_coach/doc/source/pypi.rst b/hbp_nrp_virtual_coach/doc/source/pypi.rst new file mode 100644 index 0000000000000000000000000000000000000000..06acba2a8c8d458050c9784741fb6e14b6822053 --- /dev/null +++ b/hbp_nrp_virtual_coach/doc/source/pypi.rst @@ -0,0 +1,35 @@ +.. _virtual-pypi: + +.. sectionauthor:: Viktor Vorobev <vorobev@in.tum.de> + +.. seealso:: + + :ref:`User manual<virtual_coach_intro>` / + :ref:`Tutorials<virtual-coach-tutorial>` / + :ref:`Developer pages<virtual_coach_dev_space>` + +Stand-alone installation +======================== + +The Virtual Coach is packed and published to PyPi repository. + +The official releases can be found `here <https://pypi.org/project/pynrp/>`_ and you can install it as + +.. code-block:: bash + + pip3 install pynrp + + +The intermediate packages are stored in internal PyPi repository with developer-only access. One requires the username and the password for the developers Nexus server to get them. The following command will help to install the specific version + +.. code-block:: bash + + pip3 install pynrp==<version> --index-url https://<user>:<pass>@nexus.neurorobotics.ebrains.eu/repository/nrp-pypi/simple/ --trusted-host nexus.neurorobotics.ebrains.eu --use-deprecated=legacy-resolver + +where + +* :code:`<user>` is your Nexus username; +* :code:`<pass>` is your Nexus password; +* :code:`<version>` is a package version, that is determined as :code:`git describe --tags --always` of your commit. + +You can browse the available versions `here <https://nexus.neurorobotics.ebrains.eu/#browse/browse:nrp-pypi-internal>`_.