{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# PackageManager demo" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's use PackageManager to install the latest released version of the Digraphs package." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\"0.15.2\"" ] }, "execution_count": 1, "metadata": { "text/plain": "" }, "output_type": "execute_result" } ], "source": [ "PackageInfo(\"digraphs\")[1].Version;" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "true" ] }, "execution_count": 2, "metadata": { "text/plain": "" }, "output_type": "execute_result" } ], "source": [ "LoadPackage(\"PackageManager\");" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "#I Getting PackageInfo URLs...\n", "#I Created directory /home/gap/.gap/\n", "#I Created directory /home/gap/.gap/pkg/\n", "#I Retrieving PackageInfo.g from https://gap-packages.github.io/Digraphs/PackageInfo.g ...\n", "#I PackageInfo.g validated successfully\n", "#I Downloading archive from URL https://github.com/gap-packages/Digraphs/releases/download/v0.15.4/digraphs-0.15.4.tar.gz ...\n", "#I Saved archive to /tmp/tmEju2st/digraphs-0.15.4.tar.gz\n", "#I Extracting to /home/gap/.gap/pkg/digraphs-0.15.4 ...\n", "#I Extracted successfully\n", "#I Running compilation script on /home/gap/.gap/pkg/digraphs-0.15.4 ...\n", "#I Compilation was successful\n", "#I Checking dependencies for Digraphs...\n", "#I io >=4.5.1: true\n", "#I orb >=4.8.2: true\n", "#I Running compilation script on /home/gap/.gap/pkg/digraphs-0.15.4 ...\n", "#I Compilation was successful\n" ] }, { "data": { "text/plain": [ "true" ] }, "execution_count": 3, "metadata": { "text/plain": "" }, "output_type": "execute_result" } ], "source": [ "InstallPackage(\"digraphs\");" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\"0.15.4\"" ] }, "execution_count": 4, "metadata": { "text/plain": "" }, "output_type": "execute_result" } ], "source": [ "PackageInfo(\"digraphs\")[1].Version;" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "true" ] }, "execution_count": 5, "metadata": { "text/plain": "" }, "output_type": "execute_result" } ], "source": [ "LoadPackage(\"digraphs\");" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 6, "metadata": { "text/plain": "" }, "output_type": "execute_result" } ], "source": [ "Digraph([[2], [3], [1]]);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next, let's remove that package (the second argument disables interactivity):" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "#I Removed directory /home/gap/.gap/pkg/digraphs-0.15.4\n" ] }, { "data": { "text/plain": [ "true" ] }, "execution_count": 7, "metadata": { "text/plain": "" }, "output_type": "execute_result" } ], "source": [ "RemovePackage(\"digraphs\", false);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can install the latest *development* version of a package from Github:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "#I memoisation package is not available. Check that the name is correct\n", "#I and it is present in one of the GAP root directories (see '??RootPaths')\n" ] }, { "data": { "text/plain": [ "fail" ] }, "execution_count": 8, "metadata": { "text/plain": "" }, "output_type": "execute_result" } ], "source": [ "LoadPackage(\"Memoisation\");" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "#I Cloning to /home/gap/.gap/pkg/Memoisation ...\n", "#I Package cloned successfully\n", "#I Checking dependencies for Memoisation...\n", "#I GAPDoc >= 1.6.1: true\n", "#I curlInterface >= 2.1: true\n", "#I io >= 4.0: true\n", "#I json >= 2.0: true\n", "#I crypting >= 0.8: true\n", "#I Running compilation script on /home/gap/.gap/pkg/Memoisation ...\n", "#I Compilation was successful\n" ] }, { "data": { "text/plain": [ "true" ] }, "execution_count": 9, "metadata": { "text/plain": "" }, "output_type": "execute_result" } ], "source": [ "InstallPackage(\"https://github.com/gap-packages/Memoisation.git\");" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "true" ] }, "execution_count": 10, "metadata": { "text/plain": "" }, "output_type": "execute_result" } ], "source": [ "LoadPackage(\"Memoisation\");" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "function( func, args... ) ... end" ] }, "execution_count": 11, "metadata": { "text/plain": "" }, "output_type": "execute_result" } ], "source": [ "MemoisedFunction;" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To keep our installed package up to date, we can use `UpdatePackage` later:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "#I Pulling from git repository...\n", "#I git: Already up to date.\n", "#I Running compilation script on /home/gap/.gap/pkg/Memoisation ...\n", "#I Compilation was successful\n" ] }, { "data": { "text/plain": [ "true" ] }, "execution_count": 12, "metadata": { "text/plain": "" }, "output_type": "execute_result" } ], "source": [ "UpdatePackage(\"Memoisation\");" ] } ], "metadata": { "kernelspec": { "display_name": "GAP 4", "language": "gap", "name": "gap-4" }, "language_info": { "codemirror_mode": "gap", "file_extension": ".g", "mimetype": "text/x-gap", "name": "GAP 4", "nbconvert_exporter": "", "pygments_lexer": "gap", "version": "4.10.2" } }, "nbformat": 4, "nbformat_minor": 2 }