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: Put the sys.prefix in the config search path #15426

Merged
merged 1 commit into from Apr 26, 2021

Conversation

pelson
Copy link
Contributor

@pelson pelson commented Apr 26, 2021

Description of Changes

This change puts sys.prefix on the config search path. With this change we have the option of providing a centrally managed spyder installation which can be pre-configured without setting global (machine-wide) config.

The use case that this comes from:

I want to be able to provide a spyder installation to a large number of users (200+) who have all got a specific NFS drive mounted on their Linux (Centos) machines. I therefore cannot setup a config in /etc/, and cannot control the user's ~/.config; I therefore want to be able to put a config in {sys.prefix}/etc/spyder/spyder.ini and it affect the global config (which can be overridden by the user config, should a user so choose).

In my case, I wanted to provide a spyder installation which is pre-configured to use a specific interpreter by default (different from the spyder interpreter). I therefore put the following config file in place:

$ which spyder
/home/pelson/github/spyder/spyder/env/bin/spyder

$ cat /home/pelson/github/spyder/spyder/env/etc/spyder/spyder.ini 
[main_interpreter]
custom_interpreter = /tmp/spyder-kernel-env/bin/python
executable = /tmp/spyder-kernel-env/bin/python
default = False
custom = True

$ rm -rf ~/.config/spyder-py*

$ spyder   # correctly uses the configured environment (/tmp/spyder-kernel-env/bin/python)

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct:

@pelson

@ccordoba12 ccordoba12 changed the title Put the sys.prefix in the config search path PR: Put the sys.prefix in the config search path Apr 26, 2021
@ccordoba12 ccordoba12 changed the base branch from master to 5.x April 26, 2021 15:23
@ccordoba12 ccordoba12 changed the base branch from 5.x to master April 26, 2021 15:24
@ccordoba12 ccordoba12 added this to the v5.0.2 milestone Apr 26, 2021
@ccordoba12
Copy link
Member

Hey @pelson, nice to see you here and thanks a lot for your contribution!

We'd like to include it in our next release in the Spyder 5 series. For that, please make your branch to derive from our 5.x branch (instead of master), with the following commands:

git checkout 5.x
git checkout feature/sys_prefix_config
git rebase --onto 5.x master feature/sys_prefix_config
git push -f origin feature/sys_prefix_config

Other than that, the change seems sensible, so I'm ok with it.

@pelson pelson changed the base branch from master to 5.x April 26, 2021 19:49
@pelson
Copy link
Contributor Author

pelson commented Apr 26, 2021

nice to see you here and thanks a lot for your contribution!

Good to see you also! It has been a long time!

We'd like to include it in our next release in the Spyder 5 series

Great, I've rebased. 👍

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.

Thanks @pelson!

@ccordoba12 ccordoba12 merged commit 7747c10 into spyder-ide:5.x Apr 26, 2021
ccordoba12 added a commit that referenced this pull request Apr 26, 2021
@pelson pelson deleted the feature/sys_prefix_config branch April 27, 2021 11:53
@pelson
Copy link
Contributor Author

pelson commented Apr 27, 2021

🥳 - thank you for reviewing/merging so quickly. Happy to have my first commit on spyder! 👍

@ccordoba12
Copy link
Member

ccordoba12 commented Apr 27, 2021

No prob, hope more commits will come in the future!

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.

None yet

2 participants