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

DEV: Allow symlink in Windows for editable install #1373

Merged
merged 1 commit into from
Jun 10, 2022

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Jun 2, 2022

Description

This pull request is to address #1218 (comment) by allowing symlink on Windows when it is possible.

For my own Windows setup, symlink is impossible because Miniconda is on C drive by source code in on D. With this patch, I confirmed that it still makes a full copy as in #1218 without crashing. Imviz seems to work in notebook and standalone modes.

For my WSL2 setup, I can confirm that this patch still does symlink, as expected. Imviz seems to work in notebook but I cannot test the standalone portion due to voila-dashboards/voila#773 , though I don't see why it wouldn't work.

Devs who review this should check that the files are copied or symlinked properly and at least run a quick example notebook. You should install this PR branch with pip install -e .. @duytnguyendtn , since you are on Windows, maybe you can see if it does symlink without error for "modern Windows". If you get that admin permission error again with this patch, then maybe this is not possible after all.

Maybe @vidartf and @maartenbreddels are interested to review too?

Fixes #1282

Checklist for package maintainer(s)

This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a change log needed? If yes, is it added to CHANGES.rst?
  • Is a milestone set?
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

editable install if OS allows it.
@pllim pllim added the no-changelog-entry-needed changelog bot directive label Jun 2, 2022
@pllim pllim added this to the 2.7 milestone Jun 2, 2022
@codecov
Copy link

codecov bot commented Jun 2, 2022

Codecov Report

Merging #1373 (e64423b) into main (e174819) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1373   +/-   ##
=======================================
  Coverage   84.77%   84.77%           
=======================================
  Files          91       91           
  Lines        8021     8021           
=======================================
  Hits         6800     6800           
  Misses       1221     1221           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e174819...e64423b. Read the comment docs.

Copy link
Contributor

@javerbukh javerbukh left a comment

Choose a reason for hiding this comment

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

Works for me on Windows!

@javerbukh
Copy link
Contributor

When I tried to run it again, however, I got the following traceback. Any idea what happened?

Traceback (most recent call last):
  File "C:\Users\javer\anaconda3\envs\jdaviz-dev-2.7\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\javer\anaconda3\envs\jdaviz-dev-2.7\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\javer\anaconda3\envs\jdaviz-dev-2.7\Scripts\jupyter-lab.exe\__main__.py", line 7, in <module>
  File "C:\Users\javer\anaconda3\envs\jdaviz-dev-2.7\lib\site-packages\jupyter_server\extension\application.py", line 594, in launch_instance
    serverapp.start()
  File "C:\Users\javer\anaconda3\envs\jdaviz-dev-2.7\lib\site-packages\jupyter_server\serverapp.py", line 2815, in start
    self.start_ioloop()
  File "C:\Users\javer\anaconda3\envs\jdaviz-dev-2.7\lib\site-packages\jupyter_server\serverapp.py", line 2801, in start_ioloop
    self.io_loop.start()
  File "C:\Users\javer\anaconda3\envs\jdaviz-dev-2.7\lib\site-packages\tornado\platform\asyncio.py", line 199, in start
    self.asyncio_loop.run_forever()
  File "C:\Users\javer\anaconda3\envs\jdaviz-dev-2.7\lib\asyncio\base_events.py", line 570, in run_forever
    self._run_once()
  File "C:\Users\javer\anaconda3\envs\jdaviz-dev-2.7\lib\asyncio\base_events.py", line 1844, in _run_once
    handle = self._ready.popleft()
IndexError: pop from an empty deque

@javerbukh
Copy link
Contributor

First time I tested using jupyter-lab and it worked. I tried to use that command a second time and saw the previous traceback. Using jdaviz cubeviz data did not even start up the kernel. Using jupyter notebook then worked. Not sure what that means.

@pllim
Copy link
Contributor Author

pllim commented Jun 8, 2022

Is that just with this patch or also on main? I had problem with Lab (not with this branch) and I had to reinstall the Lab extensions. 🤷

@javerbukh
Copy link
Contributor

I'll check.

@javerbukh
Copy link
Contributor

So it works most of the time on this branch, all the time on main. I would be really interested if someone else on a different windows setup could test it out though because it could just be my machine.

@pllim
Copy link
Contributor Author

pllim commented Jun 9, 2022

@javerbukh , is your problem same as jupyterlab/jupyterlab#11934 ?

@javerbukh
Copy link
Contributor

Yes!

Copy link
Collaborator

@duytnguyendtn duytnguyendtn left a comment

Choose a reason for hiding this comment

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

Such strong irony that I'm providing a review from the macOS side, rather than the Windows side!

Checked all the tools on macOS and everything seems to look good to me! I'll take that @javerbukh's review for the Windows side clears this to be merged! (minus the bug above)

@pllim
Copy link
Contributor Author

pllim commented Jun 9, 2022

clears this to be merged

I cannot be sure since @javerbukh says he only sees that Lab problem with this patch! Jesse, what say you?

@javerbukh
Copy link
Contributor

I think it's ok since the bug is upstream. If we open an issue for the bug then I am ok merging this.

@pllim
Copy link
Contributor Author

pllim commented Jun 10, 2022

Is noting this under known issues sufficient?

@pllim
Copy link
Contributor Author

pllim commented Jun 10, 2022

Okay, I opened #1391 for that known issue. I'll merge this. 🤞

Thanks for all the reviews!

@pllim pllim merged commit 77d43b5 into spacetelescope:main Jun 10, 2022
@pllim pllim deleted the win-symlink branch June 10, 2022 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog-entry-needed changelog bot directive
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEV: Use symlink on Windows when possible
3 participants