From 55efda97f6f04aaeec748d9143059e34c812db7b Mon Sep 17 00:00:00 2001 From: Pavol Babincak Date: Dec 06 2017 13:50:24 +0000 Subject: [PATCH 1/6] Setuptools support Currently covers only client-side packages koji, koji.ssl and koji CLI. --- diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6db3f60 --- /dev/null +++ b/setup.py @@ -0,0 +1,57 @@ +from setuptools import setup + +setup( + name="koji", + version="1.11.1", + description=("Koji is a system for building and tracking RPMS. The base" + " package contains shared libraries and the command-line" + " interface."), + license="LGPLv2 and GPLv2+", + url="http://pagure.io/koji/", + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", + "Programming Language :: Python :: 2 :: Only", + "Topic :: Utilities" + ], + package_dir={'koji': 'koji'}, + packages=['koji', 'koji.ssl'], + scripts=['cli/koji'], + install_requires=[ + # To install all build requires: + # $ dnf install python-pip git krb5-devel gcc redhat-rpm-config \ + # glib2-devel sqlite-devel libxml2-devel python-devel \ + # openssl-devel libffi-devel + + # In a perfect world this would suffice: + # 'rpm', + # But rpm isn't available on PyPI so it needs to be installed other way. + + # To install it from upstream one would need to run ./autogen.sh and + # ./configure just to create setup.py with correct paths to header + # files. I wasn't able run it successfully anyway so it is easier to + # grab system package instead. + + # Install rpm python package system-wide: + # $ dnf install rpm-python + + # If you are running in virtualenv use following command to make + # system-wide rpm python package inside virtualenv: + # $ ln -vs $(/usr/bin/python -c 'import rpm, os.path; print os.path.dirname(rpm.__file__)') \ + # $(/usr/bin/env python -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())') + + 'pyOpenSSL', + 'python-dateutil', + 'python-krbV', + 'yum-metadata-parser', + # Note: urlgrabber package on PyPI has still bug + # https://bugzilla.redhat.com/show_bug.cgi?id=1200091 fixed yet. + 'urlgrabber', + ], + dependency_links=[ + 'git+git://yum.baseurl.org/yum-metadata-parser.git#egg=yum-metadata-parser-1.1.4', + 'git+git://yum.baseurl.org/urlgrabber.git#egg=urlgrabber-3.10.1', + ] +) From 7795464fa25f5819a7afb0b1b07b6a7065a0f4be Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Dec 06 2017 13:50:24 +0000 Subject: [PATCH 2/6] update setup.py for 1.14 Related: https://pagure.io/koji/issue/458 --- diff --git a/setup.py b/setup.py index 6db3f60..5ab14ce 100644 --- a/setup.py +++ b/setup.py @@ -1,57 +1,86 @@ +import sys from setuptools import setup +def get_install_requires(): + # To install all build requires: + # $ dnf install python-pip git krb5-devel gcc redhat-rpm-config \ + # glib2-devel sqlite-devel libxml2-devel python-devel \ + # openssl-devel libffi-devel + + # In a perfect world this would suffice: + # 'rpm', + # But rpm isn't available on PyPI so it needs to be installed other way. + + # To install it from upstream one would need to run ./autogen.sh and + # ./configure just to create setup.py with correct paths to header + # files. I wasn't able run it successfully anyway so it is easier to + # grab system package instead. + + # Install rpm python package system-wide: + # $ dnf install rpm-python + + # If you are running in virtualenv use following command to make + # system-wide rpm python package inside virtualenv: + # $ ln -vs $(/usr/bin/python -c 'import rpm, os.path; print(os.path.dirname(rpm.__file__))') \ + # $(/usr/bin/env python -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())') + # resp. for python3 + # $ ln -vs $(/usr/bin/python3 -c 'import rpm, os.path; print(os.path.dirname(rpm.__file__))') \ + # $(/usr/bin/env python -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())') + # Other options is to create virtualenv with --system-site-packages if + # it doesn't harm you. + + # pycurl can come without ssl backend (or bad one). In such case use + # $ pip uninstall pycurl; pip install pycurl --global-option="--with-nss" + # or different backend mentioned in error message (openssl, ...) + + requires = [ + 'pyOpenSSL', + 'pycurl', + 'python-dateutil', + 'requests', + 'requests-kerberos', + 'six', + #'libcomps', + #'rpm', + ] + if sys.version_info[0] < 3: + # optional auth library for older hubs + # hubs >= 1.12 are using requests' default GSSAPI + requires.append('python-krbV') + return requires + setup( name="koji", - version="1.11.1", + version="1.14.0", description=("Koji is a system for building and tracking RPMS. The base" " package contains shared libraries and the command-line" " interface."), license="LGPLv2 and GPLv2+", url="http://pagure.io/koji/", + author = 'Koji developers', + author_email = 'koji-devel@lists.fedorahosted.org', classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", - "Programming Language :: Python :: 2 :: Only", + "Natural Language :: English", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Operating System :: POSIX :: Linux", "Topic :: Utilities" ], - package_dir={'koji': 'koji'}, - packages=['koji', 'koji.ssl'], + packages=['koji', 'koji.ssl', 'koji_cli'], + package_dir={ + 'koji': 'koji', + 'koji_cli': 'cli/koji_cli', + }, + # doesn't make sense, as we have only example config + #data_files=[ + # ('/etc', ['cli/koji.conf']), + #], scripts=['cli/koji'], - install_requires=[ - # To install all build requires: - # $ dnf install python-pip git krb5-devel gcc redhat-rpm-config \ - # glib2-devel sqlite-devel libxml2-devel python-devel \ - # openssl-devel libffi-devel - - # In a perfect world this would suffice: - # 'rpm', - # But rpm isn't available on PyPI so it needs to be installed other way. - - # To install it from upstream one would need to run ./autogen.sh and - # ./configure just to create setup.py with correct paths to header - # files. I wasn't able run it successfully anyway so it is easier to - # grab system package instead. - - # Install rpm python package system-wide: - # $ dnf install rpm-python - - # If you are running in virtualenv use following command to make - # system-wide rpm python package inside virtualenv: - # $ ln -vs $(/usr/bin/python -c 'import rpm, os.path; print os.path.dirname(rpm.__file__)') \ - # $(/usr/bin/env python -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())') - - 'pyOpenSSL', - 'python-dateutil', - 'python-krbV', - 'yum-metadata-parser', - # Note: urlgrabber package on PyPI has still bug - # https://bugzilla.redhat.com/show_bug.cgi?id=1200091 fixed yet. - 'urlgrabber', - ], - dependency_links=[ - 'git+git://yum.baseurl.org/yum-metadata-parser.git#egg=yum-metadata-parser-1.1.4', - 'git+git://yum.baseurl.org/urlgrabber.git#egg=urlgrabber-3.10.1', - ] + python_requires='>=2.6', + install_requires=get_install_requires(), ) From f5285a06337eca624170d840b8f3a0f73d7d94eb Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Dec 06 2017 13:50:24 +0000 Subject: [PATCH 3/6] Makefile targets for PyPi --- diff --git a/Makefile b/Makefile index 5e29a3c..b7a5672 100644 --- a/Makefile +++ b/Makefile @@ -105,6 +105,26 @@ rpm: tarball test-rpm: tarball $(RPM_WITH_DIRS) $(DIST_DEFINES) --define "testbuild 1" -bb $(SPECFILE) +pypi: + rm -rf dist + python setup.py sdist + # py2 + virtualenv build_py2 + build_py2/bin/pip install --upgrade pip setuptools wheel virtualenv + build_py2/bin/python setup.py bdist_wheel + rm -rf build_py2 + # py3 + python3 -m venv build_py3 + build_py3/bin/pip install --upgrade pip setuptools wheel virtualenv + build_py3/bin/python setup.py bdist_wheel + rm -rf build_py3 + +pypi-upload-test: + twine upload -r https://test.pypi.org/legacy/ dist/* + +pypi-upload: + twine upload dist/* + tag:: git tag -a $(TAG) @echo "Tagged with: $(TAG)" From d01816d5ab262f03f3d3bf2458246f7c578d2906 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Dec 06 2017 13:50:24 +0000 Subject: [PATCH 4/6] Documentation update for PyPi --- diff --git a/Makefile b/Makefile index b7a5672..21e6ff3 100644 --- a/Makefile +++ b/Makefile @@ -119,9 +119,6 @@ pypi: build_py3/bin/python setup.py bdist_wheel rm -rf build_py3 -pypi-upload-test: - twine upload -r https://test.pypi.org/legacy/ dist/* - pypi-upload: twine upload dist/* diff --git a/docs/source/using_the_koji_build_system.rst b/docs/source/using_the_koji_build_system.rst index 0cc0e00..1cc485f 100644 --- a/docs/source/using_the_koji_build_system.rst +++ b/docs/source/using_the_koji_build_system.rst @@ -37,6 +37,19 @@ available. You will need to have a valid authentication token to use many features. However, many of the read-only commands will work without authentication. +Alternatively, koji CLI is now also available via: + + * `Project releases tarballs `__ + Preferred way is to use your distribution's mechanism instead, as it + will also contain appropriate configuration files. + * `PyPi `__ There is only client/API + part and it is mostly usable for people who wants some more advanced + client-side scripting in virtualenv's, so API-only access is not + sufficient for them or who can profit from some utilities in e.g. basic + ``koji`` library. + * Actual development version via Pagure's git: ``git clone + https://pagure.io/koji.git`` + Fedora Account System (FAS2) Setup ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From d9e44a156277ec29b99deb3571e11e8806877409 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Dec 06 2017 13:50:24 +0000 Subject: [PATCH 5/6] use rpm-py-installer --- diff --git a/setup.py b/setup.py index 5ab14ce..b2db985 100644 --- a/setup.py +++ b/setup.py @@ -7,28 +7,6 @@ def get_install_requires(): # glib2-devel sqlite-devel libxml2-devel python-devel \ # openssl-devel libffi-devel - # In a perfect world this would suffice: - # 'rpm', - # But rpm isn't available on PyPI so it needs to be installed other way. - - # To install it from upstream one would need to run ./autogen.sh and - # ./configure just to create setup.py with correct paths to header - # files. I wasn't able run it successfully anyway so it is easier to - # grab system package instead. - - # Install rpm python package system-wide: - # $ dnf install rpm-python - - # If you are running in virtualenv use following command to make - # system-wide rpm python package inside virtualenv: - # $ ln -vs $(/usr/bin/python -c 'import rpm, os.path; print(os.path.dirname(rpm.__file__))') \ - # $(/usr/bin/env python -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())') - # resp. for python3 - # $ ln -vs $(/usr/bin/python3 -c 'import rpm, os.path; print(os.path.dirname(rpm.__file__))') \ - # $(/usr/bin/env python -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())') - # Other options is to create virtualenv with --system-site-packages if - # it doesn't harm you. - # pycurl can come without ssl backend (or bad one). In such case use # $ pip uninstall pycurl; pip install pycurl --global-option="--with-nss" # or different backend mentioned in error message (openssl, ...) @@ -41,6 +19,7 @@ def get_install_requires(): 'requests-kerberos', 'six', #'libcomps', + 'rpm-py-installer', #'rpm', ] if sys.version_info[0] < 3: From 527deee2258e5dacb9aac705e987be08202ce2a0 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Dec 06 2017 13:51:07 +0000 Subject: [PATCH 6/6] update to 1.15 version --- diff --git a/setup.py b/setup.py index b2db985..a1df06a 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ def get_install_requires(): setup( name="koji", - version="1.14.0", + version="1.15.0", description=("Koji is a system for building and tracking RPMS. The base" " package contains shared libraries and the command-line" " interface."),