$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Packaging pratique (fr) - pycon.fr 2014
Search
Ordoquy Xavier - Linovia
October 25, 2014
Programming
1
170
Packaging pratique (fr) - pycon.fr 2014
Présentation général du packaging Python
Ordoquy Xavier - Linovia
October 25, 2014
Tweet
Share
More Decks by Ordoquy Xavier - Linovia
See All by Ordoquy Xavier - Linovia
SQLAlchemy - un ami qui vous veut du bien
xordoquy
0
6
pycon.fr 2018 - Django REST framework workshop
xordoquy
0
320
mauvaises bonnes idées pour REST
xordoquy
1
380
Authentication and Permissions with Django REST framework
xordoquy
0
190
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
Other Decks in Programming
See All in Programming
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
500
Go コードベースの構成と AI コンテキスト定義
andpad
0
120
TypeScriptで設計する 堅牢さとUXを両立した非同期ワークフローの実現
moeka__c
6
3k
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
130
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
160
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.3k
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
430
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
320
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
150
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
470
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
6
2.1k
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
170
Featured
See All Featured
Making Projects Easy
brettharned
120
6.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
We Have a Design System, Now What?
morganepeng
54
7.9k
How GitHub (no longer) Works
holman
316
140k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
For a Future-Friendly Web
brad_frost
180
10k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
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