distutils

Install package which has setup_requires from local source distributions

纵然是瞬间 提交于 2019-12-01 18:16:36
Take the following trivial package which contains setup_requires: from setuptools import setup setup(name='my_package', setup_requires=['cython']) Assuming I have done the following to build it to a source distribution: $ python setup.py sdist And downloaded the source distribution for Cython $ pip install --download ./dist/ --no-use-wheel Cython So now I have: $ ls dist/ my_package-0.0.0.tar.gz Cython-0.21.1.tar.gz What I'd like to be able to do is install the package on a network-isolated machine using some combination of --find-links , etc. I'd imagine I could do something like pip install

Install package which has setup_requires from local source distributions

淺唱寂寞╮ 提交于 2019-12-01 17:48:13
问题 Take the following trivial package which contains setup_requires: from setuptools import setup setup(name='my_package', setup_requires=['cython']) Assuming I have done the following to build it to a source distribution: $ python setup.py sdist And downloaded the source distribution for Cython $ pip install --download ./dist/ --no-use-wheel Cython So now I have: $ ls dist/ my_package-0.0.0.tar.gz Cython-0.21.1.tar.gz What I'd like to be able to do is install the package on a network-isolated

How to add header files in setup.py so dependencies are observed when building the extensions?

允我心安 提交于 2019-12-01 17:34:35
The question seems long, but it all comes down to how I can add header files to specific extension specification. The motivation is that if I change one of the header files, issuing python setup.py build should rebuild the extension even when none of the .c files are changed. I've tried to add the depending header files in "sources" keyword arg in the Extension constructor, but running the resulting setup.py generated errors complaining about unknown file extension ".h". Thanks! Take a look at the depends option on the Extension class. I've not used it myself, but your exact example is listed

How to add header files in setup.py so dependencies are observed when building the extensions?

我的梦境 提交于 2019-12-01 16:19:25
问题 The question seems long, but it all comes down to how I can add header files to specific extension specification. The motivation is that if I change one of the header files, issuing python setup.py build should rebuild the extension even when none of the .c files are changed. I've tried to add the depending header files in "sources" keyword arg in the Extension constructor, but running the resulting setup.py generated errors complaining about unknown file extension ".h". Thanks! 回答1: Take a

Having py2exe include my data files (like include_package_data)

点点圈 提交于 2019-12-01 09:06:45
I have a Python app which includes non-Python data files in some of its subpackages. I've been using the include_package_data option in my setup.py to include all these files automatically when making distributions. It works well. Now I'm starting to use py2exe. I expected it to see that I have include_package_data=True and to include all the files. But it doesn't. It puts only my Python files in the library.zip , so my app doesn't work. How do I make py2exe include my data files? I ended up solving it by giving py2exe the option skip_archive=True . This caused it to put the Python files not

Distributing pre-built libraries with python modules

 ̄綄美尐妖づ 提交于 2019-12-01 07:33:53
I use the following script to distribute a module containing pure python code. from distutils.core import setup, Extension import os setup (name = 'mtester', version = '0.1', description = 'Python wrapper for libmtester', packages=['mtester'], package_dir={'mtester':'module'}, ) The problem I have is, I modified one of the files that uses an external library (a .so file), which I need to ship along with the existing module. I was suggested to use package_data to include the library. I modified the script to the following. from distutils.core import setup, Extension import os data_dir = os.path

Why does setup.py sweeps the content of the namespace before installing?

∥☆過路亽.° 提交于 2019-12-01 06:57:22
I'm using namespaces with setuptools to distribute a same module in two different repositories. The goal is to get mymodule.one and mymodule.two installed, knowing that the content of one and two comes from different repos. But it looks like two setup.py sweep each other content. ├── repo1 │ ├── mymodule │ │ ├── __init__.py │ │ └── one │ │ └── __init__.py │ └── setup.py └── repo2 ├── mymodule │ ├── __init__.py │ └── two │ └── __init__.py └── setup.py The namespace has the __init__.py below: test$ cat repo1/mymodule/__init__.py from pkgutil import extend_path __path__ = extend_path(__path__, _

cxfreeze missing distutils module inside virtualenv

倖福魔咒の 提交于 2019-12-01 06:42:38
When running a cxfreeze binary from a python3.2 project I am getting the following runtime error: /project/dist/project/distutils/__init__.py:13: UserWarning: The virtualenv distutils package at %s appears to be in the same location as the system distutils? Traceback (most recent call last): File "/home/chrish/.virtualenvs/project/lib/python3.2/distutils/__init__.py", line 19, in <module> import dist ImportError: No module named dist Correspondingly there are several distutils entries in the missing modules section of the cxfreeze output: ? dist imported from distutils ? distutils.ccompiler

Distributing pre-built libraries with python modules

瘦欲@ 提交于 2019-12-01 05:59:12
问题 I use the following script to distribute a module containing pure python code. from distutils.core import setup, Extension import os setup (name = 'mtester', version = '0.1', description = 'Python wrapper for libmtester', packages=['mtester'], package_dir={'mtester':'module'}, ) The problem I have is, I modified one of the files that uses an external library (a .so file), which I need to ship along with the existing module. I was suggested to use package_data to include the library. I

Having py2exe include my data files (like include_package_data)

江枫思渺然 提交于 2019-12-01 05:46:12
问题 I have a Python app which includes non-Python data files in some of its subpackages. I've been using the include_package_data option in my setup.py to include all these files automatically when making distributions. It works well. Now I'm starting to use py2exe. I expected it to see that I have include_package_data=True and to include all the files. But it doesn't. It puts only my Python files in the library.zip , so my app doesn't work. How do I make py2exe include my data files? 回答1: I