setuptools

pip: Any workaround to avoid --allow-external?

*爱你&永不变心* 提交于 2020-01-31 03:31:04
问题 Recent versions of pip installer hasn’t installed packages that do not upload their package files to PyPI unless the user explicitly provide --allow-external option (related answer). I want to distribute my package that depend on such library like dirspec. Currently I have to tell users of my package to install my package by the following command: $ pip install --allow-external dirspec MyPackage It becomes more problematic when it comes to library packaging. If my package is a library I also

How to include a shared C library in a Python package

删除回忆录丶 提交于 2020-01-31 02:08:03
问题 I have a project depending on a shared library. To make it clear from the beginning: the shared library is a pure C library and not a Python library. For reasons of simplicity I created a small demo project called pkgtest which I will refer to. So what needs to be done is: Run a Makefile to compile the library and place the compiled shared library (called libhello.so here) file somewhere it can be accessed from within the depending Python package. My best guess so far was to run the makefile

How to include a shared C library in a Python package

て烟熏妆下的殇ゞ 提交于 2020-01-31 02:05:49
问题 I have a project depending on a shared library. To make it clear from the beginning: the shared library is a pure C library and not a Python library. For reasons of simplicity I created a small demo project called pkgtest which I will refer to. So what needs to be done is: Run a Makefile to compile the library and place the compiled shared library (called libhello.so here) file somewhere it can be accessed from within the depending Python package. My best guess so far was to run the makefile

Is it possible to exclude data file sources and intermediary files from bdist?

橙三吉。 提交于 2020-01-30 12:23:46
问题 I am using setuptools to build a number of data files (compiled translations, icons resized and converted into different formats, etc.) and I would like to include the sources of these data files in to sdist and the build results but not their sources and and intermediary files into bdist_wheel . When I use package_data both sources, intermediary files and built files will be included into bdist_wheel . E.g. translation sources (.ts) are compiled into .qm files then included as part of a rcc

Is it possible to exclude data file sources and intermediary files from bdist?

家住魔仙堡 提交于 2020-01-30 12:23:45
问题 I am using setuptools to build a number of data files (compiled translations, icons resized and converted into different formats, etc.) and I would like to include the sources of these data files in to sdist and the build results but not their sources and and intermediary files into bdist_wheel . When I use package_data both sources, intermediary files and built files will be included into bdist_wheel . E.g. translation sources (.ts) are compiled into .qm files then included as part of a rcc

Python setuptools with company signed SSL certificate

断了今生、忘了曾经 提交于 2020-01-30 05:07:35
问题 I am new to setuptools on python. I added a package 'numpy' and 'tensorflow' to install_requires list and running python setup.py install. It does not install due to SSL issue. We use self signed SSL for https based urls. In case of pip for individual packages I can use --cert option. As I know setuptools use pip indirectly. If so, is there anyway to force it to use --cert option when setup.py is ran? 回答1: It turns out that we have actually two problems here. The problem about tensorflow is

Python setuptools with company signed SSL certificate

*爱你&永不变心* 提交于 2020-01-30 05:05:13
问题 I am new to setuptools on python. I added a package 'numpy' and 'tensorflow' to install_requires list and running python setup.py install. It does not install due to SSL issue. We use self signed SSL for https based urls. In case of pip for individual packages I can use --cert option. As I know setuptools use pip indirectly. If so, is there anyway to force it to use --cert option when setup.py is ran? 回答1: It turns out that we have actually two problems here. The problem about tensorflow is

Python打包之setuptools

£可爱£侵袭症+ 提交于 2020-01-26 03:25:55
参考链接1 参考链接2 参考链接3 一、setuptools介绍 Setuptools是Python Distutils的加强版,使开发者构建和发布Python包更加容易,特别是当包依赖于其他包时。用setuptools构建和发布的包与用Distutils发布的包是类似的。包的使用者无需安装setuptools就可以使用该包。如果用户是从源码包开始构建,并且没有安装过setuptools的话,则只要在你的setup脚本中包含一个bootstrap模块(ez_setup),用户构建时就会自动下载并安装setuptools了。 功能亮点: 利用EasyInstall自动查找、下载、安装、升级依赖包 创建Python Eggs 包含包目录内的数据文件 自动包含包目录内的所有的包,而不用在setup.py中列举 自动包含包内和发布有关的所有相关文件,而不用创建一个MANIFEST.in文件 自动生成经过包装的脚本或Windows执行文件 支持Pyrex,即在可以setup.py中列出.pyx文件,而最终用户无须安装Pyrex 支持上传到PyPI 可以部署开发模式,使项目在sys.path中 用新命令或setup()参数扩展distutils,为多个项目发布/重用扩展 在项目setup()中简单声明entry points,创建可以自动发现扩展的应用和框架 二、简单的例子

Define setup.py dependencies from a private PyPI

ぃ、小莉子 提交于 2020-01-24 08:50:07
问题 I'd like to install dependencies from my private PyPI by specifying them within a setup.py . I've already tried to specify where to find dependencies within the dependency_links this way: setup( ... install_requires=["foo==1.0"], dependency_links=["https://my.private.pypi/"], ... ) I've also tried to define the entire URL within the dependency_links : setup( ... install_requires=[], dependency_links=["https://my.private.pypi/foo/foo-1.0.tar.gz"], ... ) but when I try to install with python

Why do imports fail in setuptools entry_point scripts, but not in python interpreter?

橙三吉。 提交于 2020-01-24 04:10:32
问题 I have the following project structure: project |-project.py |-__init__.py |-setup.py |-lib |-__init__.py |-project |-__init__.py |-tools.py with project.py : from project.lib import * def main(): print("main") tool() if __name__ == "__main__": main() setup.py : from setuptools import setup setup( name = "project", version="1.0", packages = ["project", "project.lib"], package_dir = {"project": ".", "project.lib": 'lib/project'}, entry_points={ 'console_scripts': [ 'project = project.project