def test_short_description(self): su = SetupUtil.source( rel_setup_path=Path('test-resources/src/setup.py')) inf = su.get_info() self.assertEqual( 'Inspect and iterate on git tags and invoke setup utils', inf['short_description'])
def test_setup_util(self): setup_str = """name=zensols.progname packages=[] version=%(ver)s description=This project attempts to export a local Zotero library to a usable HTML website. author=Paul Landes [email protected] url=https://github.com/plandes/progname download_url=https://github.com/plandes/progname/releases/download/v%(ver)s/zensols.progname-%(ver)s-py3-none-any.whl long_description=# Inspect and iterat... long_description_content_type=text/markdown install_requires=['zensols.util>=1.3.0', 'gitpython==2.1.11', 'gitdb2==2.0.3'] keywords=['akeyword'] classifiers=['aclass'] entry_points={'console_scripts': ['progname=zensols.progname:main']} """ % { 'ver': VERSION } setup_path = Path(__file__).parent.parent.parent.joinpath('src/python') su = SetupUtil( setup_path=setup_path, name='zensols.progname', user='******', project='progname', description= 'This project attempts to export a local Zotero library to a usable HTML website.', keywords=['akeyword'], classifiers=['aclass'], ) sio = StringIO() su.write(writer=sio) logger.debug(sio.getvalue()) if False: print(setup_str) print('-' * 40) print(sio.getvalue()) self.maxDiff = None self.assertEqual(setup_str, sio.getvalue())
def _assert_build_info(self): """Create the build info JSON file by using ``SetupUtil`` instance's ``to_json`` method. :py:function:`zensols.pybuild.SetupUtil.to_json` """ if not self.path.exists(): from zensols.pybuild import SetupUtil self.path.parent.mkdir(parents=True, exist_ok=True) if not self.rel_setup_path.exists(): raise OSError('configuration file does not ' + f'exist: {self.rel_setup_path}') su = SetupUtil.source(rel_setup_path=self.rel_setup_path) logger.info(f'saving build info to {self.path}') with open(self.path, 'w') as f: su.to_json(writer=f)
from pathlib import Path from zensols.pybuild import SetupUtil su = SetupUtil( setup_path=Path(__file__).parent.absolute(), name="movie", package_names=['movie', 'resources'], # package_data={'': ['*.html', '*.js', '*.css', '*.map', '*.svg']}, description= 'The Stanford/Cornell movie review dataset to demonstrate the DeepZenos framework for the sentiment analysis task.', user='******', project='movie', keywords=['tooling'], # has_entry_points=False, ).setup()
from pathlib import Path from zensols.pybuild import SetupUtil su = SetupUtil( setup_path=Path(__file__).parent.absolute(), name="zensols.deepnlp", package_names=['zensols', 'resources'], package_data={'': ['*.conf']}, description='Deep learning utility library for natural language processing that aids in feature engineering and embedding layers.', user='******', project='deepnlp', keywords=['tooling'], has_entry_points=False, ).setup()
from pathlib import Path from zensols.pybuild import SetupUtil su = SetupUtil( setup_path=Path(__file__).parent.absolute(), name="zensols.db", package_names=['zensols', 'resources'], # package_data={'': ['*.html', '*.js', '*.css', '*.map', '*.svg']}, description= 'A library of database convenience utilities, typically for creation of temporary files for processing large data.', user='******', project='dbutil', keywords=['tooling'], has_entry_points=False, ).setup()
from pathlib import Path from zensols.pybuild import SetupUtil SetupUtil( setup_path=Path(__file__).parent.absolute(), name="zensols.garmdown", package_names=['zensols', 'resources'], package_data={ '': ['*.conf'] }, description='Download Garmin Connect data', user='******', project='garmdown', keywords=['garmin data'], ).setup()
from pathlib import Path from zensols.pybuild import SetupUtil SetupUtil( setup_path=Path(__file__).parent.absolute(), name="zensols.dlqaclass", package_names=['zensols', 'resources'], # package_data={'': ['*.html', '*.js', '*.css', '*.map', '*.svg']}, description= 'This is a deep learning implementation of question/answer for information retrieval that implements the this paper.', user='******', project='dlqa', keywords=['tooling'], # has_entry_points=False, ).setup()
from pathlib import Path from zensols.pybuild import SetupUtil su = SetupUtil( setup_path=Path(__file__).parent.absolute(), package_names=['zensols', 'resources'], name='zensols.zotsite', user='******', project='zotsite', package_data={ '': ['*.html', '*.js', '*.css', '*.map', '*.svg', 'glyphicons*'] }, description= 'This project attempts to export a local Zotero library to a usable HTML website.', keywords=['academic', 'web', 'website', 'research'], ) su.setup()
from pathlib import Path from zensols.pybuild import SetupUtil su = SetupUtil( setup_path=Path(__file__).parent.absolute(), name="zensols.bibstract", package_names=['zensols', 'resources'], # package_data={'': ['*.html', '*.js', '*.css', '*.map', '*.svg']}, package_data={ '': ['*.conf', '*.json', '*.yml'] }, description= 'This utility extracts Bib(La)Tex references (a.k.a *markers*) from a (La)Tex.', user='******', project='bibstract', keywords=['tooling'], # has_entry_points=False, ).setup()
def write(self): sutil = SetupUtil.source(start_path=self.setup_path) if self.output_format == 'json': sutil.to_json() else: sutil.write()
from pathlib import Path from zensols.pybuild import SetupUtil su = SetupUtil( setup_path=Path(__file__).parent.absolute(), name="zensols.deeplearn", package_names=['zensols', 'resources'], package_data={'': ['*.conf', '*.yml']}, description='General deep learing utility library', user='******', project='deeplearn', keywords=['tooling'], has_entry_points=False, ).setup()
from pathlib import Path from zensols.pybuild import SetupUtil su = SetupUtil( setup_path=Path(__file__).parent.absolute(), name="zensols.nlp", package_names=['zensols', 'resources'], package_data={ '': ['*.conf'] }, description='A utility library to assist in parsing natural language text.', user='******', project='nlparse', keywords=['tooling'], has_entry_points=False, ).setup()