暗能星系

    • 登录
    • 搜索

    关于PyPI私服的配置和使用

    软件部署及教程
    1
    1
    29
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • I
      ice-melt 最后由 ice-melt 编辑

      私服配置

      (可选)创建一个Blob Stores,供仓库使用
      选择pypi类型的local,proxy,group各配置一个,(group可配置多个)
      local中修改部署策略为: Allow redeploy
      proxy中设置镜像源,推荐https://pypi.tuna.tsinghua.edu.cn/simple
      group中将local和proxy仓库添加为成员

      上传私有包

      首先修改配置:

      vim ~/.pypirc

      [distutils]
      index-servers=local
      
      [local]
      repository: https://repository.genostack.com/repository/pypi-local/
      username: 个人私服账号
      password: 个人私服密码
      

      打包上传:
      python setup.py sdist upload -r local

      下载

      vim ~/.config/pip/pip.conf

      [global]
      index-url=https://pypi.tuna.tsinghua.edu.cn/simple
      extra-index-url=https://repository.genostack.com/repository/pypi-group/simple
      

      可以通过命令直接配置

      pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
      pip config set global.extra-index-url https://repository.genostack.com/repository/pypi-group/simple
      
      1 条回复 最后回复 回复 引用 0
      • First post
        Last post
      Powered by 暗能星系