Skip to content

Commit eb1b2f6

Browse files
committed
Add support for python packaging.
Added a setup.py for packaging. This will install the .py files as autospec library in dist-packages. Because of the way the imports are currently done, autospec.py is installed in dist-packages dir. The rpm packaging should create a symlink to this file at /usr/bin/autospec.py
1 parent 71461e2 commit eb1b2f6

22 files changed

+45
-5
lines changed

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include README.rst
2+
include LICENSE

autospec/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import sys
2+
import os
3+
4+
__all__ = ["buildreq", "build", "buildpattern", "config", "docs","files",
5+
"git","lang", "license", "patches", "specdescription", "tarball",
6+
"util", "commitmessage", "test", "patches"]

autospec.py autospec/autospec.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818

1919
import argparse
20+
import sys
21+
import os
22+
import re
23+
import types
24+
2025
import build
2126
import buildpattern
2227
import buildreq
@@ -26,22 +31,17 @@
2631
import lang
2732
import license
2833
import docs
29-
import os
3034
import patches
31-
import re
3235
import specdescription
33-
import sys
3436
import tarball
3537
import test
36-
import types
3738
import commitmessage
3839

3940
from tarball import name
4041
from util import _file_write
4142

4243
sys.path.append(os.path.dirname(__file__))
4344

44-
4545
def write_sources(file):
4646
"""Append additonal source files.
4747
systemd unit files, gcov and additional source tarballs

build.py autospec/build.py

File renamed without changes.
File renamed without changes.

buildreq.py autospec/buildreq.py

File renamed without changes.
File renamed without changes.

config.py autospec/config.py

File renamed without changes.

count.pl autospec/count.pl

File renamed without changes.

docs.py autospec/docs.py

File renamed without changes.

files.py autospec/files.py

File renamed without changes.

git.py autospec/git.py

File renamed without changes.

lang.py autospec/lang.py

File renamed without changes.

license.py autospec/license.py

File renamed without changes.

patches.py autospec/patches.py

File renamed without changes.
File renamed without changes.

tarball.py autospec/tarball.py

File renamed without changes.

test.py autospec/test.py

File renamed without changes.
File renamed without changes.

util.py autospec/util.py

File renamed without changes.

setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[egg_info]
2+
tag_build =

setup.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from setuptools import setup, find_packages
2+
3+
import sys, os
4+
version = "1.0.0"
5+
6+
def readme():
7+
with open("README.rst") as f:
8+
return f.read()
9+
10+
setup(name="autospec",
11+
description="Automated creation of RPM packaging",
12+
long_description=readme(),
13+
version = version,
14+
license = "GPLv3",
15+
packages = ["autospec"],
16+
package_data = {
17+
'': ['*.pl', '*.dic'],
18+
},
19+
classifiers=[
20+
'Intended Audience :: Developers',
21+
'Topic :: Software Development :: Build Tools',
22+
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
23+
# Python versions supported.
24+
'Programming Language :: Python :: 3',
25+
'Programming Language :: Python :: 3.2',
26+
'Programming Language :: Python :: 3.3',
27+
'Programming Language :: Python :: 3.4',
28+
],
29+
include_package_data = True,
30+
)

0 commit comments

Comments
 (0)