久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    • <bdo id='2tI5Y'></bdo><ul id='2tI5Y'></ul>
    <legend id='2tI5Y'><style id='2tI5Y'><dir id='2tI5Y'><q id='2tI5Y'></q></dir></style></legend>
    <i id='2tI5Y'><tr id='2tI5Y'><dt id='2tI5Y'><q id='2tI5Y'><span id='2tI5Y'><b id='2tI5Y'><form id='2tI5Y'><ins id='2tI5Y'></ins><ul id='2tI5Y'></ul><sub id='2tI5Y'></sub></form><legend id='2tI5Y'></legend><bdo id='2tI5Y'><pre id='2tI5Y'><center id='2tI5Y'></center></pre></bdo></b><th id='2tI5Y'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2tI5Y'><tfoot id='2tI5Y'></tfoot><dl id='2tI5Y'><fieldset id='2tI5Y'></fieldset></dl></div>

      <tfoot id='2tI5Y'></tfoot>

        <small id='2tI5Y'></small><noframes id='2tI5Y'>

        在 python 存儲庫名稱和包名稱中使用連字符/破折

        Using hyphen/dash in python repository name and package name(在 python 存儲庫名稱和包名稱中使用連字符/破折號)

            <tfoot id='CeVks'></tfoot>
          1. <small id='CeVks'></small><noframes id='CeVks'>

              <tbody id='CeVks'></tbody>
                <bdo id='CeVks'></bdo><ul id='CeVks'></ul>

                  <i id='CeVks'><tr id='CeVks'><dt id='CeVks'><q id='CeVks'><span id='CeVks'><b id='CeVks'><form id='CeVks'><ins id='CeVks'></ins><ul id='CeVks'></ul><sub id='CeVks'></sub></form><legend id='CeVks'></legend><bdo id='CeVks'><pre id='CeVks'><center id='CeVks'></center></pre></bdo></b><th id='CeVks'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CeVks'><tfoot id='CeVks'></tfoot><dl id='CeVks'><fieldset id='CeVks'></fieldset></dl></div>
                  <legend id='CeVks'><style id='CeVks'><dir id='CeVks'><q id='CeVks'></q></dir></style></legend>
                • 本文介紹了在 python 存儲庫名稱和包名稱中使用連字符/破折號的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試使我的 git 存儲庫 pip 可安裝.為此,我正在重組 repo 以遵循正確的約定.通過查看其他存儲庫,我的理解是,我應該將所有源代碼放在與存儲庫名稱同名的包中.例如.如果我的存儲庫名為 myrepo,那么源代碼將全部放入一個也稱為 myrepo 的包中.

                  I am trying to make my git repository pip-installable. In preparation for that I am restructuring the repo to follow the right conventions. My understanding from looking at other repositories is that I should put all my source code in a package that has the same name as the repository name. E.g. if my repository is called myrepo, then the source code would all go into a package also called myrepo.

                  為了便于閱讀,我的存儲庫中有一個連字符:例如我的倉庫.所以如果我想為它創建一個同名的包,它也會有一個連字符.在本教程中 它說 python 包不要使用連字符"名字.但是,我見過一些完善的軟件包,例如 scikit-learn,它們的名稱中有連字符.我注意到的一件事是,在 scikit-learn 存儲庫中,包名稱與存儲庫名稱不同,而是稱為 sklearn.

                  My repository has a hyphen in it for readability: e.g. my-repo. So if I wanted to make a package for it with the same name, it would have a hyphen in it as well. In this tutorial it says "don't use hyphens" for python package names. However I've seen well-established packages such as scikit-learn that have hyphens in their name. One thing that I have noticed though is that in the scikit-learn repo, the package name is not the same as the repo name and is instead called sklearn.

                  我認為我上面的討論歸結為以下問題:

                  I think my discussion above boils down to the following questions:

                  1. 打包repo的時候,repository的名字和package的名字是什么關系?名字不匹配時有什么要注意的嗎?
                  2. 可以在包名中使用連字符嗎?存儲庫名稱呢?
                  3. 如果 scikit-learn 的包名是 sklearn,那么我安裝它時怎么會使用 pip install scikit-learnpip install sklearn的?
                  1. When packaging a repo, what is the relationship between the repository's name and the package's name? Is there anything to beware of when having names that don't match?
                  2. Is it okay to have hyphens in package names? What about in repository names?
                  3. If the package name for scikit-learn is sklearn, then how come when I install it I do pip install scikit-learn instead of pip install sklearn?

                  推薦答案

                  為了回答你的第一點,讓我改寫 我的回答 換一個問題.

                  To answer your 1st point let me rephrase my answer to a different question.

                  誤解的最大來源是包"這個詞.嚴重超載.游戲中有 4 個不同的名稱——存儲庫名稱、用于開發的目錄名稱(包含 setup.py 的目錄名稱)、包含 的目錄名稱__init__.py 和其他可導入模塊,PyPI 的分發名稱.這 4 個通常相同或相似,但這不是必需的.

                  The biggest source of misunderstanding is that the word "package" is heavily overloaded. There are 4 different names in the game — the name of the repository, the name of the directory being used for development (the one that contains setup.py), the name of the directory containing __init__.py and other importable modules, the name of distribution at PyPI. Quite often these 4 are the same or similar but that's not required.

                  存儲庫和開發目錄的名稱可以是任何名稱,它們的名稱不起任何作用.當然,正確命名它們很方便,但這只是方便.

                  The names of the repository and development directory can be any, their names don't play any role. Of course it's convenient to name them properly but that's only convenience.

                  包含 Python 文件的目錄名稱是要導入的包的名稱.一旦包被命名為導入,名稱通常會卡住并且無法更改.

                  The name of the directory with Python files name the package to be imported. Once the package is named for import the name usually stuck and cannot be changed.

                  發行版的名稱在 PyPI 中提供了一個頁面和發行版文件的名稱(源發行版、雞蛋、輪子).這是 setup(name='distribution') 調用中的名稱.

                  The name of the distribution gives one a page at PyPI and the name of distribution files (source distribution, eggs, wheels). It's the name one puts in setup(name='distribution') call.

                  讓我展示詳細的真實示例.我一直在維護一個名為 CheetahTemplate 的模板庫.我在名為 cheetah3/ 的開發目錄中開發它.PyPI 的分布稱為 Cheetah3;這是我放入 setup(name='Cheetah3').頂級模塊是 Cheetah 因此有一個import Cheetah.Templatefrom Cheetah import Template;這意味著我有一個目錄 cheetah3/Cheetah/.

                  Let me show detailed real example. I've been maintaining a templating library called CheetahTemplate. I develop it in the development directory called cheetah3/. The distribution at PyPI is called Cheetah3; this is the name I put into setup(name='Cheetah3'). The top-level module is Cheetah hence one does import Cheetah.Template or from Cheetah import Template; that means that I have a directory cheetah3/Cheetah/.

                  2 的答案是:您可以在存儲庫名稱和 PyPI 分發名稱中使用破折號,但不能在包(包含 __init__.py 文件的目錄)名稱和模塊(.py 文件)名稱,因為你不能在 Python 中編寫 import xy-zzy,這將是減法和 SyntaxError.

                  The answer to 2 is: you can have dashes in repository names and PyPI distribution names but not in package (directories with __init__.py files) names and module (.py files) names because you cannot write in Python import xy-zzy, that would be subtraction and SyntaxError.

                  第 3 點:站點和存儲庫名稱是 scikit-learn,以及 發行版名稱,但可導入的包(帶有 __init__.py 的頂級目錄)是 sklearn.

                  Point 3: The site and the repository names are scikit-learn, as well as the distribution name, but the importable package (the top-level directory with __init__.py) is sklearn.

                  PEP 8 與該問題無關,因為它不討論分發,只討論可導入的包和模塊.

                  PEP 8 has nothing to do with the question as it doesn't talk about distribution, only about importable packages and modules.

                  這篇關于在 python 存儲庫名稱和包名稱中使用連字符/破折號的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個模塊和類)
                  Configuring Python to use additional locations for site-packages(配置 Python 以使用站點包的其他位置)
                  How to structure python packages without repeating top level name for import(如何在不重復導入頂級名稱的情況下構造python包)
                  Install python packages on OpenShift(在 OpenShift 上安裝 python 包)
                  How to refresh sys.path?(如何刷新 sys.path?)
                  Distribute a Python package with a compiled dynamic shared library(分發帶有已編譯動態共享庫的 Python 包)

                  • <bdo id='9NOXg'></bdo><ul id='9NOXg'></ul>

                      <tbody id='9NOXg'></tbody>
                      <i id='9NOXg'><tr id='9NOXg'><dt id='9NOXg'><q id='9NOXg'><span id='9NOXg'><b id='9NOXg'><form id='9NOXg'><ins id='9NOXg'></ins><ul id='9NOXg'></ul><sub id='9NOXg'></sub></form><legend id='9NOXg'></legend><bdo id='9NOXg'><pre id='9NOXg'><center id='9NOXg'></center></pre></bdo></b><th id='9NOXg'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='9NOXg'><tfoot id='9NOXg'></tfoot><dl id='9NOXg'><fieldset id='9NOXg'></fieldset></dl></div>

                        <tfoot id='9NOXg'></tfoot>

                        <legend id='9NOXg'><style id='9NOXg'><dir id='9NOXg'><q id='9NOXg'></q></dir></style></legend>

                            <small id='9NOXg'></small><noframes id='9NOXg'>

                            主站蜘蛛池模板: 国产一区在线观看视频 | 国产精品不卡视频 | 国产一区二区不卡视频 | 韩日中文字幕 | 成年视频在线观看 | 精品伊人久久 | 中文一级片 | 国产精品伦理一区 | 国产精品成人免费一区久久羞羞 | 国产在线高清 | 91精品看片 | 国产午夜精品久久 | 天天干在线观看 | 精品欧美一区二区三区久久久 | 黄色小视频免费看 | 欧美999| 久久久黄色片 | 你懂的在线网站 | 色婷婷综合在线 | 久久性生活视频 | 天海翼在线视频 | 99一区二区 | 欧美久久久 | 中文字幕观看 | 亚洲视频三区 | 99久久久国产精品免费蜜臀 | 欧美成人一级片 | 视频一区二区在线播放 | 欧美在线观看一区二区 | 国产青青操 | 乳色吐息在线观看 | 性免费视频 | 久久亚洲成人 | 日韩视频一区二区 | 88av视频 | 蜜臀99久久精品久久久久小说 | 中文字幕精品在线观看 | 精品一区二区国产 | 国产又粗又猛视频免费 | 国产精品嫩草影院桃色 | 深夜福利影院 |