SlideShare a Scribd company logo
1 of 70
Download to read offline
Pipenv!
Python Dev Workflow
for Humans
Andreu Vallbona
Pycones 2018
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Who am I
Andreu Vallbona @avallbona
Bachelor degree in computer science
Web developer at APSL, Mallorca, Spain
Mainly developing with Python and Django
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
What we do at APSL
Web development
Systems engineering - devops
Data science
Mobile apps
Consulting and formation
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
What it is?
it’s a package and virtualenv
managing system
it’s aimed to replace
the use of pip and virtualenv
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Created by
Kenneth Reitz
Creator of many
useful projects such as:
Requests: HTTP for Humans
Maya: Datetimes for Humans
Records: SQL for Humans
Requests-HTML: HTML Parsing for Humans
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Current state of the art
Before pipenv we used to
create a python environment
with virtualenv
install some packages
freeze the dependencies
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
requirements.txt anatomy
list of dependencies
with pinned versions
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Problems
Problems
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Problems
pip and virtualenv are concepts
difficult to understand for beginners
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Problems
requirements.txt
is difficult to maintain
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Problems
we have to remember
to update the requirements.txt file
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Problems
For different environments
we need to maintain
several requirements.txt files
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Problems
we do not easily know
what python version
the project uses
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Problems
transitive relations
A -> B -> C
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Solutions
Solutions
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
What problems does pipenv solve?
avoid manually maintenance
of the dependencies
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
What problems does pipenv solve?
easy to know which
version of python
the project uses
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
What problems does pipenv solve?
show us the dependencies
in a more concise way
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
What problems does pipenv solve?
update dependencies
securely and automatically
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
What problems does pipenv solve?
allow us to have a
default environment
and a development environment
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Installation
Installation
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Installation
pip install --user pipenv
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Pipfile anatomy
Specify the packages we want
Production and development
sections
Human readable
Toml format
Specify the python version
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Pipfile.lock anatomy
Specify the packages we need
Json format
Machine readable
Easy to parse
Pinned versions
Hashes
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Pipfile.lock anatomy
Specify the packages we need
Json format
Machine readable
Easy to parse
Pinned versions
Hashes
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
pipenv install
creates the virtualenv
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
pipenv shell
activates the virtualenv
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
pipenv install <package-name>
install a package
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
pipenv install <package-name> --dev
install a package
in the development environment
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
pipenv uninstall <package-name>
uninstall a package
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
pipenv clean
uninstall packages
not specified in Pipfile.lock
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
pipenv graph
Displays currently installed
dependency graph information
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
pipenv run command
runs a command inside
the virtualenv without activating it
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
pipenv check
checks for security vulnerabilities
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
pipenv lock -r > requirements.txt
generates a requirements.txt file
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
pipenv install -r requirements.txt
imports a requirements.txt file
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
load .env files automatically
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
usage
pipenv install -c .
can discover requirements
from the codebase
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
usage
pipenv check --unused .
show potentially
unused dependencies
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Integration
Integration
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Integration with pyenv
pipenv --python 3.4.1 install
integrates well with pyenv
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Integration with pyenv
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Integration with docker
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
Integration with platforms and editors
integrated with
platforms and editors
Heroku (Cloud Hosting)
Platform.sh (Cloud Hosting)
PyUp (Security Notification)
Emacs (Editor Integration)
Fish Shell
(Automatic $ pipenv shell!)
VS Code (Editor Integration)
PyCharm (Editor Integration)
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
utility
Utility
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
utility
Pipenv Pipes
https://github.com/gtalarico/pipenv-pipes
Pipenv Environment Switcher
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
utility
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
caveats
Caveats
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
caveats
It’s slow when locking dependencies
Always tries to update
dependencies by default
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
alternatives
Alternatives
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
alternatives
Poetry
https://poetry.eustace.io/
Hatch
https://github.com/ofek/hatch
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
thanks
Thank you!
Questions?
@avallbona
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
resources of interest
https://www.pythonforbeginners.com/basics/how-to-use-pip-and-pypi
https://realpython.com/pipenv-guide/
https://www.kennethreitz.org/essays/announcing-pipenv
https://nvie.com/posts/better-package-management/
https://nvie.com/posts/pin-your-packages/
https://medium.com/@jimjh/managing-dependencies-in-python-applications-b9c93dda98c2
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - Pycones - October 2018
resources of interest
https://www.promptworks.com/blog/pin-all-dependencies
https://www.well-typed.com/blog/2008/04/the-dreaded-diamond-dependency-problem/
https://medium.com/@DJetelina/pipenv-review-after-using-in-production-a05e7176f3f0
https://chriswarrick.com/blog/2018/07/17/pipenv-promises-a-lot-delivers-very-little/
https://np.reddit.com/r/Python/comments/8jd6aq/why_is_pipenv_the_recommended_packaging_tool_by/
http://journal.kennethreitz.org/entry/r-python

