Skip to content

Commit

Permalink
Merge pull request #55 from knights-lab/release-93
Browse files Browse the repository at this point in the history
Release 93
  • Loading branch information
bhillmann authored Oct 11, 2017
2 parents e13651c + b20ff88 commit f66b3a5
Show file tree
Hide file tree
Showing 26 changed files with 3,085 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shi7/_version.py export-subst
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,4 @@ fabric.properties
*.su

scratch
*.pyz
660 changes: 660 additions & 0 deletions LICENSE.md

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions LICENSE.txt

This file was deleted.

2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include versioneer.py
include shi7/_version.py
32 changes: 32 additions & 0 deletions make_release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python
import tempfile
from distutils.dir_util import copy_tree
import os
import shutil

entry_points = ("shi7", "shi7_learning")

def create_main_template(entry_point):
template = "#!/usr/bin/env python\nimport shi7\nshi7.{entry_point}.main()\n"
for entry_point in entry_points:
yield entry_point, template.format(entry_point=entry_point)

def line_prepender(filename, line):
with open(filename, 'rb+') as f:
content = f.read()
f.seek(0, 0)
f.write(line.rstrip(b'\r\n') + b'\n' + content + b'\n')

for entry_point, main_file in create_main_template(entry_points):
with tempfile.TemporaryDirectory() as tmpdirname:
os.makedirs(os.path.join(tmpdirname, 'shi7'))
copy_tree("shi7", os.path.join(tmpdirname, 'shi7'))
with open(os.path.join(tmpdirname, '__main__.py'), 'w') as inf:
inf.write(main_file)
shutil.make_archive(entry_point, 'zip', tmpdirname)
# shutil.move(entry_point + '.zip', entry_point + '.pyz')
# shutil.move(os.path.join(tmpdirname, entry_point),"./")
# line_prepender(entry_point + '.pyz', b"#!/usr/bin/env python")



7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[versioneer]
VCS=git
style=pep440
versionfile_source = shi7/_version.py
versionfile_build = shi7/_version.py
tag_prefix =
parentdir_prefix = shi7
14 changes: 8 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
from glob import glob
import os
import platform
import versioneer

__author__ = "Knights Lab"
__copyright__ = "Copyright (c) 2016--, %s" % __author__
__credits__ = ["Kaiwei Ang", "Gabe Al-Ghalith", "Benjamin Hillmann"]
__email__ = "[email protected]"
__license__ = "GPLv3"
__maintainer__ = "Kaiwei Ang"
__version__ = "0.9.2"
__license__ = "AGPL"
__maintainer__ = "Benjamin Hillmann"

long_description = 'All of your shi7 is one place. From quality scores to mappable reads.'
long_description = 'All of your shi7 in one place. From quality scores to mappable reads.'

setup(
name='shi7',
version=__version__,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
packages=find_packages(),
package_data={'shi7': ['adapters/*.fa']},
url='',
Expand All @@ -25,10 +26,11 @@
description='',
long_description=long_description,
keywords='',
install_requires=['nose'],
install_requires=[],
entry_points={
'console_scripts': [
'shi7 = shi7.shi7:main',
'shi7_learning = shi7.shi7_learning:main'
]
},
)
11 changes: 9 additions & 2 deletions shi7/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
from .shi7 import *
from .shi7_learning import *
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions


import shi7.shi7 as shi7
import shi7.shi7_learning as shi7_learning

__all__ = ["shi7", "shi7_learning"]
Loading

0 comments on commit f66b3a5

Please sign in to comment.