setup.py

How to include an executable file in setup.py

二次信任 提交于 2021-02-10 18:12:33
问题 I have a Python project that uses an executable file. The package structure is something like that: /Project /Package __init__.py aClass.py executableFile LICENSE README.md and I've this setup.py: ... setup( author=... author_email=.... classifiers=[...] description=.... install_requires=[...] license=.. long_description=... include_package_data=True packages=find_packages(include=['Package*']) url=.. version=x.x.x ) but when I upload the package as stated here with twine in PyPI, the

How to include an executable file in setup.py

≡放荡痞女 提交于 2021-02-10 18:05:17
问题 I have a Python project that uses an executable file. The package structure is something like that: /Project /Package __init__.py aClass.py executableFile LICENSE README.md and I've this setup.py: ... setup( author=... author_email=.... classifiers=[...] description=.... install_requires=[...] license=.. long_description=... include_package_data=True packages=find_packages(include=['Package*']) url=.. version=x.x.x ) but when I upload the package as stated here with twine in PyPI, the

Add custom action to setup.py

狂风中的少年 提交于 2021-02-10 15:52:41
问题 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

Add custom action to setup.py

為{幸葍}努か 提交于 2021-02-10 15:48:38
问题 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

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

Include minimum pip version in setup.py

强颜欢笑 提交于 2021-02-08 13:59:16
问题 I've created a setup.py for my application. Some of the dependencies i set in install_requires require pip version 19.3.1 or greater. Is there a way to check for pip version as part of setup.py? and to upgrade pip prior to build? 回答1: This is not your responsibility to build workarounds in your project for the issues in the packaging of other projects. This is kind of a bad practice. There is also not much point in doing this as part of a setup.py anyway since in many cases this file is not

including python file from project root in setup.py build

三世轮回 提交于 2021-02-07 19:49:39
问题 I am trying to include a python file in the build/lib directory created when running python setup.py install In particular, I would like to include a simple configuration file ('definitions.py') that defines a ROOT_DIR variable, which is then used by subpackages. The 'definitions.py' file contains: import os ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) My goal is to have configuration files within each subpackage ('config.py') call ROOT_DIR to build their own absolute paths: from

including python file from project root in setup.py build

て烟熏妆下的殇ゞ 提交于 2021-02-07 19:49:35
问题 I am trying to include a python file in the build/lib directory created when running python setup.py install In particular, I would like to include a simple configuration file ('definitions.py') that defines a ROOT_DIR variable, which is then used by subpackages. The 'definitions.py' file contains: import os ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) My goal is to have configuration files within each subpackage ('config.py') call ROOT_DIR to build their own absolute paths: from

including python file from project root in setup.py build

让人想犯罪 __ 提交于 2021-02-07 19:48:49
问题 I am trying to include a python file in the build/lib directory created when running python setup.py install In particular, I would like to include a simple configuration file ('definitions.py') that defines a ROOT_DIR variable, which is then used by subpackages. The 'definitions.py' file contains: import os ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) My goal is to have configuration files within each subpackage ('config.py') call ROOT_DIR to build their own absolute paths: from

How to use setup.py to install dependencies only?

醉酒当歌 提交于 2021-02-06 15:29:30
问题 I am not interested in installing my package itself but I am interested installing all the dependencies used by my package. Is there a way to do this using setup.py ? It seems setup.py installs my package and all dependencies. 回答1: Use the -e flag on pip install pip install -e . 回答2: The only way I've found to reliably do this in a straightforward manner is this: pip install . && pip uninstall `python setup.py --name` 来源: https://stackoverflow.com/questions/30797124/how-to-use-setup-py-to