Skip to content

Commit

Permalink
Bump to rc4 and try to improve pypi readme handloine
Browse files Browse the repository at this point in the history
  • Loading branch information
gb119 committed May 15, 2017
1 parent f60f469 commit ff3e840
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 130 deletions.
2 changes: 1 addition & 1 deletion Stoner/__init__.py
Expand Up @@ -12,7 +12,7 @@
from .Folders import DataFolder

from os import path as _path_
__version_info__ = ('0', '7', '0rc3')
__version_info__ = ('0', '7', '0rc4')
__version__ = '.'.join(__version_info__)

__home__=_path_.realpath(_path_.dirname(__file__))
1 change: 0 additions & 1 deletion doc/Makefile
Expand Up @@ -43,7 +43,6 @@ clean:
-rm -rf classes/* functions/*

readme:
pandoc -f rst -t markdown_github -o README.md readme.rst
cp readme.rst ../README.rst

html: readme
Expand Down
125 changes: 0 additions & 125 deletions doc/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion doc/UserGuide/datafolder.rst
Expand Up @@ -118,7 +118,7 @@ groups, then they are merged with the addition operator.
Getting a List of Files
-----------------------

To get a list of the names of the files in a :py:class:`DataFolder`, you can use the py:attr:`DataFolder.ls` attribute.
To get a list of the names of the files in a :py:class:`DataFolder`, you can use the :py:attr:`DataFolder.ls` attribute.
Sub-:py:class:`DataFolder`s also have a name (essentially a string key to the dictionary that holds them), this can be accessed
via the :py:attr:`DataFolder.lsgrp` generator fumnction.::

Expand Down
65 changes: 63 additions & 2 deletions setup.py
@@ -1,9 +1,69 @@
import os
from setuptools import setup, find_packages
import Stoner
import re
import sys, io


def yield_sphinx_only_markup(lines):
"""
:param file_inp: a `filename` or ``sys.stdin``?
:param file_out: a `filename` or ``sys.stdout`?`
"""
substs = [
## Selected Sphinx-only Roles.
#
(r':abbr:`([^`]+)`', r'\1'),
(r':ref:`([^`]+)`', r'`\1`_'),
(r':term:`([^`]+)`', r'**\1**'),
(r':dfn:`([^`]+)`', r'**\1**'),
(r':(samp|guilabel|menuselection):`([^`]+)`', r'``\2``'),
(r':py:[a-z]+:`([^`]+)`', r'\1'),



## Sphinx-only roles:
# :foo:`bar` --> foo(``bar``)
# :a:foo:`bar` XXX afoo(``bar``)
#
#(r'(:(\w+))?:(\w+):`([^`]*)`', r'\2\3(``\4``)'),
(r':(\w+):`([^`]*)`', r'\1(``\2``)'),


## Sphinx-only Directives.
#
(r'\.\. doctest', r'code-block'),
(r'\.\. plot::', r'.. '),
(r'\.\. seealso', r'info'),
(r'\.\. glossary', r'rubric'),
(r'\.\. figure::', r'.. '),


## Other
#
(r'\|version\|', r'x.x.x'),
]

regex_subs = [ (re.compile(regex, re.IGNORECASE), sub) for (regex, sub) in substs ]

def clean_line(line):
try:
for (regex, sub) in regex_subs:
line = regex.sub(sub, line)
except Exception as ex:
print("ERROR: %s, (line(%s)"%(regex, sub))
raise ex

return line

for line in lines:
yield clean_line(line)

def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
mydir=os.path.dirname(__file__)
with io.open(os.path.join(mydir, fname)) as fd:
return fd.readlines()

setup(
name = "Stoner",
Expand All @@ -22,14 +82,15 @@ def read(fname):
package_data={'Stoner':['stylelib/*.mplstyle']},
test_suite="tests",
install_requires=["numpy>=1.7","scipy>=0.14","matplotlib>=1.5","h5py","lmfit","filemagic","pillow","scikit-image"],
long_description=read('doc/readme.rst'),
long_description= ''.join(yield_sphinx_only_markup(read('doc/readme.rst'))),
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
],
)

0 comments on commit ff3e840

Please sign in to comment.