package made up of only .so's?

Hi All, I need to build a package which is made up of a set of .so's. These .so's are compiled elsewhere, so I just need to write an appropriate setup.py and bdist_wheel to get what I want. But that first part is where I'm struggling. Each of these .so's is essentially a top level python module. How do I tell setuptools' setup() function to basically just roll these into a wheel? Any help gratefully received! Chris

Try my new project, enscons. https://bitbucket.org/dholth/enscons . You can just wheel up whatever you want, without bothering with all this setup.py nonsense. Put your metadata in pyproject.toml, enscons' setup2toml script might help you generate that from setup.py. It might look something like this: import pytoml as tomlimport ensconsmetadata = dict(toml.load(open('pyproject.toml')))['tool']['enscons']# most specific binary, non-manylinux1 tag should be at the top of this listif True: import wheel.pep425tags for tag in wheel.pep425tags.get_supported(): full_tag = '-'.join(tag) if not 'manylinux' in tag: breakenv = Environment(tools=['default', 'packaging', enscons.generate], PACKAGE_METADATA=metadata, WHEEL_TAG=full_tag, ROOT_IS_PURELIB=False)sources = Glob('*.so')env.Whl('platlib', sources, root='.') On Mon, Jul 4, 2016 at 12:07 PM Chris Withers <chris@simplistix.co.uk> wrote:
Hi All,
I need to build a package which is made up of a set of .so's.
These .so's are compiled elsewhere, so I just need to write an appropriate setup.py and bdist_wheel to get what I want. But that first part is where I'm struggling.
Each of these .so's is essentially a top level python module. How do I tell setuptools' setup() function to basically just roll these into a wheel?
Any help gratefully received!
Chris
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig

Please install directly from the repository for now. On Thu, Jul 7, 2016, 07:13 Chris Withers <chris@simplistix.co.uk> wrote:
The release version on pypi doesn't seem to work...
(Appears to be missing setup2toml and doesn't sepcify pytoml as a dependency).
What's the current recommended way to install enscons?
Chris
On 04/07/2016 17:27, Daniel Holth wrote:
Try my new project, enscons. https://bitbucket.org/dholth/enscons . You can just wheel up whatever you want, without bothering with all this setup.py nonsense. Put your metadata in pyproject.toml, enscons' setup2toml script might help you generate that from setup.py. It might look something like this:
import pytoml as tomlimport enscons metadata = dict(toml.load(open('pyproject.toml')))['tool']['enscons'] # most specific binary, non-manylinux1 tag should be at the top of this listif True: import wheel.pep425tags for tag in wheel.pep425tags.get_supported(): full_tag = '-'.join(tag) if not 'manylinux' in tag: breakenv = Environment(tools=['default', 'packaging', enscons.generate], PACKAGE_METADATA=metadata, WHEEL_TAG=full_tag, ROOT_IS_PURELIB=False) sources = Glob('*.so')env.Whl('platlib', sources, root='.')
On Mon, Jul 4, 2016 at 12:07 PM Chris Withers <chris@simplistix.co.uk> wrote:
Hi All,
I need to build a package which is made up of a set of .so's.
These .so's are compiled elsewhere, so I just need to write an appropriate setup.py and bdist_wheel to get what I want. But that first part is where I'm struggling.
Each of these .so's is essentially a top level python module. How do I tell setuptools' setup() function to basically just roll these into a wheel?
Any help gratefully received!
Chris
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com ______________________________________________________________________

On Mon, Jul 4, 2016 at 6:53 PM, Chris Withers <chris@simplistix.co.uk> wrote:
Each of these .so's is essentially a top level python module. How do I tell setuptools' setup() function to basically just roll these into a wheel?
If you want to package arbitrary files take a look at this setup.py: https://github.com/pytest-dev/pytest-cov/blob/master/setup.py It should be simple enough to replicate, and it handles most ways to install, besides wheels. Thanks, -- Ionel Cristian Mărieș, http://blog.ionelmc.ro

On 04/07/2016 17:31, Ionel Cristian Mărieș wrote:
On Mon, Jul 4, 2016 at 6:53 PM, Chris Withers <chris@simplistix.co.uk <mailto:chris@simplistix.co.uk>> wrote:
Each of these .so's is essentially a top level python module. How do I tell setuptools' setup() function to basically just roll these into a wheel?
If you want to package arbitrary files take a look at this setup.py: https://github.com/pytest-dev/pytest-cov/blob/master/setup.py It should be simple enough to replicate, and it handles most ways to install, besides wheels.
Not sure I'm following, I don't see any handling for non-.py files in there... What line(s) should I be looking at? Chris

You could also probably use flit to do what you want: https://pypi.python.org/pypi/flit (It might require that you bundle the different modules into a single top level package. You might want to consider doing that regardless.) -n On Jul 4, 2016 9:07 AM, "Chris Withers" <chris@simplistix.co.uk> wrote:
Hi All,
I need to build a package which is made up of a set of .so's.
These .so's are compiled elsewhere, so I just need to write an appropriate setup.py and bdist_wheel to get what I want. But that first part is where I'm struggling.
Each of these .so's is essentially a top level python module. How do I tell setuptools' setup() function to basically just roll these into a wheel?
Any help gratefully received!
Chris
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig

Hi Chris, On 7 July 2016 at 11:49, Chris Withers <chris@simplistix.co.uk> wrote:
flit does look nice and clean, but appears to only support one module/package? Thomas, that ever likely to change?
That's by design, I'm afraid. I like one top-level module to correspond to one installable distribution. Flit also assumes that the wheels it's building are pure Python, so they get -none-any tags. Feel free to cannibalise code from flit to build your specific wheels, though. It's relatively easy to create a wheel without lots of tooling. For instance, I have a script that unpacks the Windows binary installers for PyQt4, reassembles the files into wheels, and uploads them to PyPI: https://github.com/takluyver/pyqt4_windows_whl Thomas
participants (5)
-
Chris Withers
-
Daniel Holth
-
Ionel Cristian Mărieș
-
Nathaniel Smith
-
Thomas Kluyver