More Related Content

Similar to Pipenv python dev workflow for humans

First python project
First python projectFirst python project
First python projectNeetu Jain
 
python programming.pptx
python programming.pptxpython programming.pptx
python programming.pptxKaviya452563
 
Building Serverless applications with Python
Building Serverless applications with PythonBuilding Serverless applications with Python
Building Serverless applications with PythonAndrii Soldatenko
 
Primers or Reminders? The Effects of Existing Review Comments on Code Review
Primers or Reminders? The Effects of Existing Review Comments on Code ReviewPrimers or Reminders? The Effects of Existing Review Comments on Code Review
Primers or Reminders? The Effects of Existing Review Comments on Code ReviewDelft University of Technology
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Patrick Muehlbauer
 
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...Edureka!
 
Pipfile, pipenv, pip… what?!
Pipfile, pipenv, pip… what?!Pipfile, pipenv, pip… what?!
Pipfile, pipenv, pip… what?!Ivan Chernoff
 
Behold the Power of Python
Behold the Power of PythonBehold the Power of Python
Behold the Power of PythonSarah Dutkiewicz
 
NumPy and SciPy for Data Mining and Data Analysis Including iPython, SciKits,...
NumPy and SciPy for Data Mining and Data Analysis Including iPython, SciKits,...NumPy and SciPy for Data Mining and Data Analysis Including iPython, SciKits,...
NumPy and SciPy for Data Mining and Data Analysis Including iPython, SciKits,...Ryan Rosario
 
Why Python Should Be Your First Programming Language
Why Python Should Be Your First Programming LanguageWhy Python Should Be Your First Programming Language
Why Python Should Be Your First Programming LanguageEdureka!
 
How You Can Use Open Source Materials to Learn Python & Data Science - EuroPy...
How You Can Use Open Source Materials to Learn Python & Data Science - EuroPy...How You Can Use Open Source Materials to Learn Python & Data Science - EuroPy...
How You Can Use Open Source Materials to Learn Python & Data Science - EuroPy...Kamila Stępniowska
 
Continuous Delivery in a content centric world
Continuous Delivery in a content centric worldContinuous Delivery in a content centric world
Continuous Delivery in a content centric worldJeroen Reijn
 
The devops approach to monitoring, Open Source and Infrastructure as Code Style
The devops approach to monitoring, Open Source and Infrastructure as Code StyleThe devops approach to monitoring, Open Source and Infrastructure as Code Style
The devops approach to monitoring, Open Source and Infrastructure as Code StyleJulien Pivotto
 
Real time stock processing with apache nifi, apache flink and apache kafka
Real time stock processing with apache nifi, apache flink and apache kafkaReal time stock processing with apache nifi, apache flink and apache kafka
Real time stock processing with apache nifi, apache flink and apache kafkaTimothy Spann
 
Serverless survival kit
Serverless survival kitServerless survival kit
Serverless survival kitSteve Houël
 

Similar to Pipenv python dev workflow for humans (20)

First python project
First python projectFirst python project
First python project
 
Pyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdfPyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdf
 
python programming.pptx
python programming.pptxpython programming.pptx
python programming.pptx
 
Python in a real life
Python in a real lifePython in a real life
Python in a real life
 
Building Serverless applications with Python
Building Serverless applications with PythonBuilding Serverless applications with Python
Building Serverless applications with Python
 
OpenAPIs are erverywhere
OpenAPIs are erverywhereOpenAPIs are erverywhere
OpenAPIs are erverywhere
 
Primers or Reminders? The Effects of Existing Review Comments on Code Review
Primers or Reminders? The Effects of Existing Review Comments on Code ReviewPrimers or Reminders? The Effects of Existing Review Comments on Code Review
Primers or Reminders? The Effects of Existing Review Comments on Code Review
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018
 
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...
Python Projects For Beginners | Python Projects Examples | Python Tutorial | ...
 
