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

PR: Specify file for storing connection info when starting server #408

Merged
merged 3 commits into from
Apr 3, 2023

Conversation

jitseniesen
Copy link
Member

Add a command line parameter to the notebook server for specifying the file in which connection information is to be stored. Use this parameter to set the file name to spynbserver-NNNN-MM.json where NNNN is the PID of the Spyder process and MM distinguishes between the notebook servers started by Spyder.

The reason for this is that Jupyter by default uses nbserver-XXXX.json where XXXX is the PID of the notebook server process, but in a venv in Windows there is no good method for finding this PID.

Fixes #398

Add a command line parameter to the notebook server for specifying the
file in which connection information is to be stored. Use this parameter
to set the file name to spynbserver-NNNN-MM.json where NNNN is the PID of
the Spyder process and MM distinguishes between the notebook servers started
by Spyder.

The reason for this is that Jupyter by default uses nbserver-XXXX.json
where XXXX is the PID of the notebook server process, but in a venv in
Windows there is no good method for finding this PID.
@jitseniesen jitseniesen added this to the v0.4.1 milestone Mar 31, 2023
@jitseniesen jitseniesen self-assigned this Mar 31, 2023
@jitseniesen jitseniesen changed the title Specify file for storing connection info when starting server PR: Specify file for storing connection info when starting server Mar 31, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 31, 2023

Codecov Report

Merging #408 (f1dd1e8) into 0.4.x (c21f37f) will increase coverage by 0.14%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
Impacted Files Coverage Δ
spyder_notebook/server/main.py 100.00% <100.00%> (ø)
spyder_notebook/utils/servermanager.py 97.50% <100.00%> (+0.10%) ⬆️
spyder_notebook/widgets/notebooktabwidget.py 91.95% <100.00%> (-0.05%) ⬇️

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Some suggestions to make the code a bit more readable, otherwise looks good to me @jitseniesen.

spyder_notebook/utils/servermanager.py Outdated Show resolved Hide resolved
spyder_notebook/utils/servermanager.py Outdated Show resolved Hide resolved
spyder_notebook/utils/servermanager.py Outdated Show resolved Hide resolved
spyder_notebook/utils/servermanager.py Outdated Show resolved Hide resolved
spyder_notebook/utils/servermanager.py Outdated Show resolved Hide resolved
spyder_notebook/utils/servermanager.py Outdated Show resolved Hide resolved
spyder_notebook/utils/servermanager.py Outdated Show resolved Hide resolved
spyder_notebook/widgets/tests/test_serverinfo.py Outdated Show resolved Hide resolved
spyder_notebook/widgets/tests/test_serverinfo.py Outdated Show resolved Hide resolved
jitseniesen and others added 2 commits March 31, 2023 19:29
This is part of the change in the previous commit: In a venv
on Windows, the server process is different from the process
that starts the server.
Suggestion from code review.

Co-authored-by: Carlos Cordoba <[email protected]>
@jitseniesen
Copy link
Member Author

Some suggestions to make the code a bit more readable, otherwise looks good to me.

Thanks. It would probably have been easier for you to simply add one comment to rename infofile to info_file throughout, instead of writing a bunch of suggestions.

@ccordoba12
Copy link
Member

Ok, will do for next time.

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Looks good to me now, thanks @jitseniesen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants