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
Ordoquy Xavier - Linovia
October 25, 2014
Programming
170
1
Share
Packaging pratique (fr) - pycon.fr 2014
Présentation général du packaging Python
Ordoquy Xavier - Linovia
October 25, 2014
More Decks by Ordoquy Xavier - Linovia
See All by Ordoquy Xavier - Linovia
SQLAlchemy - un ami qui vous veut du bien
xordoquy
0
15
pycon.fr 2018 - Django REST framework workshop
xordoquy
0
350
mauvaises bonnes idées pour REST
xordoquy
1
400
Authentication and Permissions with Django REST framework
xordoquy
0
190
Buildbot 0.9
xordoquy
0
110
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
130
Django REST framework - DjangoConG 2015
xordoquy
3
150
Other Decks in Programming
See All in Programming
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
110
実践ハーネスエンジニアリング:ステアリングループを実例から読み解く / Practical Harness Engineering: Understanding Steering Loops Through Real-World Examples
nrslib
5
5.1k
ハーネスエンジニアリングとは?
kinopeee
13
6.9k
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
500
Road to RubyKaigi: Play Hard(ware)
makicamel
1
560
過去のレビュー知見をSkillsで資産化した話
pkshadeck
PRO
1
1.8k
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.6k
AI時代になぜ書くのか
mutsumix
0
360
AWSはOSSをどのように 考えているのか?
akihisaikeda
0
110
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
180
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
250
Agent Skills を社内で育てる仕組み作り
jackchuka
1
1.8k
Featured
See All Featured
Unsuck your backbone
ammeep
672
58k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
370
Mobile First: as difficult as doing things right
swwweet
225
10k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
140
Skip the Path - Find Your Career Trail
mkilby
1
120
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
500
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
210
Automating Front-end Workflow
addyosmani
1370
200k
Typedesign – Prime Four
hannesfritz
42
3k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
540
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
190
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