distutils

Nested Python C Extensions/Modules?

风格不统一 提交于 2019-12-21 04:53:14
问题 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', [

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

*爱你&永不变心* 提交于 2019-12-21 04:08:11
问题 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

Is `setup.cfg` deprecated?

别说谁变了你拦得住时间么 提交于 2019-12-21 04:04:48
问题 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

Override default installation directory for Python bdist Windows installer

馋奶兔 提交于 2019-12-21 03:57:18
问题 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

How do I create Python eggs from distutils source packages?

最后都变了- 提交于 2019-12-21 03:51:10
问题 I vaguely remember some sort of setuptools wrapper that would generate .egg files from distutils source. Can someone jog my memory? 回答1: 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

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

依然范特西╮ 提交于 2019-12-20 18:43:09
问题 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

Creating MSI with cx_freeze and bdist_msi for PySide app

青春壹個敷衍的年華 提交于 2019-12-20 14:48:06
问题 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'

Creating MSI with cx_freeze and bdist_msi for PySide app

邮差的信 提交于 2019-12-20 14:46:28
问题 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'

Using CMake with setup.py

混江龙づ霸主 提交于 2019-12-20 09:18:21
问题 For a project I build a C library and implict Python bindings (via GObject introspection) with CMake. I also want to distribute some Python helper modules using distutils. I am able to build and install the module with this CMakeLists.txt find_program(PYTHON "python") if (PYTHON) set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in") set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py") set(DEPS "${CMAKE_CURRENT_SOURCE_DIR}/module/__init__.py") set(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build

Automatic version number both in setup.py (setuptools) AND source code?

♀尐吖头ヾ 提交于 2019-12-20 09:15:31
问题 SITUATION: I have a python library, which is controlled by git, and bundled with distutils/setuptools. And I want to automatically generate version number based on git tags, both for setup.py sdist and alike commands, and for the library itself. For the first task I can use git describe or alike solutions (see How can I get the version defined in setup.py (setuptools) in my package?). And when, for example, I am in a tag '0.1' and call for 'setup.py sdist', I get 'mylib-0.1.tar.gz'; or 'mylib