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

Rework linux/osx support plus new simplified format? #48

Closed
goanpeca opened this issue Jul 29, 2017 · 9 comments · Fixed by #91
Closed

Rework linux/osx support plus new simplified format? #48

goanpeca opened this issue Jul 29, 2017 · 9 comments · Fixed by #91
Labels
locked [bot] locked due to inactivity pending::discussion contains some ongoing discussion that needs to be resolved prior to proceeding stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity

Comments

@goanpeca
Copy link

goanpeca commented Jul 29, 2017

@kalefranz, @msarahan, @mingwandroid

I have been wanting to update the linux/osx support for some time, but it might also be a good opportunity to reevaluate the current format. Since conda uses jinja2, yaml and selectors, it would be pretty natural to do the same for menuinst (lets say version 2.0):

Based on https://github.com/ContinuumIO/menuinst/wiki/Menu-Shortcut-Config-Structure

Could we turn the format into yaml, and use jinja2 and selectors, and make it more uniform among all OSs? We could still use separate files for separate OSs, but we could just have one file that knows what to do everywhere

This would create subfolders for environments and no subfolder for the root (hopefully). Overriding the creation for other envs, should probably be handed by the CLI when called, instead of including the info inside this file

../conda.recipe/
   menu.yaml
   icons/
      someicon.ico
      someicon.icns
{% set BASE_DIR = 'Anaconda'PY_VER PLATFORM %}
{% set ICO_EXT = 'ico' if WIN or LINUX else 'icns' %}

version: 2.0
menu:
  - path: {% if ROOT_PREFIX != ENV_PREFIX %}{{ BASE_DIR }}/{{ ENVNAME }}{% else %}{{ BASE_DIR }}{{% endif %}
    shortcuts:
      - name: 'SomeApp'
        version: 1.8.9
        cmd:    #  Or we can split cmd, and args...
          - '{{ PYTHONW }}'
          - '{{ PYTHON_SCRIPTS }}/someapp'
        comment: 'Some description of someapp'
        icon: '{{ MENU_DIR }}/someicon.{{ ICO_EXT }}'
        icon_path: 'icons/someicon.{{ ICO_EXT }}'
        desktop: True                         # [win]
        quicklaunch: True                     # [linux and win]
# Check the need of keys
terminal
id

# "new" env variables
FILEBROWSER
WEBBROWSER
CMD/BASH ?

# deprecate keys
icns 
pywscript
pyscript
script
scriptarguments
system
webbrowser

Plus adding a programmatic api menuinst.api

from menuninst.api import Menu, Shortcut

menu = Menu('My awesome thing/submenu/')
shortcut = Shortcut('App', ['command'], desktop=True, icon=None)
shortcut.icon = '{{ MENU_DIR }}/icon.ico'
shortcut.icon_path = 'icons/icon.ico'
menu.add(shortcut)
menu.install(context={...})
menu.uninstall(...)
yaml_data = menu.to_yaml()
json_data = menu.to_json()

Thoughts?

@goanpeca goanpeca added the pending::discussion contains some ongoing discussion that needs to be resolved prior to proceeding label Jul 29, 2017
@goanpeca goanpeca changed the title Rework linux/osx support plus new format? Rework linux/osx support plus new simplified format? Jul 29, 2017
@mingwandroid
Copy link
Contributor

mingwandroid commented Jul 30, 2017

Sounds good! I'd probably try to get something going on mac (creation of .app bundles and Info.plists) and Linux (.desktop stuff) and have a feel for what those platforms introduce. .app bundles have file associations too (and a load of other stuff). It would be nice to solve the Windows "double-click on a jupyter-notebook and have it launch in a fully activated env" at the same time as doing .app bundle file association support in menuinst.

@goanpeca
Copy link
Author

goanpeca commented Jul 30, 2017

Yep, thats the idea. Most of the code is there already, we just need to update it a bit and clean it up. App bundles do have a ton of stuff :-p. Associations good idea!

@csoja
Copy link

csoja commented Jul 31, 2017

This is not going to be for the September release, correct?

@goanpeca
Copy link
Author

Probably not, would be nice though

@mbargull
Copy link
Member

An uniform cross-platform format with platform-specific definitions via selectors (or the like) would be a very nice addition! This would also solve conda/conda#5153 in a much cleaner manner than tinkering within conda itself.

@mbargull
Copy link
Member

@goanpeca Will the master branch switch to such a "2.0" endeavor in the near future? I am asking in regards to whether PRs should be based on master or 1.4.x if one wants to target a short term release.

@goanpeca
Copy link
Author

@mbargull that is the plan!

@kalefranz kalefranz changed the title Rework linux/osx support plus new simplified format? MEN-51 ⁃ Rework linux/osx support plus new simplified format? Jan 30, 2018
@kalefranz kalefranz changed the title MEN-51 ⁃ Rework linux/osx support plus new simplified format? Rework linux/osx support plus new simplified format? Jan 30, 2018
@jaimergp
Copy link
Contributor

I'd like to revisit this. I have added patches to provide basic Linux/OSX support on #89 #88 but it'd be nice to clean up a bit too.

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Oct 15, 2022
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Nov 15, 2022
@github-actions github-actions bot moved this to Done in 🧭 Planning Nov 15, 2022
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Nov 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity pending::discussion contains some ongoing discussion that needs to be resolved prior to proceeding stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants