setuptools packaging

This commit is contained in:
Jay Greguske 2016-01-04 16:13:48 -05:00
commit 87af01e040
6 changed files with 23 additions and 23 deletions

1
MANIFEST.in Normal file
View file

@ -0,0 +1 @@
include etc/multilib.conf README.md LICENSE

View file

@ -13,7 +13,7 @@ except ImportError:
# RHEL 7 and later
import json
import fakepo
from multilib import multilib.fakepo
# generate test data for multilib
# accepts a path to a compose and writes out a bigass json file with multlib
@ -37,7 +37,7 @@ def get_options():
def get_fpo(rpmfile):
"""return a fake yum PackageObject for a given RPM"""
po = yum.packages.YumLocalPackage(filename=rpmfile)
return fakepo.FakePackageObject(po=po)
return multilib.fakepo.FakePackageObject(po=po)
def find_repos(cpath):
"""generator to recursively go down a path and find yum repositories"""

View file

@ -11,7 +11,7 @@ import bz2
from ConfigParser import ConfigParser
import fakepo
from fnmatch import fnmatch
import multilib
from multilib import multilib
import os
# if you want to test the testing with the original mash code
@ -25,9 +25,8 @@ class test_methods(object):
try:
files = os.listdir('testdata')
except OSError:
print 'Run the tests in the same directory as multilib.py'
print 'There should be a testdata subdirectory there, and note'
print 'only the first .json.bz2 file will be considered'
print 'There should be a testdata subdirectory in your CWD, and'
print 'note only the first .json.bz2 file found will be considered'
raise
pj = None
for f in files:
@ -35,7 +34,7 @@ class test_methods(object):
fd = bz2.BZ2File('testdata/RHEL-7.1-Server-x86_64.json.bz2', 'r')
pj = json.load(fd)
break # just take the first hit
assert pj, 'No test data found in testdata, create some with the gentestdata script'
assert pj, 'No test data found in testdata, create some with the multilib_test_data script'
cls.packages = pj
fd.close()
@ -75,7 +74,7 @@ class test_methods(object):
key64 = '%s.%s' % (fpo.name, self.revarchmap[fpo.arch])
data = self.packages.has_key(key64)
print ' data says %s' % data
#assert code and data, msg
assert code and data, msg
assert code, msg
return True
@ -97,7 +96,7 @@ class test_methods(object):
key64 = '%s.%s' % (fpo.name, self.revarchmap[fpo.arch])
data = self.packages.has_key(key64)
print ' data says %s' % data
#assert not code and not data, msg
assert not code and not data, msg
assert not code, msg
return True

View file

@ -1,14 +1,14 @@
Name: python2-multilib
Version: 1.0
Release: 1%{?dist}
Summary: a module for determining if a package is multilib or not
Name: python2-multilib
Version: 1.0
Release: 1%{?dist}
Summary: a module for determining if a package is multilib or not
Group: Development/Libraries
License: GPLv3+
URL: https://github.com/Zyzyx/python-multilib/archive/master.zip
Source0: %{name}-%{version}.zip
License: GPLv3+
URL: https://github.com/Zyzyx/python-multilib/archive/master.zip
Source0: %{name}-%{version}.zip
BuildRequires: python2-devel
Requires: python2
BuildRequires: python2-devel
Requires: python2
%description
A Python module that supports several multilib "methods" useful for determining
@ -32,7 +32,6 @@ if a 32-bit package should be included with its 64-bit analogue in a compose.
%doc README.md LICENSE
%changelog
* Tue Jul 21 2009 Jay Greguske <jgregusk@redhat.com> - 1.0-1
- Initial RPM release

View file

@ -9,7 +9,8 @@ setup(
description = ("module for determining if a package is multilib"),
license = "GPLv3",
url = "https://github.com/Zyzyx/python-multilib.git",
packages = ['multilib'],
package_data = {'': ['multilib.conf']},
packages = find_packages(),
package_data = {'': ['README.md', 'LICENSE']},
data_files = [('/etc', ['etc/multilib.conf'])],
scripts = ['multilib/multilib_test_data']
)