Skip to main content

Conan type stubs

Project description

Conan-stubs: Type stubs for Conan

https://pypi.org/project/conan-stubs/ PyPI Python versions Downloads

Type stubs for specific conan versions for authoring Conanfiles. Versions of this package will correspond to the corresponding conan minor version.

  • Generated with mypy via stubgen -p conans --include-private to fill up package, so everything resolves
  • model.conan_file is handcrafted and functions are documented with basic descriptions
  • Selectable string values are annotated and scm attribute is fully type hinted as TypedDict

Why use type stubs instead of the bundled pylint plugin?

  • Only usable with pylint, which is very unperformant and newer tools as Ruff can not work with this
  • Methods are still missing (e.g. tool_requires)
  • No autocomplete from pylint

Limitations

Details

Methods which also can be used as class variables can not be annotated directly:

...
tool_requires = "cmake/3.25.3"
def build_requirements(self):
    self.tool_requires("cmake/3.25.3")

The annotation would look like this with a property plus method, but can not be interpreted:

@property
@overload
def tool_requires(self) -> None: ...
@overload
def tool_requires(self, requirement: str, force_host_context: bool=False) -> None: ...
@tool_requires.setter
def tool_requires(self, value: Optional[Iterable[str]]): ...

Supported conan versions:

  • 1.59

Supported Python versions:

  • minimum 3.8

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

conan-stubs-1.59.0a4.tar.gz (93.1 kB view hashes)

Uploaded Source

Built Distribution

conan_stubs-1.59.0a4-py3-none-any.whl (197.4 kB view hashes)

Uploaded Python 3

Supported by

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