Distributing Python Application the right way

543 views

Published on

Published in: Engineering, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
543
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Distributing Python Application the right way

  1. 1. DISTRIBUTING PYTHON APPLICATION THE RIGHT WAY deck version 0.1
  2. 2. DON'T REINVENT THE WHEEL Make use of alreadyestablished tools and iterate over it.
  3. 3. COOKIECUTTER Use Cookiecutter to bootstrap your projectfrom allthe available templates Make your own template to your need cookiecutterhttps://github.com/audreyr/cookiecutter-pypackage.git
  4. 4. BUILD YOUR APP https://github.com/vinu76jsr/django_profiler/blob/master/profiler/mid allthe code to write your app, this is adjango middleware which intercepts requests and provides cProfile outputbutthat's notimportant, itis here only as placeholder
  5. 5. EDIT SETUP.PY setup( name= 'profile-middleware',#thenameforpip version=version, description= """Profilerfordjangoviews""", long_description=readme+ 'nn'+history, author= 'VaibhavMishra', author_email= 'vinu76jsr@gmail.com', url= 'https://github.com/vinu76jsr/django_profi packages=[ 'profiler',#whichpackagess ], include_package_data= True, install_requires=[ ], license= "BSD", zip_safe= False, keywords= 'profiler',
  6. 6. SETUP.PY CONTINUED install_requires=[ ], #specifydependencieshere license= "BSD", zip_safe= False, keywords= 'profiler', classifiers=[ 'DevelopmentStatus::2-Pre 'Framework::Django', 'IntendedAudience::Develope 'License::OSIApproved::BS 'NaturalLanguage::English', 'ProgrammingLanguage::Pytho 'ProgrammingLanguage::Pytho 'ProgrammingLanguage::Pytho 'ProgrammingLanguage::Pytho 'ProgrammingLanguage::Pytho ], )
  7. 7. SHOW YOUR CONFIDENCE Integration with travis or anyother CI Integration with acode coverage metric tools Doesn'tmatter how you do it, butalways agood idea show the metrics --what's up with the coverage
  8. 8. WHAT IS WITH THE COVERAGE an acceptable targetis 60%+ I used coveralls to show the badge although it's notbulletproof good coverage generallymeans better tested code and hence lesser bug
  9. 9. lastcommand picks your version from setup.pyand upload itto pypi UPLOAD TO PYPI $pythonsetup.pyregister runningregister Weneedtoknowwhoyouare,sopleasechooseeither: 1.useyourexistinglogin, 2.registerasanewuser, 3.havetheservergenerateanewpasswordforyou(andemailittoyou),or 4.quit Yourselection[default1]:1 $pythonsetup.pysdistupload
  10. 10. THAT'S IT Your package is available on PyPI one more thing...
  11. 11. to preview them DOCUMENTATION Nobodycan use your app if theydon'tknow how to README.MD is agood start go to docs folder and write your docs makedocs
  12. 12. DOCUMENTATION TIPS Maintain achangelog use sphinx to generate docs and write them in restructured text Add supportfor readthedocs.org
  13. 13. ADDING DOCS TO READTHEDOCS If you are usinggithub it's easypeasy add readthedocs webhook in your project register aurlin read the docs and pointitto readthedocs.org That's it check outdjango-profiler-docs
  14. 14. QUESTIONS?

×