zoukankan      html  css  js  c++  java
  • python打包

    一、RPM

    准备环境

    安装脚本setup.py内容如下:

    在linux环境下执行打包编译命令: python2 setup.py bdist --formats=rpm

    formats参数=wininst则会打包为.exe程序

    创建安装程序或包时,会出现一些错误和警告,只要看到

    writing manifest file 'MANIFEST'
    creating hello-1.0
    making hard links in hello-1.0...
    hard linking hello.py -> hello-1.0
    hard linking setup.py -> hello-1.0
    creating dist
    tar -cf dist/hello-1.0.tar hello-1.0
    gzip -f9 dist/hello-1.0.tar
    tar -cf dist/hello-1.0.tar hello-1.0
    gzip -f9 dist/hello-1.0.tar
    removing 'hello-1.0' (and everything under it)

    类似的信息,就可以忽略告警和错误信息。

    pack目录下我放了两个模块,hello和hello_2,并且setup.py中参数也是py_modules=['hello','hello2'],但是打包出来的tar包里,只有hello模块,这个比较奇怪~可能只能打包一个模块?·····

    如果想重新构建,需要删除MANIFEST.in文件。

    二、安装

    发布的话,就直接发布hello-1.0.tar.gz。

     python setup.py install

  • 相关阅读:
    POJ1094(Topological Sort)
    POJ1258(Minimum Spanning Tree,Prim)
    POJ2509(Water,Greedy)
    POJ1258(Minimum Spanning Tree,Kruskal)
    POJ1256(permutation)
    POJ2790(BFS)
    HDU 1527 取石子游戏
    POJ Mayor's posters
    HDU 1907 John
    HDU 2516 取石子游戏
  • 原文地址:https://www.cnblogs.com/littlebird1/p/9259924.html
Copyright © 2011-2022 走看看