#492 Setuptools support
Merged 6 years ago by mikem. Opened 6 years ago by tkopecek.
tkopecek/koji pypi  into  master

file modified
+17
@@ -105,6 +105,23 @@ 

  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)"

@@ -37,6 +37,19 @@ 

  many features. However, many of the read-only commands will work without

  authentication.

  

+ Alternatively, koji CLI is now also available via:

+ 

+   * `Project releases tarballs <https://pagure.io/koji/releases>`__

+     Preferred way is to use your distribution's mechanism instead, as it

+     will also contain appropriate configuration files.

+   * `PyPi <https://pypi.python.org/pypi/koji>`__ 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

  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  

file added
+65
@@ -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(),

+ )

Related to https://pagure.io/koji/issue/458

Support for setuptools, so for PyPi.

If you have virtualenvwrapper available, this could also use virtualenvwrapper_get_site_packages_dir.

rebased

6 years ago

rebased onto 68493bdaba0f0df4d5ebb2ece2d0c5dcda5d0cbb

6 years ago

rebased onto 62fd38490de45082ddf1e0d571bd30a4179910d1

6 years ago

rebased onto 48d643a1e8b20d115a6456a9317c35b6f2f75a68

6 years ago

+1

@mikem: Can we review this one and release Koji on PyPi? It would help a lot in Factory2 projects like MBS, ODCS or Freshmaker to setup testing environment. For example python3-koji is available only for py36 in F26 and not py35, which limits our testing code and makes it harder to write tests which run for everyone everywhere.

Hello, what is the current state?

rebased onto 55efda9

6 years ago

Commit c78a531 fixes this pull-request

Pull-Request has been merged by mikem

6 years ago