distutils

How to install distutils packages using distutils api or setuptools api

◇◆丶佛笑我妖孽 提交于 2019-12-03 20:37:01
I'm working on a buildout script that needs to install a distutils package on remote server. On PyPi there are 2 recipes for doing this collective.recipe.distutils 0.1 and zerokspot.recipe.distutils 0.1.1 . The later module a derivative of the former, and is a little more convenient then the first, but the both suffer from the same problem, which I will describe now. When bootstrap.py is executed, it downloads zc.buildout package and puts it into buildout's eggs directory. This gives ./bin/buildout access to zc.buildout code, but /usr/local/python does not know anything about zc.buildout at

Confused about the package_dir and packages settings in setup.py

杀马特。学长 韩版系。学妹 提交于 2019-12-03 19:19:30
问题 Here is my project directory structure, which includes the project folder, plus a "framework" folder containing packages and modules shared amongst several projects which resides at the same level in the hierarchy as the project folders: -------------------------------------------------------------- Framework/ package1/ __init__.py mod1.py mod2.py package2/ __init__.py moda.py modb.py My_Project/ src/ main_package/ __init__.py main_module.py setup.py README.txt -------------------------------

Use WiX or Inno Setup to bundle the installation of several MSI files

我的未来我决定 提交于 2019-12-03 16:20:51
I use cx-freeze to create an MSI installer for a Python application. Let's call it application "A". It depends on another application "B". I would like my installer for "A" to include and run the MSI installer for "B". How can I create a bootstrapping/chaining installer using Inno Setup or the WiX toolset? Here is a basic Inno Setup script that bundles two MSI installations into a single setup program. Since the installer only exists to install MSI files, there is no need for an application directory. To avoid creating the application directory, use "CreateAppDir=no". (thanks TLama!) [Setup]

Nested Python C Extensions/Modules?

天涯浪子 提交于 2019-12-03 14:12:53
How do I compile a C-Python module such that it is local to another? E.g. if I have a module named "bar" and another module named "mymodule", how do I compile "bar" so that it imported via "import mymodule.bar"? (Sorry if this is poorly phrased, I wasn't sure what the proper term for it was.) I tried the following in setup.py, but it doesn't seem to work: from distutils.core import setup, Extension setup(name='mymodule', version='1.0', author='Me', ext_modules=[Extension('mymodule', ['mymodule-module.c']), Extension('bar', ['bar-module.c'])]) Edit Thanks Alex. So this is what I ended up using:

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

六月ゝ 毕业季﹏ 提交于 2019-12-03 14:06:53
问题 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

Is `setup.cfg` deprecated?

天大地大妈咪最大 提交于 2019-12-03 13:37:05
It's not completely clear to me, what is the status of setup.cfg . I am looking for solutions for my other question about PEP 508 environment markers, and I became totally confused. To me it seems that setup.cfg is an improvement over setup.py , because it's declarative, does not involve running arbitrary code to make package installable, makes it harder to distribute malicious Python packages, makes it easier to run Python package registries etc. So, here in setuptools docs it's mentioned that setuptools got support for setup.cfg in 30.3.0 (8 Dec 2016) version, which is quite recent. So, this

Override default installation directory for Python bdist Windows installer

落花浮王杯 提交于 2019-12-03 13:01:56
Is it possible to specify during the installer generation (or during the actual installation) a custom path for Python modules? By way of example, let's say I have 5 modules for which I generate an installer using: c:\>python setup.py bdist Everything gets packaged up correctly, but when I install, I am forced to install into site-packages. I need to be able to specify a custom directory of my (or the installer's choosing). At a minimum, I need to be able to override the default so my custom path appears as the default. Is this possible using a built distribution? You should write setup.cfg

How to get error log of a disutils setup in Python?

最后都变了- 提交于 2019-12-03 12:34:25
I am new to Python. I have created some C/C++ extensions for Python and able to build those with the help of Python disutils setup script. But, I have to integrate this setup script to an existing build system. So, I wrote another script to call this setup script using run_setup() method. distributionObj = run_setup("setup.py",["build_ext"]) Now, I want if any error occurs during the building of extension (Compiler, Linker or anything), I must be able to get the information along with the error string from the caller script to notify the build process. Please provide me some suggestion.

Accessing data files before and after distutils/setuptools

和自甴很熟 提交于 2019-12-03 11:46:25
I'm doing a platform independent PyQt application. I intend to use write a setup.py files using setuptools. So far I've managed to detech platform, e.g. load specific options for setup() depending on platform in order to use py2exe on Windows... etc... However, with my application I'm distributing some themes, HTML and images, I need to load these images in the application at runtime. So far they are stored in the themes/ directory of the application. I've been reading documentation on setuptools and distutils, and figured out that if I gave setup() the data_files options with all the files in

How does `setup.py sdist` work?

给你一囗甜甜゛ 提交于 2019-12-03 11:34:46
I'm trying to make a source distribution of my project with setup.py sdist . I already have a functioning setup.py that I can install with. But when I do the sdist , all I get is another my_project folder inside my my_project folder, a MANIFEST file I have no interest in, and a zip file which contains two text files, and not my project. What am I doing wrong? Where is the documentation on sdist ? Update: Here's my setup.py : #!/usr/bin/env python import os from distutils.core import setup import distutils from general_misc import package_finder try: distutils.dir_util.remove_tree('build',