setuptools

Add post-clean command to python setup.py

人走茶凉 提交于 2021-02-09 04:21:13
问题 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:20:57
问题 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

python alternative package setup using setuptools

旧城冷巷雨未停 提交于 2021-02-08 06:35:38
问题 I am having some trouble adding packages with my particular setup: . ├── pkg_a │ ├── pkg_a │ │ ├── __init__.py │ │ └── module_a.py │ └── run_a.py ├── pkg_b │ ├── pkg_b │ │ ├── __init__.py │ │ └── module_b.py │ └── run_b.py └── setup.py My goal is to be able to import package modules without repeating package name twice. For example, in run_a.py I'd like to be able to call from pkg_a import module_a instead of calling from pkg_a.pkg_a import module_a I tried to follow Section 2.1 of doc here.

Overriding Python setuptool's default include_dirs and library_dirs?

最后都变了- 提交于 2021-02-08 06:26:25
问题 I specify in setup.py the following include_dirs and library_dirs : /opt/x86_64-sdk-linux/usr/bin/python3 setup.py build_ext \ --include-dirs=/opt/neon-poky-linux-gnueabi/usr/include/python3.5m/ \ --library-dirs=/opt/neon-poky-linux-gnueabi/usr/lib/ \ --rpath=/opt/neon-poky-linux-gnueabi/usr/lib/ \ --plat-name=linux_armv7l However, the generated gcc commands (when executing python3 setup.py build_ext ) also include the include path where python3 is running from (I have added newlines for

Overriding Python setuptool's default include_dirs and library_dirs?

余生颓废 提交于 2021-02-08 06:26:00
问题 I specify in setup.py the following include_dirs and library_dirs : /opt/x86_64-sdk-linux/usr/bin/python3 setup.py build_ext \ --include-dirs=/opt/neon-poky-linux-gnueabi/usr/include/python3.5m/ \ --library-dirs=/opt/neon-poky-linux-gnueabi/usr/lib/ \ --rpath=/opt/neon-poky-linux-gnueabi/usr/lib/ \ --plat-name=linux_armv7l However, the generated gcc commands (when executing python3 setup.py build_ext ) also include the include path where python3 is running from (I have added newlines for

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

Python Setuptools installing additional files to users config directory

谁说胖子不能爱 提交于 2021-02-07 14:53:05
问题 I am trying to creat a Python module that has a utility command line program. I am using setuptools and Python3. I have the utility program being created just fine with the entry_points field of setup but I want to include a default configuration file and I want to place it in the user's home .config directory. Here is my package directory layout: ⤷ tree . ├── config │ └── spt.config ├── README.org ├── utilityTool │ ├── __init__.py │ ├── file1.py │ ├── file2.py │ └── tools │ ├── commandline

Python Setuptools installing additional files to users config directory

社会主义新天地 提交于 2021-02-07 14:52:45
问题 I am trying to creat a Python module that has a utility command line program. I am using setuptools and Python3. I have the utility program being created just fine with the entry_points field of setup but I want to include a default configuration file and I want to place it in the user's home .config directory. Here is my package directory layout: ⤷ tree . ├── config │ └── spt.config ├── README.org ├── utilityTool │ ├── __init__.py │ ├── file1.py │ ├── file2.py │ └── tools │ ├── commandline