setup.py

How to specify dependencies when creating the setup.py file for a python package

喜夏-厌秋 提交于 2020-01-19 09:43:10
问题 The python doc for "Writing the Setupscript (http://docs.python.org/2/distutils/setupscript.html) mentions that dependencies can be specified under section > 2.4. Relationships between Distributions and Packages [...] These relationships can be specified using keyword arguments to the distutils.core.setup() function. Dependencies on other Python modules and packages can be specified by supplying the requires keyword argument to setup(). The value must be a list of strings. Each string

How to specify dependencies when creating the setup.py file for a python package

一世执手 提交于 2020-01-19 09:43:05
问题 The python doc for "Writing the Setupscript (http://docs.python.org/2/distutils/setupscript.html) mentions that dependencies can be specified under section > 2.4. Relationships between Distributions and Packages [...] These relationships can be specified using keyword arguments to the distutils.core.setup() function. Dependencies on other Python modules and packages can be specified by supplying the requires keyword argument to setup(). The value must be a list of strings. Each string

distutils: How to pass a user defined parameter to setup.py?

被刻印的时光 ゝ 提交于 2020-01-18 19:36:05
问题 Please prompt me how to pass a user-defined parameter both from the command line and setup.cfg configuration file to distutils' setup.py script. I want to write a setup.py script, which accepts my package specific parameters. For example: python setup.py install -foo myfoo Thank you, Mher 回答1: As Setuptools/Distuils are horribly documented, I had problems finding the answer to this myself. But eventually I stumbled across this example. Also, this similar question was helpful. Basically, a

Python 2.7 package install with multiple modules and packaged namespaces

荒凉一梦 提交于 2020-01-16 10:31:49
问题 I want to keep multiple python modules in the same repo so it's easier to manage them, and work on them simultaneously. The modules are packaged namespace packages, so I can't have the roots at the same level, and there are 4 of them, and might be more later. Here's the structure I have: repo/ modules/ foo_a/ setup.py VERSION foo/ __init__.py a/ foo_b/ setup.py VERSION foo/ __init__.py b/ The VERSION files are separate and track different versions. And the __init__.py files above are the

How to include a text file in a python installed package?

孤者浪人 提交于 2020-01-15 06:26:09
问题 I have created a python package that looks like this: /command /command module.py __main__.py README.md setup.py file.txt To install i run: sudo python setup.py install Now when i call $ command it shows this error: FileNotFoundError: [Errno 2] No such file or directory: '../file.txt' There are approximately the contents of modules setup.py , __main__.py and module.py setup.py import setuptools setuptools.setup( name='command', ... entry_points={ 'console_scripts': [ 'command = command.__main

setup.py install_require with options

ぃ、小莉子 提交于 2020-01-14 12:35:56
问题 I need to add rjsmin to my dependencies via install_require in a setup.py. rjsmin offers a way to disable the c-extension by using the --without-c-extensions switch like following python setup.py install --without-c-extensions I wonder, how to add this switch to the install_require string. 回答1: You need to provide an --install-option or --global-option along with the requirement text. You can refer the doc here 回答2: I solved my problem of installing dependencies with global-options by sub

Add folders and subfolders outside of main module using setuptools(setup.py)

我只是一个虾纸丫 提交于 2020-01-14 03:32:14
问题 So it is yet another similar looking but different question than setuptools: adding additional files outside package and Including non-Python files with setup.py. I have structure very similar to that of first question -module -python_file1.py -python_file2.py -folder -subfolder1 -data_file_1.txt -subfolder2 -data_file_2.txt What I want: I want to install the packages along with the folder,subfolders and files within them. What I tried: Approach_1: If I move the folder inside the module then

Why find_packages(exclude=xxx) does not work when doing setup.py sdist?

自闭症网瘾萝莉.ら 提交于 2020-01-13 13:14:21
问题 I am packaging my source code, but I do not want to include tests and docs because it will be too big. To do that I include in my setup.py: setup(... packages=find_packages(exclude=['tests.*','tests','docs.*','docs']), ... ) When doing a python setup.py sdist I can see that my root tests/ and docs/ dirs and everything inside are still included in the generated distribution. It seems that only python setup.py bdist is sensible to the exclude parameter. Why ? is it possible to exclude dirs for

Passing the library path as a command line argument to setup.py

拟墨画扇 提交于 2020-01-12 14:27:28
问题 modules = [Extension("MyLibrary", src, language = "c++", extra_compile_args=["-fopenmp", "-std=c++11", "-DNOLOG4CXX"], # log4cxx is not currently used extra_link_args=["-fopenmp", "-std=c++11"], include_dirs=[os.path.join(os.path.expanduser("~"), (os.path.join(gtest, "include"))], library_dirs=[log4cxx_library, os.path.join(os.path.expanduser("~"), gtest)], libraries=["log4cxx", "gtest"])] This is a part of my setup.py script. How do I pass options like include_dirs or library_dirs through

Python: migrate setup.py “scripts=” to entry_points

情到浓时终转凉″ 提交于 2020-01-12 14:07:02
问题 I'd like to make use of someone else's python utility, foobartools , whose native environment is linux. Foobartools is pure python so there's no reason it can't be used on Windows, where I am. In their setup.py they're using the older style scripts=['bin/foobar'], . Running pip install -e b:\code\foobar creates a file called foobar in %pythonhome%\Scripts , but Windows doesn't know about it even though Scripts is in PATH. To use it I need to make a @python %pythonhome%\scripts\foobar batch