Python
Python Python
Python
 
Pipfile, pipenv, pip… what?!
Pipfile, pipenv, pip… what?!Pipfile, pipenv, pip… what?!
Pipfile, pipenv, pip… what?!
 
Behold the Power of Python
Behold the Power of PythonBehold the Power of Python
Behold the Power of Python
 
shanghai
shanghaishanghai
shanghai
 
NumPy and SciPy for Data Mining and Data Analysis Including iPython, SciKits,...
NumPy and SciPy for Data Mining and Data Analysis Including iPython, SciKits,...NumPy and SciPy for Data Mining and Data Analysis Including iPython, SciKits,...
NumPy and SciPy for Data Mining and Data Analysis Including iPython, SciKits,...
 
Why Python Should Be Your First Programming Language
Why Python Should Be Your First Programming LanguageWhy Python Should Be Your First Programming Language
Why Python Should Be Your First Programming Language
 
How You Can Use Open Source Materials to Learn Python & Data Science - EuroPy...
How You Can Use Open Source Materials to Learn Python & Data Science - EuroPy...How You Can Use Open Source Materials to Learn Python & Data Science - EuroPy...
How You Can Use Open Source Materials to Learn Python & Data Science - EuroPy...
 
Continuous Delivery in a content centric world
Continuous Delivery in a content centric worldContinuous Delivery in a content centric world
Continuous Delivery in a content centric world
 
The devops approach to monitoring, Open Source and Infrastructure as Code Style
The devops approach to monitoring, Open Source and Infrastructure as Code StyleThe devops approach to monitoring, Open Source and Infrastructure as Code Style
The devops approach to monitoring, Open Source and Infrastructure as Code Style
 
Real time stock processing with apache nifi, apache flink and apache kafka
Real time stock processing with apache nifi, apache flink and apache kafkaReal time stock processing with apache nifi, apache flink and apache kafka
Real time stock processing with apache nifi, apache flink and apache kafka
 
Serverless survival kit
Serverless survival kitServerless survival kit
Serverless survival kit
 

More from Andreu Vallbona Plazas

More from Andreu Vallbona Plazas (6)

Localhost to the internet
Localhost to the internetLocalhost to the internet
Localhost to the internet
 
Apsl attrs
Apsl   attrsApsl   attrs
Apsl attrs
 
Apsl pycharm + docker
Apsl   pycharm + dockerApsl   pycharm + docker
Apsl pycharm + docker
 
Apsl testing
Apsl   testingApsl   testing
Apsl testing
 
Apsl translation manager
Apsl   translation managerApsl   translation manager
Apsl translation manager
 
Pytest - testing tips and useful plugins
Pytest - testing tips and useful pluginsPytest - testing tips and useful plugins
Pytest - testing tips and useful plugins
 

Recently uploaded

Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxMario
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxmibuzondetrabajo
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
Internet of Things Presentation (IoT).pptx
Internet of Things Presentation (IoT).pptxInternet of Things Presentation (IoT).pptx
Internet of Things Presentation (IoT).pptxErYashwantJagtap
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationMarko4394
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 

Recently uploaded (15)

Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptx
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptx
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
Internet of Things Presentation (IoT).pptx
Internet of Things Presentation (IoT).pptxInternet of Things Presentation (IoT).pptx
Internet of Things Presentation (IoT).pptx
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentation
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 

