Posts

Showing posts with the label github

Tips on publishing your Python package to PyPI

Image
  If you want to publish your first Python package to PyPI, here are some tips that might help you in avoiding some pitfalls when releasing your code to the world. Table of contents   1. Unsupported reST directives and other limitations        1.1 PyPI limitations        1.2 GitHub limitations        1.3 Limitations from all   2. Versioning your project   3.  Validate your documentation before uploading   4. Make a release   5. Publishing first to TestPyPI   6. Mistakes found in a published README   7. Remove a release from PyPI   8. Conclusion   9. Resources 10. Notes 1. Unsupported reST directives and other limitations The README.rst [ 1 ] that you painstakingly wrote for readthedocs.org [ 2 ]  might not render correctly on PyPI, nor on GitHub [ 3 ] . Here are some of the limitations that you need to look carefully for each website on which you might ...

markdown-toc Atom package: problem with underscores in headings

Image
markdown-toc ( version 0.4.2 ) is an Atom ( version 1.28.0 ) package that generates a table of contents from all your markdown headings. However, when generating links for headings having underscores (e.g. "The file logging_conf.json") by markdown-toc , the underscores are ignored in the generated relative URLs. GitHub needs the underscores within the headings' URLs so your internal links work correctly. Underscores are ignored by default by the markdown-toc package when generating the relative URLs for the internal links in the TOC Thus, you will have to modify the regex used by markdown-toc for ignoring some characters (e.g. underscore) in the headings when forming the relative links. In order to do so, do the following: Go to Atom->Preferences... , then click on Open Config Folder . On the Project tab, search for the file TOC.coffee that you can find within the folder packages/markdown-toc/lib/ . Find the line hash = hash.replace /[^a-z0-9\u...

GIFs on GitHub pages: Content length exceeded

Image
If you are adding GIFs on your GitHub pages (e.g. README.md), and are getting hit with the " Content length exceeded " message when accessing the said GIFs, it means that your GIFs are too big (more than 5 MB). Even if the GIFs were initially uploaded to a third site (e.g. blogspot.com, or giphy.com), they are eventually copied to GitHub servers, and if your GIFs are too big (e.g. more than 5 MB), they will no be shown (only the dreaded error message will be seen). To solve this problem, you have two choices : Commit your big GIFs to your GitHub repository: you might have other problems eventually when pulling from your repository, since these big GIFs will also be pulled locally Resize your GIFs : go back to the drawing board, and play with your video editing/GIF making software (e.g. PicGIF Lite) by trimming some images, lowering the video resolution (# pixels wide and tall), or speeding up the video. The best solution and the one I opted is the second one ...