diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 00000000..254d288c --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,14 @@ +[bumpversion] +current_version = 4.1.3 +commit = True +tag = False + +[bumpversion:file:VERSION] + +[bumpversion:file:./cloudmesh/bar/__version__.py] +[bumpversion:file:./cloudmesh/bar/__init__.py] + + +search = version: {current_version} +replace = {new_version} + diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5dc748bc --- /dev/null +++ b/.gitignore @@ -0,0 +1,92 @@ +Makefilee +*.pye +.idea +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# IPython Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# dotenv +.env + +# virtualenv +venv/ +ENV/ + +# Spyder project settings +.spyderproject + +# Rope project settings +.ropeproject diff --git a/README-icons.md b/README-icons.md new file mode 100644 index 00000000..96e211fc --- /dev/null +++ b/README-icons.md @@ -0,0 +1,15 @@ +Documentation +============= + + +[![image](https://img.shields.io/travis/TankerHQ/cloudmesh-pi-burn.svg?branch=master)](https://travis-ci.org/TankerHQ/cloudmesn-pi-burn) + +[![image](https://img.shields.io/pypi/pyversions/cloudmesh-pi-burn.svg)](https://pypi.org/project/cloudmesh-pi-burn) + +[![image](https://img.shields.io/pypi/v/cloudmesh-pi-burn.svg)](https://pypi.org/project/cloudmesh-pi-burn/) + +[![image](https://img.shields.io/github/license/TankerHQ/python-cloudmesh-pi-burn.svg)](https://github.com/TankerHQ/python-cloudmesh-pi-burn/blob/master/LICENSE) + +see cloudmesh.cmd5 + +* https://github.com/cloudmesh/cloudmesh.cmd5 diff --git a/cloudmesh/__init__.py b/cloudmesh/__init__.py new file mode 100644 index 00000000..2e435f54 --- /dev/null +++ b/cloudmesh/__init__.py @@ -0,0 +1,3 @@ +import pkg_resources + +pkg_resources.declare_namespace(__name__) diff --git a/cloudmesh/burn/__init__.py b/cloudmesh/burn/__init__.py new file mode 100644 index 00000000..f9aa3e11 --- /dev/null +++ b/cloudmesh/burn/__init__.py @@ -0,0 +1 @@ +__version__ = "0.3.2" diff --git a/cloudmesh/burn/__version__.py b/cloudmesh/burn/__version__.py new file mode 100644 index 00000000..5189669c --- /dev/null +++ b/cloudmesh/burn/__version__.py @@ -0,0 +1 @@ +version = "0.3.2" diff --git a/cmburn/general/__init__.py b/cloudmesh/burn/command/__init__.py similarity index 100% rename from cmburn/general/__init__.py rename to cloudmesh/burn/command/__init__.py diff --git a/cloudmesh/burn/command/burn.py b/cloudmesh/burn/command/burn.py new file mode 100644 index 00000000..b1864b6e --- /dev/null +++ b/cloudmesh/burn/command/burn.py @@ -0,0 +1,41 @@ +from __future__ import print_function + +from cloudmesh.common.console import Console +from cloudmesh.common.debug import VERBOSE +from cloudmesh.shell.command import PluginCommand +from cloudmesh.shell.command import command + + +class BurnCommand(PluginCommand): + + # noinspection PyUnusedLocal + @command + def do_burn(self, args, arguments): + """ + :: + + Usage: + burn --file=FILE + burn list + + This command does some useful things. + + Arguments: + FILE a file name + + Options: + -f specify the file + + """ + arguments.FILE = arguments['--file'] or None + + VERBOSE(arguments) + + if arguments.FILE: + print("option a") + + elif arguments.list: + print("option b") + + Console.error("This is just a sample") + return "" diff --git a/cms/Makefile b/cms/Makefile new file mode 100644 index 00000000..026f0cb4 --- /dev/null +++ b/cms/Makefile @@ -0,0 +1,146 @@ +package=burn +UNAME=$(shell uname) +VERSION=`head -1 VERSION` + +define banner + @echo + @echo "###################################" + @echo $(1) + @echo "###################################" +endef + +all: install + +install: + pip install -e . + +source: + cd ../cloudmesh.cmd5; make source + $(call banner, "Install cloudmesh-{package}") + pip install -e . -U + cms help + +requirements: + echo "cloudmesh-cmd5" > tmp.txt + echo "cloudmesh-sys" >> tmp.txt + echo "cloudmesh-inventory" >> tmp.txt + echo "cloudmesh-configuration" >> tmp.txt + pip-compile setup.py + fgrep -v "# via" requirements.txt | fgrep -v "cloudmesh" >> tmp.txt + mv tmp.txt requirements.txt + git commit -m "update requirements" requirements.txt + git push + +manual: + mkdir -p docs-source/source/manual + cms help > /tmp/commands.rst + echo "Commands" > docs-source/source/manual/commands.rst + echo "========" >> docs-source/source/manual/commands.rst + echo >> docs-source/source/manual/commands.rst + tail -n +4 /tmp/commands.rst >> docs-source/source/manual/commands.rst + cms man --kind=rst burn > docs-source/source/manual/admin.rst + cms man --kind=rst foo > docs-source/source/manual/banner.rst + +doc: + rm -rf docs + mkdir -p dest + cd docs-source; make html + cp -r docs-source/build/html/ docs + +view: + open docs/index.html + +# +# TODO: BUG: This is broken +# +#pylint: +# mkdir -p docs/qc/pylint/cm +# pylint --output-format=html cloudmesh > docs/qc/pylint/cm/cloudmesh.html +# pylint --output-format=html cloud > docs/qc/pylint/cm/cloud.html + +clean: + $(call banner, "CLEAN") + rm -rf dist + rm -rf *.zip + rm -rf *.egg-info + rm -rf *.eggs + rm -rf docs/build + rm -rf build + find . -type d -name __pycache__ -delete + find . -name '*.pyc' -delete + rm -rf .tox + rm -f *.whl + +###################################################################### +# PYPI +###################################################################### + + +twine: + pip install -U twine + +dist: + python setup.py sdist bdist_wheel + twine check dist/* + +patch: clean requirements + $(call banner, "bbuild") + bump2version --no-tag --allow-dirty patch + python setup.py sdist bdist_wheel + git push + # git push origin master --tags + twine check dist/* + twine upload --repository testpypi dist/* + # $(call banner, "install") + # sleep 10 + # pip install --index-url https://test.pypi.org/simple/ cloudmesh-$(package) -U + + #make + #git commit -m "update documentation" docs + #git push + +minor: clean + $(call banner, "minor") + bump2version minor --allow-dirty + @cat VERSION + @echo + +release: clean + $(call banner, "release") + git tag "v$(VERSION)" + git push origin master --tags + python setup.py sdist bdist_wheel + twine check dist/* + twine upload --repository pypi dist/* + $(call banner, "install") + @cat VERSION + @echo + #sleep 10 + #pip install -U cloudmesh-common + + +dev: + bump2version --new-version "$(VERSION)-dev0" part --allow-dirty + bump2version patch --allow-dirty + @cat VERSION + @echo + +reset: + bump2version --new-version "4.0.0-dev0" part --allow-dirty + +upload: + twine check dist/* + twine upload dist/* + +pip: + pip install --index-url https://test.pypi.org/simple/ cloudmesh-$(package) -U + +# --extra-index-url https://test.pypi.org/simple + +log: + $(call banner, log) + gitchangelog | fgrep -v ":dev:" | fgrep -v ":new:" > ChangeLog + git commit -m "chg: dev: Update ChangeLog" ChangeLog + git push + + diff --git a/cms/setup.py b/cms/setup.py new file mode 100644 index 00000000..18363695 --- /dev/null +++ b/cms/setup.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python +# ----------------------------------------------------------------------- # +# Copyright 2017, Gregor von Laszewski, Indiana University # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. You may obtain # +# a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# 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. # +# ------------------------------------------------------------------------# + +import io + +from setuptools import find_packages, setup + + +def readfile(filename): + with io.open(filename, encoding="utf-8") as stream: + return stream.read().split() + + +# requiers = readfile ('requirements.txt') +# +# add minimum requirements here +# +requiers = """ +psutil +pygments +""".split("\n") + +# dependency_links = ['http://github.com/nicolaiarocci/eve.git@develop'] + +version = readfile("VERSION")[0].strip() + +with open('README.md') as f: + long_description = f.read() + +NAME = "cloudmesh-burn" +DESCRIPTION = "A command called burn and foo for the cloudmesh shell" +AUTHOR = "Gregor von Laszewski" +AUTHOR_EMAIL = "laszewski@gmail.com" +URL = "https://github.com/cloudmesh/cloudmesh-burn" + +setup( + name=NAME, + author=AUTHOR, + author_email=AUTHOR_EMAIL, + description=DESCRIPTION, + long_description=long_description, + long_description_content_type="text/markdown", + version=version, + license="Apache 2.0", + url=URL, + packages=find_packages(), + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 3", + ], + install_requires=requiers, + tests_require=[ + "flake8", + "coverage", + ], + zip_safe=False, + namespace_packages=['cloudmesh'], +) diff --git a/deprecated/general/__init__.py b/deprecated/general/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/cmburn/general/cmburn.py b/deprecated/general/cmburn.py similarity index 100% rename from cmburn/general/cmburn.py rename to deprecated/general/cmburn.py diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 00000000..6f5f2a40 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,4 @@ +nose +pytest +coverage +flake8 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..2a9acf13 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal = 1