{"id":16347050,"url":"https://github.com/ospoon/sp_utils","last_synced_at":"2025-11-09T02:30:26.421Z","repository":{"id":105557414,"uuid":"139298202","full_name":"OSpoon/sp_utils","owner":"OSpoon","description":"发布到pypi的流程","archived":false,"fork":false,"pushed_at":"2018-07-01T03:43:49.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-28T06:09:36.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OSpoon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-01T03:43:09.000Z","updated_at":"2018-07-01T03:43:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"a77a064f-f822-4cd0-a34c-63eea0e484ad","html_url":"https://github.com/OSpoon/sp_utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSpoon%2Fsp_utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSpoon%2Fsp_utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSpoon%2Fsp_utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSpoon%2Fsp_utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OSpoon","download_url":"https://codeload.github.com/OSpoon/sp_utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239565664,"owners_count":19660158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T00:39:23.926Z","updated_at":"2025-11-09T02:30:26.354Z","avatar_url":"https://github.com/OSpoon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"##### 1.创建项目\n\n    目录结构：\n    /example_pkg\n      /example_pkg\n        __init__.py\n        \n##### 2.编辑example_pkg/__init__.py\n    \n    name = \"example_pkg\"\n    \n    * 这只是为了可以在后面确认它是否正确安装\n    \n##### 3.创建包文件\n\n    /example_pkg\n      /example_pkg\n        __init__.py\n      setup.py\n      LICENSE\n      README.md\n      \n##### 4.创建的setup.py\n\n    import setuptools\n\n    with open(\"README.md\", \"r\") as fh:\n        long_description = fh.read()\n    \n    setuptools.setup(\n        name=\"example_pkg\",\n        version=\"0.0.1\",\n        author=\"Example Author\",\n        author_email=\"author@example.com\",\n        description=\"A small example package\",\n        long_description=long_description,\n        long_description_content_type=\"text/markdown\",\n        url=\"https://github.com/pypa/example-project\",\n        packages=setuptools.find_packages(),\n        classifiers=(\n            \"Programming Language :: Python :: 3\",\n            \"License :: OSI Approved :: MIT License\",\n            \"Operating System :: OS Independent\",\n        ),\n    )\n    \n##### 5.创建许可证 LICENSE\n    \n    Copyright (c) 2018 The Python Packaging Authority\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n    \n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n    \n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n    SOFTWARE.\n    \n##### 6.确认安装setuptools并wheel 安装了最新版本\n    \n    pip install --upgrade pip\n    python3 -m pip install --upgrade setuptools wheel\n    \n##### 7.编译dist文件\n    \n    python3 setup.py sdist bdist_wheel\n    \n    dist/\n      example_pkg-0.0.1-py3-none-any.whl\n      example_pkg-0.0.1.tar.gz\n      \n##### 8.安装twine\n    \n    python3 -m pip install --upgrade twine\n    \n##### 9.运行Twine以上传dist\n\n    twine upload dist/*\n    \n    twine upload --repository-url https://test.pypi.org/legacy/ dist/*\n    \n##### 备注\n    创建 .pypirc\n    [distutils]\n    index-servers =\n      pypi\n      pypitest\n    \n    [pypi]\n    repository=https://pypi.python.org/pypi\n    username=zhangxin\n    password=Zx1234567890.\n    \n    [pypitest]\n    repository=https://testpypi.python.org/pypi\n    username=zhangxin\n    password=Zx1234567890.\n    \n    \n    发布地址(*创建账号后需要邮件激活)\n    https://pypi.org/\n    https://test.pypi.org/\n    \n    安装\n    pip install --upgrade sp-utils\n    \n    ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fospoon%2Fsp_utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fospoon%2Fsp_utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fospoon%2Fsp_utils/lists"}