SlideShare una empresa de Scribd logo
1 de 70
Descargar para leer sin conexión
Pipenv!
Python Dev Workflow
for Humans
Andreu Vallbona
PyBCN February 2019
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
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 - PyBCN - February 2019
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 - PyBCN - February 2019
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 - PyBCN - February 2019
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 - PyBCN - February 2019
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 - PyBCN - February 2019
requirements.txt anatomy
list of dependencies
with pinned versions
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Problems
Problems
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Problems
pip and virtualenv are concepts
difficult to understand for beginners
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Problems
requirements.txt
is difficult to maintain
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Problems
we have to remember
to update the requirements.txt file
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Problems
For different environments
we need to maintain
several requirements.txt files
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Problems
we do not easily know
what python version
the project uses
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Problems
transitive relations
A -> B -> C
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Solutions
Solutions
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
What problems does pipenv solve?
avoid manually maintenance
of the dependencies
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
What problems does pipenv solve?
easy to know which
version of python
the project uses
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
What problems does pipenv solve?
show us the dependencies
in a more concise way
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
What problems does pipenv solve?
update dependencies
securely and automatically
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
What problems does pipenv solve?
allow us to have a
default environment
and a development environment
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Installation
Installation
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Installation
pip install --user pipenv
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
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 - PyBCN - February 2019
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 - PyBCN - February 2019
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 - PyBCN - February 2019
Usage
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
pipenv install
creates the virtualenv
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
pipenv shell
activates the virtualenv
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
pipenv install <package-name>
install a package
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
pipenv install <package-name> --dev
install a package
in the development environment
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
pipenv uninstall <package-name>
uninstall a package
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
pipenv clean
uninstall packages
not specified in Pipfile.lock
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
pipenv graph
Displays currently installed
dependency graph information
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
pipenv run command
runs a command inside
the virtualenv without activating it
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
pipenv check
checks for security vulnerabilities
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
pipenv lock -r > requirements.txt
generates a requirements.txt file
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
pipenv install -r requirements.txt
imports a requirements.txt file
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
load .env files automatically
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
usage
pipenv install -c .
can discover requirements
from the codebase
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
usage
pipenv check --unused .
show potentially
unused dependencies
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
usage
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Integration
Integration
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Integration with pyenv
pipenv --python 3.4.1 install
integrates well with pyenv
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Integration with pyenv
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
Integration with docker
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
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 - PyBCN - February 2019
utility
Utility
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
utility
Pipenv Pipes
https://github.com/gtalarico/pipenv-pipes
Pipenv Environment Switcher
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
utility
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
caveats
Caveats
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
caveats
It’s slow when locking dependencies
Always tries to update
dependencies by default
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
alternatives
Alternatives
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
alternatives
Poetry
https://poetry.eustace.io/
Hatch
https://github.com/ofek/hatch
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
thanks
Thank you!
Questions?
@avallbona
Pipenv: Python Dev Workflow for Humans
Andreu Vallbona - PyBCN - February 2019
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 - PyBCN - February 2019
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

Más contenido relacionado

Similar a PyBCN - pipenv - python dev workflow for humans

Python In The Browser: Intro to Brython
Python In The Browser: Intro to BrythonPython In The Browser: Intro to Brython
Python In The Browser: Intro to BrythonSusan Tan
 
Intro To JavaScript
Intro To JavaScriptIntro To JavaScript
Intro To JavaScriptIvy Rueb
 
Scientist meets web dev: how Python became the language of data
Scientist meets web dev: how Python became the language of dataScientist meets web dev: how Python became the language of data
Scientist meets web dev: how Python became the language of dataGael Varoquaux
 
Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-52-74
Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-52-74Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-52-74
Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-52-74Ivy Rueb
 
Cloud Foundry for Data Science
Cloud Foundry for Data ScienceCloud Foundry for Data Science
Cloud Foundry for Data ScienceIan Huston
 
Why Python is the Best Coding Language For PWA Development_.ppt
Why Python is the Best Coding Language For PWA Development_.pptWhy Python is the Best Coding Language For PWA Development_.ppt
Why Python is the Best Coding Language For PWA Development_.pptTechinventive Software
 
