distutils

How do I create Python eggs from distutils source packages?

余生颓废 提交于 2019-12-03 10:50:42
I vaguely remember some sort of setuptools wrapper that would generate .egg files from distutils source. Can someone jog my memory? setuptools monkey-patches some parts of distutils when it is imported. When you use easy_install to get a distutils-based project from PyPI, it will create an egg (pip may do that too). To do the same thing locally (i.e. in a directory that’s a code checkout or an unpacked tarball), use this trick: python -c "import setuptools; execfile('setup.py')" bdist_egg . Have you tried python setup.py bdist_egg Here I assume you are using setuptools instead of distutils i.e

Creating MSI with cx_freeze and bdist_msi for PySide app

烂漫一生 提交于 2019-12-03 08:25:24
I have a PySide application that I'm trying to package into an MSI using cx_freeze. I can successfully create an MSI installer, but I'm having trouble figuring out how to list additional modules to be included in the package. Here's my setup.py script: import sys from cx_Freeze import setup, Executable company_name = 'My Company Name' product_name = 'My Gui' bdist_msi_options = { 'upgrade_code': '{66620F3A-DC3A-11E2-B341-002219E9B01E}', 'add_to_path': False, 'initial_target_dir': r'[ProgramFilesFolder]\%s\%s' % (company_name, product_name), # 'includes': ['atexit', 'PySide.QtNetwork'], # <--

How to strip source from distutils binary distributions?

ぃ、小莉子 提交于 2019-12-03 07:49:37
I want to create a bytecode-only distribution from distutils (no really, I do; I know what I'm doing). Using setuptools and the bdist_egg command, you can simply provide the --exclude-source parameter. Unfortunately the standard commands don't have such an option. Is there an easy way to strip the source files just before the tar.gz, zip, rpm or deb is created. Is there a relatively clean per-command way to do this (eg just for tar.gz or zip). The distutils "build_py" command is the one that matters, as it's (indirectly) reused by all the commands that create distributions. If you override the

Python command line program: generate man page from existing documentation and include in the distribution

不想你离开。 提交于 2019-12-03 05:47:21
Following an (hopefully) common practice, I have a Python package that includes several modules and an executable script in a separate scripts directory, as can be seen here . The documentation for the script, apart from the auto-generated help given by optparse, is together with the package documentation in a Sphinx subdirectory. I am trying to: generate the man page for the script from the existing documentation include the man page in the distribution I can easily do #1 with Sphinx, the man_pages setting and sphinx-build -b man . So I can call python setup.py build_sphinx -b man and have

How to use Python distutils?

空扰寡人 提交于 2019-12-03 04:14:54
问题 I wrote a quick program in python to add a gtk GUI to a cli program. I was wondering how I can create an installer using distutils. Since it's just a GUI frontend for a command line app it only works in *nix anyway so I'm not worried about it being cross platform. my main goal is to create a .deb package for debian/ubuntu users, but I don't understand make/configure files. I've primarily been a web developer up until now. edit : Does anyone know of a project that uses distutils so I could see

Calling C++ code from Python using Cython whith the distutilis approach

我们两清 提交于 2019-12-03 03:56:39
I am trying to call a c++ code from a python script using cython. I already managed to work with an example from here but the thing is: my c++ code includes non-standard libraries from opencv. I believe I am not linking them correctly so I need someone to have a look on my setup.py and my cpp_rect.h and cpp_rect.cpp files. The error I am getting is regarding to the bold line yn the *.cpp file: cv::Mat img1(7,7,CV_32FC2,Scalar(1,3)); When I try to test the library, I receive an include error when I execute $ python userect.py : Traceback (most recent call last): File "userect.py", line 2, in

Python发布

情到浓时终转凉″ 提交于 2019-12-03 03:27:18
简要介绍Python模块的编译与安装。 1. setup.py编写 from distutils.core import setup setup( name='hello', version='1.0', description='A simple example', author='dbloop', author_email='984513956@qq.com', url='http://my.oschina.net/dbloop/blog', py_modules=['hello'] ) 2. 示例脚本 # coding=utf8 __metaclass__ = type __author__ = 'dbloop' print 'hello word!' 3. 编译 C:\Users\Administrator\distutilsDir\test001>python setup.py build running build running build_py creating build creating build\lib copying hello.py -> build\lib 4. 安装 C:\Users\Administrator\distutilsDir\test001>python setup.py install running install running

Distributing a shared library and some C code with a Cython extension module

為{幸葍}努か 提交于 2019-12-03 03:06:41
问题 I'm trying to take some functions from a large C++ shared library (libbig.so) and expose them to Python via Cython. To do so, I've got a little C++ file (small.cpp) that provides a thin wrapper around the functionality from the shared library that I need, in a way that makes it easy to call via Cython (pysmall.pyx). libbig.so -> small.cpp, small.h -> libsmall.so -> pysmall.pyx -> pysmall.cpp -> pysmall.so I can build and run this extension module on my own computer: I just compile small.cpp

What is the proper way to work with shared modules in Python development?

醉酒当歌 提交于 2019-12-03 03:00:54
问题 I'm working toward adopting Python as part of my team's development tool suite. With the other languages/tools we use, we develop many reusable functions and classes that are specific to the work we do. This standardizes the way we do things and saves a lot of wheel re-inventing. I can't seem to find any examples of how this is usually handled with Python. Right now I have a development folder on a local drive, with multiple project folders below that, and an additional "common" folder

how to install python distutils

风格不统一 提交于 2019-12-03 02:42:14
问题 I just got some space on a VPS server(running on ubuntu 8.04), and I'm trying to install django on it. The server has python 2.5 installed, but I guess its non standard installation. When I run install script for django, I get amitoj@ninja:~/Django-1.2.1$ python setup.py install Traceback (most recent call last): File "setup.py", line 1, in <module> from distutils.core import setup ImportError: No module named distutils.core I'm stumped. All the articles on internet tell me how to install