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

Install as Rez bin tool #6

Closed
3 tasks done
davidlatwe opened this issue Mar 9, 2021 · 7 comments
Closed
3 tasks done

Install as Rez bin tool #6

davidlatwe opened this issue Mar 9, 2021 · 7 comments

Comments

@davidlatwe
Copy link
Owner

davidlatwe commented Mar 9, 2021

Goals

  • Able to call rez deliver and rez-deliver in command-line
  • Configurable with rezconfig.plugins

Why ?

  • Able to store and manage rez-deliver configurations in rezconfig
  • Align with Rez command-line interface
  • Simplify environment setup for accessing rez-deliver, manage them all as one concept (rez bin tools)

Breakdown

The tool will have these components :

  1. Main module, the tool module itself.
  2. Rez application type plugin, for registering configurations, PR required.
  3. Rez cli submodule, for setting up command-line parser.

And the tool can be installed via :

  1. rezconfig.plugin_path, or
  2. setup.py

Rez plugin can be registered and found via rezconfig.plugin_path. But we cannot generate binary for it, even we do, if the plugin somehow gets excluded from rezconfig.plugin_path afterward, previously generated binary will remain accessible but possible out of function. Which is not ideal.

On the other hand with setup.py, we could pip install tool as like namespace package under rez and rezplugins, with binary generated. And with pip uninstall, all installed files can be removed entirely. Which is great !

So maybe we could register tool with rezconfig.plugin_path while developing, and use setup.py when released.

Update :
Registering tool with rezconfig.plugin_path may not work if the plugin requires it's main module.

TODO

  • Construct package layout
  • Add application type plugin in Rez
  • Enable registering Rez sub-command from rezconfig.plugins
@davidlatwe
Copy link
Owner Author

Now the new Application type plugin has been implemented, and the subcommand can be registered along with the plugin, but there are still some issues ...

  • Install plugin as data_files may not work
  • Plugin module not found

@davidlatwe
Copy link
Owner Author

davidlatwe commented Mar 12, 2021

So I have came up with a wheel compatible setup.py, will have to do more tests, here's some related issues/PRs :

And one question, why entry_points was still needed in Rez's setup.py while the install.py will remove those binaries ?

@davidlatwe
Copy link
Owner Author

RP submitted 👉🏼 AcademySoftwareFoundation/rez#1039
See how this gose.

@davidlatwe
Copy link
Owner Author

And the example package layout 👉🏼 https://github.com/davidlatwe/rezbefoo

@davidlatwe
Copy link
Owner Author

Application plugin PR submitted 👉 AcademySoftwareFoundation/rez#1040

@davidlatwe
Copy link
Owner Author

davidlatwe commented Mar 24, 2021

Updates

Here's where we are at right now :

About AcademySoftwareFoundation/rez#1039

The Python entry_points has a few problems in Rez point of view :

  1. Cannot have interpreter flags e.g. -E when installing with wheel
  2. Cannot have sub-directory hierarchy under install path
  3. The executable path written inside the entry_points is absolute path in most cases

... to be continued

notes

separate rez bin generation. so that we could dev rez with pip install -e easily
manage console_script/entry_points separately
re-link entry_points
control pip install location
rezup

References:
pypa/pip#4368
pypa/pip#3758
pypa/pip#3759
https://docs.python.org/3/distutils/examples.html
https://bitbucket.org/pypa/distlib/src/4f54a3117db58f6bb00c69ab9a892170b91acd3b/PC/launcher.c#lines-642
https://stackoverflow.com/a/17329493
https://stackoverflow.com/a/14159430
https://stackoverflow.com/a/58730020
https://stackoverflow.com/a/51302248
https://stackoverflow.com/a/27909082
https://stackoverflow.com/a/15441487
https://stackoverflow.com/a/5423147
https://www.python.org/dev/peps/pep-0397
https://www.python.org/dev/peps/pep-0486
https://www.python.org/dev/peps/pep-0426
https://www.python.org/dev/peps/pep-0518

@davidlatwe
Copy link
Owner Author

Made a tool for managing/installing plugins and the rez production environment 👉🏼 https://github.com/davidlatwe/rezup
Consider this done.

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

No branches or pull requests

1 participant