{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "view-in-github", "colab_type": "text" }, "source": [ "\"Open" ] }, { "cell_type": "markdown", "id": "f3b67243", "metadata": { "id": "f3b67243" }, "source": [ "# Paquetes distribuibles\n", "Son paquetes distribuibles para otras personas o para reutilizar nosotros mismos. \n", "Pasos:\n", "1. Crear el paquete\n", "2. Instalar el paquete\n", "\n", "Crear un paquete distribuible permite que podamos llamarle esté donde esté, en cualquier carpeta de nuestro ordenador. \n", "Lo que haremos es instalar este paquete dentro del sistema Python alojado en nuestro PC.\n", "\n", "## Crear el paquete\n", "Crearemos un archivo `setup.py` en la raiz de nuestro proyecto que contendrá la descripción del paquete, versión del paquete, autor, ...., packages. \n", "En packages se ha de indicar el paquete principal y el subpaquete con toda su ruta. \n", "\n", "\n", "![setup.py](https://github.com/financieras/pyCourse/blob/main/jupyter/img/setup_py.png?raw=1)\n" ] }, { "cell_type": "code", "source": [ "from setuptools import setup" ], "metadata": { "id": "ofQlhzhzIxdI" }, "id": "ofQlhzhzIxdI", "execution_count": 1, "outputs": [] }, { "cell_type": "code", "execution_count": null, "id": "5c65e37b", "metadata": { "id": "5c65e37b" }, "outputs": [], "source": [ "setup(\n", " name = \"paquetecalculos\",\n", " version = \"1.0\",\n", " description = \"Paquete que calcula la media y la moda\",\n", " author = \"María\",\n", " author_email = \"maria@pru.org\",\n", " url = \"www.pru.tk\",\n", " packages = [\"calculos\", \"calculos.estadistidos\"]\n", ")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.11" }, "colab": { "name": "0180_paquetes_distribuibles.ipynb", "provenance": [], "include_colab_link": true } }, "nbformat": 4, "nbformat_minor": 5 }