setuptools

Exclude single source file from python bdist_egg or bdist_wheel

时间秒杀一切 提交于 2019-12-22 10:07:24
问题 Background: I have one source file which is responsible for security. In there are magic keys and specific algorithms. Is it possible to remove a this single source file from a python egg or wheel package? I already accomplished to ship only binarys with the the egg command. python setup.py bdist_egg --exclude-source-files Edit Project structure: ├── setup.py ├── src | ├── __init__.py | ├── file1.py | ├── file2.py | ├── file_to_exclude.py Thanks for your help! 回答1: Unfortunately, neither

How to have PyPI package install header files for C extension with distutils/setuptools?

心已入冬 提交于 2019-12-22 09:20:12
问题 We have a package (rebound) up on PyPI that includes a C extension . The relevant part of the setup.py file looks like this (simplified): libreboundmodule = Extension('librebound', sources = [ 'src/rebound.c'], include_dirs = ['src'],) Additional libraries need access to rebound.h, but when one runs pip install rebound it doesn't install rebound.h anywhere. How can we get distutils/setuptools to install rebound.h somewhere along with all the python modules? We're hoping that we can have pip

Install package with separate source directory in editable mode

六月ゝ 毕业季﹏ 提交于 2019-12-22 09:08:01
问题 Situation This is the structure of an example package: $ tree Foo/ Foo/ ├── setup.py └── src ├── bar.py └── __init__.py The package's name shall be foo however the package's source files are placed in the src folder. The files' contents are: setup.py: from setuptools import setup setup( name='foo', version='1', packages=['foo'], package_dir={'foo': 'src'} ) __init__.py: from .bar import bar print(bar) bar.py: bar = 1 Problem When doing pip install Foo everything is fine and I can use the

Install python package from private pypiserver

本小妞迷上赌 提交于 2019-12-22 06:20:21
问题 I have setup a pypiserver behind an nginx proxy which uses htpasswd for authentication. I am currently able to upload sdists, but I can't figure out how to download them. I want to be able to download them when running setup.py test and somehow by using pip . Is this possible? [distutils] index-servers = private [private] repository = https://example.com/pypi username = remco password = mypass To make it extra hard the server is currently using a non verified ssl connection. I tried the

Override the shebang mangling in python setuptools

我与影子孤独终老i 提交于 2019-12-22 05:45:09
问题 Background I write small python packages for a system that uses modules (https://luarocks.org/) to manage packages. For those of you who don't know it, you can run module load x and a small script is run that modifies various environmental variables to make software 'x' work, you can then undo this with module unload x . This method of software management is nearly ubiquitous in scientific computing and has a lot of value in that arena: you can run ancient unmaintained software alongside

Namespace packages with a core part?

∥☆過路亽.° 提交于 2019-12-22 04:09:31
问题 This question follows up The way to make namespace packages in Python and How do I create a namespace package in Python?. Note PEP 420, and the distribute docs, which state: You must NOT include any other code and data in a namespace package’s __init__.py . Even though it may appear to work during development, or when projects are installed as .egg files, it will not work when the projects are installed using “system” packaging tools – in such cases the __init__.py files will not be installed

Mac Python Setuptools Installing in Wrong Directory

↘锁芯ラ 提交于 2019-12-22 01:29:26
问题 Prior to today, executing sudo python setup.py install would install my desired module to /Library/Python/2.7/site-packages/ . However, today it has been trying to install to /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ . The only installs that occurred between these changes were Macports, updating Command Line Tools for Xcode, and OS X El Capitan update. How can I change the default setuptools install path back to /Library/Python/2.7

Python setuptools not including C++ standard library headers

旧巷老猫 提交于 2019-12-21 18:12:12
问题 I'm trying to compile a Python wrapper to a small C++ library I've written. I've written the following setup.py script to try to use setuptools to compile the wrapper: from setuptools import setup, Extension import numpy as np import os atmcmodule = Extension( 'atmc', include_dirs=[np.get_include(), '/usr/local/include'], libraries=['mcopt', 'c++'], # my C++ library is at ./build/libmcopt.a library_dirs=[os.path.abspath('./build')], sources=['atmcmodule.cpp'], language='c++', extra_compile

setup.py check if non-python library dependency exists

旧街凉风 提交于 2019-12-21 17:06:32
问题 I'm trying to make a setup.py for cgal-bindings. To install this, the user needs to have at least a certain version of CGAL. In addition, CGAL has a few optional targets that should be built if the user has some libraries (like Eigen3). Is there a cross-platform way in Python to check for this? I can use find_library in ctypes.util to check if the library exists, but I don't see any easy way to get the version . <-- This doesn't actually work all the time, some libraries are header-only like

setuptools: data files included with `bdist` but not with `sdist`

爱⌒轻易说出口 提交于 2019-12-21 09:14:34
问题 I've got a setup.py file which looks like this: #!/usr/bin/env python from setuptools import setup, find_packages setup( name="foo", version="1.0", packages=find_packages(), include_package_data=True, package_data={ "": ["*"], }, ) And a package foo which looks like this: foo/__init__.py foo/bar.txt When I run setup.py bdist , the bar.txt file is (correctly) included in the distribution… But when I use setup.py sdist it isn't. What's up with that? Am I misunderstanding the meaning of package