forked from openSUSE/osc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatic package publication via Travis CI
* `.travis.yml` - Reformatted for easier reading - Used `before_*` statements instead of script chains - Publish only source packages * `setup.py` - Reformatted for easier reading - Use README contents for `long_description` to have a nice description on PyPI - Added classifiers - Added explicit package dependencies * fixes openSUSE#658 * fixes openSUSE#708
- Loading branch information
1 parent
9b0dcf3
commit f817db1
Showing
3 changed files
with
73 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
language: python | ||
python: | ||
- '2.7' | ||
- '3.6' | ||
- '2.7' | ||
- '3.6' | ||
- '3.7' | ||
addons: | ||
apt: | ||
packages: | ||
- diffstat | ||
- diffstat | ||
sudo: false | ||
script: cd tests; python suite.py | ||
before_script: cd $TRAVIS_BUILD_DIR/tests | ||
script: python suite.py | ||
before_deploy: | ||
- cd $TRAVIS_BUILD_DIR/ | ||
- rm -rf $TRAVIS_BUILD_DIR/dist/* | ||
deploy: | ||
provider: pypi | ||
user: suse | ||
password: | ||
secure: R4+YNPW2tsiY06hibGvONYn0//1z1QdcY8VmNbYpIRly4eTAbPE9uejKpyuflUkznpEkoqCdFzi5FNFhgat9N+AkIKyX9NTkf0oxaKKbdqBM7H1V8bqLYlAO479262spRyO0ee5fV5v6g81AFjncIV+pGjtQ0Vg/sjVcvGa61bs= | ||
on: | ||
tags: true | ||
distributions: sdist bdist_wheel | ||
distributions: sdist | ||
repo: openSUSE/osc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include NEWS | ||
include README | ||
include AUTHORS | ||
include COPYING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,19 @@ | |
from distutils.core import setup | ||
import distutils.core | ||
from distutils.command import build, install_data | ||
import gzip | ||
import os.path | ||
import osc.core | ||
import sys | ||
|
||
import setuptools | ||
|
||
import osc.core | ||
from osc import commandline | ||
from osc import babysitter | ||
|
||
# optional support for py2exe | ||
try: | ||
import py2exe | ||
|
||
HAVE_PY2EXE = True | ||
except: | ||
HAVE_PY2EXE = False | ||
|
@@ -27,14 +29,13 @@ class build_osc(build.build, object): | |
def build_man_page(self): | ||
""" | ||
""" | ||
import gzip | ||
man_path = os.path.join(self.build_base, 'osc.1.gz') | ||
distutils.log.info('generating %s' % man_path) | ||
outfile = gzip.open(man_path, 'wt') | ||
osccli = commandline.Osc(stdout=outfile) | ||
# FIXME: we cannot call the main method because osc expects an ~/.oscrc | ||
# file (this would break builds in environments like the obs) | ||
#osccli.main(argv = ['osc','man']) | ||
# osccli.main(argv = ['osc','man']) | ||
osccli.optparser = osccli.get_optparser() | ||
osccli.do_man(None) | ||
outfile.close() | ||
|
@@ -60,11 +61,11 @@ def run(self): | |
metadata = self.distribution.metadata | ||
# package_dir may be None, in that case use the current directory. | ||
src_dir = (self.distribution.package_dir or {'': ''})[''] | ||
src_dir = os.path.join(os.getcwd(), src_dir) | ||
src_dir = os.path.join(os.getcwd(), src_dir) | ||
import sphinx | ||
sphinx.main(['runme', | ||
'-D', 'version=%s' % metadata.get_version(), | ||
os.path.join('docs',), os.path.join(self.built_docs, 'docs')]) | ||
'-D', 'version=%s' % metadata.get_version(), | ||
os.path.join('docs', ), os.path.join(self.built_docs, 'docs')]) | ||
|
||
|
||
# take a potential build-base option into account (for instance, if osc is | ||
|
@@ -91,34 +92,62 @@ def finalize_options(self): | |
|
||
addparams = {} | ||
if HAVE_PY2EXE: | ||
addparams['console'] = [{'script': 'osc-wrapper.py', 'dest_base': 'osc', 'icon_resources': [(1, 'osc.ico')]}] | ||
addparams['console'] = [ | ||
{'script': 'osc-wrapper.py', 'dest_base': 'osc', 'icon_resources': [(1, 'osc.ico')]}] | ||
addparams['zipfile'] = 'shared.lib' | ||
addparams['options'] = {'py2exe': {'optimize': 0, 'compressed': True, 'packages': ['xml.etree', 'StringIO', 'gzip']}} | ||
addparams['options'] = {'py2exe': {'optimize': 0, 'compressed': True, | ||
'packages': ['xml.etree', 'StringIO', 'gzip']}} | ||
|
||
data_files = [] | ||
if sys.platform[:3] != 'win': | ||
data_files.append((os.path.join('share', 'man', 'man1'), ['osc.1.gz'])) | ||
|
||
setuptools.setup(name='osc', | ||
version = osc.core.__version__, | ||
description = 'openSUSE commander', | ||
long_description = 'Command-line client for the openSUSE Build Service, which allows to access repositories in the openSUSE Build Service in similar way as Subversion repositories.', | ||
author = 'openSUSE project', | ||
author_email = '[email protected]', | ||
license = 'GPL', | ||
platforms = ['Linux', 'Mac OSX', 'Windows XP/2000/NT', 'Windows 95/98/ME', 'FreeBSD'], | ||
keywords = ['openSUSE', 'SUSE', 'RPM', 'build', 'buildservice'], | ||
url = 'http://en.opensuse.org/openSUSE:OSC', | ||
download_url = 'https://github.com/openSUSE/osc', | ||
packages = ['osc', 'osc.util'], | ||
scripts = ['osc-wrapper.py'], | ||
data_files = data_files, | ||
|
||
# Override certain command classes with our own ones | ||
cmdclass = { | ||
with open("README") as fh: | ||
long_description = fh.read() | ||
|
||
setuptools.setup( | ||
name='osc', | ||
version=osc.core.__version__, | ||
description='openSUSE commander', | ||
long_description=long_description, | ||
long_description_content_type="text/plain", | ||
author='openSUSE project', | ||
author_email='[email protected]', | ||
license='GPL', | ||
platforms=['Linux', 'Mac OSX', 'Windows XP/2000/NT', 'Windows 95/98/ME', 'FreeBSD'], | ||
keywords=['openSUSE', 'SUSE', 'RPM', 'build', 'buildservice'], | ||
url='http://en.opensuse.org/openSUSE:OSC', | ||
download_url='https://github.com/openSUSE/osc', | ||
packages=['osc', 'osc.util'], | ||
scripts=['osc-wrapper.py'], | ||
data_files=data_files, | ||
install_requires=['M2Crypto', 'chardet'], | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Information Technology", | ||
"Intended Audience :: System Administrators", | ||
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Topic :: Software Development :: Build Tools", | ||
"Topic :: System :: Archiving :: Packaging", | ||
], | ||
|
||
|
||
# Override certain command classes with our own ones | ||
cmdclass={ | ||
'build': build_osc, | ||
'build_docs' : build_docs, | ||
'build_docs': build_docs, | ||
'install_data': install_data | ||
}, | ||
**addparams | ||
) | ||
}, | ||
**addparams | ||
) |