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

In-memory plug-ins #140

Closed
mottosso opened this issue Jan 25, 2015 · 1 comment
Closed

In-memory plug-ins #140

mottosso opened this issue Jan 25, 2015 · 1 comment
Labels
Milestone

Comments

@mottosso
Copy link
Member

Goal

Provide users with the ability to develop and deploy plug-ins, without resorting to physical files on disk.

The motivation for this feature came about during the development of tutorials and the need to effortlessly implement basic plug-ins in order to describe how Pyblish works at a higher-level, but without going through the hassle of saving files and appending paths for discovery.

Implementation

A basic interface could looks something like this.

import pyblish.api

class SelectMyInstances(pyblish.api.Selector):
    ...
    # Implementation of plug-in here

# Register new plug-in, at run-time.
pyblish.api.register_plugin(SelectMyInstances)

At this point the plug-in would be processed amongst other plug-ins discovered at filesystem-level.

Additional uses

Additionally, there might be an interest in only exposing plug-ins this way, and thus never make use of plug-ins as files. This could be beneficial when for example:

  1. Access to file-system is limited
  2. Portability is preferred over flexibility

Portability

What does it mean to be "portable"? Consider a scenario in which a series of plug-ins is shared with you by a colleague or friend. Currently, he could share a directory that you then..

  1. Copy onto your file-system.
  2. The path of which you register with Pyblish.

These steps could potentially be condensed into:

  1. You running a self-contained script, that implicitly makes available included plug-ins.

The file-system remaining untouched.

Benefits

The immediate and intended benefit is simplicity in describing the process in which publishing happens. There is also the added benefit of being able to run tests without requiring access to the file-system, thus simplifying testing.

At the moment, a "fixture" is provided within the /tests directory of Pyblish, containing a number of probable scenarios in which a user might configure his environment. A number of plug-ins performing simple tasks that are then tested.

The problem with fixtures is it's required access from a run-time test onto a file-system with which a number of potential problems - unrelated to the test - may occur, such as read permission or missing/corrupted files.

@mottosso mottosso added this to the 1.1 milestone Jan 25, 2015
mottosso added a commit to mottosso/pyblish-base that referenced this issue May 18, 2015
@mottosso
Copy link
Member Author

mottosso commented Jun 4, 2015

Added to 1.1

@mottosso mottosso closed this as completed Jun 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant