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 pip
Search
JuanPablo
December 12, 2014
Programming
0
360
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
47
Creando paquetes para npm
juanpabloaj
0
26
Unit test
juanpabloaj
0
110
Other Decks in Programming
See All in Programming
15分間でふんわり理解するDocker @ Matsuriba MAX
ukwhatn
PRO
1
340
C# 大統一理論推進委員会 会員のための Unity Package Manager プロジェクト構成案
monry
PRO
0
580
App Router への移行は「改善」となり得るのか?/ Can migration to App Router be an improvement
takefumiyoshii
1
140
Dockerで始めるAWS Lambda開発
stutkhd0709
14
2.5k
上手な探索的テストとその上達方法について
matsu802
4
660
Go1.22からの疑似乱数生成器について/go-122-pseudo-random-generator
convto
1
160
イベントストーミングによるオブジェクトモデリング・オブジェクト指向プログラミングの適用・開発プロセスの変遷・アーキテクチャの変革 / Object modeling with Event Storming.
nrslib
12
3.2k
脱・初心者!脱・マネコン!AWS CDKを使ってみませんか!?
har1101
0
180
Data Contracts In Practice With Debezium and Apache Flink (Kafka Summit London)
gunnarmorling
2
280
孤独のCTOグルメという やや奇抜な企画をやった目的と効果
shoheimitani
3
1k
Material 3で Material 2ぽい見た目にする
numeroanddev
2
250
WebComponentsで フレームワークを1ページに共存させる
webuilder240
0
150
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
407
22k
What the flash - Photography Introduction
edds
64
11k
Designing on Purpose - Digital PM Summit 2013
jponch
109
6.4k
Large-scale JavaScript Application Architecture
addyosmani
501
110k
The Pragmatic Product Professional
lauravandoore
24
5.7k
Docker and Python
trallard
33
2.6k
Happy Clients
brianwarren
91
6.3k
A designer walks into a library…
pauljervisheath
199
23k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
GraphQLとの向き合い方2022年版
quramy
28
12k
Web Components: a chance to create the future
zenorocha
304
41k
Typedesign – Prime Four
hannesfritz
36
2k
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/