-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
224 changed files
with
3,078 additions
and
3,637 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.