# Conan-stubs: Type stubs for Conan
![https://pypi.org/project/conan-stubs/](https://img.shields.io/pypi/v/conan-stubs)
![PyPI Python versions](https://img.shields.io/pypi/pyversions/conan-stubs)
![Downloads](https://img.shields.io/pypi/dm/conan-stubs)
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
* tool_requires, build_requires, requires are annotated with only their function signature
* settings are annotated by their setter information for the class variable
* Every annotation is in the file, but commented out
* See https://github.com/python/mypy/issues/3004 and https://github.com/microsoft/pylance-release/issues/1735
### 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
Raw data
{
"_id": null,
"home_page": "",
"name": "conan-stubs",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "conan,stubs",
"author": "Peter Gosztolya",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/9d/5a/130f06770d4398b2e96b7abf5b43d24897b219f542342b05a62fe5405619/conan-stubs-1.59.0a4.tar.gz",
"platform": null,
"description": "# Conan-stubs: Type stubs for Conan\n![https://pypi.org/project/conan-stubs/](https://img.shields.io/pypi/v/conan-stubs)\n![PyPI Python versions](https://img.shields.io/pypi/pyversions/conan-stubs)\n![Downloads](https://img.shields.io/pypi/dm/conan-stubs)\n\nType stubs for specific conan versions for authoring Conanfiles.\nVersions of this package will correspond to the corresponding conan minor version.\n\n* Generated with mypy via `stubgen -p conans --include-private` to fill up package, so everything resolves\n* model.conan_file is handcrafted and functions are documented with basic descriptions\n* Selectable string values are annotated and scm attribute is fully type hinted as TypedDict\n\n## Why use type stubs instead of the bundled pylint plugin?\n\n* Only usable with pylint, which is very unperformant and newer tools as Ruff can not work with this\n* Methods are still missing (e.g. tool_requires)\n* No autocomplete from pylint\n\n## Limitations\n\n* tool_requires, build_requires, requires are annotated with only their function signature\n* settings are annotated by their setter information for the class variable\n* Every annotation is in the file, but commented out\n* See https://github.com/python/mypy/issues/3004 and https://github.com/microsoft/pylance-release/issues/1735\n\n### Details\n\nMethods which also can be used as class variables can not be annotated directly:\n```\n...\ntool_requires = \"cmake/3.25.3\"\ndef build_requirements(self):\n self.tool_requires(\"cmake/3.25.3\")\n```\n\nThe annotation would look like this with a property plus method, but can not be interpreted:\n```\n@property\n@overload\ndef tool_requires(self) -> None: ...\n@overload\ndef tool_requires(self, requirement: str, force_host_context: bool=False) -> None: ...\n@tool_requires.setter\ndef tool_requires(self, value: Optional[Iterable[str]]): ...\n```\n\n## Supported conan versions:\n * 1.59\n\n## Supported Python versions:\n * minimum 3.8\n\n\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Conan type stubs",
"version": "1.59.0a4",
"project_urls": null,
"split_keywords": [
"conan",
"stubs"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2b714aecd329abf4eed4403e4f93008f01add42c7fd8c326b4b53381a59b3b7c",
"md5": "17c463de7594362ee83cb99e59cf6eae",
"sha256": "4d63e9b34f3a33e97c0121e464cd4c7a17fb69c64910197238ee3f1717e33037"
},
"downloads": -1,
"filename": "conan_stubs-1.59.0a4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "17c463de7594362ee83cb99e59cf6eae",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 197394,
"upload_time": "2023-10-19T06:26:35",
"upload_time_iso_8601": "2023-10-19T06:26:35.739182Z",
"url": "https://files.pythonhosted.org/packages/2b/71/4aecd329abf4eed4403e4f93008f01add42c7fd8c326b4b53381a59b3b7c/conan_stubs-1.59.0a4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9d5a130f06770d4398b2e96b7abf5b43d24897b219f542342b05a62fe5405619",
"md5": "d7786a8e0743e5b4e3112e7bdd2e10da",
"sha256": "bdc1a13b2e271cf43f4c370c6765163d324aa95499c4472c56b6530e2144db75"
},
"downloads": -1,
"filename": "conan-stubs-1.59.0a4.tar.gz",
"has_sig": false,
"md5_digest": "d7786a8e0743e5b4e3112e7bdd2e10da",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 93149,
"upload_time": "2023-10-19T06:26:37",
"upload_time_iso_8601": "2023-10-19T06:26:37.238123Z",
"url": "https://files.pythonhosted.org/packages/9d/5a/130f06770d4398b2e96b7abf5b43d24897b219f542342b05a62fe5405619/conan-stubs-1.59.0a4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-19 06:26:37",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "conan-stubs"
}