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
470
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
60
Creando paquetes para npm
juanpabloaj
0
33
Unit test
juanpabloaj
0
120
Other Decks in Programming
See All in Programming
旅行プランAIエージェント開発の裏側
ippo012
1
470
パスタの技術
yusukebe
1
530
オープンセミナー2025@広島LT技術ブログを続けるには
satoshi256kbyte
0
140
Trem on Rails - Prompt Engineering com Ruby
elainenaomi
1
100
物語を動かす行動"量" #エンジニアニメ
konifar
14
5.6k
為你自己學 Python - 冷知識篇
eddie
1
280
UbieのAIパートナーを支えるコンテキストエンジニアリング実践
syucream
2
760
Azure SRE Agentで運用は楽になるのか?
kkamegawa
0
470
コーディングエージェント時代のNeovim
key60228
1
110
TanStack DB ~状態管理の新しい考え方~
bmthd
2
350
エンジニアのための”最低限いい感じ”デザイン入門
shunshobon
0
130
あなたとJIT, 今すぐアセンブ ル
sisshiki1969
1
740
Featured
See All Featured
Bash Introduction
62gerente
614
210k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Agile that works and the tools we love
rasmusluckow
330
21k
Typedesign – Prime Four
hannesfritz
42
2.8k
Balancing Empowerment & Direction
lara
2
600
Writing Fast Ruby
sferik
628
62k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
How to Think Like a Performance Engineer
csswizardry
26
1.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.6k
GitHub's CSS Performance
jonrohan
1032
460k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
570
The Invisible Side of Design
smashingmag
301
51k
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/