setuptools

Add custom action to setup.py

南楼画角 提交于 2021-02-10 15:44:43
问题 I have the project with such structure: Project/ Project/ __init__.py config.py setup.py .gitignore config.py contains two variables ( LOGIN , PASS ) and is added to .gitignore . I would like to add custom action to setup.py then run python setup.py install than triggered creating config.py with some inputs("Please write your login/pass") prior to installation of package. How to do it right? 回答1: It is not a good idea to do any customization at install time . It is good practice to do

Installing setuptools from source “No module named numbers” error

天大地大妈咪最大 提交于 2021-02-10 12:35:40
问题 This is based on Install Python Flask without using pip My environment has no rpms installed or enabled, nor do I have pip, easy_install, virtualenv, etc. Based on the answer in the linked question, I need to install setuptools in order to install Jinja. To do this, I downloaded and un-tared setuptools-19.1.1.tar.gz. I then run the following command and get an ImportError: $python setup.py install Traceback (most recent call last): File "setup.py", line 21, in <module> exec(init_file.read(),

Installing setuptools from source “No module named numbers” error

时光怂恿深爱的人放手 提交于 2021-02-10 12:35:27
问题 This is based on Install Python Flask without using pip My environment has no rpms installed or enabled, nor do I have pip, easy_install, virtualenv, etc. Based on the answer in the linked question, I need to install setuptools in order to install Jinja. To do this, I downloaded and un-tared setuptools-19.1.1.tar.gz. I then run the following command and get an ImportError: $python setup.py install Traceback (most recent call last): File "setup.py", line 21, in <module> exec(init_file.read(),

How to I change the Manifest.in depending on the extra_requires I wish to use?

坚强是说给别人听的谎言 提交于 2021-02-10 05:31:09
问题 My problem is that a project I'm working with comes shipped with all of the training data needed to reproduce its results. I want the default installation ( pip install package ) to include all this stuff, but a specific installation ( pip install package[train_only] ) to not. The two ways I want to slim it down are: Having different manifests for the default and the train_only version, where the default manifest is more inclusive, and Having different install_requires for each, where the

setup.py not installing swig extension module

半世苍凉 提交于 2021-02-09 09:31:57
问题 I'm struggling to figure out how to copy the wrapper generated by swig at the same level than the swig shared library. Consider this tree structure: │ .gitignore │ setup.py │ ├───hello ├───src │ hello.c │ hello.h │ hello.i │ └───test test_hello.py and this setup.py: import os import sys from setuptools import setup, find_packages, Extension from setuptools.command.build_py import build_py as _build_py class build_py(_build_py): def run(self): self.run_command("build_ext") return super().run()

With setuptools, “optional” C extension module error is fatal

可紊 提交于 2021-02-09 07:02:55
问题 I'm putting a little time into getting my treap module (like a dict, but always sorted by key) working with setuptools 39.0.1. I want it to be able to compile and install the Cython version from an included .c file, or to fall back on a pure python version if that fails. I'm currently using: setup( name='treap', py_modules=[ 'treap', 'py_treap', 'nest', ], # ext_modules=cythonize("pyx_treap.pyx"), ext_modules=[Extension('pyx_treap', ['pyx_treap.c'], optional=True)], # setup_requires=[ #

With setuptools, “optional” C extension module error is fatal

橙三吉。 提交于 2021-02-09 07:00:28
问题 I'm putting a little time into getting my treap module (like a dict, but always sorted by key) working with setuptools 39.0.1. I want it to be able to compile and install the Cython version from an included .c file, or to fall back on a pure python version if that fails. I'm currently using: setup( name='treap', py_modules=[ 'treap', 'py_treap', 'nest', ], # ext_modules=cythonize("pyx_treap.pyx"), ext_modules=[Extension('pyx_treap', ['pyx_treap.c'], optional=True)], # setup_requires=[ #

With setuptools, “optional” C extension module error is fatal

会有一股神秘感。 提交于 2021-02-09 06:58:07
问题 I'm putting a little time into getting my treap module (like a dict, but always sorted by key) working with setuptools 39.0.1. I want it to be able to compile and install the Cython version from an included .c file, or to fall back on a pure python version if that fails. I'm currently using: setup( name='treap', py_modules=[ 'treap', 'py_treap', 'nest', ], # ext_modules=cythonize("pyx_treap.pyx"), ext_modules=[Extension('pyx_treap', ['pyx_treap.c'], optional=True)], # setup_requires=[ #

Add post-clean command to python setup.py

只谈情不闲聊 提交于 2021-02-09 04:26:02
问题 From resources online, I've learned that the following will add a "post-install" hook if included in setup.py : from setuptools import setup from setuptools.command.install import install as _install class install(_install): def run(self): _install.run(self) # Do something magical setup(cmdclass={'install': install}) What I'd like to do, though, is create equivalent behavior after a setup.py clean is executed. Specifically, I'd like setup.py clean to remove the .egg-INFO directory created

Add post-clean command to python setup.py

别等时光非礼了梦想. 提交于 2021-02-09 04:21:33
问题 From resources online, I've learned that the following will add a "post-install" hook if included in setup.py : from setuptools import setup from setuptools.command.install import install as _install class install(_install): def run(self): _install.run(self) # Do something magical setup(cmdclass={'install': install}) What I'd like to do, though, is create equivalent behavior after a setup.py clean is executed. Specifically, I'd like setup.py clean to remove the .egg-INFO directory created