Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FromTim: suggested changes to Collections looking to Python3.8 #9

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
68c9cdc
py3: handle file opens lib/cylc/
oliver-sanders Jan 28, 2019
696f643
py3: handle file opens lib/parsec/
oliver-sanders Jan 28, 2019
e01b3f0
py3: TEMP - patch Jinja2
oliver-sanders Jan 28, 2019
a973e94
py3: correct __slots__ usage
oliver-sanders Jan 28, 2019
3870e3a
py3: list comprehension leaky scope del statements
oliver-sanders Jan 28, 2019
64b8528
py3: patch __cmp__ functions
oliver-sanders Jan 30, 2019
49c8d92
py3: cmp to key
oliver-sanders Jan 30, 2019
df4885f
py3: misc changes
oliver-sanders Jan 28, 2019
2100249
cherrypy: remove bundled installation
oliver-sanders Jan 30, 2019
441f953
zmq: implement basic zmq server/client
oliver-sanders Feb 1, 2019
456ed7a
zmq: implement cylc configurations and interfaces
oliver-sanders Feb 5, 2019
4137437
more cycling hacks
oliver-sanders Feb 5, 2019
a282a23
py3: unicode
oliver-sanders Feb 6, 2019
7fab0a5
cat-state: refactor command
oliver-sanders Feb 7, 2019
3b2f7a2
review: unbundle cylc review
oliver-sanders Feb 8, 2019
23c6384
health check: move debug log line
oliver-sanders Feb 11, 2019
4ec85fb
scan: remove port scanning logic
oliver-sanders Feb 12, 2019
7e5bc71
scan: refactor command
oliver-sanders Feb 12, 2019
8e91945
remove old tests
oliver-sanders Feb 12, 2019
aa10f13
reference log: improve output
oliver-sanders Feb 15, 2019
63279ab
py3: add shebangs to remaining scripts
oliver-sanders Feb 18, 2019
c04079c
graph: re-implement --reference functionality
oliver-sanders Feb 18, 2019
c8a13f1
documentation: move docs test into its own Travis-CI stage
oliver-sanders Feb 18, 2019
904bb34
zmq: remove unused endpoints
oliver-sanders Feb 19, 2019
86db16a
empy: remove empy from testing (#2958)
oliver-sanders Feb 19, 2019
bb68a81
diffr: utility for differencing JSON files
oliver-sanders Feb 15, 2019
0db2492
auto stop-restart: forbid ambiguous hosts
oliver-sanders Feb 22, 2019
be9fa8e
auth-tests: fix scan tests, diable anon auth tests
oliver-sanders Feb 22, 2019
4174219
empy: disable validation tests
oliver-sanders Feb 22, 2019
5252c07
py3: fixing unit tests for loggingutil and scheduler
Feb 25, 2019
a5312d9
ci: python3 and refactor
oliver-sanders Feb 22, 2019
d20915f
db: remove legacy upgrade logic
oliver-sanders Feb 27, 2019
6fa6c76
zmq: open asyncio request interface
oliver-sanders Feb 27, 2019
7909a98
scan: use zmq asyncio interface
oliver-sanders Feb 27, 2019
9c9b328
tests: fix flaky timing dependent tests
oliver-sanders Mar 1, 2019
726a6e3
db: remove cylc-suite.db symlink
oliver-sanders Mar 1, 2019
fd53b8a
remove remaining gcylc and cherrypy legacy
oliver-sanders Mar 1, 2019
20fe29f
test: fix flaky test
oliver-sanders Mar 1, 2019
f523008
doc: remove gui documentation
oliver-sanders Mar 1, 2019
192b8d3
doc: remove cherrypy/http/https documentation
oliver-sanders Mar 1, 2019
b41f038
doc: update installation instructions
oliver-sanders Mar 1, 2019
b27bb78
pycodestyle
oliver-sanders Mar 1, 2019
6c5a6d9
py3: respond to feedback
oliver-sanders Mar 4, 2019
36c80e8
fromtim: suggested changes looking to Python3.8
wxtim Mar 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 0 additions & 12 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,15 @@ debug=
#include
note=
omit=
*/lib/cherrypy/*
*/lib/cylc/gui/*
*/lib/cylc/tests/*
*/lib/cylc/cylc_xdot.py
*/lib/cylc/profiler.py
*/lib/cylc/cfgspec/gcylc.py
*/lib/cylc/cfgspec/gscan.py
*/lib/cylc/profiling/*
*/lib/cylc/mkdir_p.py
*/lib/parsec/OrderedDictCompat.py
*/lib/isodatetime/*
*/lib/jinja2/*
*/lib/markupsafe/*
*/lib/parsec/tests/*
*/lib/xdot.py
parallel = True
plugins=
source=
Expand All @@ -64,21 +58,15 @@ fail_under=0
ignore_errors = False
include=
omit=
*/lib/cherrypy/*
*/lib/cylc/gui/*
*/lib/cylc/tests/*
*/lib/cylc/cylc_xdot.py
*/lib/cylc/profiler.py
*/lib/cylc/cfgspec/gcylc.py
*/lib/cylc/cfgspec/gscan.py
*/lib/cylc/profiling/*
*/lib/cylc/mkdir_p.py
*/lib/parsec/OrderedDictCompat.py
*/lib/isodatetime/*
*/lib/jinja2/*
*/lib/markupsafe/*
*/lib/parsec/tests/*
*/lib/xdot.py
partial_branches=
precision=2
show_missing=False
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# python bytecode
*.pyc
*.py[cod]
__pycache__/

# Generated documentation files (from 'cylc make-docs')
# - Command reference from called script 'custom/make-commands.sh'.
Expand Down
118 changes: 74 additions & 44 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,63 +25,93 @@
# More information for Travis can be found at http://docs.travis-ci.com/user/getting-started/

---
language: python
cache: pip
virtualenv:
# we need system packages in Travis-CI's virtualenv in order to access pygtk, installed via apt-get
system_site_packages: true
dist: xenial
addons:
apt:
# instruct travis-ci to always run apt-get before each build
update: true
update: true # instruct travis-ci to always run apt-get before each build

language: python

stages:
- unit-test
- test
- functional-test
- documentation

env:
global:
- PATH="${TRAVIS_BUILD_DIR}/bin:$PATH"
# Only run the generic tests on Travis CI.
- CYLC_TEST_RUN_PLATFORM=false
# Custom diff command to ignore Xlib errors (xvfb has not RANDR extension).
- CYLC_TEST_DIFF_CMD="diff -I Xlib -u"
# This coverage RC file is created under the script task
- COVERAGE_PROCESS_START="/tmp/.coveragerc"
matrix:
- CHUNK="1/4"
- CHUNK="2/4"
- CHUNK="3/4"
- CHUNK="4/4"
- PATH="${TRAVIS_BUILD_DIR}/bin:$PATH"
# Only run the generic tests on Travis CI.
- CYLC_TEST_RUN_PLATFORM=false
# Custom diff command to ignore Xlib errors (xvfb has not RANDR extension).
- CYLC_TEST_DIFF_CMD="diff -I Xlib -u"
# This coverage RC file is created under the script task
- COVERAGE_PROCESS_START="/tmp/.coveragerc"

unittest: &unittest
stage: unit-test
install:
- .travis/install.sh unit-tests
script:
- export PYTHONPATH=$(pwd -P)/lib/
- pycodestyle
- pytest --cov-append --cov=lib/cylc --cov=lib/parsec
after_success:
# Report metrics, such as coverage
- coverage combine --append
- coverage xml --ignore-errors
- bash <(curl -s https://codecov.io/bash)

# this is the default test stage, which is used for functional-tests
install: .travis/install.sh functional-tests docs
script:
- export PYTHONPATH="${TRAVIS_BUILD_DIR}/.travis"
# When we run cylc commands, there are processes being forked, that get a
# new working directory. As .coveragerc contains relatives paths, it fails
# to produce the correct coverage, unless we use absolute paths. The `sed`
# call below tries to define the data_file, and sources locations for Travis.
- sed -e "s|data_file=.coverage|data_file=${TRAVIS_BUILD_DIR}/.coverage|g; s|./bin|${TRAVIS_BUILD_DIR}/bin|g; s|./lib|${TRAVIS_BUILD_DIR}/lib|g" .coveragerc > /tmp/.coveragerc
# And some tests fail if we touch files in the git working directory, due
# to Cylc's version appearing with the "dirty" suffix. To avoid this, we
# are using a new coveragerc created under the temporary directory.
- coverage run .travis/cover.py
- unset PYTHONPATH
after_script: .travis/after_script.sh
after_success:
# Report metrics, such as coverage
- coverage combine --append
- coverage xml --ignore-errors
- bash <(curl -s https://codecov.io/bash)
regressiontest: &regressiontest
stage: functional-test
python:
- "3.7"
install:
- .travis/install.sh functional-tests docs
script:
- export PYTHONPATH="${TRAVIS_BUILD_DIR}/.travis"
- .travis/coverage-data.sh
- coverage run .travis/cover.py
- unset PYTHONPATH
after_failure:
- .travis/after_failure.sh
after_success:
# Report metrics, such as coverage
- coverage combine --append
- coverage xml --ignore-errors
- bash <(curl -s https://codecov.io/bash)

jobs:
include:
- stage: unit-test

# run unittests at each supported Python version
- <<: *unittest
python: "3.6"
- <<: *unittest
python: "3.7"

# run regression tests in chunks with the most contemporary
# supported Python version
- <<: *regressiontest
python: "3.7"
env: CHUNK="1/4"
- <<: *regressiontest
python: "3.7"
env: CHUNK="2/4"
- <<: *regressiontest
python: "3.7"
env: CHUNK="3/4"
- <<: *regressiontest
python: "3.7"
env: CHUNK="4/4"

# TODO: run shortlist of regression tests with the
# least contemporary Python version

# build documentation
- stage: documentation
python: "3.7"
install:
- .travis/install.sh unit-tests functional-tests
- .travis/install.sh docs
script:
- pycodestyle --ignore=E402,W503,W504 lib/cylc lib/Jinja2Filters/*.py lib/parsec/*.py $(grep -l '#!.*\<python\>' bin/*)
- PYTHONPATH=$(pwd -P)/lib/ pytest --cov-append --cov=lib/cylc --cov=lib/parsec
after_script: true
- cylc make-docs
2 changes: 2 additions & 0 deletions .travis/after_script.sh → .travis/after_failure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@

# Check output (more useful if you narrow down what tests get run)

cylc scan -f --color=never

find $HOME/cylc-run -name '*.err' -type f -exec echo '==== {} ====' \; -exec cat '{}' \;
find /tmp/${USER}/cylctb-* -type f -exec echo '==== {} ====' \; -exec cat '{}' \;
8 changes: 7 additions & 1 deletion bin/gcylc → .travis/coverage-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

exec "$(dirname "$0")/cylc" 'gui' "$@"
# When we run cylc commands, there are processes being forked, that get a
# new working directory. As .coveragerc contains relatives paths, it fails
# to produce the correct coverage, unless we use absolute paths. The `sed`
# call below tries to define the data_file, and sources locations for Travis.
sed -e "s|data_file=.coverage|data_file=${TRAVIS_BUILD_DIR}/.coverage|g; s|./bin|${TRAVIS_BUILD_DIR}/bin|g; s|./lib|${TRAVIS_BUILD_DIR}/lib|g" .coveragerc > /tmp/.coveragerc
# And some tests fail if we touch files in the git working directory, due
# to Cylc's version appearing with the "dirty" suffix. To avoid this, we
28 changes: 12 additions & 16 deletions .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,23 @@ shopt -s extglob

args=("$@")

# pygtk via apt-get, necessary for both unit and functional tests
sudo apt-get install graphviz libgraphviz-dev python-gtk2-dev heirloom-mailx
# coverage dependencies
pip install coverage pytest-cov mock

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

# install dependencies required for running functional tests
if grep 'functional-tests' <<< "${args[@]}"; then
# pygraphviz needs special treatment to avoid an error from "from . import release"
pip install EmPy pyopenssl
pip install pygraphviz \
--install-option="--include-path=/usr/include/graphviz" \
--install-option="--library-path=/usr/lib/graphviz/"
if grep 'unit-tests' <<< "${args[@]}"; then
pip install pycodestyle pytest mock
# TODO: EmPy removed from testing, see: #2958
fi

# install dependencies required for building documentation, only when instructed to do so
# 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

Expand Down
5 changes: 3 additions & 2 deletions .travis/sitecustomize.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# This file is used by Travis-CI to start the coverage process. In order to make
# Cylc and Python aware of it, we export PYTHONPATH when running the tests
# This file is used by Travis-CI to start the coverage process.
# In order to make Cylc and Python aware of it, we export PYTHONPATH when
# running the tests.

import coverage
coverage.process_startup()
8 changes: 0 additions & 8 deletions ACKNOWLEDGEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Licences for non-cylc work included in this distribution can be found in the
`licences/` directory.
* `lib/cherrypy/`:
External software library released under a BSD license.
Minor modification to ignore an import warning.
See [cherrypy](http://www.cherrypy.org/).
* `lib/isodatetime/`:
Unmodified external software library released under the LGPL license.
See [metomi/isodatetime](https://github.com/metomi/isodatetime/).
Expand All @@ -15,10 +11,6 @@ Licences for non-cylc work included in this distribution can be found in the
* `lib/markupsafe/`:
External software library released under a BSD license, used by Jinja2.
See [MarkupSafe](http://www.pocoo.org/projects/markupsafe/).
* `lib/xdot.py`:
External software released under the LGPL license.
Modifications based on version 0.6. See
[xdot](https://github.com/jrfonseca/xdot.py)
* `lib/cylc/cylc-review/static/css/bootstrap-???`,
`lib/cylc/cylc-review/static/images/glyphicons-halflings-???` &
`lib/cylc/cylc-review/static/js/bootstrap.min.js`:
Expand Down
50 changes: 19 additions & 31 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,27 @@ $ cylc check-software
Checking your software...
Individual results:
===============================================================================
Package (version requirements) Outcome (version found)
===============================================================================
*REQUIRED SOFTWARE*
Python (2.6+, <3).....................FOUND & min. version MET (2.7.12.final.0)
*OPTIONAL SOFTWARE for the GUI & dependency graph visualisation*
Python:pygtk (2.0+)...........................FOUND & min. version MET (2.24.0)
graphviz (any)...................................................FOUND (2.38.0)
Python:pygraphviz (any)...........................................FOUND (1.3.1)
*OPTIONAL SOFTWARE for the HTML User Guide*
ImageMagick (any)...............................................FOUND (6.8.9-9)
*OPTIONAL SOFTWARE for the HTTPS communications layer*
Python:urllib3 (any).............................................FOUND (1.13.1)
Python:OpenSSL (any).............................................FOUND (17.2.0)
Python:requests (2.4.2+).......................FOUND & min. version MET (2.9.1)
*OPTIONAL SOFTWARE for the LaTeX User Guide*
TeX:framed (any)....................................................FOUND (n/a)
TeX (3.0+)................................FOUND & min. version MET (3.14159265)
TeX:preprint (any)..................................................FOUND (n/a)
TeX:tex4ht (any)....................................................FOUND (n/a)
TeX:tocloft (any)...................................................FOUND (n/a)
TeX:texlive (any)...................................................FOUND (n/a)
===============================================================================
================================================================================
Package (version requirements) Outcome (version found)
================================================================================
*REQUIRED SOFTWARE*
Python (3+).............................FOUND & min. version MET (3.7.2.final.0)
Python:zmq (any)..................................................FOUND (17.1.2)
Python:jose (any)..................................................FOUND (2.0.2)
Python:colorama (any)..............................................FOUND (0.4.1)
*OPTIONAL SOFTWARE for the configuration templating*
Python:EmPy (any)..................................................FOUND (3.3.2)
*OPTIONAL SOFTWARE for the HTML documentation*
Python:sphinx (1.5.3+)..........................FOUND & min. version MET (1.8.4)
================================================================================
Summary:
****************************
Core requirements: ok
Full-functionality: ok
****************************
****************************
Core requirements: ok
Full-functionality: ok
****************************
```

### Installing The Documentation
Expand Down
2 changes: 1 addition & 1 deletion bin/cylc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ __HELP__
}

category_help_command() {
# Special case for printing categories and the gcylc gui
# Special case for printing categories
local COMMAND="${CYLC_HOME_BIN}/cylc-help"
exec "${COMMAND}" "categories"
}
Expand Down
Loading