koji-containerbuild icon indicating copy to clipboard operation
koji-containerbuild copied to clipboard

PyPI release

Open ifireball opened this issue 2 years ago • 5 comments

Could this project be released to PyPi so it can be installable via thing like Pipenv and Poetry?

ifireball avatar Dec 08 '22 08:12 ifireball

Uploading it into pypi is easy, can be done instantly, but I assume you want to use it as CLI plugin koji container-build

In this case it will not work, because in RPM we copy CLI plugin into %{python3_sitelib}/koji_cli_plugins so we have to update setup.py somehow or if it's not working, we have to do some magic with entrypoints and koji.

I'll check

MartinBasti avatar Dec 08 '22 14:12 MartinBasti

sorry I haven't found an quick way how to do it and make it workable, this would require changes to both koji and koji-c codebases.

MartinBasti avatar Dec 15 '22 15:12 MartinBasti

Hi @MartinBasti , what kind of changes are required? and what kind of copy do you do in the RPM? cli, hub and builder can perform separately?

Omeramsc avatar Dec 18 '22 10:12 Omeramsc

It seems that koji package doesn't support plugins via entrypoints [1], and I'm not sure how to copy content of this package into another without it. Theoretically we could do namespace package [2] in koji-container build but it needs changes in repo and I'm not sure if it will work as expected.

This is where we do copy operations in RPM https://github.com/containerbuildsystem/koji-containerbuild/blob/master/koji-containerbuild.spec#L116

[1] https://pagure.io/koji/blob/master/f/cli/koji#_65 [2] https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/

MartinBasti avatar Dec 19 '22 09:12 MartinBasti

Or another way could be to copy it just as data_file, but it looks very hackish

setup(...
    data_files=[(os.path.join(sys.prefix,..., 'koji_cli_plugins'), ['plugins/cli_containerbuild.py'])],
    ...
)

MartinBasti avatar Dec 19 '22 10:12 MartinBasti