SlideShare a Scribd company logo
matt_davidson@python_talks ~/ $ delivering a python project
|-- my_first_module.py
|-- test_my_first_module.py
setup(
name='my_first_package',
version=my_first_package.__version__,
author='Matt Davidson',
tests_require=['pytest'],
install_requires=['requests==2.7.0',
'docopt==0.6.2'
],
cmdclass={'test': PyTest},
author_email='matt@mattjdavidson.co.uk',
description='A dummy package used for presentations',
long_description=long_description,
packages=['my_first_package'],
include_package_data=True,
platforms='any',
my_first_package
=======
Documentation
-------------
Available in docs directory of the project, hopefully hosted
somewhere else too!
### Installation
`pip install my_first_package`
## Contact Me
Questions or comments about `my first package`? Hit me up at
[matt@mattjdavidson.co.uk](mailto:matt@mattjdavidson.co.uk).
docopt==0.6.2
requests==2.7.0
""" my_first_package is a dummy package used for presentations
"""
__version__ = '0.0.1'
|- README.md
|- requirements.txt
|- setup.py
|- docs
| |-- my_first_module.rst
|- my_first_package
| |-- __init__.py
| |-- my_first_module.py
|- tests
| |-- test_my_first_module.py
• Create projects using templates
• Windows, Mac, Linux
• Python, Javascript, Ruby etc.
https://github.com/audreyr/cookiecutter
• Readability > Verbosity
• Generate from docstrings
• Use a tool!
def complex(real=0.0, imag=0.0):
"""Form a complex number.
If necessary you can include a much longer multi line
explanation here if the single line explanation is not
sufficient.
Keyword arguments:
real -- the real part (default 0.0)
imag -- the imaginary part (default 0.0)
"""
if imag == 0.0 and real == 0.0:
return complex_zero
...
• http://sphinx-doc.org/
• http://fitzgen.github.io/pycco/
• http://www.mkdocs.org/
• Manage throughout development lifecycle
• Dependency’s dependencies
matt@workstation ~/code $ pip freeze > requirements.txt
• PyPA recommended install tool
• Easy to use with PyPI (mirrors), wheels
• Easy requirements gathering
• 2.7.9+ 3.4+ included
matt@workstation ~/code $ pip install my_first_package
matt@workstation ~/code $ pip install /path/to/dir
matt@workstation ~/code $ pip install -e /path/to/dir
matt@workstation ~/code $ pip install -r requirements.txt
matt@workstation ~/code $ pip uninstall ...
matt@workstation ~/code $ pip install --no-index --find-links
/path/to/dependencies my_first_package
• A zip archive
• Requires setup.py and PEP 376 files
• Wheel > egg (dependencies)
matt@workstation ~/code $ python setup.py bdist_wheel
matt@workstation ~/code $ pip install wheel
matt@workstation ~/code $ pip --wheel-dir /path/to/dir my_first_package
matt@workstation ~/code $ pip install --no-index --find-links
/path/to/dir my_first_package
• Organise your code
• Run your tests
• Generate your documents
• Build your wheels
• Distribute your wheels
• Share your code
matt@workstation ~/code $ python setup.py test
matt@workstation ~/code $ sphinx/pycco ...
matt@workstation ~/code $ pip wheel --wheel-dir /path/to/dir
my_first_package
matt@workstation ~/code $ git bundle create repo.bundle --all
matt@workstation ~/code $ pip install --no-index --find-links
/path/to/dir my_first_package
• Development Tools and Virtualenvs
• Unit Testing and Docker
• Python 2 vs Python 3 & “future” proofing
• Intermediate Python
• Pythonic Code
• https://www.python.org/dev/peps
• http://www.jeffknupp.com/blog/
• http://docs.python-guide.org/en/latest/

More Related Content

What's hot (20)

PDF
Dive into Pinkoi 2013
Mosky Liu
 
PDF
Git, Jenkins & Chuck
Juraj Michálek
 
PDF
Intro to Jupyter Notebooks
Francis Michael Bautista
 
PDF
Data analytics in the cloud with Jupyter notebooks.
Graham Dumpleton
 
PDF
Introduction to ipython notebook
Go Asgard
 
PPTX
Easy contributable internationalization process with Sphinx @ pyconmy2015
Takayuki Shimizukawa
 
PDF
Rust + python: lessons learnt from building a toy filesystem
ChengHui Weng
 
PDF
PEARC17: Modernizing GooFit: A Case Study
Henry Schreiner
 
PDF
Learning Git with Workflows
Mosky Liu
 
PDF
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
Aaron Meurer
 
PDF
Digital RSE: automated code quality checks - RSE group meeting
Henry Schreiner
 
PDF
Learning Python from Data
Mosky Liu
 
PDF
Virtualenv
WEBdeBS
 
PDF
PyPy's approach to construct domain-specific language runtime
National Cheng Kung University
 
PDF
Apache Solr for TYPO3 Components & Review 2016
timohund
 
PDF
CMake best practices
Henry Schreiner
 
PPTX
Intro to-venv-py3
Dhineshsunder ganapathi
 
ODP
Pulp 3 - Simpler, Better, More awesome
Dennis Kliban
 
PDF
The magic of IPython Notebook
Alexey Agapov
 
PDF
Will iPython replace Bash?
Babel
 
Dive into Pinkoi 2013
Mosky Liu
 
Git, Jenkins & Chuck
Juraj Michálek
 
Intro to Jupyter Notebooks
Francis Michael Bautista
 
Data analytics in the cloud with Jupyter notebooks.
Graham Dumpleton
 
Introduction to ipython notebook
Go Asgard
 
Easy contributable internationalization process with Sphinx @ pyconmy2015
Takayuki Shimizukawa
 
Rust + python: lessons learnt from building a toy filesystem
ChengHui Weng
 
PEARC17: Modernizing GooFit: A Case Study
Henry Schreiner
 
Learning Git with Workflows
Mosky Liu
 
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
Aaron Meurer
 
Digital RSE: automated code quality checks - RSE group meeting
Henry Schreiner
 
Learning Python from Data
Mosky Liu
 
Virtualenv
WEBdeBS
 
PyPy's approach to construct domain-specific language runtime
National Cheng Kung University
 
Apache Solr for TYPO3 Components & Review 2016
timohund
 
CMake best practices
Henry Schreiner
 
Intro to-venv-py3
Dhineshsunder ganapathi
 
Pulp 3 - Simpler, Better, More awesome
Dennis Kliban
 
The magic of IPython Notebook
Alexey Agapov
 
Will iPython replace Bash?
Babel
 

Similar to How to deliver a Python project (20)

PDF
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Codemotion
 
PDF
Arbeiten mit distribute, pip und virtualenv
Markus Zapke-Gründemann
 
PDF
Python+gradle
Stephen Holsapple
 
PDF
Isolated development in python
Andrés J. Díaz
 
ODP
Python-specific packaging
dwvisser
 
PDF
Custom deployments with sbt-native-packager
GaryCoady
 
KEY
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
Puppet
 
PDF
Mojolicious lite
andrefsantos
 
PDF
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
Pôle Systematic Paris-Region
 
PDF
Writing and Publishing Puppet Modules - PuppetConf 2014
Puppet
 
PPTX
2013 09-02 senzations-bimschas-part4-setting-up-your-own-testbed
Daniel Bimschas
 
PDF
PuppetCamp SEA 1 - Use of Puppet
Walter Heck
 
PDF
PuppetCamp SEA 1 - Use of Puppet
OlinData
 
PDF
Arbeiten mit distribute, pip und virtualenv
Markus Zapke-Gründemann
 
ODP
Tox as project descriptor.
Roberto Polli
 
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
biicode
 
PDF
Docker for data science
Calvin Giles
 
KEY
DBIx::Skinnyと仲間たち
Ryo Miyake
 
PPTX
Webinar - Managing Files with Puppet
OlinData
 
PDF
QA for PHP projects
Michelangelo van Dam
 
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Codemotion
 
Arbeiten mit distribute, pip und virtualenv
Markus Zapke-Gründemann
 
Python+gradle
Stephen Holsapple
 
Isolated development in python
Andrés J. Díaz
 
Python-specific packaging
dwvisser
 
Custom deployments with sbt-native-packager
GaryCoady
 
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
Puppet
 
Mojolicious lite
andrefsantos
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
Pôle Systematic Paris-Region
 
Writing and Publishing Puppet Modules - PuppetConf 2014
Puppet
 
2013 09-02 senzations-bimschas-part4-setting-up-your-own-testbed
Daniel Bimschas
 
PuppetCamp SEA 1 - Use of Puppet
Walter Heck
 
PuppetCamp SEA 1 - Use of Puppet
OlinData
 
Arbeiten mit distribute, pip und virtualenv
Markus Zapke-Gründemann
 
Tox as project descriptor.
Roberto Polli
 
Dependencies Managers in C/C++. Using stdcpp 2014
biicode
 
Docker for data science
Calvin Giles
 
DBIx::Skinnyと仲間たち
Ryo Miyake
 
Webinar - Managing Files with Puppet
OlinData
 
QA for PHP projects
Michelangelo van Dam
 
Ad

Recently uploaded (20)

PPTX
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
 
PPTX
Android Notifications-A Guide to User-Facing Alerts in Android .pptx
Nabin Dhakal
 
PDF
Code Once; Run Everywhere - A Beginner’s Journey with React Native
Hasitha Walpola
 
PDF
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
 
PPTX
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
 
PPTX
B2C EXTRANET | EXTRANET WEBSITE | EXTRANET INTEGRATION
philipnathen82
 
PDF
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
 
PDF
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
 
PPTX
IObit Uninstaller Pro 14.3.1.8 Crack Free Download 2025
sdfger qwerty
 
PDF
Cloud computing Lec 02 - virtualization.pdf
asokawennawatte
 
PPTX
computer forensics encase emager app exp6 1.pptx
ssuser343e92
 
PPTX
Iobit Driver Booster Pro 12 Crack Free Download
chaudhryakashoo065
 
PPTX
Introduction to web development | MERN Stack
JosephLiyon
 
PPTX
ManageIQ - Sprint 264 Review - Slide Deck
ManageIQ
 
PPTX
CONCEPT OF PROGRAMMING in language .pptx
tamim41
 
PDF
LPS25 - Operationalizing MLOps in GEP - Terradue.pdf
terradue
 
PDF
Building scalbale cloud native apps with .NET 8
GillesMathieu10
 
PDF
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
PDF
IObit Uninstaller Pro 14.3.1.8 Crack for Windows Latest
utfefguu
 
PPTX
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
 
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
 
Android Notifications-A Guide to User-Facing Alerts in Android .pptx
Nabin Dhakal
 
Code Once; Run Everywhere - A Beginner’s Journey with React Native
Hasitha Walpola
 
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
 
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
 
B2C EXTRANET | EXTRANET WEBSITE | EXTRANET INTEGRATION
philipnathen82
 
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
 
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
 
IObit Uninstaller Pro 14.3.1.8 Crack Free Download 2025
sdfger qwerty
 
Cloud computing Lec 02 - virtualization.pdf
asokawennawatte
 
computer forensics encase emager app exp6 1.pptx
ssuser343e92
 
Iobit Driver Booster Pro 12 Crack Free Download
chaudhryakashoo065
 
Introduction to web development | MERN Stack
JosephLiyon
 
ManageIQ - Sprint 264 Review - Slide Deck
ManageIQ
 
CONCEPT OF PROGRAMMING in language .pptx
tamim41
 
LPS25 - Operationalizing MLOps in GEP - Terradue.pdf
terradue
 
Building scalbale cloud native apps with .NET 8
GillesMathieu10
 
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
IObit Uninstaller Pro 14.3.1.8 Crack for Windows Latest
utfefguu
 
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
 
Ad

How to deliver a Python project

Editor's Notes

  • #4: 2 primary functions: Various project aspects are configured Command line interface for packaging task commands
  • #14: PyPA – Python Packaging Authority PyPI – Python Packaging Index
  • #20: PyPA – Python Packaging Authority PyPI – Python Packaging Index