distutils

py2app picking up .git subdir of a package during build

China☆狼群 提交于 2019-12-07 01:23:07
问题 We use py2app extensively at our facility to produce self contained .app packages for easy internal deployment without dependency issues. Something I noticed recently, and have no idea how it began, is that when building an .app, py2app started including the .git directory of our main library. commonLib, for instance, is our root python library package, which is a git repo. Under this package are the various subpackages such as database, utility, etc. commonLib/ |- .git/ # because commonLib

Get the commands distutils passes to the compiler

拜拜、爱过 提交于 2019-12-06 20:29:15
问题 Lets say I have this Python code in a setup.py script to build a C extension: from distutils.core import setup, Extension module1 = Extension('demo', sources = ['demo.c']) setup (name = 'PackageName', version = '1.0', description = 'This is a demo package', ext_modules = [module1]) Easy enough. Now I call the setup.py script with this line: C:/> python setup.py build_ext --compiler=mingw32 Ok, but whats the question? When distutils calls mingw32 and passes all the necessary and operating

Trying to build the basic python extension example fails (windows)

為{幸葍}努か 提交于 2019-12-06 12:58:14
I have Python 2.6 and Visual Studio 2008 running on a Win7 x64 machine. When I try to build the basic python extension example in c "example_nt" as found in the python 2.6 sources distribution, it fails: python setup.py build And this results in: running build running build_ext building 'aspell' extension Traceback (most recent call last): File "setup.py", line 7, in <module> ext_modules = [module1]) File "C:\Python26\lib\distutils\core.py", line 152, in setup dist.run_commands() File "C:\Python26\lib\distutils\dist.py", line 975, in run_commands self.run_command(cmd) File "C:\Python26\lib

Python cx_freeze 4.3.4: Setting targetName causes errors

好久不见. 提交于 2019-12-06 11:45:08
I am very new to cx_freeze and I am trying to understand it a bit better, I have this setup.py file: import sys from cx_Freeze import setup, Executable # Dependencies are automatically detected, but it might need fine tuning. build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]} setup( name = "guifoo", version = "0.1", description = "My GUI application!", options = {"build_exe": build_exe_options}, executables = [Executable("mypy.py", base="Console", targetName="hello")]) which if I remove the targetName="hello" it works however when I include it, it doesnt. Would anyone know why?

How to create namespace packages in Python?

冷暖自知 提交于 2019-12-06 09:49:03
问题 I have a Python 3 project with the following structure: project/ | +--root/ | +--__init__.py | +--sub/ | +--__init__.py | +--actualcode.py I want to use "namespace packages" so that my lib shares a common namespace with other related libs in separate projects. The import statement should look like this: from root.sub.actualcode import something The __init__.py file in the root folder contains the following statement to create a namespace package: from pkgutil import extend_path __path__ =

Cython and distutils

喜欢而已 提交于 2019-12-06 06:06:11
问题 I want to use Cython to convert multiple .pyx files into an executable package (.DLL). How do I create a single Windows DLL from multiple .pyx via distutils? Sample used: sub1.pyx: cimport sub1 class A(): def test(self, val): print "A", val sub1.pxd: cdef class A: cpdef test(self,val) sub2.pyx: cimport sub2 class B(): def test(self): return 5 sub2.pxd: cdef class B: cpdef test(self) init .py: cimport sub1 cimport sub2 import sub1 import sub2 setup.py: from distutils.core import setup from

How to link to forked package in distutils, without breaking pip freeze?

送分小仙女□ 提交于 2019-12-06 05:06:14
Preface The official python package python-openid (as distributed through pypi.org) does not work with Google Apps. Somebody wrote a fix to this and uploaded the patched source to github. Now I want to create a package which should link to this forked package. Now when installing this package, everything is well. The forked package is installed and everything is fine. However, when doing a pip freeze , there is no mentioning of where the package came from. As the forked package should be used, including the official package breaks deployments. How can I link to a forked package in my own

How to add PyPi dependencies to DEB package

微笑、不失礼 提交于 2019-12-06 01:39:34
问题 I created some python app using autobahn and packaged it using baazar builddeb . In python setup.py file I added requires tag with all the required dependencies. Is it possible to tell debian package installer to install these packages? I added some of deps to debian/control>Depends but: dpkg -i my_package does not install dependencies. Just shows the error and I need to install these deps manually. some packages does not exists in standard Ubuntu repos. For example autobahn. And in general I

How to have PyPI package install header files for C extension with distutils/setuptools?

主宰稳场 提交于 2019-12-06 01:07:32
We have a package (rebound) up on PyPI that includes a C extension . The relevant part of the setup.py file looks like this (simplified): libreboundmodule = Extension('librebound', sources = [ 'src/rebound.c'], include_dirs = ['src'],) Additional libraries need access to rebound.h, but when one runs pip install rebound it doesn't install rebound.h anywhere. How can we get distutils/setuptools to install rebound.h somewhere along with all the python modules? We're hoping that we can have pip install rebound do all the work so the user doesn't have to run any additional commands. 来源: https:/

Setuptools not passing arguments for entry_points

牧云@^-^@ 提交于 2019-12-06 00:41:22
问题 I'm using setuptools for a Python script I wrote After installing, I do: $ megazord -i input -d database -v xx-xx -w yy-yy Like I would if I was running it ./like_this However, I get: Traceback (most recent call last): File "/usr/local/bin/megazord", line 9, in <module> load_entry_point('megazord==1.0.0', 'console_scripts', 'megazord')() TypeError: main() takes exactly 1 argument (0 given) Which looks like setuptools is not sending my arguments to main() to be parsed (by optparse) Here's my