diff --git a/Makefile b/Makefile index 2af53ba..89249ca 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ SHELL := /bin/bash .DEFAULT_GOAL := help -.PHONY: coverage deps help lint push test +.PHONY: coverage deps help lint push test doc build coverage: ## Run tests with coverage coverage erase @@ -24,6 +24,10 @@ test: ## Run tests doc: ## Update documentation make -C docs --makefile=Makefile html +build: ## Build package + rm -fr dist/* + python setup.py sdist bdist_wheel + doc-clean: ## Update documentation make -C docs --makefile=Makefile clean diff --git a/README.md b/README.md index f5024d9..dffced7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/35fa3dfd53a24a339344b33d9f9f2f3d)](https://www.codacy.com/gh/Doctorado-ML/STree?utm_source=github.com&utm_medium=referral&utm_content=Doctorado-ML/STree&utm_campaign=Badge_Grade) [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/Doctorado-ML/STree.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Doctorado-ML/STree/context:python) -# Stree +# STree Oblique Tree classifier based on SVM nodes. The nodes are built and splitted with sklearn SVC models. Stree is a sklearn estimator and can be integrated in pipelines, grid searches, etc. diff --git a/docs/requirements.txt b/docs/requirements.txt index 56c8516..acff299 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,4 @@ sphinx sphinx-rtd-theme myst-parser +git+https://github.com/doctorado-ml/stree diff --git a/docs/source/stree.md b/docs/source/stree.md index a525fb8..5f014f5 100644 --- a/docs/source/stree.md +++ b/docs/source/stree.md @@ -1,4 +1,4 @@ -# Stree +# STree [![Codeship Status for Doctorado-ML/STree](https://app.codeship.com/projects/8b2bd350-8a1b-0138-5f2c-3ad36f3eb318/status?branch=master)](https://app.codeship.com/projects/399170) [![codecov](https://codecov.io/gh/doctorado-ml/stree/branch/master/graph/badge.svg)](https://codecov.io/gh/doctorado-ml/stree) diff --git a/setup.py b/setup.py index 959d6dd..e5850ce 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ import setuptools -import stree def readme(): @@ -7,11 +6,23 @@ def readme(): return f.read() -VERSION = stree.__version__ +def get_data(field): + item = "" + with open("stree/__init__.py") as f: + for line in f.readlines(): + if line.startswith(f"__{field}__"): + delim = '"' if '"' in line else "'" + item = line.split(delim)[1] + break + else: + raise RuntimeError(f"Unable to find {field} string.") + return item + + setuptools.setup( name="STree", - version=stree.__version__, - license=stree.__license__, + version=get_data("version"), + license=get_data("license"), description="Oblique decision tree with svm nodes", long_description=readme(), long_description_content_type="text/markdown", @@ -21,19 +32,19 @@ setuptools.setup( "Code": "https://github.com/Doctorado-ML/STree", "Documentation": "https://stree.readthedocs.io/en/latest/index.html", }, - author=stree.__author__, - author_email=stree.__author_email__, + author=get_data("author"), + author_email=get_data("author_email"), keywords="scikit-learn oblique-classifier oblique-decision-tree decision-\ tree svm svc", classifiers=[ "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: " + stree.__license__, + "License :: OSI Approved :: " + get_data("license"), "Programming Language :: Python :: 3.8", "Natural Language :: English", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Intended Audience :: Science/Research", ], - install_requires=["scikit-learn", "numpy", "ipympl"], + install_requires=["scikit-learn", "numpy"], test_suite="stree.tests", zip_safe=False, ) diff --git a/stree/.readthedocs.yaml b/stree/.readthedocs.yaml new file mode 100644 index 0000000..6b44aba --- /dev/null +++ b/stree/.readthedocs.yaml @@ -0,0 +1,10 @@ +version: 2 + +sphinx: + configuration: docs/source/conf.py + +python: + version: 3.8 + install: + - requirements: requirements.txt + - requirements: docs/requirements.txt