From c78a53167b01c38c75484ed13a712b48a1c0ed24 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Dec 08 2017 14:58:00 +0000 Subject: PR#492: Setuptools support Merges #492 https://pagure.io/koji/pull-request/492 Relates: #458 https://pagure.io/koji/issue/458 submit koji to pypi --- diff --git a/Makefile b/Makefile index 5e29a3c..21e6ff3 100644 --- a/Makefile +++ b/Makefile @@ -105,6 +105,23 @@ 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: + twine upload dist/* + tag:: git tag -a $(TAG) @echo "Tagged with: $(TAG)" 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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..a1df06a --- /dev/null +++ b/setup.py @@ -0,0 +1,65 @@ +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 + + # 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-py-installer', + #'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.15.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+)", + "Natural Language :: English", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Operating System :: POSIX :: Linux", + "Topic :: Utilities" + ], + 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'], + python_requires='>=2.6', + install_requires=get_install_requires(), +)