diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 22f83f2..09329ab 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.0.0 +current_version = 0.0.1 commit = True tag = True @@ -11,7 +11,7 @@ replace = version="{new_version}" search = v{current_version}. replace = v{new_version}. -[bumpversion:file:docs/conf.py] +[bumpversion:file:docs/source/conf.py] search = version = release = "{current_version}" replace = version = release = "{new_version}" diff --git a/AUTHORS.rst b/AUTHORS.rst index 56b21a2..14b1d3a 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -2,4 +2,6 @@ Authors ======= -* Pierre-Luc St-Charles - pierreluc.stcharlesgmail.com +* Pierre-Luc St-Charles - stcharplcrim.ca +* Francis Charette Migneault - francis.charette-migneaultcrim.ca +* Mario Beaulieu - mario.beaulieucrim.ca diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a292e8f..e6db195 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,7 +2,7 @@ Changelog ========= -0.1.0 (Summer 2018) +0.0.1 (2018/10/03) ------------------- -* Initial WiP release. +* Initial release (work in progress). diff --git a/LICENSE b/LICENSE index bbc0693..0004b4c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Apache Software License 2.0 -Copyright (c) 2018, Pierre-Luc St-Charles +Copyright (c) 2018, Centre de Recherche Informatique de Montreal (CRIM) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,4 +12,4 @@ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and -limitations under the License. \ No newline at end of file +limitations under the License. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5a0a89d --- /dev/null +++ b/Makefile @@ -0,0 +1,184 @@ +define BROWSER_PYSCRIPT +import os, webbrowser, sys +try: + from urllib import pathname2url +except: + from urllib.request import pathname2url + +webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) +endef +export BROWSER_PYSCRIPT +BROWSER := python -c "$$BROWSER_PYSCRIPT" + +CUR_DIR := $(abspath $(lastword $(MAKEFILE_LIST))/..) +APP_ROOT := $(CURDIR) +APP_NAME := $(shell basename $(APP_ROOT)) + +# Anaconda +ANACONDA_HOME ?= $(HOME)/anaconda +CONDA_ENV ?= $(APP_NAME) +CONDA_ENVS_DIR ?= $(HOME)/.conda/envs +CONDA_ENV_PATH := $(CONDA_ENVS_DIR)/$(CONDA_ENV) +DOWNLOAD_CACHE := $(APP_ROOT)/downloads +PYTHON_VERSION := 3.6 + +# choose anaconda installer depending on your OS +ANACONDA_URL = https://repo.continuum.io/miniconda +OS_NAME := $(shell uname -s 2>/dev/null || echo "unknown") +ifeq "$(OS_NAME)" "Linux" +FN := Miniconda3-latest-Linux-x86_64.sh +else ifeq "$(OS_NAME)" "Darwin" +FN := Miniconda3-latest-MacOSX-x86_64.sh +else +FN := unknown +endif + + +.DEFAULT_GOAL := help + +.PHONY: all +all: help + +.PHONY: help +help: + @echo "bump bump version using version specified as user input" + @echo "bump-dry bump version using version specified as user input (dry-run)" + @echo "bump-tag bump version using version specified as user input, tags it and commits the change in git" + @echo "clean remove all build, test, coverage and Python artifacts" + @echo "clean-build remove build artifacts" + @echo "clean-env remove package environment" + @echo "clean-pyc remove Python file artifacts" + @echo "clean-test remove test and coverage artifacts" + @echo "lint check style with flake8" + @echo "test run tests quickly with the default Python" + @echo "test-all run tests on every Python version with tox" + @echo "coverage check code coverage quickly with the default Python" + @echo "docs generate Sphinx HTML documentation, including API docs" + @echo "release package and upload a release" + @echo "dist package" + @echo "install install the package to the active Python's site-packages" + @echo "install-docs install docs related components" + @echo "update same as 'install' but without conda packages installation" + +.PHONY: bump +bump: conda_env + $(shell bash -c 'read -p "Version: " VERSION_PART; \ + source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV); \ + $(CONDA_ENV_PATH)/bin/bumpversion --config-file $(CUR_DIR)/.bumpversion.cfg \ + --verbose --allow-dirty --no-tag --new-version $$VERSION_PART patch;') + +.PHONY: bump-dry +bump-dry: conda_env + $(shell bash -c 'read -p "Version: " VERSION_PART; \ + source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV); \ + $(CONDA_ENV_PATH)/bin/bumpversion --config-file $(CUR_DIR)/.bumpversion.cfg \ + --verbose --allow-dirty --dry-run --tag --tag-name "{new_version}" --new-version $$VERSION_PART patch;') + +.PHONY: bump-tag +bump-tag: conda_env + $(shell bash -c 'read -p "Version: " VERSION_PART; \ + source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV); \ + $(CONDA_ENV_PATH)/bin/bumpversion --config-file $(CUR_DIR)/.bumpversion.cfg \ + --verbose --allow-dirty --tag --tag-name "{new_version}" --new-version $$VERSION_PART patch;') + +.PHONY: clean +clean: clean-build clean-pyc clean-test + +.PHONY: clean-build +clean-build: + rm -fr $(CUR_DIR)/build/ + rm -fr $(CUR_DIR)/dist/ + rm -fr $(CUR_DIR)/.eggs/ + find . -type f -name '*.egg-info' -exec rm -fr {} + + find . -type f -name '*.egg' -exec rm -f {} + + +.PHONY: clean-env +clean-test: + @-test -d $(CONDA_ENV_PATH) && "$(ANACONDA_HOME)/bin/conda" remove -n $(CONDA_ENV) --yes --all + +.PHONY: clean-pyc +clean-pyc: + find . -type f -name '*.pyc' -exec rm -f {} + + find . -type f -name '*.pyo' -exec rm -f {} + + find . -type f -name '*~' -exec rm -f {} + + find . -type f -name '__pycache__' -exec rm -fr {} + + +.PHONY: clean-test +clean-test: + rm -fr $(CUR_DIR)/.tox/ + rm -f $(CUR_DIR)/.coverage + rm -fr $(CUR_DIR)/coverage/ + +.PHONY: lint +lint: + flake8 api tests + +.PHONY: test +test: + python $(CUR_DIR)/setup.py test + +.PHONY: test-all +test-all: + tox + +.PHONY: coverage +coverage: + coverage run --source src/thelper setup.py test + coverage report -m + coverage html -d coverage + $(BROWSER) coverage/index.html + +.PHONY: docs +docs: install-docs + echo $(CUR_DIR) + # generate module docs from code + $(CUR_DIR)/docs/sphinx "apidoc" -o $(CUR_DIR)/docs/source $(CUR_DIR)/src + # generate documentation from generated code docs and other metadata + $(MAKE) -C $(CUR_DIR)/docs clean + $(MAKE) -C $(CUR_DIR)/docs html + $(BROWSER) $(CUR_DIR)/docs/build/html/index.html + +.PHONY: install-docs +install-docs: clean conda_env + @-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV); pip install -r $(CUR_DIR)/docs/requirements.txt" + +.PHONY: install +install: clean conda_env + # install packages that fail with pip using conda instead + @-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV); $(ANACONDA_HOME)/bin/conda install -y gdal pyproj" + @-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV); pip install -r $(CUR_DIR)/requirements.txt" + # enforce pip install using cloned repo + @-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV); pip install $(CUR_DIR)/src/thelper --no-deps" + $(MAKE) clean + +.PHONY: update +update: clean + @-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV); pip install $(CUR_DIR)" + +# Anaconda targets + +.PHONY: anaconda +anaconda: + @echo "Installing Anaconda ..." + @test -d $(ANACONDA_HOME) || curl $(ANACONDA_URL)/$(FN) --silent --insecure --output "$(DOWNLOAD_CACHE)/$(FN)" + @test -d $(ANACONDA_HOME) || bash "$(DOWNLOAD_CACHE)/$(FN)" -b -p $(ANACONDA_HOME) + @echo "Add '$(ANACONDA_HOME)/bin' to your PATH variable in '.bashrc'." + +.PHONY: conda_config +conda_config: anaconda + @echo "Update ~/.condarc" + @"$(ANACONDA_HOME)/bin/conda" config --add envs_dirs $(CONDA_ENVS_DIR) + @"$(ANACONDA_HOME)/bin/conda" config --set ssl_verify true + @"$(ANACONDA_HOME)/bin/conda" config --set use_pip true + @"$(ANACONDA_HOME)/bin/conda" config --set channel_priority true + @"$(ANACONDA_HOME)/bin/conda" config --set auto_update_conda false + @"$(ANACONDA_HOME)/bin/conda" config --add channels defaults + @"$(ANACONDA_HOME)/bin/conda" config --append channels birdhouse + @"$(ANACONDA_HOME)/bin/conda" config --append channels conda-forge + +.PHONY: conda_env +conda_env: anaconda conda_config + @echo "Update conda environment $(CONDA_ENV) using $(ANACONDA_HOME) ..." + @test -d $(CONDA_ENV_PATH) || "$(ANACONDA_HOME)/bin/conda" create -y -n $(CONDA_ENV) python=$(PYTHON_VERSION) + "$(ANACONDA_HOME)/bin/conda" install -y -n $(CONDA_ENV) setuptools=$(SETUPTOOLS_VERSION) + @-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV); pip install --upgrade pip" diff --git a/README.rst b/README.rst index 453b437..f2b983c 100644 --- a/README.rst +++ b/README.rst @@ -22,7 +22,7 @@ Overview .. |commits-since| image:: https://img.shields.io/github/commits-since/plstcharles/thelper/latest.svg :alt: Commits since latest release - :target: https://github.com/plstcharles/thelper/compare/v0.0.0...master + :target: https://github.com/plstcharles/thelper/compare/v0.0.1...master .. not ready for live version (WiP) @@ -58,38 +58,38 @@ This library provides training help & tools for PyTorch-based machine learning p Installation ============ - + :: - + pip install thelper - + Documentation ============= - + https://thelper.readthedocs.io/ - + Development =========== - + To run the all tests run:: - + tox - + Note, to combine the coverage data from all the tox environments run: - + .. list-table:: :widths: 10 90 :stub-columns: 1 - + - - Windows - :: - + set PYTEST_ADDOPTS=--cov-append tox - + - - Other - :: - + PYTEST_ADDOPTS=--cov-append tox ===== @@ -102,10 +102,14 @@ To install locally, use ``pip install -e ``, or ``pip install Current dependencies: - augmentor>=0.2.2 - - matplotlib>=2.2.2 - - numpy>=1.14.0 + - matplotlib + - numpy - opencv-python>=3.3.0 - torch>=0.4.0 - torchvision>=0.2.1 + - tensorflow (for tensorboard only) + - tensorboardX==1.2 + - bumpversion + - scikit-learn The project's structure was originally generated by `cookiecutter `_ via `ionelmc's template `_. diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..53677ae --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,184 @@ +# Makefile for Sphinx documentation +# +CUR_DIR := $(abspath $(lastword $(MAKEFILE_LIST))/..) + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = ./sphinx +PAPER = +BUILDDIR = $(CUR_DIR)/build + +# User-friendly check for sphinx +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " applehelp to make an Apple Help Book" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " coverage to run coverage check of the documentation (if enabled)" + +clean: + rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) build -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) build -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) build -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) build -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) build -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) build -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the .hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) build -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the .qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/twitcher.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/twitcher.qhc" + +applehelp: + $(SPHINXBUILD) build -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp + @echo + @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." + @echo "N.B. You won't be able to view it unless you put it in ~/Library/Documentation/Help or install it in your application bundle." + +devhelp: + $(SPHINXBUILD) build -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/twitcher" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/twitcher" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) build -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) build -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex (use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) build -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +latexpdfja: + $(SPHINXBUILD) build -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) build -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) build -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) build -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo (use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) build -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) build -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) build -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) build -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) build -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the results in $(BUILDDIR)/doctest/output.txt." + +coverage: + $(SPHINXBUILD) build -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage + @echo "Testing of coverage in the sources finished, look at the results in $(BUILDDIR)/coverage/python.txt." + +xml: + $(SPHINXBUILD) build -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +pseudoxml: + $(SPHINXBUILD) build -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/docs/source/.gitignore b/docs/source/.gitignore new file mode 100644 index 0000000..fcd1336 --- /dev/null +++ b/docs/source/.gitignore @@ -0,0 +1,3 @@ +modules.rst +thelper.modules.rst +thelper.rst diff --git a/docs/authors.rst b/docs/source/authors.rst similarity index 100% rename from docs/authors.rst rename to docs/source/authors.rst diff --git a/docs/changelog.rst b/docs/source/changelog.rst similarity index 100% rename from docs/changelog.rst rename to docs/source/changelog.rst diff --git a/docs/conf.py b/docs/source/conf.py similarity index 97% rename from docs/conf.py rename to docs/source/conf.py index a4325a8..09bfa17 100644 --- a/docs/conf.py +++ b/docs/source/conf.py @@ -23,7 +23,7 @@ year = "2018" author = "Pierre-Luc St-Charles" copyright = "{0}, {1}".format(year, author) -version = release = "0.0.0" +version = release = "0.0.1" pygments_style = "trac" templates_path = ["."] diff --git a/docs/contributing.rst b/docs/source/contributing.rst similarity index 100% rename from docs/contributing.rst rename to docs/source/contributing.rst diff --git a/docs/index.rst b/docs/source/index.rst similarity index 100% rename from docs/index.rst rename to docs/source/index.rst diff --git a/docs/installation.rst b/docs/source/installation.rst similarity index 100% rename from docs/installation.rst rename to docs/source/installation.rst diff --git a/docs/readme.rst b/docs/source/readme.rst similarity index 100% rename from docs/readme.rst rename to docs/source/readme.rst diff --git a/docs/reference/index.rst b/docs/source/reference/index.rst similarity index 100% rename from docs/reference/index.rst rename to docs/source/reference/index.rst diff --git a/docs/reference/thelper.rst b/docs/source/reference/thelper.rst similarity index 100% rename from docs/reference/thelper.rst rename to docs/source/reference/thelper.rst diff --git a/docs/requirements.txt b/docs/source/requirements.txt similarity index 100% rename from docs/requirements.txt rename to docs/source/requirements.txt diff --git a/docs/spelling_wordlist.txt b/docs/source/spelling_wordlist.txt similarity index 100% rename from docs/spelling_wordlist.txt rename to docs/source/spelling_wordlist.txt diff --git a/docs/usage.rst b/docs/source/usage.rst similarity index 100% rename from docs/usage.rst rename to docs/source/usage.rst diff --git a/docs/sphinx b/docs/sphinx new file mode 100755 index 0000000..f167738 --- /dev/null +++ b/docs/sphinx @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +import os +import sys +import argparse + +import sphinx.cmd.build +import sphinx.cmd.quickstart +import sphinx.ext.apidoc +import sphinx.ext.autosummary.generate + +cur_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../src/thelper')) +sys.path.insert(0, cur_dir) + + +def main(argv=sys.argv): + ap = argparse.ArgumentParser(description='thelper sphinx documentation generator') + ap.add_argument('mode', type=str, choices=['build', 'quickstart', 'apidoc', 'summary'], + help="prints the version of the library and exits") + runner_args = ap.parse_args(args=argv[1:2]) + sphinx_args = argv[2:] + if runner_args.mode == 'build': + sys.exit(sphinx.cmd.build.main(sphinx_args)) + elif runner_args.mode == 'quickstart': + sys.exit(sphinx.cmd.quickstart.main(sphinx_args)) + elif runner_args.mode == 'apidoc': + sys.exit(sphinx.ext.apidoc.main(sphinx_args)) + elif runner_args.mode == 'summary': + sys.exit(sphinx.ext.autosummary.generate.main(sphinx_args)) + else: + raise ValueError("unknown sphinx mode `{!r}`".format(runner_args.mode)) + + +if __name__ == '__main__': + main() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..daeed58 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,15 @@ +torch +torchvision +bumpversion +matplotlib +cython +torch +opencv-python +# tensorflow required for tensorboard only +tensorflow +# numpy version requirement set by tensorflow +numpy<=1.14.5 +scipy +scikit-learn +augmentor +tensorboardX==1.2 diff --git a/setup.py b/setup.py index beed43e..d9e47e2 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,6 @@ def _unavailable(self, e): Optimizations for this package will not be available! """) - print("CAUSE:") print("") print(" " + repr(e)) @@ -50,7 +49,7 @@ def _unavailable(self, e): setuptools.setup( name="thelper", - version="0.0.0", + version="0.0.1", license="Apache Software License 2.0", description="Provides training help & tools for PyTorch-based machine learning projects.", long_description="%s\n%s" % ( @@ -58,7 +57,7 @@ def _unavailable(self, e): re.sub(":[a-z]+:`~?(.*?)`", r"``\1``", read("CHANGELOG.rst")) ), author="Pierre-Luc St-Charles", - author_email="pierreluc.stcharles@gmail.com", + author_email="stcharpl@crim.ca", url="https://github.com/plstcharles/thelper", packages=setuptools.find_packages("src"), package_dir={"": "src"}, diff --git a/src/thelper/__init__.py b/src/thelper/__init__.py index ca8b792..31d8466 100644 --- a/src/thelper/__init__.py +++ b/src/thelper/__init__.py @@ -12,5 +12,5 @@ logger = logging.getLogger("thelper") -__version__ = "0.0.0" +__version__ = "0.0.1" __url__ = "https://github.com/plstcharles/thelper"