Your SlideShare is downloading. ×
Distributing Python Application the right way
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Distributing Python Application the right way

215
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
215
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. DISTRIBUTING PYTHON APPLICATION THE RIGHT WAY deck version 0.1
  • 2. DON'T REINVENT THE WHEEL Make use of alreadyestablished tools and iterate over it.
  • 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. 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. 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. 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. 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. 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. 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. THAT'S IT Your package is available on PyPI one more thing...
  • 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. DOCUMENTATION TIPS Maintain achangelog use sphinx to generate docs and write them in restructured text Add supportfor readthedocs.org
  • 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. QUESTIONS?