Automotive Grade Linux on Raspberry Pi: How Does It Work?
Automotive Grade Linux on Raspberry Pi: How Does It Work?Automotive Grade Linux on Raspberry Pi: How Does It Work?
Automotive Grade Linux on Raspberry Pi: How Does It Work?Leon Anavi
 
Building Serverless applications with Python
Building Serverless applications with PythonBuilding Serverless applications with Python
Building Serverless applications with PythonAndrii Soldatenko
 
First python project
First python projectFirst python project
First python projectNeetu Jain
 
Tracing in distributed systems
Tracing in distributed systemsTracing in distributed systems
Tracing in distributed systemsPixel Federation
 
a quick Introduction to PyPy
a quick Introduction to PyPya quick Introduction to PyPy
a quick Introduction to PyPyKai Aras
 
Python 101 For The Net Developer
Python 101 For The Net DeveloperPython 101 For The Net Developer
Python 101 For The Net DeveloperSarah Dutkiewicz
 
Kubernetes_Webinar_Slide_Deck.pdf
Kubernetes_Webinar_Slide_Deck.pdfKubernetes_Webinar_Slide_Deck.pdf
Kubernetes_Webinar_Slide_Deck.pdfAuliaFebrian2
 
CoC23_ Looking at the New Features of Apache NiFi
CoC23_ Looking at the New Features of Apache NiFiCoC23_ Looking at the New Features of Apache NiFi
CoC23_ Looking at the New Features of Apache NiFiTimothy Spann
 
CoC23_ Looking at the New Features of Apache NiFi
CoC23_ Looking at the New Features of Apache NiFiCoC23_ Looking at the New Features of Apache NiFi
CoC23_ Looking at the New Features of Apache NiFissuser73434e
 
A quick overview of why to use and how to set up iPython notebooks for research
A quick overview of why to use and how to set up iPython notebooks for researchA quick overview of why to use and how to set up iPython notebooks for research
A quick overview of why to use and how to set up iPython notebooks for researchAdam Pah
 

Similar a PyBCN - pipenv - python dev workflow for humans (20)

shanghai
shanghaishanghai
shanghai
 
Python In The Browser: Intro to Brython
Python In The Browser: Intro to BrythonPython In The Browser: Intro to Brython
Python In The Browser: Intro to Brython
 
Intro To JavaScript
Intro To JavaScriptIntro To JavaScript
Intro To JavaScript
 
Python in a real life
Python in a real lifePython in a real life
Python in a real life
 
Scientist meets web dev: how Python became the language of data
Scientist meets web dev: how Python became the language of dataScientist meets web dev: how Python became the language of data
Scientist meets web dev: how Python became the language of data
 
Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-52-74
Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-52-74Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-52-74
Deck 8983a1d9-68df-4447-8481-3b4fd0de734c-9-52-74
 
Cloud Foundry for Data Science
Cloud Foundry for Data ScienceCloud Foundry for Data Science
Cloud Foundry for Data Science
 
Why Python is the Best Coding Language For PWA Development_.ppt
Why Python is the Best Coding Language For PWA Development_.pptWhy Python is the Best Coding Language For PWA Development_.ppt
Why Python is the Best Coding Language For PWA Development_.ppt
 
Automotive Grade Linux on Raspberry Pi: How Does It Work?
Automotive Grade Linux on Raspberry Pi: How Does It Work?Automotive Grade Linux on Raspberry Pi: How Does It Work?
Automotive Grade Linux on Raspberry Pi: How Does It Work?
 
Pyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdfPyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdf
 
Building Serverless applications with Python
Building Serverless applications with PythonBuilding Serverless applications with Python
Building Serverless applications with Python
 
First python project
First python projectFirst python project
First python project
 
Tracing in distributed systems
Tracing in distributed systemsTracing in distributed systems
Tracing in distributed systems
 
a quick Introduction to PyPy
a quick Introduction to PyPya quick Introduction to PyPy
a quick Introduction to PyPy
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To Python
 
Python 101 For The Net Developer
Python 101 For The Net DeveloperPython 101 For The Net Developer
Python 101 For The Net Developer
 
Kubernetes_Webinar_Slide_Deck.pdf
Kubernetes_Webinar_Slide_Deck.pdfKubernetes_Webinar_Slide_Deck.pdf
Kubernetes_Webinar_Slide_Deck.pdf
 
