Skip to main content

Python bindings to libpkgconf

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypkgconf-2.1.1.1.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypkgconf-2.1.1.1-cp37-abi3-win_amd64.whl (109.5 kB view details)

Uploaded CPython 3.7+Windows x86-64

File details

Details for the file pypkgconf-2.1.1.1.tar.gz.

File metadata

  • Download URL: pypkgconf-2.1.1.1.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for pypkgconf-2.1.1.1.tar.gz
Algorithm Hash digest
SHA256 fd951a4494afa24d77320f7ddeb912a6cda890a51d7ae3e5cf576e2571db1c98
MD5 27e996c3b44418635d19dd8229adee70
BLAKE2b-256 7678c4c2138719d49cf46d0b93a2791b924437f6b5b7139582de03ceb126284f

See more details on using hashes here.

File details

Details for the file pypkgconf-2.1.1.1-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: pypkgconf-2.1.1.1-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 109.5 kB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for pypkgconf-2.1.1.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b04180c395a63243cbb4d439183eb4245a4674b6667ae1ab67871cc782f5cdfd
MD5 fe7881768ca55a029b983a96dd4882e9
BLAKE2b-256 d117b0d65702dd4c05e3c6abefdbbc52c444260f04caa28aa35624ad02c1d90e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page