Setuptools Binary Targets
Distutils/Setuptools provides a fantastic cross platform framework for building python packages, including binary extensions using your platforms standard c/c++ compiler.
Why should it be limited only to use on python pyd extensions however, there’s nothing to stop it being used for compiling anything with said comiler, such as executables and static libraries.
Well it turns out all the functionality is already there, it just isn’t really exposed to the end user very easily. This is easily rectified however:
from setuptools import setup
from ext_targets import build_ext, StaticLib, Executable
setup(
name='binaries!', # This isn't actually used in the built targets
cmdclass={'build_ext': build_ext},
ext_modules=ext_modules = [
StaticLib(
name='saveforlater',
sources=['lib.c', 'required.c'],
include_dirs=['../include']
),
Executable(
name='my_program',
sources=['source.c', 'extra.cpp'],
libraries=['libsaveforlater']
language='c++',
include_dirs=['../include'],
extra_compile_args=['-static'],
extra_link_args=['-static']
)
]
)
Metadata
Release files for setuptools_bin_targets 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| setuptools_bin_targets-1.3.tar.gz | 3.0 kB | Without provenance | Details for setuptools_bin_targets-1.3.tar.gz |
Release files / setuptools_bin_targets-1.3.tar.gz
| Download URL | setuptools_bin_targets-1.3.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ebdbd0dcef10024a3fabe74845a76f890458a250fe09a656835f3f8de0de0377
|
|
BLAKE2b-256 checksum How to use checksums |
15cd55d905a085cd49066a444d33129ff6164fd42bfd59d3f03f03fab231aeab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for setuptools_bin_targets 1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.