From f2ceaa1f573f5443291a5bae1de91773a6e4f465 Mon Sep 17 00:00:00 2001 From: Darius Morawiec Date: Sun, 20 Jan 2019 02:00:00 +0100 Subject: [PATCH 1/4] release/1.0.0: Merge badges at the top --- readme.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index 9075cc02..b7bd8951 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,14 @@ # sklearn-porter +[![Build Status stable branch](https://img.shields.io/travis/nok/sklearn-porter/stable.svg)](https://travis-ci.org/nok/sklearn-porter) +[![PyPI](https://img.shields.io/pypi/v/sklearn-porter.svg)](https://pypi.python.org/pypi/sklearn-porter) +[![PyPI](https://img.shields.io/pypi/pyversions/sklearn-porter.svg)](https://pypi.python.org/pypi/sklearn-porter) +[![GitHub license](https://img.shields.io/pypi/l/sklearn-porter.svg)](https://raw.githubusercontent.com/nok/sklearn-porter/master/license.txt) +[![Stack Overflow](https://img.shields.io/badge/stack%20overflow-ask%20questions-blue.svg)](https://stackoverflow.com/questions/tagged/sklearn-porter) +[![Join the chat at https://gitter.im/nok/sklearn-porter](https://badges.gitter.im/nok/sklearn-porter.svg)](https://gitter.im/nok/sklearn-porter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Twitter](https://img.shields.io/twitter/follow/darius_morawiec.svg?label=follow&style=popout)](https://twitter.com/darius_morawiec) + Transpile trained [scikit-learn](https://github.com/scikit-learn/scikit-learn) estimators to C, Java, JavaScript and others.
It's recommended for limited embedded systems and critical applications where performance matters most. @@ -389,15 +397,9 @@ If you use this implementation in you work, please add a reference/citation to t ## License -[![GitHub license](https://img.shields.io/pypi/l/sklearn-porter.svg)](https://raw.githubusercontent.com/nok/sklearn-porter/master/license.txt) - The module is Open Source Software released under the [MIT](license.txt) license. ## Questions? -[![Stack Overflow](https://img.shields.io/badge/stack%20overflow-ask%20questions-blue.svg)](https://stackoverflow.com/questions/tagged/sklearn-porter) -[![Join the chat at https://gitter.im/nok/sklearn-porter](https://badges.gitter.im/nok/sklearn-porter.svg)](https://gitter.im/nok/sklearn-porter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Twitter](https://img.shields.io/twitter/follow/darius_morawiec.svg?label=follow&style=popout)](https://twitter.com/darius_morawiec) - Don't be shy and feel free to contact me on [Twitter](https://twitter.com/darius_morawiec) or [Gitter](https://gitter.im/nok/sklearn-porter). From df7d7cbd50089bdf21334ab9b5149cca12dca85a Mon Sep 17 00:00:00 2001 From: Darius Morawiec Date: Sun, 20 Jan 2019 02:03:16 +0100 Subject: [PATCH 2/4] release/1.0.0: Remove redundant badges --- readme.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/readme.md b/readme.md index b7bd8951..d3b08d3c 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,6 @@ # sklearn-porter -[![Build Status stable branch](https://img.shields.io/travis/nok/sklearn-porter/stable.svg)](https://travis-ci.org/nok/sklearn-porter) -[![PyPI](https://img.shields.io/pypi/v/sklearn-porter.svg)](https://pypi.python.org/pypi/sklearn-porter) -[![PyPI](https://img.shields.io/pypi/pyversions/sklearn-porter.svg)](https://pypi.python.org/pypi/sklearn-porter) [![GitHub license](https://img.shields.io/pypi/l/sklearn-porter.svg)](https://raw.githubusercontent.com/nok/sklearn-porter/master/license.txt) [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-ask%20questions-blue.svg)](https://stackoverflow.com/questions/tagged/sklearn-porter) [![Join the chat at https://gitter.im/nok/sklearn-porter](https://badges.gitter.im/nok/sklearn-porter.svg)](https://gitter.im/nok/sklearn-porter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) From 7291696b321146b9cbd9f45e7bf0070f40406321 Mon Sep 17 00:00:00 2001 From: Darius Morawiec Date: Sun, 20 Jan 2019 13:50:00 +0100 Subject: [PATCH 3/4] release/0.7.2: Add separated loading of package information --- setup.py | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 00e46a3e..f6f36e5a 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,52 @@ from setuptools import setup from setuptools import find_packages -from sklearn_porter import meta # see sklearn_porter/package.json +from os.path import abspath +from os.path import dirname +from os.path import exists +from os.path import join +from json import load + + +def _load_meta(path): + """ + Load meta data about this package from file package.json. + :param path: The path to package.json + :return: Dictionary of key value pairs. + """ + with open(path) as f: + meta = load(f, encoding='utf-8') + meta = {k: v.decode('utf-8') if isinstance(v, bytes) else v + for k, v in meta.items()} + + src_dir = abspath(dirname(path)) + + if 'requirements' in meta and \ + str(meta['requirements']).startswith('file://'): + req_path = str(meta['requirements'])[7:] + req_path = join(src_dir, req_path) + if exists(req_path): + reqs = open(req_path, 'r').read().strip().split('\n') + reqs = [req.strip() for req in reqs if 'git+' not in req] + meta['requirements'] = reqs + else: + meta['requirements'] = '' + + if 'long_description' in meta and \ + str(meta['long_description']).startswith('file://'): + readme_path = str(meta['long_description'])[7:] + readme_path = join(src_dir, readme_path) + if exists(readme_path): + readme = open(readme_path, 'r').read().strip() + meta['long_description'] = readme + else: + meta['long_description'] = '' + + return meta + + +package = join(abspath(dirname(__file__)), 'sklearn_porter', 'package.json') +meta = _load_meta(package) setup( From 5394e136f0286a03310c0030000ce7808f557d95 Mon Sep 17 00:00:00 2001 From: Darius Morawiec Date: Sun, 20 Jan 2019 13:51:56 +0100 Subject: [PATCH 4/4] release/0.7.2: Release patch 0.7.2 --- changelog.md | 2 +- sklearn_porter/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index f92dce35..2ab8cdc9 100644 --- a/changelog.md +++ b/changelog.md @@ -11,7 +11,7 @@ All notable changes to this project will be documented in this file. ### Changed - +## 0.7.2 ## 0.7.1 ### Fixed diff --git a/sklearn_porter/package.json b/sklearn_porter/package.json index 25ef36fa..43d9558d 100644 --- a/sklearn_porter/package.json +++ b/sklearn_porter/package.json @@ -7,6 +7,6 @@ "url": "https://github.com/nok/sklearn-porter", "keywords": ["sklearn", "scikit-learn"], "requirements": "file://../requirements.txt", - "version": "0.7.1", + "version": "0.7.2", "license": "MIT" }