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
290
mauvaises bonnes idées pour REST
xordoquy
1
350
Authentication and Permissions with Django REST framework
xordoquy
0
180
Buildbot 0.9
xordoquy
0
97
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
110
Django REST framework - DjangoConG 2015
xordoquy
3
140
Django REST framework workshop - DjangoCong 2015
xordoquy
1
110
Other Decks in Programming
See All in Programming
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
900
Development of an App for Intuitive AI Learning - Blockly Summit 2025
teba_eleven
0
110
「ElixirでIoT!!」のこれまでとこれから
takasehideki
0
340
エラーって何種類あるの?
kajitack
5
110
💎 My RubyKaigi Effect in 2025: Top Ruby Companies 🌐
yasulab
PRO
1
130
複数アプリケーションを育てていくための共通化戦略
irof
10
3.7k
型安全RESTで爆速プロトタイピング – Hono RPC実践
tacke_jp
0
110
Devinで実践する!AIエージェントと協働する開発組織の作り方
masahiro_nishimi
6
2.9k
#QiitaBash TDDでAIに設計イメージを伝える
ryosukedtomita
2
1.7k
RubyKaigi Hack Space in Tokyo & 函館最速 "予習" 会 / RubyKaigi Hack Space in Tokyo & The Fastest Briefing of RubyKaigi 2026 in Hakodate
moznion
1
130
ktr0731/go-mcpでMCPサーバー作ってみた
takak2166
0
150
TypeScript を活かしてデザインシステム MCP を作る / #tskaigi_after_night
izumin5210
5
520
Featured
See All Featured
Visualization
eitanlees
146
16k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
How to Ace a Technical Interview
jacobian
276
23k
Practical Orchestrator
shlominoach
188
11k
GitHub's CSS Performance
jonrohan
1031
460k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
6
680
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
A better future with KSS
kneath
239
17k
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