skillfed

setuptools-dso

setuptools extension to build non-python shared libraries

setuptools-dso v2.12.3 86.6K downloads/30d#13,846 on PyPI13
Permissive license BSD Active released

What it is and what it does

setuptools_dso extends setuptools to compile non-Python shared libraries directly during wheel creation, letting you build C/C++ code as part of the standard Python packaging workflow. Instead of maintaining a separate Makefile or build system and pre-compiling binaries, you define your library sources in setup.py and setuptools_dso handles compilation across platforms.

The package is designed for projects that need to ship compiled native code alongside Python modules—common in scientific computing, systems programming, and performance-critical libraries. It integrates into the standard setuptools build pipeline, so the resulting wheels contain both your Python code and the compiled shared objects, making distribution and installation straightforward for end users.

Use it for:

  • Build and distribute C libraries as part of a Python package without maintaining external build scripts
  • Create Python wheels that bundle compiled native code for performance-critical components
  • Package EPICS (Experimental Physics and Industrial Control System) drivers and extensions
  • Distribute scientific or systems libraries that wrap C/C++ code and need to compile on user systems
  • Simplify CI/CD for projects with mixed Python and native code by using setuptools as the single build entry point

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

setuptools_dso is a setuptools plugin that builds non-Python shared libraries (like .so, .dylib, or .dll files) from source and packages them into Python wheels, replacing the need for external build systems.

Yes, if you need to build and ship non-Python shared libraries as part of a Python package. It eliminates the friction of maintaining separate build systems and integrates cleanly into the standard wheel workflow. The project is stable, actively maintained, has no known vulnerabilities, and carries a permissive license. Install only if you actually have native code to compile; it adds no value for pure-Python packages.

Install

setuptools-dso on PyPI

pip

pip install setuptools-dso

uv

uv add setuptools-dso

poetry

poetry add setuptools-dso

Installing setuptools-dso

Before you install

Installation is straightforward with low friction—a pure-wheel distribution with only setuptools as a runtime dependency. The project is actively maintained with recent commits and has been stable since its 2018 release.

License in practice

Licensed under BSD (permissive), so you can use and modify the package freely in both open-source and commercial projects with minimal restrictions.

Quickstart

pip install setuptools-dso

# In setup.py, import and use the extension:
from setuptools_dso import Extension
from setuptools import setup

setup(
    name='mypackage',
    ext_modules=[Extension('mylib', sources=['src/mylib.c'])]
)

Requires a C/C++ compiler toolchain available on the build system (gcc, clang, MSVC, etc.) to compile the shared libraries.

Verify before relying

  • Whether the package supports building C++ libraries in addition to C
  • What compiler flags and customization options are available for advanced build scenarios
  • Performance or size overhead compared to pre-built binary wheels

Package facts

License BSD (permissive)
Python support supports the current Python release (>=2.7)
Install friction low — pure-Python wheel
Runtime dependencies 1 — setuptools
Maintenance actively maintained — 184 days since the last release
Last repo commit
First released
Downloads 86,622/month — #13,846 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: setuptools_dso-2.12.3-py2.py3-none-any.whl

Development Status :: 5 - Production/StableFramework :: Setuptools PluginIntended Audience :: DevelopersProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Archiving :: Packaging

Tags

build shared libraries in python wheelssetuptools extension for C librariescompile native code in python packagingdynamic shared objects setuptoolsbundle compiled libraries in wheelsnon-python library build toolnative code packaging for python
build-systemnative-codepackaging

More Python Modules packages