Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MacHu-GWU committed Aug 6, 2019
1 parent bcf1152 commit b5ba147
Show file tree
Hide file tree
Showing 224 changed files with 3,078 additions and 3,637 deletions.
7 changes: 5 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Coverage.py is a tool for measuring code coverage of Python programs.
# for more info: https://coverage.readthedocs.io/en/coverage-4.4.1/config.html
# for more info: https://coverage.readthedocs.io/en/latest/config.html
[run]
omit =
wotlkdoc/_version.py
wotlkdoc/cli.py
wotlkdoc/pkg/*
wotlkdoc/docs/*
wotlkdoc/tests/*
wotlkdoc/handlers/*

[report]
# Regexes for lines to exclude from consideration
Expand All @@ -22,4 +25,4 @@ exclude_lines =

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
if __name__ == .__main__.:
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
language: python

python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"

install:
Expand All @@ -18,4 +15,4 @@ notifications:
email: false # Mute email notification

after_success:
- codecov # travis-ci will transfer data to codecov after success
- codecov # travis-ci will transfer data to codecov after success
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright 2018 Sanhe Hu <https://github.com/MacHu-GWU/wotlkdoc-project>
Copyright 2019 Sanhe Hu <https://github.com/MacHu-GWU/wotlkdoc-project>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ include *.txt
include *.rst
recursive-include wotlkdoc *.*
recursive-exclude *.pyc
recursive-exclude *.pyo
recursive-exclude *.pyo
119 changes: 118 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,118 @@
include ./make/python_env.mk
# -*- coding: utf-8 -*-
#
# This file is generated by cookiecutter-pygitrepo 0.0.2: https://github.com/MacHu-GWU/cookiecutter-pygitrepo/tree/0.0.2

help: ## ** Show this help message
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-40s\033[0m %s\n", $$1, $$2}'


up: ## ** Set Up the Virtual Environment
bash ./bin/py/venv-up.sh


remove: ## ** Remove Virtual Environment
bash ./bin/py/venv-remove.sh


clean: ## Clean temp files
bash ./bin/py/clean.sh


#--- Install ---
pip-uninstall: ## ** Uninstall This Package
bash ./bin/py/pip-uninstall.sh


pip-install: pip-uninstall ## ** Install This Package via setup.py
bash ./bin/py/pip-install.sh


pip-dev-install: pip-uninstall ## ** Install This Package in Editable Mode
bash ./bin/py/pip-dev-install.sh


req-dev: ## Install Development Dependencies
bash ./bin/py/req-dev.sh


req-doc: ## Install Document Dependencies
bash ./bin/py/req-doc.sh


req-test: ## Install Test Dependencies
bash ./bin/py/req-test.sh


#--- Test ---
test: req-test pip-dev-install test-only ## ** Run test


test-only: ## Run test without checking test dependencies
bash ./bin/py/test.sh


cov: req-test pip-dev-install cov-only ## ** Run Code Coverage test


cov-only: ## Run Code Coverage test without checking test dependencies
bash ./bin/py/test-cov.sh


tox: ## Run multi python version test with tox
bash ./bin/py/test-tox.sh


#--- Document ---
build-doc: req-doc pip-dev-install ## ** Build Documents, start over
bash ./bin/py/build-doc.sh


build-doc-only: ## Build Documents, skip check doc dependencies, skip clean existing doc
bash ./bin/py/build-doc-only.sh


view-doc: ## ** Open Html Document
bash ./bin/py/view-doc.sh


deploy-doc-to-version: ## Deploy Html Document to the "x.x.x" version directory on AWS S3
bash ./bin/py/deploy-doc-to-version.sh


deploy-doc-to-latest: ## Deploy Html Document to the "latest" directory on AWS S3
bash ./bin/py/deploy-doc-to-latest.sh


deploy-doc: ## ** Deploy Html Document to both "x.x.x" and "latest" directory on AWS S3
bash ./bin/py/deploy-doc.sh


build-and-deploy-doc: build-doc deploy-doc ## ** Build and deploy Html Document to AWS S3


clean-doc: ## ** Deploy Html Document to AWS S3
bash ./bin/py/clean-doc.sh


#--- Other ---
reformat: req-dev ## ** Pep8 Format Python Source Code
bash ./bin/py/reformat-python-code.sh


publish: req-dev pip-dev-install ## ** Publish This Package to PyPI
bash ./bin/py/publish-to-pypi.sh


notebook: ## ** Run jupyter notebook
bash ./bin/py/run-notebook.sh


info: ## ** Show information about python, pip in this environment
bash ./bin/py/info.sh


req-info: ## Show requirements information
bash ./bin/py/req-info.sh



2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

.. image:: https://readthedocs.org/projects/wotlkdoc/badge/?version=latest
:target: https://wotlkdoc.readthedocs.io/?badge=latest
:target: https://wotlkdoc.readthedocs.io/index.html
:alt: Documentation Status

.. image:: https://travis-ci.org/MacHu-GWU/wotlkdoc-project.svg?branch=master
Expand Down
17 changes: 17 additions & 0 deletions bin/py/build-doc-only.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# -*- coding: utf-8 -*-

dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir_bin="$(dirname "${dir_here}")"
dir_project_root=$(dirname "${dir_bin}")

source ${dir_bin}/py/python-env.sh

print_colored_line $color_cyan "[DOING] Build doc at ${path_sphinx_index_html} ..."

rm_if_exists "${path_sphinx_doc_source}/${package_name}"
(
source ${bin_activate};
cd ${path_sphinx_doc};
make html;
)
17 changes: 17 additions & 0 deletions bin/py/build-doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# -*- coding: utf-8 -*-

dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir_bin="$(dirname "${dir_here}")"
dir_project_root=$(dirname "${dir_bin}")

source ${dir_bin}/py/python-env.sh

print_colored_line $color_cyan "[DOING] Build doc at ${path_sphinx_index_html} ..."
rm_if_exists "${path_sphinx_doc_build}/html"
rm_if_exists "${path_sphinx_doc_source}/${package_name}"
(
source ${bin_activate};
cd ${path_sphinx_doc};
make html;
)
11 changes: 11 additions & 0 deletions bin/py/clean-doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# -*- coding: utf-8 -*-

dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir_bin="$(dirname "${dir_here}")"
dir_project_root=$(dirname "${dir_bin}")

source ${dir_bin}/py/python-env.sh

print_colored_line $color_cyan "[DOING] remove ${path_sphinx_doc_build} ..."
rm -r ${path_sphinx_doc_build}
29 changes: 29 additions & 0 deletions bin/py/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# -*- coding: utf-8 -*-
#
# Clean up all temp dir and files (except virtualenv)

dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir_bin="$(dirname "${dir_here}")"
dir_project_root=$(dirname "${dir_bin}")

source ${dir_bin}/py/python-env.sh

print_colored_line $color_cyan "[DOING] remove all temp files ..."

tmp_to_remove_list=(
${path_coverage_annotate_dir}
${path_tox_dir}
${path_build_dir}
${path_dist_dir}
${path_egg_dir}
${path_pytest_cache_dir}
${path_sphinx_doc_build}
${path_lambda_deploy_pkg_file}
)

for tmp_path in "${tmp_to_remove_list[@]}"
do
echo "remove ${tmp_path}"
rm_if_exists ${tmp_path}
done
15 changes: 15 additions & 0 deletions bin/py/deploy-doc-to-latest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# -*- coding: utf-8 -*-
#
# Deploy html doc to s3://<s3-bucket-name>/<dir-prefix>/<package-name>/latest


dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir_bin="$(dirname "${dir_here}")"
dir_project_root=$(dirname "${dir_bin}")

source ${dir_bin}/py/python-env.sh


print_colored_line $color_cyan "[DOING] deploy ${path_sphinx_doc_build_html} to ${s3_uri_doc_latest} ..."
deploy_doc_to_s3 ${path_sphinx_doc_build_html} ${s3_uri_doc_latest}
14 changes: 14 additions & 0 deletions bin/py/deploy-doc-to-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# -*- coding: utf-8 -*-
#
# Deploy html doc to s3://<s3-bucket-name>/<dir-prefix>/<package-name>/<version>


dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir_bin="$(dirname "${dir_here}")"
dir_project_root=$(dirname "${dir_bin}")

source ${dir_bin}/py/python-env.sh

print_colored_line $color_cyan "[DOING] deploy ${path_sphinx_doc_build_html} to ${s3_uri_doc_versioned} ..."
deploy_doc_to_s3 ${path_sphinx_doc_build_html} ${s3_uri_doc_versioned}
21 changes: 21 additions & 0 deletions bin/py/deploy-doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# -*- coding: utf-8 -*-
#
# Deploy html doc to s3://<s3-bucket-name>/<dir-prefix>/<package-name>/<version>
# and s3://<s3-bucket-name>/<dir-prefix>/<package-name>/latest


dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir_bin="$(dirname "${dir_here}")"
dir_project_root=$(dirname "${dir_bin}")

source ${dir_bin}/py/python-env.sh

print_colored_line $color_cyan "[DOING] deploy ${path_sphinx_doc_build_html} to ${s3_uri_doc_versioned} ..."
deploy_doc_to_s3 ${path_sphinx_doc_build_html} ${s3_uri_doc_versioned}

print_colored_line $color_cyan "Also deploy to ${s3_uri_doc_latest} (y/n)? "
read answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
deploy_doc_to_s3 ${path_sphinx_doc_build_html} ${s3_uri_doc_latest}
fi
25 changes: 25 additions & 0 deletions bin/py/info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# -*- coding: utf-8 -*-

dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir_bin="$(dirname "${dir_here}")"
dir_project_root=$(dirname "${dir_bin}")

source ${dir_bin}/py/python-env.sh

print_colored_line ${color_cyan} "[DOING] print useful information:"
print_colored_ref_line ${color_light_blue} "venv" $(colored_path ${dir_venv})
print_colored_ref_line ${color_light_blue} "${package_name} installed at" $(colored_path "${dir_venv_site_packages}/${package_name}")
print_colored_ref_line ${color_light_blue} "python executable" $(colored_path ${bin_python})
print_colored_ref_line ${color_light_blue} "pip executable" $(colored_path ${bin_pip})
print_colored_ref_line ${color_light_blue} "activate venv" "source $(colored_path ${bin_activate})"
print_colored_ref_line ${color_light_blue} "deactivate venv" "deactivate"
print_colored_ref_line ${color_light_blue} "site-packages" $(colored_path ${dir_venv_site_packages})
print_colored_ref_line ${color_light_blue} "site-packages64" $(colored_path ${dir_venv_site_packages64})
print_colored_ref_line ${color_yellow} "local html doc" $(colored_path ${path_sphinx_index_html})
print_colored_ref_line ${color_yellow} "latest doc on readthedocs.org" ${rtd_url}
print_colored_ref_line ${color_yellow} "readthedocs project" ${rtd_project_url}
print_colored_ref_line ${color_yellow} "latest doc on s3.amazonaws.com" ${s3_doc_url}
print_colored_ref_line ${color_yellow} "versioned doc on s3" ${s3_uri_doc_versioned}
print_colored_ref_line ${color_yellow} "latest doc on s3" ${s3_uri_doc_latest}
print_colored_ref_line ${color_yellow} "readme file" $(colored_path ${path_readme})
11 changes: 11 additions & 0 deletions bin/py/pip-dev-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# -*- coding: utf-8 -*-

dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir_bin="$(dirname "${dir_here}")"
dir_project_root=$(dirname "${dir_bin}")

source ${dir_bin}/py/python-env.sh

print_colored_line $color_cyan "[DOING] pip install ${package_name} in editable mode ..."
${bin_pip} install --editable ${dir_project_root}
11 changes: 11 additions & 0 deletions bin/py/pip-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# -*- coding: utf-8 -*-

dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir_bin="$(dirname "${dir_here}")"
dir_project_root=$(dirname "${dir_bin}")

source ${dir_bin}/py/python-env.sh

print_colored_line $color_cyan "[DOING] pip install ${package_name} ..."
${bin_pip} install ${dir_project_root}
11 changes: 11 additions & 0 deletions bin/py/pip-uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# -*- coding: utf-8 -*-

dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir_bin="$(dirname "${dir_here}")"
dir_project_root=$(dirname "${dir_bin}")

source ${dir_bin}/py/python-env.sh

print_colored_line $color_cyan "[DOING] pip uninstall ${package_name} ..."
${bin_pip} uninstall -y ${package_name}
23 changes: 23 additions & 0 deletions bin/py/publish-to-pypi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# -*- coding: utf-8 -*-
#
# Publish this Package to https://pypi.org/

dir_here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir_bin="$(dirname "${dir_here}")"
dir_project_root=$(dirname "${dir_bin}")

source ${dir_bin}/py/python-env.sh

print_colored_line $color_cyan "[DOING] Publish ${package_name} to https://pypi.org ..."
rm_if_exists $path_build_dir
rm_if_exists $path_dist_dir
rm_if_exists $path_egg_dir
(
cd ${dir_project_root};
${bin_python} setup.py sdist bdist_wheel --universal;
${bin_twine} upload dist/*;
)
rm_if_exists $path_build_dir
rm_if_exists $path_dist_dir
rm_if_exists $path_egg_dir

0 comments on commit b5ba147

Please sign in to comment.