Skip to content

Commit

Permalink
initial rever setup
Browse files Browse the repository at this point in the history
  • Loading branch information
scopatz committed May 16, 2017
1 parent e1b8429 commit e25fd4b
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md → README.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# rever
rever
=====
Release Versions of Software
5 changes: 5 additions & 0 deletions rever/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import xonsh.imphooks


xonsh.imphooks.install_import_hooks()
__version__ = '0.0.0'
3 changes: 3 additions & 0 deletions rever/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from rever.main import main

main()
5 changes: 5 additions & 0 deletions rever/main.xsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Main CLI entry point for rever"""

def main(args=None):
"""Main function for rever."""
echo "hello"
3 changes: 3 additions & 0 deletions scripts/rever
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env python3 -u
from rever.main import main
main()
60 changes: 60 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env python3
import sys
import ast
try:
from setuptools import setup
except ImportError:
from distutils.core import setup


def find_version(filename):
with open(filename) as f:
initlines = f.readlines()
version_line = None
for line in initlines:
if line.startswith('__version__'):
vstr = line.strip().split()[-1]
ver = ast.literal_eval(vstr)
break
return ver


def main():
"""The main entry point."""
if sys.version_info[:2] < (3, 4):
sys.exit('xonsh currently requires Python 3.4+')
with open(os.path.join(os.path.dirname(__file__), 'README.rst'), 'r') as f:
readme = f.read()
scripts = ['scripts/rever']
skw = dict(
name='rever',
description='Release Versions of Software',
long_description=readme,
license='BSD',
version=find_version('rever/__init__.py'),
author='Anthony Scopatz',
maintainer='Anthony Scopatz',
author_email='scopatz@gmail.com',
url='https://github.com/scopatz/rever',
platforms='Cross Platform',
classifiers=['Programming Language :: Python :: 3'],
packages=['rever'],
package_dir={'rever': 'rever'},
package_data={'rever': ['*.xsh']},
scripts=scripts,
)
# WARNING!!! Do not use setuptools 'console_scripts'
# It validates the depenendcies (of which we have none) everytime the
# 'rever' command is run. This validation adds ~0.2 sec. to the startup
# time of xonsh - for every single xonsh run. This prevents us from
# reaching the goal of a startup time of < 0.1 sec. So never ever write
# the following:
#
# 'console_scripts': ['rever = rever.main:main'],
#
# END WARNING
setup(**skw)


if __name__ == '__main__':
main()

0 comments on commit e25fd4b

Please sign in to comment.