Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Empaquetando y distribuyendo código python con...
Search
JuanPablo
December 12, 2014
Programming
0
480
Empaquetando y distribuyendo código python con pip
JuanPablo
December 12, 2014
Tweet
Share
More Decks by JuanPablo
See All by JuanPablo
Nodejs, mocha y un poco de travis-ci
juanpabloaj
0
61
Creando paquetes para npm
juanpabloaj
0
34
Unit test
juanpabloaj
0
130
Other Decks in Programming
See All in Programming
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
240
社会人になっても趣味開発を続けたい! / traPavilion
mazrean
1
120
Amazon Verified Permissions実践入門 〜Cedar活用とAppSync導入事例/Practical Introduction to Amazon Verified Permissions
fossamagna
2
110
Blazing Fast UI Development with Compose Hot Reload (droidcon London 2025)
zsmb
0
430
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
3
4.6k
スキーマ駆動で、Zod OpenAPI Honoによる、API開発するために、Hono Takibiというライブラリを作っている
nakita628
0
330
エンジニアインターン「Treasure」とHonoの2年、そして未来へ / Our Journey with Hono Two Years at Treasure and Beyond
carta_engineering
0
460
CSC305 Lecture 12
javiergs
PRO
0
240
Kotlinで実装するCPU/GPU 「協調的」パフォーマンス管理
matuyuhi
0
110
マイベストのシンプルなデータ基盤の話 - Googleスイートとのつき合い方 / mybest-simple-data-architecture-google-nized
snhryt
0
110
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
2
840
Register is more than clipboard
satorunooshie
1
180
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Producing Creativity
orderedlist
PRO
348
40k
Being A Developer After 40
akosma
91
590k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
Balancing Empowerment & Direction
lara
5
710
Building Applications with DynamoDB
mza
96
6.7k
Faster Mobile Websites
deanohume
310
31k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Documentation Writing (for coders)
carmenintech
76
5.1k
A Tale of Four Properties
chriscoyier
161
23k
Transcript
Empaquetando y distribuyendo código python con pip Juan Pablo Abarzua
11 Diciembre 2014
– http://www.jeffknupp.com/blog/2014/04/03/dont-write-python-scripts-write- python-libraries/ “Don't Write Python Scripts, Write Python Libraries”
No escribas scripts, escribe librerías o mejor aun, escribe paquetes
distribuibles.
pip El gestionador de paquetes de Python
• https://pip.pypa.io/en/latest/installing.html • wget https://bootstrap.pypa.io/get-pip.py • python get-pip.py pip install
Virtualenv Entornos virtuales, instalaciones sin modificar el sistema.
virtualenv • pip install virtualenv • pip install virtualenvwapper •
mkdir ~/envs • export WORKON_HOME=~/envs • source /usr/local/bin/virtualenvwrapper.sh
• mkvirtualenv env_ejemplo • workon env_ejemplo • pip install django
Creando un entorno virtual
None
• pip freeze • pip freeze > requirements.txt • pip
install -r requirements.txt requirements.txt
Creando un modulo distribuible
None
• mkvirtualenv env_ejemplo_modulo • workon env_ejemplo_modulo • pip install -e
. • pip list • pip uninstall modulo-simple
None
Creando una aplicación de consola distribuible
None
• mkvirtualenv env_ejemplo_command • workon env_ejemplo_command • pip install -e
. • pip uninstall hola-meetup
None
• Hasta este punto cualquiera que descargue el código o
lo clone de un repositorio publico puede instalarlo.
PyPI - the Python Package Index
• Crear un cuenta en https://pypi.python.org/pypi • Crear el
archivo ~/.pypirc [distutils] index-servers= pypi [pypi] repository = https://pypi.python.org/pypi username = <your production user name goes here> password = <your production password goes here>
• python setup.py register -r pypi • python setup.py sdist
upload -r pypi
• pip search slacker-cli • https://pypi.python.org/pypi/slacker-cli/
• pip install git+git://github.com/juanpabloaj/repo_name.git@branch_name Instalando desde un repositorio git
• http://juanpabloaj.com/2014/08/03/Virtualenv-y- virtualenvwapper/ • http://juanpabloaj.com/wiki/pip/ • https://hynek.me/articles/sharing-your-labor-of-love- pypi-quick-and-dirty/ • http://peterdowns.com/posts/first-time-with-pypi.html
• http://www.jeffknupp.com/blog/2014/04/03/dont-write- python-scripts-write-python-libraries/ • http://choosealicense.com/