SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
por Gabriel Taufer - 05/2022
Gerenciando dependências em Python
de maneira fácil
● Meu nome é Gabriel Taufer
● Atuo há aproximadamente 5 anos na área
● Hoje ocupo o cargo de desenvolvedor
Python na Clevertech
Uma odisseia - gerenciamento de dependências e packaging
Antiguidade Idade média Era moderna
1990 - Disquetes? 2011 - PyPA 2016 - pyproject.toml
2000 - distutils 2012 - Conda 2017 - Independent builds
2003 - PyPI 2012 - pip-tools 2017 - pipenv
2004 - setuptools 2013 - wheel 2018 - poetry
2007 - virtualenv 2014 - PEP-440 sysver 2019 - pip updates
2008 - pip 2015 - PyPI Standards 2022 - PyCaxias
*Tabela inspirada nessa talk https://www.youtube.com/watch?v=QX_Nhu1zhlg&t=637s&ab_channel=PyGotham2019
pip?
pipenv?
venv?
virtualenv?
setuptools?
conda?
distutils?
PyPi?
requirements.txt?
pyenv?
pipfile?
PDM?
Pipx?
PyPA?
distutils?
Conhecendo o Poetry
● Gerenciamento de dependências e
packaging em Python
● Criado em 2018
● Fácil instalação e utilização
● Open source
Vantagens do Poetry
● Gerenciamento de dependências
juntamente com ambientes virtuais
● Configuração centralizada (pyproject.toml)
● Possui um lockfile (poetry.lock)
● Fácil implementação e remoção em um
projeto
● Possibilidade de exportar as dependências
em formato compatível com pip
*Imagem ilustrando a confusão que os ambientes Python podem gerar
O pyproject.toml
X
O poetry.lock
setuptools
twine
setup.py
setup.cfg
MANIFEST.in
pip
requirements.txt
pipenv
Pipfile
conda
pip-tools
poetry
pyproject.toml
O Poetry no ecossistema python
Packaging Gerenciamento
de dependência
Instalação e utilização básica
Como instalar o Poetry e entendendo os comandos mais básicos
Instalando o Poetry
*Screenshot tirada da documentação de instalação do Poetry
Configurando o Poetry em um projeto
Configurando o Poetry em um projeto
Adicionando uma dependência
Instalando dependências em um projeto já configurado
Talk is cheap. Show me the code.
Iniciando um projeto em Django com Poetry
Revisitando alguns tópicos
● Gerenciamento de dependências em um
nível extremamente detalhado, facilitando a
replicação de um mesmo ambiente em
diferentes casos
● Independência para criar e publicar pacotes
no PyPi sem precisar de outras libs
● Centralização de toda a configuração do
projeto em um único arquivo
● Fácil transição para adicionar e remover o
Poetry de um projeto
Outros tópicos interessantes
Mais alguns assuntos recentes/relacionados no universo Python
Pyenv
● Gerencia versões diferentes do python em
uma mesma máquina
● Permite alternar entre versões do python
rapidamente
● Funciona bem em conjunto com o Poetry
Pipx
● Gerenciamento de dependência e ambientes
virtuais
● Parecido com o Poetry, porém sem o sistema
de packaging
PDM
● Referente à PEP-582
● Propõe uma estrutura sem a presença de
uma virtualenv
● Usa a pasta __pypackages__ para salvar a
dependências (semelhante a node_modules
do JS)
Agradecimentos
À organização do evento, por toda a
dedicação
Aos amigos e colegas de trabalho que
também contribuíram com a apresentação
A todas as pessoas presentes no evento, que
tornam a nossa comunidade cada vez maior
github.com/gabriel-taufer

Mais conteúdo relacionado

Mais procurados

Component of smart school concept
Component of smart school conceptComponent of smart school concept
Component of smart school conceptyatz90
 
Organizing Machine Learning Projects - Repository Organization
Organizing Machine Learning Projects - Repository OrganizationOrganizing Machine Learning Projects - Repository Organization
Organizing Machine Learning Projects - Repository OrganizationHao-Wen (Herman) Dong
 
