pip打包

这篇博客介绍了如何在Makefile中添加命令来执行pip打包操作,并提供了setup.py文件的相关信息。还详细说明了如何配置Artifactory账户密码,包括在.bashrc或.zshrc中设置环境变量,以及创建包含repository、username和password的.pypirc文件,以便上传pip包。
摘要由CSDN通过智能技术生成

增加setup.py 文件
setuptools文档
setup.py样例

from setuptools import setup, find_packages

def sh(command):
    try:
        if isinstance(command, list):
            command = ' '.join(command)
        return subprocess.check_output(
            command, shell=True,
            stderr=subprocess.STDOUT).decode('utf-8').rstrip()
    except Exception as e:
        return None

VERSION = 'major.minor.patch' 
git_branch = sh('git rev-parse --abbrev-ref HEAD')
git_commit_hash = sh('git log -1 --format=%h')
git_commit_count = sh('git rev-list --count HEAD')
git_diff_name_only = sh('git diff --name-only')
if git_diff_name_only:
    git_diff_name_only = git_diff_name_only.replace('
', ',')

# this is a hack, the easiest way I found to inject these metedata
with open('w
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值