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
450
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
53
Creando paquetes para npm
juanpabloaj
0
33
Unit test
juanpabloaj
0
120
Other Decks in Programming
See All in Programming
音声プラットフォームのアーキテクチャ変遷から学ぶ、クラウドネイティブなバッチ処理 (20250422_CNDS2025_Batch_Architecture)
thousanda
0
300
Being an ethical software engineer
xgouchet
PRO
0
220
On-the-fly Suggestions of Rewriting Method Deprecations
ohbarye
1
3.4k
Chrome Extension Techniques from Hell
moznion
1
160
エンジニア向けCursor勉強会 @ SmartHR
yukisnow1823
2
2.4k
파급효과: From AI to Android Development
l2hyunwoo
0
120
Lambda(Python)の リファクタリングが好きなんです
komakichi
3
220
一緒に働きたくなるプログラマの思想 #QiitaConference
mu_zaru
73
17k
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
250
Orleans + Sekiban + SignalR でリアルタイムWeb作ってみた
tomohisa
0
130
エンジニアが挑む、限界までの越境
nealle
1
280
Instrumentsを使用した アプリのパフォーマンス向上方法
hinakko
0
100
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.2k
Build your cross-platform service in a week with App Engine
jlugia
230
18k
The Language of Interfaces
destraynor
157
25k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
KATA
mclloyd
29
14k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Designing for Performance
lara
608
69k
GraphQLの誤解/rethinking-graphql
sonatard
71
10k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
670
It's Worth the Effort
3n
184
28k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
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/