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
Packaging pratique (fr) - pycon.fr 2014
Search
xordoquy
October 25, 2014
Programming
1
170
Packaging pratique (fr) - pycon.fr 2014
Présentation général du packaging Python
xordoquy
October 25, 2014
Tweet
Share
More Decks by xordoquy
See All by xordoquy
pycon.fr 2018 - Django REST framework workshop
xordoquy
0
300
mauvaises bonnes idées pour REST
xordoquy
1
360
Authentication and Permissions with Django REST framework
xordoquy
0
180
Buildbot 0.9
xordoquy
0
100
Performances Django REST framework - DjangoCong 2016
xordoquy
0
130
Présentation de l'architecture REST - meetup Django Paris
xordoquy
0
110
Django REST framework workshop @Djangocon Europe 2015
xordoquy
0
120
Django REST framework - DjangoConG 2015
xordoquy
3
140
Django REST framework workshop - DjangoCong 2015
xordoquy
1
120
Other Decks in Programming
See All in Programming
AIともっと楽するE2Eテスト
myohei
8
3k
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
1.1k
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
0
260
顧客の画像データをテラバイト単位で配信する 画像サーバを WebP にした際に起こった課題と その対応策 ~継続的な取り組みを添えて~
takutakahashi
4
1.3k
商品比較サービス「マイベスト」における パーソナライズレコメンドの第一歩
ucchiii43
0
180
Vibe Codingの幻想を超えて-生成AIを現場で使えるようにするまでの泥臭い話.ai
fumiyakume
10
4.6k
AI コーディングエージェントの時代へ:JetBrains が描く開発の未来
masaruhr
1
200
Android 16KBページサイズ対応をはじめからていねいに
mine2424
0
440
PicoRuby on Rails
makicamel
3
140
React は次の10年を生き残れるか:3つのトレンドから考える
oukayuka
15
4.6k
LT 2025-06-30: プロダクトエンジニアの役割
yamamotok
0
870
おやつのお供はお決まりですか?@WWDC25 Recap -Japan-\(region).swift
shingangan
0
140
Featured
See All Featured
A better future with KSS
kneath
238
17k
How GitHub (no longer) Works
holman
314
140k
Scaling GitHub
holman
460
140k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
108
19k
Designing for Performance
lara
610
69k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
830
Faster Mobile Websites
deanohume
308
31k
Site-Speed That Sticks
csswizardry
10
700
The Language of Interfaces
destraynor
158
25k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Transcript
packaging xavier ordoquy
@linovia_net
Changer une miriade de scripts
en un système contrôlé.
Distribution: Une « distribution » Python est un fichier d’archive
versionné qui contient des paquets Python, des modules et d’autres fichiers de ressources qui sont utilisés pour distribuer une « Release ». Ce fichier de distribution est ce qu’un utilisateur final téléchargera d’Internet et installera.
Par la suite: packaging == distribution
exemple : pip install sentry[postgres]
Packaging Python : pourquoi ?
multi plateformes
Packaging Python : comment ?
3 outils + du code !!
virtualenv pyenv
Isoler le projet du reste
y compris avec docker, lxc, vagrant…
gain: fin des conflits
dépôt pypi
dépôt ‘officiel’ pypi.python.org
dépôt privé devpi
gain: distribution simple
pip
pip install -e
pip freeze (-l)
requirements: pip install -r
gain: gestion des dépendances
setup.py
use setuptools
recopiez !!
versions: PEP440 1.2.4.dev3557 1.2.4a1 1.2.4b1 1.2.4c1 == 1.2.4rc1 1.2.4 1.2.4.post1
images, css..: MANIFEST.in
gain: application web
executables : entry_points
gain : aucun chemin en dur
requirements : extra_requires
exemple : pip install sentry[postgres] pip install -e .[tests,dev]
gain: uniformisation des méthodes
Bonus: wheel
gain: temps
Bonus 2: stevedore
Bonus 3: du code !
setup( name='project', version='0.1.3a4', description='Some description', long_description=open('README.rst').read(), author='Xavier Ordoquy', author_email='
[email protected]
', url='http://github.com/xx/yy',
packages=find_packages(exclude=[‘tests']), zip_safe=False, include_package_data=True, classifiers=[ 'Framework :: Django', ] ) exemple:
setup( … install_requires=install_requires, extras_require={ 'tests': tests_require, 'dev': dev_requires, 'postgres': install_requires
+ pg_requires, } ) exemple:
setup( … entry_points={ 'console_scripts': [ 'sentry = sentry.utils.runner:main', ], },
) exemple:
class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = ['tests'] self.test_suite =
True def run_tests(self): import pytest errno = pytest.main(self.test_args) sys.exit(errno) setup( … cmdclass={'test': PyTest}, ) exemple:
Présentation http://bit.ly/1skB3K4 Python Packaging User Guide http://bit.ly/1ww8Nbz setup.py Sentry http://bit.ly/1FMMCnG
Merci