SlideShare a Scribd company logo
Welcome to the Cheese Shop
setuptools, virtualenv and PyPUG
Dale Visser
https://dalevisser.wordpress.com/
Outline
● Cheese Shop?
● Setuptools
● Sdists, Eggs and Wheels
● Demo of pip and virtualenv
● Online Resources
● Conclusion
Image credit: http://www.clker.com/clipart-cheese-wheel.html
Cheese Shop?
● Name comes from Monty Python, of
course.
– For full history:
https://youtu.be/pZTiAkwiPgI
– For the sketch:
https://youtu.be/B3KBuQHHKx0
● Corporate sponsor preferred something
more formal, less likely to infringe
copyright:
– The Python Package Index, or PyPI
– https://pypi.python.org/pypi
Setuptools (1/2)
https://bitbucket.org/pypa/setuptools
from setuptools import setup, find_packages
setup(
    name = "HelloWorld",
    version = "0.1",
    packages = find_packages(),
    scripts = ['say_hello.py'],
    # Project uses reStructuredText, so ensure that the docutils get
    # installed or upgraded on the target machine
    install_requires = ['docutils>=0.3'],
    package_data = {
        # If any package contains *.txt or *.rst files, include them:
        '': ['*.txt', '*.rst'],
        # And include any *.msg files found in the 'hello' package, too:
        'hello': ['*.msg'],
    },
Setuptools (2/2)
    # metadata for upload to PyPI
    author = "Me",
    author_email = "me@example.com",
    description = "This is an Example Package",
    license = "PSF",
    keywords = "hello world example examples",
    url = "http://example.com/HelloWorld/",   # project home page, if any
    # could also include long_description, download_url, classifiers, etc.
)
Python Distributions – 2 kinds
● Source Distributions or “sdists”
– python setup.py sdist
● Built Distributions (“bdists”)
– Eggs
● python setup.py bdist or
● python setup.py bdist_egg
– Wheels
●
python setup.py bdist_wheel
● python setup.py bdist_wheel --universal
Egg and Wheel Distribution Formats
● Eggs - classic
– .egg – zip archive or folder
containing package and
metadata
– .egg-info – metadata folder that
sits alongside installed package
folder
– Lacks formal specification, but is
well-described:
http://bit.ly/egg_format
● Wheels – pip and PyPI preferred
– .whl – zip archive containing package
and metadata
– .dist-info – metadatafolder that sits
alongside installed package folder
– Relevant specifications:
● PEP-376 - Database of Installed Python
Distributions
● PEP-426 - Metadata for Python Software
Packages 2.0
● PEP-427 - The Wheel Binary Package
Format 1.0
Universal Wheels?
● Platform wheels
– Contain compiled extensions
– Specific to a platform
●
Linux
● Windows
● OSX
– PyPI only supports Windows
and OSX
● Pure Python wheels
– No compiled
extensions
– Subtype: universal
wheels
● Support both Python 2
and 3
pip and virtualenv demo
Online Resources
● Your first, best resource is this:
https://packaging.python.org/
– It is a collaborative resource created by the PyPI
people. E.g., find out about twine
● Also, you can “pip install” from git
repos!: http://bit.ly/pip_vcs
Image credit: http://www.clker.com/clipart-9829.html
Conclusion
● This talk just scratched the surface.
● Keeping your library-dependent software
secure:
– Have a look at OWASP Dependency Check.
– With any luck, a near-future release will be Python-
aware.
This work is licensed under the Creative
Commons Attribution-ShareAlike 4.0 International
License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/4.0/ or
send a letter to Creative Commons, PO Box 1866,
Mountain View, CA 94042, USA.

More Related Content

ODP
Buildout: creating and deploying repeatable applications in python
PDF
Creating new Tizen profiles using the Yocto Project
PDF
Openwrt startup
PDF
Installing nagios core_from_source
PDF
Openwrt frontend backend
PDF
A Continuous Packaging Pipeline
PDF
8-9-10=Jessie,Stretch,Buster
PDF
MongoDB World 2019 Builder's Fest - Ready, Git set ... Go!
Buildout: creating and deploying repeatable applications in python
Creating new Tizen profiles using the Yocto Project
Openwrt startup
Installing nagios core_from_source
Openwrt frontend backend
A Continuous Packaging Pipeline
8-9-10=Jessie,Stretch,Buster
MongoDB World 2019 Builder's Fest - Ready, Git set ... Go!

What's hot (19)