Pipenv python dev workflow for humans

  • 1. Pipenv! Python Dev Workflow for Humans Andreu Vallbona Pycones 2018
  • 2. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Who am I Andreu Vallbona @avallbona Bachelor degree in computer science Web developer at APSL, Mallorca, Spain Mainly developing with Python and Django
  • 3. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 What we do at APSL Web development Systems engineering - devops Data science Mobile apps Consulting and formation
  • 4. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 What it is? it’s a package and virtualenv managing system it’s aimed to replace the use of pip and virtualenv
  • 5. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Created by Kenneth Reitz Creator of many useful projects such as: Requests: HTTP for Humans Maya: Datetimes for Humans Records: SQL for Humans Requests-HTML: HTML Parsing for Humans
  • 6. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Current state of the art Before pipenv we used to create a python environment with virtualenv install some packages freeze the dependencies
  • 7. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 requirements.txt anatomy list of dependencies with pinned versions
  • 8. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Problems Problems
  • 9. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Problems pip and virtualenv are concepts difficult to understand for beginners
  • 10. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Problems requirements.txt is difficult to maintain
  • 11. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Problems we have to remember to update the requirements.txt file
  • 12. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Problems For different environments we need to maintain several requirements.txt files
  • 13. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Problems we do not easily know what python version the project uses
  • 14. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Problems transitive relations A -> B -> C
  • 15. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Solutions Solutions
  • 16. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 What problems does pipenv solve? avoid manually maintenance of the dependencies
  • 17. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 What problems does pipenv solve? easy to know which version of python the project uses
  • 18. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 What problems does pipenv solve? show us the dependencies in a more concise way
  • 19. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 What problems does pipenv solve? update dependencies securely and automatically
  • 20. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 What problems does pipenv solve? allow us to have a default environment and a development environment
  • 21. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Installation Installation
  • 22. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Installation pip install --user pipenv
  • 23. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Pipfile anatomy Specify the packages we want Production and development sections Human readable Toml format Specify the python version
  • 24. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Pipfile.lock anatomy Specify the packages we need Json format Machine readable Easy to parse Pinned versions Hashes
  • 25. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Pipfile.lock anatomy Specify the packages we need Json format Machine readable Easy to parse Pinned versions Hashes
  • 26. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage Usage
  • 27. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage pipenv install creates the virtualenv
  • 28. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 29. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage pipenv shell activates the virtualenv
  • 30. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 31. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage pipenv install <package-name> install a package
  • 32. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 33. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage pipenv install <package-name> --dev install a package in the development environment
  • 34. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 35. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage pipenv uninstall <package-name> uninstall a package
  • 36. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 37. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage pipenv clean uninstall packages not specified in Pipfile.lock
  • 38. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 39. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage pipenv graph Displays currently installed dependency graph information
  • 40. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 41. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage pipenv run command runs a command inside the virtualenv without activating it
  • 42. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 43. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage pipenv check checks for security vulnerabilities
  • 44. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 45. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage pipenv lock -r > requirements.txt generates a requirements.txt file
  • 46. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 47. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage pipenv install -r requirements.txt imports a requirements.txt file
  • 48. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 49. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 50. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage load .env files automatically
  • 51. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Usage
  • 52. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 usage pipenv install -c . can discover requirements from the codebase
  • 53. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 usage
  • 54. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 usage pipenv check --unused . show potentially unused dependencies
  • 55. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 usage
  • 56. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Integration Integration
  • 57. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Integration with pyenv pipenv --python 3.4.1 install integrates well with pyenv
  • 58. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Integration with pyenv
  • 59. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Integration with docker
  • 60. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 Integration with platforms and editors integrated with platforms and editors Heroku (Cloud Hosting) Platform.sh (Cloud Hosting) PyUp (Security Notification) Emacs (Editor Integration) Fish Shell (Automatic $ pipenv shell!) VS Code (Editor Integration) PyCharm (Editor Integration)
  • 61. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 utility Utility
  • 62. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 utility Pipenv Pipes https://github.com/gtalarico/pipenv-pipes Pipenv Environment Switcher
  • 63. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 utility
  • 64. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 caveats Caveats
  • 65. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 caveats It’s slow when locking dependencies Always tries to update dependencies by default
  • 66. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 alternatives Alternatives
  • 67. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 alternatives Poetry https://poetry.eustace.io/ Hatch https://github.com/ofek/hatch
  • 68. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 thanks Thank you! Questions? @avallbona
  • 69. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 resources of interest https://www.pythonforbeginners.com/basics/how-to-use-pip-and-pypi https://realpython.com/pipenv-guide/ https://www.kennethreitz.org/essays/announcing-pipenv https://nvie.com/posts/better-package-management/ https://nvie.com/posts/pin-your-packages/ https://medium.com/@jimjh/managing-dependencies-in-python-applications-b9c93dda98c2
  • 70. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - Pycones - October 2018 resources of interest https://www.promptworks.com/blog/pin-all-dependencies https://www.well-typed.com/blog/2008/04/the-dreaded-diamond-dependency-problem/ https://medium.com/@DJetelina/pipenv-review-after-using-in-production-a05e7176f3f0 https://chriswarrick.com/blog/2018/07/17/pipenv-promises-a-lot-delivers-very-little/ https://np.reddit.com/r/Python/comments/8jd6aq/why_is_pipenv_the_recommended_packaging_tool_by/ http://journal.kennethreitz.org/entry/r-python