{"id":26579940,"url":"https://github.com/obriencj/koji-typing","last_synced_at":"2026-02-21T09:32:21.346Z","repository":{"id":234462130,"uuid":"788934974","full_name":"obriencj/koji-typing","owner":"obriencj","description":"Experimental typing support for Koji","archived":false,"fork":false,"pushed_at":"2025-10-28T14:39:56.000Z","size":178,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T16:29:40.277Z","etag":null,"topics":["koji","mypy-stubs","type-annotations"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obriencj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-19T11:30:05.000Z","updated_at":"2025-10-28T14:40:00.000Z","dependencies_parsed_at":"2024-05-19T15:24:30.505Z","dependency_job_id":"a2bbcceb-5291-4dad-a3ff-7a33b03b1fd1","html_url":"https://github.com/obriencj/koji-typing","commit_stats":null,"previous_names":["obriencj/koji-typing"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/obriencj/koji-typing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obriencj%2Fkoji-typing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obriencj%2Fkoji-typing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obriencj%2Fkoji-typing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obriencj%2Fkoji-typing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obriencj","download_url":"https://codeload.github.com/obriencj/koji-typing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obriencj%2Fkoji-typing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29678237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["koji","mypy-stubs","type-annotations"],"created_at":"2025-03-23T06:29:34.460Z","updated_at":"2026-02-21T09:32:21.320Z","avatar_url":"https://github.com/obriencj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\n\n`preoccupied.koji-typing` is an experimental distribution which\nprovides typing support for the [koji] package.\n\nIt is currently a Work In-Progress, there are still many signatures\nto be added. The initial starting point was simply the set of\nhub calls that were being used by [koji-smoky-dingo]. This project\naims to fill out everything.\n\n[koji-smoky-dingo]: https://github.com/obriencj/koji-smoky-dingo\n\n[koji]: https://pagure.io/koji\n\n**This project is neither enodorsed, nor supported, by the upstream\n[Koji] project**.\n\nThis repository exists because I had a number of opinions on how to\nproduce the typing support. There is an open [issue] in the upstream\nto start including typing stubs. However, because koji still supports\nPython 2, they are limited to only providing stubs. This means that\ntheir `TypedDict` declarations are also constrained purely to the stub\ndefinitions. The problem with this approach is that one cannot import\ntyping declarations from a stub for use in a non-stub. While [MyPy]\ncan infer some of the fields from the usage of the return values this\nway, anything more complex than mutating the fields in the same\nfunction they are obtained becomes un-checkable. One could not declare\nhelper functions and then annotate them to make it clear that they\noperate specifically on the `BuildInfo` structure, because `BuildInfo`\ncould not be imported and used for the annotation during runtime\nloading of the hypothetical module.\n\n[issue]: https://pagure.io/koji/issue/3708\n\n\n## Runtime package\n\nThe runtime-available `koji_types` package provides a number of\n`TypedDict` definitions which provide structure for the numerous\ndictionary result types returned by koji's `ClientSession`\ninterface. These types can be used to annotate your client code in\norder to later perform anaylsis. It also provides some Pythonic\nenumerations for some koji constant values.\n\n\n## Static analysis package\n\nFollowing [PEP-561] guidelines the packages `koij-stubs`,\n`koji_cli-stubs`, and `kojihub-stubs` provide partial stub annotations\nfor use during static analysis with tools like [MyPy]. These all rely\non the `koji_types` package definitions in order to supply accurate\nsignatures for many of the dict-based results.\n\n[PEP-561]: https://peps.python.org/pep-0561/\n\n[MyPy]: https://mypy-lang.org\n\n\n## Caveats\n\nI have not been able to figure out how to provide typing annotations\nto correctly reflect the return type change of `ClientSession` calls\nwhich support a `queryOpts` in the use case of `countOnly = True`. In\nthose calls the return type is actually an `int` but I haven't found a\nway to provide an override annotation that shows this.\n\n```python\n# here the return type is List[UserInfo]\nfriends = session.listUsers()\n\n# here the return type is actually int, but no annotation support\n# exists for this scenario so static analysis will still think\n# it's a List[UserInfo]\nhowmany = session.listUsers(queryOpts={\"countOnly\": True})\n```\n\n\n## Contact\n\nAuthor: Christopher O'Brien  \u003cobriencj@preoccupied.net\u003e\n\nOriginal Git Repository: \u003chttps://github.com/obriencj/koji-typing\u003e\n\n\n## License\n\nThis library is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 3 of the License, or (at\nyour option) any later version.\n\nThis library is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nGeneral Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this library; if not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobriencj%2Fkoji-typing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobriencj%2Fkoji-typing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobriencj%2Fkoji-typing/lists"}