Skip to main content

This project provides Python bindings to pkgconf.

Building pypkgconf wheel

pip install build
python -m build -Csetup-args="-Ddefault_library=static"

Building on Windows

On Windows, you want to link with the static version of libpkgconf. You also want to use release buildtype.

pip install build
python -m build  -Csetup-args="-Ddefault_library=static" -Csetup-args="-Dbuildtype=release"

Running tests

You need a recent version of meson.

pip install pytest cffi
meson setup . build -Ddefault_library=static -Dbuildtype=release
meson test -C build

Using pypkgconf

The API is very close to the original C code.

cli-like API

This high-level API uses same arguments as the pkgconf executable.

Results are returned as a list of string (the list may be empty). Errors and warnings are logger using the standard Python logging module, under the pkgconf logger. In case or error result, a pypkgconf.PkgConfError exception is raised.

pypkgconf.query_args(command: str, env: dict[str, str] | None = None) -> list[str]

The command is just like the command line arguments (e.g.: "--libs foo")

If env is provided, pkgconf will use it for any envvar it queries. If env is None (default), os.environ is used.

pypkgconf.query(args: list[str] | None, **kwargs) -> list[str]

Positional arguments are given as a list of strings.

Optional arguments are given either using an union of pypkgconf.Flags, or as keyword arguments, depending if it is a boolean value or not.

low-level API

The cffi interface to c function is provided through pypkgconf._libpkgconf.lib and pypkgconf._libpkgconf.ffi.

Please refer to pkgconf code and to cffi documentation, or use the high-level interface as a reference on how to use it.

Release files for pypkgconf 2.1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypkgconf 2.1.1.1
File Size Uploaded
pypkgconf-2.1.1.1.tar.gz 26.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypkgconf 2.1.1.1
File Interpreter ABI Platform
pypkgconf-2.1.1.1-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details

Total release size: 136.2 kB

Release files / pypkgconf-2.1.1.1.tar.gz

Download URL pypkgconf-2.1.1.1.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fd951a4494afa24d77320f7ddeb912a6cda890a51d7ae3e5cf576e2571db1c98
BLAKE2b-256 checksum
How to use checksums
7678c4c2138719d49cf46d0b93a2791b924437f6b5b7139582de03ceb126284f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Release files / pypkgconf-2.1.1.1-cp37-abi3-win_amd64.whl

Download URL pypkgconf-2.1.1.1-cp37-abi3-win_amd64.whl
Size 109.5 kB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b04180c395a63243cbb4d439183eb4245a4674b6667ae1ab67871cc782f5cdfd
BLAKE2b-256 checksum
How to use checksums
d117b0d65702dd4c05e3c6abefdbbc52c444260f04caa28aa35624ad02c1d90e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Release history Release notifications | RSS feed

This release

2.1.1.1 This release

2 release files

2.1.1

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page