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

Migrate katcp to Python 3 #215

Merged
merged 90 commits into from
Oct 25, 2019

Conversation

mmphego
Copy link
Contributor

@mmphego mmphego commented Sep 11, 2019

This PR does the following:

  • Stage 1: Migrate
    • Adds Py2/Py3 compatibility to katcp-python by running futurize
      • Ran find . -name '*.py' | xargs futurize -0 -w -a -n
    • Added support for Py2 and Py3 testing via tox.
    • Updated Jenkinsfile to support the above.
    • Updated setup.py to add support for Py2&Py3
  • Stage 2: PY2 Pass
    • Update tests such that they all pass on Python2
    • Minor clean-up (imports and etc)
  • Stage 3: PY3 Pass
    • Update tests such that they all pass on Python3
    • Minor clean-up (imports and etc)
  • Stage 4: Update docs and refactor
    • Address PR comments.

    • Fix skipped test(s)

      • For some apparent test_until_some_kwargs fails when ran via tox but passes when ran manually!
        - [ ] @ajoubertza: Memory leak related test.
    • Ensure AQF runs successfully.

      • Activate a subarray through ipython:
         import katuilib;
         config_cam('userpass', 'all');
         ...
      • Benchmark current and master branch i.e. time subarray startup.
    • Update docs

      • Notify community regarding new changes or PY3 compatibility.
      • Update docs (release notes, changelog and etc)
      • Add document generation as part of Jenkins CI build stage.
    • Reformat with black, sort imports, cleanup and address flake8 comments.

      • sort imports
        - [ ] flake8 fixes
        - [ ] black fixes
  • Stage 5: Deploy and test on site
    • Updated katcp on all mkat-rts nodes, all looks ok
    • Published katcp v0.7.0 to Pypi
    • Update readthedocs with latest release docs.
    • Notified internal and external katcp users regarding latest release.

JIRA: MT-737

Demo

Simulated 4A4k subarray benchmark

Original version of katcp

katcp_original_4A4k

Migrated version of katcp

katcp_migration_4A4k

Simulated 5A4k(64 X-Fhosts) subarray benchmark

Original version of katcp

katcp_master_5A4k

Migrated version of katcp

katcp_migration_5A4k

Mpho Mphego and others added 23 commits September 5, 2019 12:34
* Stage 1: Migrate katcp-python to Python 3 and ensure PY2 tests pass

This PR does the following:

- Updated `Jenkinsfile` and added `tox.ini`
- Updated `setup.py` with changes similar to `katportalclient`.
- Renamed `COPYING` to `LICENSE` and `CHANGELOG` to `CHANGELOG.md`
- Added/Updated copyright and licence information on `*.py` files
- Migrated `README.rst` to `README.md`, why - Markdown is better (Opinionated review)
- Skipping `test_until_some_kwargs` test as it fails on tox, will investigate later.
- Commented out static analysis, speed up ci
- Added flake8 config on setup.cfg
- Ran futurize on katcp-tests, added minor fixes for tests to pass - Tests passes on tox py27
…pport py2&py3 compartibility at the same time supports different versions of tornado. This becomes tricky as tornado api has significant changes accross different versions
… protocol in order to you access original function object.
…joubertza had concerns mainly regarding multiple requests handling and memory usage
Raises TypeError as Py3 doesn't support comparing instances of an object and etc.
User/mmphego/mt 737/stage3 make py3 pass
@mmphego mmphego requested review from ajoubertza, sw00, amakhaba, kmadisa and lanceWilliams and removed request for ajoubertza September 11, 2019 15:23
- Fixed `ValueError: Attempted relative import in non-package` when importing `docsrape` module.
- Updated package installation instructions, fixed grammatic and header issues.
- Updated document hyperlinks
- Bullet(s/ing) related fixes
- Inline emphasis start-string without end-string.
- Unknown target name: "agg".
- Block quote ends without a blank line; unexpected unindent.
- Explicit markup ends without a blank line; unexpected unindent
- Removed `docs` generation dependencies from `setup.py`, and moved them to `tox.ini`. (see: https://github.com/ska-sa/katcp-python/pull/215/files#r325371314)
- Added 'Py3.8' classifier as per @bmerry's recommendations. (see: https://github.com/ska-sa/katcp-python/pull/215/files#r336985014)
@mmphego mmphego force-pushed the user/mmphego/MT-737/Add-Py2-Py3-compatibility branch from 2f1836f to 20b0714 Compare October 24, 2019 12:44
@mmphego mmphego force-pushed the user/mmphego/MT-737/Add-Py2-Py3-compatibility branch from 20b0714 to 51650a7 Compare October 24, 2019 12:59
@@ -79,6 +79,19 @@ pipeline {
}
}
}
stage('Generate documentation.') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@ajoubertza
Copy link
Contributor

AQF run on CAM OK. 1 minor change needed for a float comparison that was using == instead of a tolerance. So 123.00000000000001 != 123.0. This is due to using the repr for float conversion instead of "%.15g".

Copy link
Contributor

@ajoubertza ajoubertza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go! 🎉
(Only took 90 commits and 245 comments...)

Thanks to everyone that worked on this mega PR. We'll make a new version for PyPI soon.

Copy link
Contributor

@tockards tockards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🉑 ❗️

@ofaletse
Copy link
Contributor

Woot!

@mmphego
Copy link
Contributor Author

mmphego commented Oct 25, 2019

🍰 🍰 🍰 🍰 🍰 🍰 🍰 🍰 🍰

@mmphego
Copy link
Contributor Author

mmphego commented Oct 25, 2019

@mmphego mmphego merged commit 653d69e into master Oct 25, 2019
@mmphego mmphego deleted the user/mmphego/MT-737/Add-Py2-Py3-compatibility branch October 25, 2019 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants