-
Notifications
You must be signed in to change notification settings - Fork 94
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 cylc a module #2990
Make cylc a module #2990
Conversation
I now realize that the discussion in the WIP pull request, if done in a ticket, it would still be assigned to this milestone. Instead of lost in the closed pull request. Something to improve :-) even though I may still use WIP/Draft pull requests, will create a placeholder ticket for discussions, important notes, links, etc. 👍 apologies. At least tried to link with a footnote comment in this issue description... |
Great, I've wanted this done for ages! Now it's all happening so fast.
Yep, no more ssl!
I think you might get a test failure due to empy, perhaps comment it out of the |
Excellent review as always @oliver-sanders ! Have updated a few items, but will go through tox, and the other pending ones with more calm tomorrow morning. Thanks! |
There is an extra dependency group |
327fdb2
to
2f56631
Compare
Note: In some Python projects, the structure includes a folder with the same name of the project, that contains the source code. e.g. In our case, we have Also note, that having |
2f56631
to
bbdb04e
Compare
The build in Travis for the functional tests took only 2 minutes each job. Looks like there's something wrong with an import somewhere. Getting an error running it locally. |
Found the issue. At the moment, several scripts (Python and Shell) depend on the In my environment I have Anaconda Python 3.7, with a virtual environment activated for Cylc (to isolate other projects, e.g. cylc-jupyterhub, from crashing due to dependencies installed). Running Then the scripts use the |
We can restructure the source tree if necessary, to make it more standard and better for packaging. |
It should still work with the Will try to find a solution that changes as little code as possible first. If that doesn't work, then it may require changing how |
BTW I vaguely recall we talked about packaging and multiple cylc versions (?) but can't recall the outcome, sorry. ATM users can run different suites at different versions if necessary (e.g. long-running suite that's not upgraded yet, and a new suite written for new cylc) and every suite job invokes the right cylc version thanks to Can we still support this sort of thing without users having to |
I saw it somewhere while reviewing the Python3 pull request, but can't recall which file. I will update the issue description with a list of requirements to consider |
For sites that need this capability, maybe we could just explain how to install multiple virtual environments centrally (one for each cylc version) and have the central cylc wrapper script load the version-specif environment instead of just pointing to the right bin path as it does now? |
If that option would allow the operations guy to keep old suites, while using Cylc 8, I'd be +1 for that as it's simpler. |
👍 @matthewrmshin seems to agree, so let's go for that. |
bbdb04e
to
6de6b47
Compare
Environment manipulation can be done in many ways. Some modern ways may be very sophisticated, but may also be slow. The most important thing is to make sure that we have efficient logic for calling |
(I am happy as long as the new way is nice and efficient.) |
b78ae15
to
c038e84
Compare
@cylc/core - can we try to get this merged this week or next week? (depending on UK team availability late April I guess) ... it's been a long wait. It will make some other things easier, and details such as dependency version specificity can always be revisited later. @kinow is there anything much remaining to be resolved on this that you're aware of, from reviews so far? Do we need to move non-Python files (example suites as discussed above, and editor syntax files etc.) ... (presumably that's not critical either really - no big deal if they temporarily end up in site-packages dir or whatever, out of sight of users). |
+1 this has become a blocker of issues here and in
Nothing that cannot be revisited later IMO. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good by 👀. I'll do some quick tests.
[bdist_rpm] | ||
requires = | ||
python3-colorama | ||
python-isodatetime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is something we need to address later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Should be python3-isodatetime in the future.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is something we need to address later?
Oh, well thought. Yup, or we could change that right now, but it hasn't changed in isodatetime
yet I think. So I think later we can change that here once we change it there.
I can get Can't get the
|
Depending on how you install the module, the test dependencies are not installed (default behaviour for setuptools/pip).
The only way to achieve the test dependencies installed this way, is via another group in FWIW, here's the issue that was created (and rejected) for pip to install those dependencies as well: pypa/pip#1197 (comment) I'm using After running
But we are missing the dependency from For what's worth, the setuptools documentation says:
Once that's installed, running tests should work fine. I believe Travis is passing as they should include |
(Just running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can use python3 setup.py
with build_sphinx
, sdist
, bdist_wheel
, install
, etc. Pytest works on its own but not as part of python3 setup.py test
. Installed cylc
appears to work.
(I started testing this last night, will try to complete this morning.) |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same results as Matt above - LGTM!
That and also the user guide. After this PR I will work on - besides the ones for GraphQL, UI server, etc - more pull requests to address issues pointed by reviewers here and documentation. |
OK ... discussion with @oliver-sanders on dependency specificity still unresolved, but this ain't production code yet and we can tweak details later. So I'm going to merge this sucker!!! Thanks @kinow ... 🎉 |
Fix #2989
Adapted code from previous pull request, but it was a bit outdated (4 months old), with conflicts due to Python 3. So I thought it would be easier to copy the
setuptools
files, and simply apply the other changes manually.Also looked at
isodatetime
to see what we could improve in oursetup.py
.master
with Python 3setup.py
setup.py
setup.cfg
. It is possible to confirm what it looks like runningrm -rf lib/cylc.egg*
, thenpip install -e .
, and inspecting thePKGINFO
file created within that egg foldersetup.cfg
.travis.yml
file to runpip install -e .[all]
andpip install -e .
.ssl
groups from the old pull request, as it does not seem to be a requirement forpyzmq
(@oliver-sanders ? not sure if I missed any dependency for Python 3)cylc-make-docs
and replace bysetuptools
and Sphinx integration due toCYLC_DIR
useTests were done via
python setup.py test
andcylc run --no-detach --debug --verbose five
. Changes passing in Travis-CI.Dependencies were frozen, so we don't run into build/security problems due to unintentional updates in environments.
To see available commands, try
python setup.py --help-commands
. It works similarly tocylc help
orcylc-check-software
. With the difference that new commands may appear if you install plugins.When you clone the repo, for instance, you won't see
build_sphinx
, unless you have thesphinx
dependency. If you runpip install -e .[all]
orpip install -e .[docs]
(i.e. install editable with all or docs dependency group) then thebuild_sphinx
option should automagically appear as available inpython setup.py help-commands
.Related: #2834