PDF
Does Cowgirl Dream of Red Swirl?
ODP
about Debian "squeeze" @201002 OSC Tokyospring
PDF
2016/11/05: OSWDem16 workshop
PDF
The new Odoo community organization and platform
PPT
10 11-hart installing pythonsoftware
PPTX
Gorush: A push notification server written in Go
PDF
find & improve some bottleneck in Debian project (DebConf14 LT)
PDF
LicensePlist - A license list generator of all your dependencies for iOS appl...
PDF
node.js app deploy to heroku PaaS
PDF
Install Nagios Core On CentOS 7
PDF
Scalable Deployment Architectures with TYPO3 Surf, Git and Jenkins
ODP
Git: be social
ODP
Ripping web accessible .git files
PDF
Culerity and Headless Full Stack Integration Testing
PPTX
Git & G
PDF
Porting your favourite cmdline tool to Android
ODP
Wonderful world of (distributed) SCM or VCS
PDF
Node.js x Azure, cli usage, website deployment
PDF
Git, Jenkins & Chuck
Does Cowgirl Dream of Red Swirl?
about Debian "squeeze" @201002 OSC Tokyospring
2016/11/05: OSWDem16 workshop
The new Odoo community organization and platform
10 11-hart installing pythonsoftware
Gorush: A push notification server written in Go
find & improve some bottleneck in Debian project (DebConf14 LT)
LicensePlist - A license list generator of all your dependencies for iOS appl...
node.js app deploy to heroku PaaS
Install Nagios Core On CentOS 7
Scalable Deployment Architectures with TYPO3 Surf, Git and Jenkins
Git: be social
Ripping web accessible .git files
Culerity and Headless Full Stack Integration Testing
Git & G
Porting your favourite cmdline tool to Android
Wonderful world of (distributed) SCM or VCS
Node.js x Azure, cli usage, website deployment
Git, Jenkins & Chuck
Ad

Similar to Welcome to the Cheese Shop: setuptools, virtualenv and PyPUG (20)

ODP
Python-specific packaging
PDF
Virtualenv
PDF
Python+gradle
PPTX
How to deliver a Python project
PDF
We Buy Cheese in a Cheese Shop
PDF
Python packaging: how did we get here, and where are we going?
PDF
Python packaging and dependency resolution
PDF
Pipfile, pipenv, pip… what?!
PDF
Django Dev Environment Howto
PDF
Build and deploy scientific Python Applications
PDF
Using Python Packages - An Overview
PPTX
E D - Environmental Dependencies in Python
PPTX
Run Python on windows
PDF
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
PDF
Django district pip, virtualenv, virtualenv wrapper & more
PDF
Time travel: Let’s learn from the history of Python packaging!
PDF
Arbeiten mit distribute, pip und virtualenv
PDF
PyCon 2013 : Scripting to PyPi to GitHub and More
ODP
Pythonpresent
PDF
Arbeiten mit distribute, pip und virtualenv
Python-specific packaging
Virtualenv
Python+gradle
How to deliver a Python project
We Buy Cheese in a Cheese Shop
Python packaging: how did we get here, and where are we going?
Python packaging and dependency resolution
Pipfile, pipenv, pip… what?!
Django Dev Environment Howto
Build and deploy scientific Python Applications
Using Python Packages - An Overview
E D - Environmental Dependencies in Python
Run Python on windows
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Django district pip, virtualenv, virtualenv wrapper & more
Time travel: Let’s learn from the history of Python packaging!
Arbeiten mit distribute, pip und virtualenv
PyCon 2013 : Scripting to PyPi to GitHub and More
Pythonpresent
Arbeiten mit distribute, pip und virtualenv
Ad

Recently uploaded (20)

PPTX
How to Build Crypto Derivative Exchanges from Scratch.pptx
PDF
Transforming Manufacturing operations through Intelligent Integrations
PDF
Top Generative AI Tools for Patent Drafting in 2025.pdf
PDF
ai-archetype-understanding-the-personality-of-agentic-ai.pdf
PDF
Smarter Business Operations Powered by IoT Remote Monitoring
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PDF
Dell Pro 14 Plus: Be better prepared for what’s coming
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
Event Presentation Google Cloud Next Extended 2025
PPTX
Web Security: Login Bypass, SQLi, CSRF & XSS.pptx
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
DevOps & Developer Experience Summer BBQ
PDF
Reimagining Insurance: Connected Data for Confident Decisions.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
How to Build Crypto Derivative Exchanges from Scratch.pptx
Transforming Manufacturing operations through Intelligent Integrations
Top Generative AI Tools for Patent Drafting in 2025.pdf
ai-archetype-understanding-the-personality-of-agentic-ai.pdf
Smarter Business Operations Powered by IoT Remote Monitoring
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
A Day in the Life of Location Data - Turning Where into How.pdf
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
Dell Pro 14 Plus: Be better prepared for what’s coming
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Event Presentation Google Cloud Next Extended 2025
Web Security: Login Bypass, SQLi, CSRF & XSS.pptx
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Chapter 3 Spatial Domain Image Processing.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
DevOps & Developer Experience Summer BBQ
Reimagining Insurance: Connected Data for Confident Decisions.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Welcome to the Cheese Shop: setuptools, virtualenv and PyPUG