Skip to content

Commit

Permalink
Merge pull request #2990 from kinow/make-cylc-a-module-take-2
Browse files Browse the repository at this point in the history
Make cylc a module
  • Loading branch information
hjoliver authored Apr 25, 2019
2 parents a414d48 + c038e84 commit b1aa2f3
Show file tree
Hide file tree
Showing 63 changed files with 242 additions and 20,412 deletions.
20 changes: 14 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@
*.py[cod]
__pycache__/

# Generated documentation files (from 'cylc make-docs')
# - Command reference from called script 'custom/make-commands.sh'.
doc/src/appendices/command-ref.rst
# - Main directories of generated sphinx docs (guides) files.
doc/built-sphinx/
doc/built-sphinx-single/
# - Installed docs
doc/install/

# vim backup files
*.swp
Expand Down Expand Up @@ -40,3 +34,17 @@ passphrase
.coverage.*
coverage.xml
htmlcov/

# distutils files
build
dist
MANIFEST
cylc.egg-info
.eggs

# virtualenv
venv

# mypy
.mypy_cache/

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ jobs:
install:
- .travis/install.sh docs
script:
- cylc make-docs
- python setup.py build_sphinx
8 changes: 2 additions & 6 deletions .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,20 @@ args=("$@")

if grep -E '(unit-tests|functional-tests)' <<< "${args[@]}"; then
sudo apt-get install heirloom-mailx
# coverage dependencies
pip install coverage pytest-cov
# common Cylc reqirements
pip install colorama python-jose zmq empy
fi

if grep 'unit-tests' <<< "${args[@]}"; then
sudo apt-get install shellcheck
pip install pycodestyle pytest testfixtures empy
fi

# install dependencies required for building documentation
if grep 'docs' <<< "${args[@]}"; then
pip install sphinx
# for PDF output via LaTeX builder
sudo apt-get install texlive-latex-base
fi

pip install -e ."[all]"

# configure local SSH for Cylc jobs
ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
Expand Down
23 changes: 0 additions & 23 deletions Makefile

This file was deleted.

21 changes: 2 additions & 19 deletions bin/cylc
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,15 @@ CATEGORIES=('control' 'con' 'information' 'info' 'all' 'task' 'license' \

HELP_OPTS=('help' '--help' '-h' 'h' '?')

get_version() {
CYLC_VERSION="$(python -c "from cylc import __version__;\
print(__version__)")"
}

print_version() {
get_version
if [[ "$#" -eq 0 ]]; then
echo "$CYLC_VERSION"
fi
if [[ "$*" == 'long' || "$*" == '--long' ]]; then
echo "Cylc ${CYLC_VERSION} (${CYLC_DIR})"
fi
python3 -c "from cylc import __version__; print(__version__)"
}

init_cylc() {
set -eu

CYLC_HOME_BIN=$(cd "$(dirname "$0")" && pwd -P)
CYLC_DIR="$(dirname "${CYLC_HOME_BIN}")"

PATH="$(path_lead "${PATH:-}" "${CYLC_HOME_BIN}")"
PYTHONPATH="$(path_lead "${PYTHONPATH:-}" "${CYLC_DIR}/lib/")"
PYTHONUNBUFFERED='true'

export PATH PYTHONPATH PYTHONUNBUFFERED CYLC_DIR
export PYTHONUNBUFFERED
}

help_util() {
Expand Down
3 changes: 1 addition & 2 deletions bin/cylc-documentation
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def main():

parser.add_option(
"--local",
help=("Open the local documentation (if it has been built, see cylc "
"make-docs)."),
help="Open the local documentation (if it has been built).",
action="store_true", default=False, dest="local")

parser.add_option(
Expand Down
2 changes: 0 additions & 2 deletions bin/cylc-help
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ admin_commands = {}
admin_commands['test-battery'] = ['test-battery']
admin_commands['import-examples'] = ['import-examples']
admin_commands['check-software'] = ['check-software']
admin_commands['make-docs'] = ['make-docs']

preparation_commands = {}
preparation_commands['register'] = ['register']
Expand Down Expand Up @@ -332,7 +331,6 @@ comsum = {}
comsum['test-battery'] = 'Run a battery of self-diagnosing test suites'
comsum['import-examples'] = 'Import example suites your suite run directory'
comsum['check-software'] = 'Check required software is installed'
comsum['make-docs'] = 'Build the HTML documentation with Sphinx.'
# preparation
comsum['register'] = 'Register a suite for use'
comsum['print'] = 'Print registered suites'
Expand Down
51 changes: 0 additions & 51 deletions bin/cylc-make-docs

This file was deleted.

5 changes: 5 additions & 0 deletions bin/cylc-test-battery
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ export CYLC_TEST_IS_GENERIC=true
CYLC_TEST_TIME_INIT="$(date -u +'%Y%m%dT%H%M%SZ')"
export CYLC_TEST_TIME_INIT

# CYLC_DIR does not work under virtualenv
if [[ -n ${TRAVIS_BUILD_DIR:-} ]]; then
export CYLC_DIR="${TRAVIS_BUILD_DIR}"
fi

if [[ "$PWD" != "$CYLC_DIR" ]]; then
echo "cd \"$CYLC_DIR\""
cd "$CYLC_DIR" || exit 1
Expand Down
20 changes: 0 additions & 20 deletions lib/isodatetime/__init__.py

This file was deleted.

Loading

0 comments on commit b1aa2f3

Please sign in to comment.