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

Make Rosie Work under packaging (branched from #2360) #2366

Merged
merged 3 commits into from
Jul 15, 2019

Conversation

wxtim
Copy link
Contributor

@wxtim wxtim commented Jul 9, 2019

PR #2360 deactivated tests for rosie and rosa in the packaged version of rose. This ticket is to re-activate them:

  • Reactivate all skipped tests and check that these work.
    • Rosa
      • rosa svn-pre-commit
      • rosa svn-post-commit
      • rosa db-create
    • rosie
      • checkout
      • create
      • delete
      • disco
      • graph
      • hello
      • id
      • lookup
      • ls
      • .db

@wxtim wxtim self-assigned this Jul 9, 2019
@wxtim wxtim added this to the next-feature-alpha milestone Jul 9, 2019
@wxtim wxtim changed the title [WIP] Fix Rosie Fix Rosie Jul 10, 2019
@wxtim wxtim mentioned this pull request Jul 10, 2019
20 tasks
@wxtim wxtim changed the title Fix Rosie Make Rosie Work under packaging (branched from #2360) Jul 10, 2019
@oliver-sanders
Copy link
Member

May want to rebase - squash :)

@wxtim wxtim force-pushed the another-rose-package-branch-fix-rosie branch 2 times, most recently from 4564d64 to ff73042 Compare July 10, 2019 20:41
Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

Note that at present pip installing Rose doesn't quite work as due to an incompatibility with 8.0a0 which is all we have on pipy right now. I've tested against master using the following diff and all is fine:

diff --git a/setup.py b/setup.py
index 8303bd3c3..062720788 100644
--- a/setup.py
+++ b/setup.py
@@ -50,7 +50,10 @@ with open("README.md", "r") as fh:
 
 INSTALL_REQUIRES = [
     "jinja2>=2.10.1, <2.11.0",
-    "cylc-flow==8.0a0",
+    (
+        'cylc-flow @ https://github.com/cylc/cylc-flow'
+        '/tarball/master#egg=cylc-8.0a1.dev'
+    ),
     "aiofiles",
     "tornado",
     "sqlalchemy",

Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

Technically sound, tested as working.

Some documentation issues resulting from an over-zealous search and replace:

@wxtim wxtim force-pushed the another-rose-package-branch-fix-rosie branch from b158578 to e29e859 Compare July 11, 2019 13:20
@wxtim wxtim closed this Jul 11, 2019
@wxtim wxtim reopened this Jul 11, 2019
@sadielbartholomew sadielbartholomew removed their request for review July 11, 2019 14:12
@sadielbartholomew
Copy link
Contributor

(Unassigning myself for review, as discussed with Tim offline. I'm not the best placed to review this one, having little experience with packaging.)

@wxtim wxtim force-pushed the another-rose-package-branch-fix-rosie branch 2 times, most recently from 9bd39fd to f2769fb Compare July 12, 2019 07:55
@oliver-sanders
Copy link
Member

OK, I think we are good to go here, you've managed to do that thing with your commits where they are all duplicated for some reason. Can you squash them down? And how the heck does this happen anyway!

@wxtim wxtim force-pushed the another-rose-package-branch-fix-rosie branch from 4004012 to 49d422b Compare July 12, 2019 11:44
* Get rid of ROSE_HOME
* Lots of syntax help from Oliver Sanders
* Made refs to isodatetime work with metomi.isodatetime
@wxtim wxtim force-pushed the another-rose-package-branch-fix-rosie branch from 49d422b to ea60ad9 Compare July 12, 2019 12:03
@wxtim
Copy link
Contributor Author

wxtim commented Jul 12, 2019

OK, I think we are good to go here, you've managed to do that thing with your commits where they are all duplicated for some reason. Can you squash them down? And how the heck does this happen anyway!

I think this was caused by me working on a branch of a branch whilst the first branch was under review and the rebasing or merging badly after making changes to the first branch.

I can't squash them easily. I took a diff and created something new that should be tidier. Detail has been lost though.

Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

Tentative approval! I think this is OK, installed locally pip install -e ..

Copy link
Member

@kinow kinow left a comment

Choose a reason for hiding this comment

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

Installed via pip install -e . with no issues.

(venv) kinow@kinow-VirtualBox:~/Development/python/workspace/rose$ python -c 'from metomi.rose import __version__;print(__version__)'
2.0.0alpha3

pip show -f metomi-rose is behaving a bit weird, but in the issues I found related to the message "Cannot locate installed-files.txt" the issue was actually elsewhere (e.g. in pip or wheels).

And after installing with pip install . (not editable) pip show -f metomi-rose works. Looking at the files generated, METADATA is missing platform, but I don't think that's a blocker. I don't know rose well enough, but I think I spotted something that could prevent rosie from working, so will add comments for @wxtim or somebody else to take a look.

But great work! You did it really quick, something that took me over a month to get it right-ish for Cylc Flow haha. 👏 And packaging in Python is probably one of the hardest, when comparing with other programming languages like PHP, JavaScript, and Java.

Copy link
Member

@kinow kinow left a comment

Choose a reason for hiding this comment

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

@wxtim I have finished adding a bunch of comments, then re-read the ticket description, but from this part "this ticket is to re-activate them", I reckon you've accomplished what was desired here.

Feel free to resolve my comments and merge if you'd like. These comments can all be tackled in another ticket later, as I think this one was just to re-enable tests.

import rosie.suite_id
import rosie.ws_client
import rosie.ws_client_cli
import pygraphviz
Copy link
Member

Choose a reason for hiding this comment

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

This is raising an issue in my virtual environment, due to pygraphviz not being installed after pip install .. I don't see any graphviz related dependencies in setup.py... is this file used by rose or rosie? If so, we may need to include the dependencies in setup.py.

Copy link
Contributor Author

@wxtim wxtim Jul 15, 2019

Choose a reason for hiding this comment

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

Yes. Thanks!

This is nasty: 😞 - I'm afraid there is more work to be done on removing pygraphviz from the dependency tree in both rose and rosie. I failed to notice this because of the skips in the tests.

Pygraphviz can be installed via conda, but there is no surety of installing it correctly using pip, and therefore, since we are planning to remove it anyway it should be removed. It looks fairly involved, however, since it needs to change rosie graph and rose graph significantly so with the permission of @kinow @oliver-sanders I'm going to suggest that it should be a separate issue.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, this dependency has been left floating about, it will be removed in due course, I think we will copy the solution from the new Cylc Graph.

Copy link
Member

Choose a reason for hiding this comment

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

For now either delete rosie graph or add pygraphviz to the dependencies (note it's a bit of a pain to install).

Copy link
Contributor Author

@wxtim wxtim Jul 15, 2019

Choose a reason for hiding this comment

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

@kinow I'm afraid I'm just going to leave this for this PR and create a new issue to deal with removing this. There's no point getting this test working as the item tested will be removed and re-written in the new GUI. I do not want to include pygraphviz in the package dependencies since the need for it will be removed.

issue #2369 created

@kinow
Copy link
Member

kinow commented Jul 15, 2019

Really didn't want to block the PR. If you prefer to move some of the work here for later please feel free. I just got confused because I read the title and went straight to review it without reading the issue description, sorry!

One thing that I saved for later but that's bugging me is an alert on my IDE, that I tested later and indeed didn't work... again, not blocker, but if you are looking at the code again, perhaps you could try and let me know if this works for you (I think your environment is slightly different with miniconda, conda, etc... so it could be my environment).

(venv) kinow@ranma:~/Development/python/workspace/rose$ python
Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from metomi.rose.macro import get_macros_for_config
>>> get_macros_for_config(config=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/kinow/Development/python/workspace/rose/metomi/rose/macro.py", line 802, in get_macros_for_config
    config = metomi.rose.config.ConfigNode()
UnboundLocalError: local variable 'metomi' referenced before assignment
>>> 

@wxtim
Copy link
Contributor Author

wxtim commented Jul 15, 2019

No @kinow , I think I should bite the bullet and do it. So nearly there...

@kinow
Copy link
Member

kinow commented Jul 15, 2019

No @kinow , I think I should bite the bullet and do it. So nearly there...

In that case happy to try to help testing. Let me know if you need anything 👍

@wxtim
Copy link
Contributor Author

wxtim commented Jul 15, 2019

One thing that I saved for later but that's bugging me is an alert on my IDE, that I tested later and indeed didn't work... again, not blocker, but if you are looking at the code again, perhaps you could try and let me know if this works for you (I think your environment is slightly different with miniconda, conda, etc... so it could be my environment).

Had the same issue - have had a go at fixing it.

* tiny fix for Kinow's Rose Macro issue
* remove foolish sed errors
@wxtim wxtim force-pushed the another-rose-package-branch-fix-rosie branch from 8de2192 to 5430107 Compare July 15, 2019 11:34
@wxtim wxtim force-pushed the another-rose-package-branch-fix-rosie branch from 7f5bfea to 306c27b Compare July 15, 2019 11:52
@wxtim
Copy link
Contributor Author

wxtim commented Jul 15, 2019

Annoyingly this is now failing because of the issue described in #3216. 🤦‍♂️

@wxtim
Copy link
Contributor Author

wxtim commented Jul 15, 2019

from metomi.rose.macro import get_macros_for_config
get_macros_for_config(config=None)

@kinow - Think I've fixed this one!

@wxtim wxtim merged commit 1d1f448 into metomi:master Jul 15, 2019
@MetRonnie MetRonnie mentioned this pull request Dec 10, 2021
@wxtim wxtim deleted the another-rose-package-branch-fix-rosie branch July 25, 2023 07:32
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.

4 participants