setup.py

python setup.py configuration to install files in custom directories

本小妞迷上赌 提交于 2019-12-20 18:04:50
问题 I want to create a setup.py which would install my files into custom directories. I have a certain prefix, where I would like to get the following result: /my/prefix/ bin/ script.sh libexec/ one.py two.py ... lib/pythonX.Y/site-packages/ package/... My initial project is following: / script.sh one.py two.py ... setup.py package/... __init__.py ... What would be the best way to achieve that? I would like to be able to install it later with something like: python setup.py install --prefix=/my

Cygwin - How to install ansible?

佐手、 提交于 2019-12-20 10:41:59
问题 How to get / install ansible using Cygwin? I tried the following steps but it's didn't work during bullet 5 (while running " python setup.py install "). Steps taken from: Taken from https://servercheck.in/blog/running-ansible-within-windows 1) Download and install Cygwin, with at least the following packages selected (you can select the packages during the install process): libyaml libyaml-devel curl python (2.7.x) python-crypto python-openssl python-paramiko python-setuptools git (2.1.x) vim

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

How can I use jython setup.py install?

ぃ、小莉子 提交于 2019-12-19 11:18:35
问题 I am using a Jython virtualenv where I can install whatever software via pip or via easy_install, but there is a software that is not registered yet and the installation mode via: [sudo] python setup.py install and I am trying to do the same with jython: [sudo] jython setup.py install So, I am getting these follow errors: Traceback (most recent call last): File "setup.py", line 3, in <module> from setuptools import setup, find_packages ImportError: No module named setuptools I checked and

How to create a Pure-Python wheel

雨燕双飞 提交于 2019-12-19 06:52:05
问题 From the following setup.py file, I am trying to create a pure-python wheel from a project that should contain only python 2.7 code. from setuptools import setup setup( name='foo', version='0.0.1', description='', url='', install_requires=[ 'bpython', 'Django==1.8.2', ], ) However, when I run python setup.py bdist_wheel the wheel file that is generated is platform specific foo-0.0.1-cp27-none-macosx_10_9_x86_64.whl wheel file instead of the expected foo-0.0.1-cp27-none-any.whl . When I try to

How to add package data recursively in Python setup.py?

允我心安 提交于 2019-12-18 10:55:10
问题 I have a new library that has to include a lot of subfolders of small datafiles, and I'm trying to add them as package data. Imagine I have my library as so: library - foo.py - bar.py data subfolderA subfolderA1 subfolderA2 subfolderB subfolderB1 ... I want to add all of the data in all of the subfolders through setup.py, but it seems like I manually have to go into every single subfolder (there are 100 or so) and add an init .py file. Furthermore, will setup.py find these files recursively,

Difference between extras_require() and install_requires() in setup.py?

爷,独闯天下 提交于 2019-12-18 05:27:21
问题 I am trying to understand the difference between extras_require() and install_requires() in setup.py but couldn't get it. Both are used for installing Python dependencies, but what's the difference between them? 回答1: According to the setuptools documentation, extras_require A dictionary mapping names of “extras” (optional features of your project) to strings or lists of strings specifying what other distributions must be installed to support those features. and install_requires A string or

Difference between setup.py install and setup.py develop

佐手、 提交于 2019-12-18 04:12:41
问题 I am trying to improve my workflow when developing python modules and have a rather basic question. What exactly happens when choosing either option. To my knowledge develop leaves the files in place so I can modify them and play around with the package whereas install copies them in the site-packages folder of my python installation. How is the package linked to my python installation when using the develop option. 回答1: develop creates an .egg-link file in the site-packages directory, which

Any python function to get “data_files” root directory?

对着背影说爱祢 提交于 2019-12-18 02:19:08
问题 This should be a very common question for developers who used "setup.py" to build installation packages and it should be asked before but I couldn't find the proper answer anywhere. In setup.py from distutils.core import setup setup( ...., ...., data_files=[('MyApp/CBV', ['myapp/data/CBV/training.cbv', 'myapp/data/CBV/test.cbv'])], ...., ...., ) Result of sudo python setup.py install running install running build running build_py running build_scripts running install_lib running install

Package only binary compiled .so files of a python library compiled with Cython

 ̄綄美尐妖づ 提交于 2019-12-17 22:52:26
问题 I have a package named mypack which inside has a module mymod.py , and the __init__.py . For some reason that is not in debate, I need to package this module compiled (nor .py or .pyc files are allowed). That is, the __init__.py is the only source file allowed in the distributed compressed file. The folder structure is: . │ ├── mypack │ ├── __init__.py │ └── mymod.py ├── setup.py I find that Cython is able to do this, by converting each .py file in a .so library that can be directly imported