CoC23_ Looking at the New Features of Apache NiFi
CoC23_ Looking at the New Features of Apache NiFiCoC23_ Looking at the New Features of Apache NiFi
CoC23_ Looking at the New Features of Apache NiFi
 
CoC23_ Looking at the New Features of Apache NiFi
CoC23_ Looking at the New Features of Apache NiFiCoC23_ Looking at the New Features of Apache NiFi
CoC23_ Looking at the New Features of Apache NiFi
 
A quick overview of why to use and how to set up iPython notebooks for research
A quick overview of why to use and how to set up iPython notebooks for researchA quick overview of why to use and how to set up iPython notebooks for research
A quick overview of why to use and how to set up iPython notebooks for research
 

Más de 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
 

Último

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Último (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

PyBCN - pipenv - python dev workflow for humans

  • 1. Pipenv! Python Dev Workflow for Humans Andreu Vallbona PyBCN February 2019
  • 2. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 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 - PyBCN - February 2019 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 - PyBCN - February 2019 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 - PyBCN - February 2019 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 - PyBCN - February 2019 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 - PyBCN - February 2019 requirements.txt anatomy list of dependencies with pinned versions
  • 8. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Problems Problems
  • 9. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Problems pip and virtualenv are concepts difficult to understand for beginners
  • 10. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Problems requirements.txt is difficult to maintain
  • 11. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Problems we have to remember to update the requirements.txt file
  • 12. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Problems For different environments we need to maintain several requirements.txt files
  • 13. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Problems we do not easily know what python version the project uses
  • 14. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Problems transitive relations A -> B -> C
  • 15. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Solutions Solutions
  • 16. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 What problems does pipenv solve? avoid manually maintenance of the dependencies
  • 17. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 What problems does pipenv solve? easy to know which version of python the project uses
  • 18. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 What problems does pipenv solve? show us the dependencies in a more concise way
  • 19. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 What problems does pipenv solve? update dependencies securely and automatically
  • 20. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 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 - PyBCN - February 2019 Installation Installation
  • 22. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Installation pip install --user pipenv
  • 23. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 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 - PyBCN - February 2019 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 - PyBCN - February 2019 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 - PyBCN - February 2019 Usage Usage
  • 27. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage pipenv install creates the virtualenv
  • 28. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 29. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage pipenv shell activates the virtualenv
  • 30. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 31. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage pipenv install <package-name> install a package
  • 32. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 33. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage pipenv install <package-name> --dev install a package in the development environment
  • 34. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 35. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage pipenv uninstall <package-name> uninstall a package
  • 36. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 37. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage pipenv clean uninstall packages not specified in Pipfile.lock
  • 38. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 39. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage pipenv graph Displays currently installed dependency graph information
  • 40. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 41. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage pipenv run command runs a command inside the virtualenv without activating it
  • 42. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 43. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage pipenv check checks for security vulnerabilities
  • 44. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 45. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage pipenv lock -r > requirements.txt generates a requirements.txt file
  • 46. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 47. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage pipenv install -r requirements.txt imports a requirements.txt file
  • 48. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 49. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 50. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage load .env files automatically
  • 51. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Usage
  • 52. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 usage pipenv install -c . can discover requirements from the codebase
  • 53. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 usage
  • 54. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 usage pipenv check --unused . show potentially unused dependencies
  • 55. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 usage
  • 56. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Integration Integration
  • 57. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Integration with pyenv pipenv --python 3.4.1 install integrates well with pyenv
  • 58. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Integration with pyenv
  • 59. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 Integration with docker
  • 60. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 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 - PyBCN - February 2019 utility Utility
  • 62. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 utility Pipenv Pipes https://github.com/gtalarico/pipenv-pipes Pipenv Environment Switcher
  • 63. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 utility
  • 64. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 caveats Caveats
  • 65. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 caveats It’s slow when locking dependencies Always tries to update dependencies by default
  • 66. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 alternatives Alternatives
  • 67. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 alternatives Poetry https://poetry.eustace.io/ Hatch https://github.com/ofek/hatch
  • 68. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 thanks Thank you! Questions? @avallbona
  • 69. Pipenv: Python Dev Workflow for Humans Andreu Vallbona - PyBCN - February 2019 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 - PyBCN - February 2019 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