-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
62 additions
and
130 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,31 +1,29 @@ | ||
""" | ||
backtranslate: Functions for reverse translation. | ||
from os.path import dirname, abspath | ||
|
||
from configparser import ConfigParser | ||
|
||
Copyright (c) 2015 Leiden University Medical Center <[email protected]> | ||
Copyright (c) 2015 Jeroen F.J. Laros <[email protected]> | ||
from .backtranslate import BackTranslate | ||
|
||
Licensed under the MIT license, see the LICENSE file. | ||
""" | ||
from __future__ import ( | ||
absolute_import, division, print_function, unicode_literals) | ||
from future.builtins import str, zip | ||
|
||
config = ConfigParser() | ||
with open('{}/setup.cfg'.format(dirname(abspath(__file__)))) as handle: | ||
config.read_file(handle) | ||
|
||
__version_info__ = ('0', '1', '0') | ||
_copyright_notice = 'Copyright (c) {} {} <{}>'.format( | ||
config.get('metadata', 'copyright'), | ||
config.get('metadata', 'author'), | ||
config.get('metadata', 'author_email')) | ||
|
||
__version__ = '.'.join(__version_info__) | ||
__author__ = 'LUMC, Jeroen F.J. Laros' | ||
__contact__ = '[email protected]' | ||
__homepage__ = 'https://github.com/mutalyzer/backtranslate' | ||
|
||
usage = __doc__.split("\n\n\n") | ||
usage = [config.get('metadata', 'description'), _copyright_notice] | ||
|
||
|
||
def doc_split(func): | ||
return func.__doc__.split("\n\n")[0] | ||
return func.__doc__.split('\n\n')[0] | ||
|
||
|
||
def version(name): | ||
return "%s version %s\n\nAuthor : %s <%s>\nHomepage : %s" % (name, | ||
__version__, __author__, __contact__, __homepage__) | ||
return '{} version {}\n\n{}\nHomepage: {}'.format( | ||
config.get('metadata', 'name'), | ||
config.get('metadata', 'version'), | ||
_copyright_notice, | ||
config.get('metadata', 'url')) |
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
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 @@ | ||
../setup.cfg |
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
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,29 @@ | ||
[metadata] | ||
name = backtranslate | ||
version = 0.1.1 | ||
description = Functions for reverse translation. | ||
long_description = file: README.rst | ||
author = LUMC, Jeroen F.J. Laros | ||
author_email = [email protected] | ||
url = https://github.com/mutalyzer/backtranslate | ||
keywords = bioinformatics | ||
license = MIT | ||
classifiers = | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3.5 | ||
Programming Language :: Python :: 3.6 | ||
copyright = 2015-2019 | ||
|
||
[options] | ||
packages = find: | ||
install_requires = | ||
biopython | ||
configparser | ||
python-Levenshtein | ||
|
||
[options.package_data] | ||
backtranslate = setup.cfg | ||
|
||
[options.entry_points] | ||
console_scripts = | ||
backtranslate = backtranslate.cli:main |
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,81 +1,4 @@ | ||
import os | ||
import sys | ||
|
||
from setuptools import setup | ||
|
||
|
||
package = 'backtranslate' | ||
package_name = 'BackTranslate' | ||
description = '{}: Functions for reverse translation.'.format(package_name) | ||
documentation = 'README.md' | ||
license = 'MIT License' | ||
keywords = ['bioinformatics'] | ||
|
||
dependencies = ['biopython', 'future', 'python-Levenshtein'] | ||
develop_dependencies = ['fake-open', 'pytest', 'tox'] | ||
supported = [(2, 7), (3, 3), (3, 4)] | ||
classifiers = [ | ||
'Development Status :: 3 - Alpha', | ||
'Intended Audience :: Science/Research', | ||
'Intended Audience :: Developers', | ||
'Topic :: Scientific/Engineering :: Bio-Informatics', | ||
] | ||
|
||
|
||
if sys.version_info < supported[0]: | ||
raise Exception('{} requires Python {}.{} or higher.'.format( | ||
package, *supported[0])) | ||
|
||
if sys.version_info[:2] == supported[0]: | ||
dependencies.extend(['argparse', 'importlib']) | ||
|
||
# This is quite the hack, but we don't want to import our package from here | ||
# since that's recipe for disaster (it might have some uninstalled | ||
# dependencies, or we might import another already installed version). | ||
distmeta = {} | ||
for line in open(os.path.join(package, '__init__.py')): | ||
try: | ||
field, value = (x.strip() for x in line.split('=')) | ||
except ValueError: | ||
continue | ||
if field == '__version_info__': | ||
value = value.strip('[]()') | ||
value = '.'.join(x.strip(' \'"') for x in value.split(',')) | ||
else: | ||
value = value.strip('\'"') | ||
distmeta[field] = value | ||
|
||
try: | ||
with open(documentation) as readme: | ||
long_description = readme.read() | ||
except IOError: | ||
long_description = 'See ' + distmeta['__homepage__'] | ||
|
||
language_string = 'Programming Language :: Python' | ||
classifiers += [ | ||
'License :: OSI Approved :: {}'.format(license), | ||
'Operating System :: OS Independent', | ||
language_string, | ||
'{} :: {}'.format(language_string, supported[0][0]), | ||
'{} :: {}'.format(language_string, supported[-1][0])] + \ | ||
['{} :: {}.{}'.format(language_string, *version) for version in supported] | ||
|
||
setup( | ||
name=package_name, | ||
version=distmeta['__version_info__'], | ||
description=description, | ||
long_description=long_description, | ||
author=distmeta['__author__'], | ||
author_email=distmeta['__contact__'], | ||
url=distmeta['__homepage__'], | ||
license=license, | ||
platforms=['any'], | ||
packages=[package], | ||
install_requires=dependencies, | ||
tests_require=develop_dependencies, | ||
entry_points={ | ||
'console_scripts': ['{0} = {0}.cli:main'.format(package)] | ||
}, | ||
classifiers=classifiers, | ||
keywords=' '.join(keywords) | ||
) | ||
setup() |
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,6 +1,6 @@ | ||
[tox] | ||
envlist = py27,py34 | ||
envlist = py35, py36 | ||
|
||
[testenv] | ||
commands = py.test | ||
commands = py.test -W error | ||
whitelist_externals = py.test |