Building a strong Data Management capability with TOGAF and ArchiMate
Building a strong Data Management capability with TOGAF and ArchiMateBuilding a strong Data Management capability with TOGAF and ArchiMate
Building a strong Data Management capability with TOGAF and ArchiMateBas van Gils
 
Extending your Information Architecture to Microsoft Teams
Extending your Information Architecture to Microsoft TeamsExtending your Information Architecture to Microsoft Teams
Extending your Information Architecture to Microsoft TeamsChristian Buckley
 
Global Azure Bootcamp Pune 2023 - Lead the AI era with Microsoft Azure.pdf
Global Azure Bootcamp Pune 2023 -  Lead the AI era with Microsoft Azure.pdfGlobal Azure Bootcamp Pune 2023 -  Lead the AI era with Microsoft Azure.pdf
Global Azure Bootcamp Pune 2023 - Lead the AI era with Microsoft Azure.pdfAroh Shukla
 
Selecting Software for Taxonomy, Thesaurus and Ontology Management
Selecting Software for Taxonomy, Thesaurus and Ontology ManagementSelecting Software for Taxonomy, Thesaurus and Ontology Management
Selecting Software for Taxonomy, Thesaurus and Ontology ManagementHeather Hedden
 
By The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market Sizing
By The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market SizingBy The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market Sizing
By The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market SizingAlan Quayle
 
Nodes 2023 - Knowledge graph based chatbot.pptx
Nodes 2023 - Knowledge graph based chatbot.pptxNodes 2023 - Knowledge graph based chatbot.pptx
Nodes 2023 - Knowledge graph based chatbot.pptxTomazBratanic1
 
Using Graph and Transformer Embeddings for Vector Based Retrieval
Using Graph and Transformer Embeddings for Vector Based RetrievalUsing Graph and Transformer Embeddings for Vector Based Retrieval
Using Graph and Transformer Embeddings for Vector Based RetrievalSujit Pal
 
Modeling ACORD with ArchiMate Case Study Views
Modeling ACORD with ArchiMate Case Study ViewsModeling ACORD with ArchiMate Case Study Views
Modeling ACORD with ArchiMate Case Study ViewsIver Band
 
RCS Business Messaging
RCS Business MessagingRCS Business Messaging
RCS Business MessagingValue First
 
Simple fuzzy Name Matching in Elasticsearch - Graham Morehead
Simple fuzzy Name Matching in Elasticsearch - Graham MoreheadSimple fuzzy Name Matching in Elasticsearch - Graham Morehead
Simple fuzzy Name Matching in Elasticsearch - Graham MoreheadBasis Technology
 
