{"id":14796,"date":"2020-09-29T20:52:29","date_gmt":"2020-09-29T20:52:29","guid":{"rendered":"https:\/\/holypython.com\/?p=14796"},"modified":"2021-03-28T01:41:24","modified_gmt":"2021-03-28T01:41:24","slug":"python-packaging-uploading-a-python-library-to-pypi","status":"publish","type":"post","link":"https:\/\/holypython.com\/python-packaging-uploading-a-python-library-to-pypi\/","title":{"rendered":"Python Packaging: Uploading a Python Library to PyPi"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"14796\" class=\"elementor elementor-14796\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-deb424f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"deb424f\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-86117b6\" data-id=\"86117b6\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-32825ff elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"32825ff\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-0cf168e\" data-id=\"0cf168e\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c1ac4e3 elementor-widget elementor-widget-image\" data-id=\"c1ac4e3\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"1210\" height=\"806\" src=\"https:\/\/holypython.com\/wp-content\/uploads\/2020\/09\/huFlPc9_-Custom.jpg\" class=\"attachment-full size-full wp-image-15245\" alt=\"\" srcset=\"https:\/\/holypython.com\/wp-content\/uploads\/2020\/09\/huFlPc9_-Custom.jpg 1210w, https:\/\/holypython.com\/wp-content\/uploads\/2020\/09\/huFlPc9_-Custom-300x200.jpg 300w, https:\/\/holypython.com\/wp-content\/uploads\/2020\/09\/huFlPc9_-Custom-1024x682.jpg 1024w, https:\/\/holypython.com\/wp-content\/uploads\/2020\/09\/huFlPc9_-Custom-768x512.jpg 768w\" sizes=\"(max-width: 1210px) 100vw, 1210px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-403b278 elementor-widget elementor-widget-text-editor\" data-id=\"403b278\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Once you cover the necessary ground for packaging whether it be coding, licensing, testing or documentation, it&#8217;s finally the moment of truth: Uploading to PyPI!<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4dc49b1 elementor-widget elementor-widget-text-editor\" data-id=\"4dc49b1\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family );\">From this point on, you should be executing commands inside the root folder of your library. This is where installation files such as: setup.py, requirements.txt and readme.md exist.<\/span><\/p><p>There are two ways to ensure you&#8217;re running Python in a specific directory that comes to mind:<\/p><ol><li><b>Before starting Python:<\/b> Navigate to the folder from Command Prompt (Anaconda Command Prompt or Anaconda Shell), then launch Python there.<ul><li>To do this, use\u00a0<span style=\"font-weight: bolder;\">cd\u00a0<\/span>command. For example:<\/li><li>if you&#8217;re in\u00a0<span style=\"font-weight: bolder;\">C:\/\u00a0<\/span>and you want to navigate to\u00a0<span style=\"font-weight: bolder;\">C:\/New_Folder,\u00a0<\/span>all you have to do is execute\u00a0<span style=\"font-weight: bolder;\">cd New_Folder<\/span><\/li><li>Then, if you execute\u00a0<span style=\"font-weight: bolder;\">cd ..\u00a0<\/span>this will take you to the directory one level up, if you are in\u00a0<span style=\"font-weight: bolder;\">C:\/New_Folder<\/span>\u00a0and execute\u00a0<span style=\"font-weight: bolder;\">cd ..\u00a0<\/span>it will take you back to\u00a0<span style=\"font-weight: bolder;\">C:\/<\/span><\/li><\/ul><\/li><li><b>From inside Python: <\/b><ul><li>import os<\/li><li><p>os.chdir(r&#8217;c:\/Users\/ABC\/Desktop&#8217;)<\/p><\/li><\/ul><\/li><\/ol><p><span class=\"kwd\">You can check your current working directory from inside Python with this code:<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3933f23 elementor-widget elementor-widget-html\" data-id=\"3933f23\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre rel=\"Python\"><code>import os\r\n\r\ndirpath=os.getcwd()\r\nprint(dirpath)\r\n<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-6a5f516\" data-id=\"6a5f516\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-aea9817 elementor-position-left elementor-view-default elementor-mobile-position-top elementor-vertical-align-top elementor-widget elementor-widget-icon-box\" data-id=\"aea9817\" data-element_type=\"widget\" data-widget_type=\"icon-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-box-wrapper\">\n\n\t\t\t\t\t\t<div class=\"elementor-icon-box-icon\">\n\t\t\t\t<span  class=\"elementor-icon\">\n\t\t\t\t<i aria-hidden=\"true\" class=\"far fa-clock\"><\/i>\t\t\t\t<\/span>\n\t\t\t<\/div>\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-icon-box-content\">\n\n\t\t\t\t\t\t\t\t\t<h4 class=\"elementor-icon-box-title\">\n\t\t\t\t\t\t<span  >\n\t\t\t\t\t\t\tEstimated Time\t\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/h4>\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t<p class=\"elementor-icon-box-description\">\n\t\t\t\t\t\t10 mins\t\t\t\t\t<\/p>\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f1f1326 elementor-widget elementor-widget-raven-divider\" data-id=\"f1f1326\" data-element_type=\"widget\" data-widget_type=\"raven-divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"raven-widget-wrapper\">\r\n\t\t\t<div class=\"raven-divider\">\r\n\t\t\t\t<span class=\"raven-divider-line raven-divider-solid\"><\/span>\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1398e69 elementor-position-left elementor-view-default elementor-mobile-position-top elementor-vertical-align-top elementor-widget elementor-widget-icon-box\" data-id=\"1398e69\" data-element_type=\"widget\" data-widget_type=\"icon-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-box-wrapper\">\n\n\t\t\t\t\t\t<div class=\"elementor-icon-box-icon\">\n\t\t\t\t<span  class=\"elementor-icon\">\n\t\t\t\t<i aria-hidden=\"true\" class=\"far fa-thumbs-up\"><\/i>\t\t\t\t<\/span>\n\t\t\t<\/div>\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-icon-box-content\">\n\n\t\t\t\t\t\t\t\t\t<h4 class=\"elementor-icon-box-title\">\n\t\t\t\t\t\t<span  >\n\t\t\t\t\t\t\tSkill Level\t\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/h4>\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t<p class=\"elementor-icon-box-description\">\n\t\t\t\t\t\tUpper-Intermediate\t\t\t\t\t<\/p>\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0660f3c elementor-widget elementor-widget-raven-divider\" data-id=\"0660f3c\" data-element_type=\"widget\" data-widget_type=\"raven-divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"raven-widget-wrapper\">\r\n\t\t\t<div class=\"raven-divider\">\r\n\t\t\t\t<span class=\"raven-divider-line raven-divider-solid\"><\/span>\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-706ac6c elementor-position-left elementor-view-default elementor-mobile-position-top elementor-vertical-align-top elementor-widget elementor-widget-icon-box\" data-id=\"706ac6c\" data-element_type=\"widget\" data-widget_type=\"icon-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-box-wrapper\">\n\n\t\t\t\t\t\t<div class=\"elementor-icon-box-icon\">\n\t\t\t\t<span  class=\"elementor-icon\">\n\t\t\t\t<i aria-hidden=\"true\" class=\"far fa-bookmark\"><\/i>\t\t\t\t<\/span>\n\t\t\t<\/div>\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-icon-box-content\">\n\n\t\t\t\t\t\t\t\t\t<h4 class=\"elementor-icon-box-title\">\n\t\t\t\t\t\t<span  >\n\t\t\t\t\t\t\tExercises\t\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/h4>\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t<p class=\"elementor-icon-box-description\">\n\t\t\t\t\t\tna\t\t\t\t\t<\/p>\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e4bd9f2 elementor-widget elementor-widget-raven-divider\" data-id=\"e4bd9f2\" data-element_type=\"widget\" data-widget_type=\"raven-divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"raven-widget-wrapper\">\r\n\t\t\t<div class=\"raven-divider\">\r\n\t\t\t\t<span class=\"raven-divider-line raven-divider-solid\"><\/span>\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0940073 elementor-position-left elementor-vertical-align-middle elementor-view-default elementor-mobile-position-top elementor-widget elementor-widget-icon-box\" data-id=\"0940073\" data-element_type=\"widget\" data-widget_type=\"icon-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-box-wrapper\">\n\n\t\t\t\t\t\t<div class=\"elementor-icon-box-icon\">\n\t\t\t\t<span  class=\"elementor-icon\">\n\t\t\t\t<i aria-hidden=\"true\" class=\"fas fa-book\"><\/i>\t\t\t\t<\/span>\n\t\t\t<\/div>\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-icon-box-content\">\n\n\t\t\t\t\t\t\t\t\t<h4 class=\"elementor-icon-box-title\">\n\t\t\t\t\t\t<span  >\n\t\t\t\t\t\t\tPosts from the Series\t\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/h4>\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6fb0930 elementor-vertical-align-middle elementor-widget elementor-widget-icon-box\" data-id=\"6fb0930\" data-element_type=\"widget\" data-widget_type=\"icon-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-box-wrapper\">\n\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-icon-box-content\">\n\n\t\t\t\t\t\t\t\t\t<h4 class=\"elementor-icon-box-title\">\n\t\t\t\t\t\t<a href=\"https:\/\/holypython.com\/python-packaging-quick-tutorial-checklist\/\" target=\"_blank\" >\n\t\t\t\t\t\t\t1- Introduction\t\t\t\t\t\t<\/a>\n\t\t\t\t\t<\/h4>\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c908cb5 elementor-vertical-align-middle elementor-widget elementor-widget-icon-box\" data-id=\"c908cb5\" data-element_type=\"widget\" data-widget_type=\"icon-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-box-wrapper\">\n\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-icon-box-content\">\n\n\t\t\t\t\t\t\t\t\t<h4 class=\"elementor-icon-box-title\">\n\t\t\t\t\t\t<a href=\"https:\/\/holypython.com\/python-packaging-getting-ready\/\" target=\"_blank\" >\n\t\t\t\t\t\t\t2- Getting Ready\t\t\t\t\t\t<\/a>\n\t\t\t\t\t<\/h4>\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1d67f0e elementor-vertical-align-middle elementor-widget elementor-widget-icon-box\" data-id=\"1d67f0e\" data-element_type=\"widget\" data-widget_type=\"icon-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-box-wrapper\">\n\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-icon-box-content\">\n\n\t\t\t\t\t\t\t\t\t<h4 class=\"elementor-icon-box-title\">\n\t\t\t\t\t\t<a href=\"https:\/\/holypython.com\/python-packaging-software-licenses-open-source-licensing-and-more\/\" target=\"_blank\" >\n\t\t\t\t\t\t\t3- Licensing\t\t\t\t\t\t<\/a>\n\t\t\t\t\t<\/h4>\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7b8d9e0 elementor-vertical-align-middle elementor-widget elementor-widget-icon-box\" data-id=\"7b8d9e0\" data-element_type=\"widget\" data-widget_type=\"icon-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-box-wrapper\">\n\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-icon-box-content\">\n\n\t\t\t\t\t\t\t\t\t<h4 class=\"elementor-icon-box-title\">\n\t\t\t\t\t\t<a href=\"https:\/\/holypython.com\/python-packaging-hosting-code-at-github\/\" >\n\t\t\t\t\t\t\t4-Github\t\t\t\t\t\t<\/a>\n\t\t\t\t\t<\/h4>\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-dea30ef elementor-widget elementor-widget-raven-divider\" data-id=\"dea30ef\" data-element_type=\"widget\" data-widget_type=\"raven-divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"raven-widget-wrapper\">\r\n\t\t\t<div class=\"raven-divider\">\r\n\t\t\t\t<span class=\"raven-divider-line raven-divider-solid\"><\/span>\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-025448f elementor-vertical-align-middle elementor-widget elementor-widget-icon-box\" data-id=\"025448f\" data-element_type=\"widget\" data-widget_type=\"icon-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-box-wrapper\">\n\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-icon-box-content\">\n\n\t\t\t\t\t\t\t\t\t<h4 class=\"elementor-icon-box-title\">\n\t\t\t\t\t\t<a href=\"https:\/\/holypython.com\/python-packaging-necessary-files-setup-py-requirements-txt-readme-md-__init__-py\/\" target=\"_blank\" >\n\t\t\t\t\t\t\t5- Necessary Files\t\t\t\t\t\t<\/a>\n\t\t\t\t\t<\/h4>\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f43419f elementor-vertical-align-middle elementor-widget elementor-widget-icon-box\" data-id=\"f43419f\" data-element_type=\"widget\" data-widget_type=\"icon-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-box-wrapper\">\n\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-icon-box-content\">\n\n\t\t\t\t\t\t\t\t\t<h4 class=\"elementor-icon-box-title\">\n\t\t\t\t\t\t<a href=\"https:\/\/holypython.com\/python-packaging-local-installation-tests-before-uploading\/\" target=\"_blank\" >\n\t\t\t\t\t\t\t6- Local Tests\t\t\t\t\t\t<\/a>\n\t\t\t\t\t<\/h4>\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8334662 elementor-vertical-align-middle elementor-widget elementor-widget-icon-box\" data-id=\"8334662\" data-element_type=\"widget\" data-widget_type=\"icon-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-box-wrapper\">\n\n\t\t\t\n\t\t\t\t\t\t<div class=\"elementor-icon-box-content\">\n\n\t\t\t\t\t\t\t\t\t<h4 class=\"elementor-icon-box-title\">\n\t\t\t\t\t\t<a href=\"https:\/\/holypython.com\/python-packaging-uploading-a-python-library-to-pypi\/\" target=\"_blank\" >\n\t\t\t\t\t\t\t7- Upload to PyPI\t\t\t\t\t\t<\/a>\n\t\t\t\t\t<\/h4>\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d8b0135 elementor-widget elementor-widget-raven-divider\" data-id=\"d8b0135\" data-element_type=\"widget\" data-widget_type=\"raven-divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"raven-widget-wrapper\">\r\n\t\t\t<div class=\"raven-divider\">\r\n\t\t\t\t<span class=\"raven-divider-line raven-divider-solid\"><\/span>\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-252196f elementor-widget elementor-widget-heading\" data-id=\"252196f\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h4 class=\"elementor-heading-title elementor-size-default\">Course Provider<\/h4>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f867080 elementor-widget elementor-widget-text-editor\" data-id=\"f867080\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Provided by HolyPython.com<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9d5b368 elementor-widget elementor-widget-image\" data-id=\"9d5b368\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"398\" height=\"344\" src=\"https:\/\/holypython.com\/wp-content\/uploads\/2020\/10\/holypython_side_logo_img.jpg\" class=\"attachment-full size-full wp-image-15177\" alt=\"\" srcset=\"https:\/\/holypython.com\/wp-content\/uploads\/2020\/10\/holypython_side_logo_img.jpg 398w, https:\/\/holypython.com\/wp-content\/uploads\/2020\/10\/holypython_side_logo_img-300x259.jpg 300w\" sizes=\"(max-width: 398px) 100vw, 398px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5b539c2 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5b539c2\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-15b6b4f\" data-id=\"15b6b4f\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4e4ec09 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4e4ec09\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-55bc339\" data-id=\"55bc339\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-ad2d7f6 elementor-widget__width-auto elementor-widget elementor-widget-heading\" data-id=\"ad2d7f6\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Creating Source Distribution<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-103a53d elementor-widget elementor-widget-text-editor\" data-id=\"103a53d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family );\">If you&#8217;ve prepared all the packaging files, did some local testing and installation you are ready for the real deal: uploading your package to PyPi Python Repository.<\/span><\/p><p>After your package is successfully up, your package will be available for installation globally.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9342d65 elementor-widget elementor-widget-html\" data-id=\"9342d65\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre rel=\"Python\"><code>python setup.py sdist\r\n<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0f969c9 elementor-widget__width-auto elementor-widget elementor-widget-heading\" data-id=\"0f969c9\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Checking your distribution<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3630d33 elementor-widget elementor-widget-text-editor\" data-id=\"3630d33\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>It&#8217;s always a good idea to check the source distribution before uploading it to a repository.<\/p><p>This way if there is an error you will catch it before hand and avoid potential failures.<\/p><p>twine already has a fantastic command that takes care of this:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-592b363 elementor-widget elementor-widget-html\" data-id=\"592b363\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre rel=\"Python\"><code>twine check dist\/*\r\n<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-acf9800 elementor-widget elementor-widget-text-editor\" data-id=\"acf9800\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>twine check is usually pretty good at pointing out the exact error when there is one. So, if there is an error, it will be raised to your attention, otherwise it will say something like check successfully completed 100%. Then, you&#8217;re good to go.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-48c581c elementor-widget elementor-widget-text-editor\" data-id=\"48c581c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>It&#8217;s the moment of truth, your precious package is ready to be uploaded and take its place in the wild. All\u00a0 you have to do is execute the command below:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fb49a99 elementor-widget elementor-widget-html\" data-id=\"fb49a99\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre rel=\"Python\"><code>twine upload dist\/*\r\n<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-58c68db elementor-widget elementor-widget-text-editor\" data-id=\"58c68db\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Then, you will be asked for your pypi <b>username<\/b> and <b>password<\/b>. Just enter them in order. While entering password it will seem like you&#8217;re not typing, if you&#8217;re not familiar with this it might feel weird, just type as usual and it will actually be registering key presses. Then press enter and ta-da!.\u00a0<\/p><p>Your package is up congratulations.<\/p><p>If something goes wrong don&#8217;t be discouraged. First times are always a bit messy. Just refer to the tutorials about each step and once you address the problem everything should work fine.<\/p><p>We tried to include all the pitfalls and common errors in each step in this tutorial series. So, you should be covered if you still get a really unexpected error then chances are high that it also happened to someone else and there is a thread about it on Stack Overflow. If there isn&#8217;t it&#8217;s a good idea to just start it which will help the next guy encountering the same problem after you.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-fbed50f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"fbed50f\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-735b5e0\" data-id=\"735b5e0\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3623e59 elementor-widget elementor-widget-text-editor\" data-id=\"3623e59\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>If you&#8217;re certain that you&#8217;ll upload your project but you just need a little more time, you might want to register your project name with PyPI in the meanwhile.<\/p><p>you need an extra file to do this:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-176140c elementor-widget elementor-widget-text-editor\" data-id=\"176140c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tOnce you create a .pypirc file with the following content you can execute the code to register your project.\n<pre style=\"padding: 5px; background-color: #feeade; color: #333333; line-height: 15.6px; border-top: 1px solid #aacc99; border-bottom: 1px solid #aacc99; border-image: initial; border-left: none; border-right: none;\">servers = pypi\n\nusername:[Enter your PyPI username here]\npassword:[Enter your PyPI password here]<\/pre>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-47b68be elementor-widget elementor-widget-html\" data-id=\"47b68be\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre rel=\"Python\"><code>python setup.py register\r\n<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3ee7eeb elementor-widget elementor-widget-text-editor\" data-id=\"3ee7eeb\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Now, you can take your time without worrying about the project name getting taken.<\/p><p>Don&#8217;t drag it forever though, some things are meant to be fixed and improved during the different development stages of the code when the program is in <b>alpha version<\/b>.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-9af20ca elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9af20ca\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8d4e44a\" data-id=\"8d4e44a\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-fe640f1 elementor-widget elementor-widget-text-editor\" data-id=\"fe640f1\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Congratulations, now you don&#8217;t only know Python and programming but you&#8217;re also figuring out how to create software and upload it to a repository, in this case PyPI which is a fantastic step for coding work in Python.<\/p>\n<p>Wishing everyone a productive, creative, innovative and meaningful coding journey.<\/p><p>If you need some inspiration check out some of the topics we have on our <a href=\"https:\/\/holypython.com\/blog\">blog<\/a>.<\/p>\n<p>Please share this Python packaging tutorial if you found it helpful.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Once you cover the necessary ground for packaging whether it be coding, licensing, testing or documentation, it&#8217;s finally the moment of truth: Uploading to PyPI! From this point on, you should be executing commands inside the root folder of your library. This is where installation files such as: setup.py, requirements.txt and readme.md exist. There are [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":15379,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[67,52],"tags":[],"class_list":["post-14796","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-packaging","category-tutorials"],"acf":[],"_links":{"self":[{"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/posts\/14796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/comments?post=14796"}],"version-history":[{"count":0,"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/posts\/14796\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/media\/15379"}],"wp:attachment":[{"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/media?parent=14796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/categories?post=14796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/holypython.com\/wp-json\/wp\/v2\/tags?post=14796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}