Skip to content

Commit

Permalink
preparation for cms integration
Browse files Browse the repository at this point in the history
  • Loading branch information
laszewsk committed Apr 9, 2020
1 parent a50b7da commit f88e6fb
Show file tree
Hide file tree
Showing 14 changed files with 397 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -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}

92 changes: 92 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions README-icons.md
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions cloudmesh/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import pkg_resources

pkg_resources.declare_namespace(__name__)
1 change: 1 addition & 0 deletions cloudmesh/burn/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.3.2"
1 change: 1 addition & 0 deletions cloudmesh/burn/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "0.3.2"
File renamed without changes.
41 changes: 41 additions & 0 deletions cloudmesh/burn/command/burn.py
Original file line number Diff line number Diff line change
@@ -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 ""
146 changes: 146 additions & 0 deletions cms/Makefile
Original file line number Diff line number Diff line change
@@ -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


78 changes: 78 additions & 0 deletions cms/setup.py
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]"
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'],
)
Empty file added deprecated/general/__init__.py
Empty file.
File renamed without changes.
Loading

0 comments on commit f88e6fb

Please sign in to comment.