Design your Business, Model your Architecture (presentation by Marc Lankhorst...
Design your Business, Model your Architecture (presentation by Marc Lankhorst...Design your Business, Model your Architecture (presentation by Marc Lankhorst...
Design your Business, Model your Architecture (presentation by Marc Lankhorst...Patrick Van Renterghem
 
Getting started with with SharePoint Syntex
Getting started with with SharePoint SyntexGetting started with with SharePoint Syntex
Getting started with with SharePoint SyntexDrew Madelung
 
Case Study: Knowledge Sourcing in Daimler-Benz
Case Study: Knowledge Sourcing in Daimler-BenzCase Study: Knowledge Sourcing in Daimler-Benz
Case Study: Knowledge Sourcing in Daimler-Benztntresor
 
Microsoft Teams University Introduction - Presenter Led
Microsoft Teams University Introduction - Presenter LedMicrosoft Teams University Introduction - Presenter Led
Microsoft Teams University Introduction - Presenter LedDominic Williamson
 
GenAI in Research with Responsible AI
GenAI in Researchwith Responsible AIGenAI in Researchwith Responsible AI
GenAI in Research with Responsible AILiming Zhu
 

Mais procurados (20)

Component of smart school concept
Component of smart school conceptComponent of smart school concept
Component of smart school concept
 
Organizing Machine Learning Projects - Repository Organization
Organizing Machine Learning Projects - Repository OrganizationOrganizing Machine Learning Projects - Repository Organization
Organizing Machine Learning Projects - Repository Organization
 
Building a strong Data Management capability with TOGAF and ArchiMate
Building a strong Data Management capability with TOGAF and ArchiMateBuilding a strong Data Management capability with TOGAF and ArchiMate
Building a strong Data Management capability with TOGAF and ArchiMate
 
Extending your Information Architecture to Microsoft Teams
Extending your Information Architecture to Microsoft TeamsExtending your Information Architecture to Microsoft Teams
Extending your Information Architecture to Microsoft Teams
 
Global Azure Bootcamp Pune 2023 - Lead the AI era with Microsoft Azure.pdf
Global Azure Bootcamp Pune 2023 -  Lead the AI era with Microsoft Azure.pdfGlobal Azure Bootcamp Pune 2023 -  Lead the AI era with Microsoft Azure.pdf
Global Azure Bootcamp Pune 2023 - Lead the AI era with Microsoft Azure.pdf
 
Selecting Software for Taxonomy, Thesaurus and Ontology Management
Selecting Software for Taxonomy, Thesaurus and Ontology ManagementSelecting Software for Taxonomy, Thesaurus and Ontology Management
Selecting Software for Taxonomy, Thesaurus and Ontology Management
 
Track SD-WAN.pdf
Track SD-WAN.pdfTrack SD-WAN.pdf
Track SD-WAN.pdf
 
By The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market Sizing
By The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market SizingBy The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market Sizing
By The Numbers: CPaaS, UCaaS, CCaaS Landscapes and Market Sizing
 
Nodes 2023 - Knowledge graph based chatbot.pptx
Nodes 2023 - Knowledge graph based chatbot.pptxNodes 2023 - Knowledge graph based chatbot.pptx
Nodes 2023 - Knowledge graph based chatbot.pptx
 
Using Graph and Transformer Embeddings for Vector Based Retrieval
Using Graph and Transformer Embeddings for Vector Based RetrievalUsing Graph and Transformer Embeddings for Vector Based Retrieval
Using Graph and Transformer Embeddings for Vector Based Retrieval
 
Modeling ACORD with ArchiMate Case Study Views
Modeling ACORD with ArchiMate Case Study ViewsModeling ACORD with ArchiMate Case Study Views
Modeling ACORD with ArchiMate Case Study Views
 
RCS Business Messaging
RCS Business MessagingRCS Business Messaging
RCS Business Messaging
 
Microsoft Viva Topics
Microsoft Viva TopicsMicrosoft Viva Topics
Microsoft Viva Topics
 
Simple fuzzy Name Matching in Elasticsearch - Graham Morehead
Simple fuzzy Name Matching in Elasticsearch - Graham MoreheadSimple fuzzy Name Matching in Elasticsearch - Graham Morehead
Simple fuzzy Name Matching in Elasticsearch - Graham Morehead
 
Design your Business, Model your Architecture (presentation by Marc Lankhorst...
Design your Business, Model your Architecture (presentation by Marc Lankhorst...Design your Business, Model your Architecture (presentation by Marc Lankhorst...
Design your Business, Model your Architecture (presentation by Marc Lankhorst...
 
Getting started with with SharePoint Syntex
Getting started with with SharePoint SyntexGetting started with with SharePoint Syntex
Getting started with with SharePoint Syntex
 
SharePoint Einführung und Anwenderschulung
SharePoint Einführung und AnwenderschulungSharePoint Einführung und Anwenderschulung
SharePoint Einführung und Anwenderschulung
 
Case Study: Knowledge Sourcing in Daimler-Benz
Case Study: Knowledge Sourcing in Daimler-BenzCase Study: Knowledge Sourcing in Daimler-Benz
Case Study: Knowledge Sourcing in Daimler-Benz
 
Microsoft Teams University Introduction - Presenter Led
Microsoft Teams University Introduction - Presenter LedMicrosoft Teams University Introduction - Presenter Led
Microsoft Teams University Introduction - Presenter Led
 
GenAI in Research with Responsible AI
GenAI in Researchwith Responsible AIGenAI in Researchwith Responsible AI
GenAI in Research with Responsible AI
 

Semelhante a Gerenciando dependências em Python com Poetry

TDC2016POA | Trilha Python - Python Assíncrono: tudo ao mesmo tempo agora
TDC2016POA | Trilha Python - Python Assíncrono: tudo ao mesmo tempo agoraTDC2016POA | Trilha Python - Python Assíncrono: tudo ao mesmo tempo agora
TDC2016POA | Trilha Python - Python Assíncrono: tudo ao mesmo tempo agoratdc-globalcode
 
BeavOps : Como o Python ajudou a integrar o mundo DevOps
BeavOps : Como o Python ajudou a integrar o mundo DevOpsBeavOps : Como o Python ajudou a integrar o mundo DevOps
BeavOps : Como o Python ajudou a integrar o mundo DevOps4LinuxCursos
 
Por Que Python - #PUGCE
Por Que Python - #PUGCEPor Que Python - #PUGCE
Por Que Python - #PUGCETiago Freire
 
Portal Padrão - passado . presente . futuro, #WPD 2014
Portal Padrão - passado . presente . futuro, #WPD 2014Portal Padrão - passado . presente . futuro, #WPD 2014
Portal Padrão - passado . presente . futuro, #WPD 2014Tania Andrea
 
Oficina Mergulhando no Plone 4
Oficina Mergulhando no Plone 4Oficina Mergulhando no Plone 4
Oficina Mergulhando no Plone 4Tania Andrea
 
PHP Turbinado com CodeIgniter - Conisli 2011
PHP Turbinado com CodeIgniter - Conisli 2011PHP Turbinado com CodeIgniter - Conisli 2011
PHP Turbinado com CodeIgniter - Conisli 2011Evaldo Junior
 
Python Nordeste 2016 - Aplicações multiplataforma - Kivy
Python Nordeste 2016 - Aplicações multiplataforma - KivyPython Nordeste 2016 - Aplicações multiplataforma - Kivy
Python Nordeste 2016 - Aplicações multiplataforma - KivyJulio Cesar Eiras Melanda
 
Docker como super comando
Docker como super comandoDocker como super comando
Docker como super comandoRafael Gomes
 
WordCamp SP 2019 - PeachPie unindo Php com C# .Net Core
WordCamp SP 2019 - PeachPie unindo Php com C# .Net CoreWordCamp SP 2019 - PeachPie unindo Php com C# .Net Core
WordCamp SP 2019 - PeachPie unindo Php com C# .Net CoreVanessa Valle
 
Tecnologias Microsoft, Open Source, Linux, Docker e a Nuvem - WTT-2019 - Mack...
Tecnologias Microsoft, Open Source, Linux, Docker e a Nuvem - WTT-2019 - Mack...Tecnologias Microsoft, Open Source, Linux, Docker e a Nuvem - WTT-2019 - Mack...
Tecnologias Microsoft, Open Source, Linux, Docker e a Nuvem - WTT-2019 - Mack...Renato Groff
 
Python e Dispositivos Móveis
Python e Dispositivos MóveisPython e Dispositivos Móveis
Python e Dispositivos Móveispugpe
 
Django: desenvolvendo aplicações web de maneira simples e rápida!
Django: desenvolvendo aplicações web de maneira simples e rápida!Django: desenvolvendo aplicações web de maneira simples e rápida!
Django: desenvolvendo aplicações web de maneira simples e rápida!Felipe Queiroz
 
Plone: O CMS da moda? - Consegi 2013
Plone: O CMS da moda? - Consegi 2013Plone: O CMS da moda? - Consegi 2013
Plone: O CMS da moda? - Consegi 2013Tania Andrea
 

Semelhante a Gerenciando dependências em Python com Poetry (20)

TDC2016POA | Trilha Python - Python Assíncrono: tudo ao mesmo tempo agora
TDC2016POA | Trilha Python - Python Assíncrono: tudo ao mesmo tempo agoraTDC2016POA | Trilha Python - Python Assíncrono: tudo ao mesmo tempo agora
TDC2016POA | Trilha Python - Python Assíncrono: tudo ao mesmo tempo agora
 
BeavOps : Como o Python ajudou a integrar o mundo DevOps
BeavOps : Como o Python ajudou a integrar o mundo DevOpsBeavOps : Como o Python ajudou a integrar o mundo DevOps
BeavOps : Como o Python ajudou a integrar o mundo DevOps
 
Canivete python
Canivete pythonCanivete python
Canivete python
 
Por Que Python - #PUGCE
Por Que Python - #PUGCEPor Que Python - #PUGCE
Por Que Python - #PUGCE
 
Portal Padrão - passado . presente . futuro, #WPD 2014
Portal Padrão - passado . presente . futuro, #WPD 2014Portal Padrão - passado . presente . futuro, #WPD 2014
Portal Padrão - passado . presente . futuro, #WPD 2014
 
Oficina Mergulhando no Plone 4
Oficina Mergulhando no Plone 4Oficina Mergulhando no Plone 4
Oficina Mergulhando no Plone 4
 
PHP Turbinado com CodeIgniter - Conisli 2011
PHP Turbinado com CodeIgniter - Conisli 2011PHP Turbinado com CodeIgniter - Conisli 2011
PHP Turbinado com CodeIgniter - Conisli 2011
 
Python Nordeste 2016 - Aplicações multiplataforma - Kivy
Python Nordeste 2016 - Aplicações multiplataforma - KivyPython Nordeste 2016 - Aplicações multiplataforma - Kivy
Python Nordeste 2016 - Aplicações multiplataforma - Kivy
 
Hello, Python!
Hello, Python!Hello, Python!
Hello, Python!
 
Docker como super comando
Docker como super comandoDocker como super comando
Docker como super comando
 
WordCamp SP 2019 - PeachPie unindo Php com C# .Net Core
WordCamp SP 2019 - PeachPie unindo Php com C# .Net CoreWordCamp SP 2019 - PeachPie unindo Php com C# .Net Core
WordCamp SP 2019 - PeachPie unindo Php com C# .Net Core
 
Trabalhando com Módulos no Puppet
Trabalhando com Módulos no PuppetTrabalhando com Módulos no Puppet
Trabalhando com Módulos no Puppet
 
Tecnologias Microsoft, Open Source, Linux, Docker e a Nuvem - WTT-2019 - Mack...
Tecnologias Microsoft, Open Source, Linux, Docker e a Nuvem - WTT-2019 - Mack...Tecnologias Microsoft, Open Source, Linux, Docker e a Nuvem - WTT-2019 - Mack...
Tecnologias Microsoft, Open Source, Linux, Docker e a Nuvem - WTT-2019 - Mack...
 
Python e Dispositivos Móveis
Python e Dispositivos MóveisPython e Dispositivos Móveis
Python e Dispositivos Móveis
 
Django: desenvolvendo aplicações web de maneira simples e rápida!
Django: desenvolvendo aplicações web de maneira simples e rápida!Django: desenvolvendo aplicações web de maneira simples e rápida!
Django: desenvolvendo aplicações web de maneira simples e rápida!
 
Virtualenv e Pip
Virtualenv e PipVirtualenv e Pip
Virtualenv e Pip
 
Python para devs
Python para devsPython para devs
Python para devs
 
Ensinando OO com Python
Ensinando OO com PythonEnsinando OO com Python
Ensinando OO com Python
 
Plone: O CMS da moda? - Consegi 2013
Plone: O CMS da moda? - Consegi 2013Plone: O CMS da moda? - Consegi 2013
Plone: O CMS da moda? - Consegi 2013
 
Canivete suíço do Python
Canivete suíço do PythonCanivete suíço do Python
Canivete suíço do Python
 

Gerenciando dependências em Python com Poetry