{"action":"opened","issue":{"url":"https://api.github.com/repos/abstractfactory/pyblish/issues/140","labels_url":"https://api.github.com/repos/abstractfactory/pyblish/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/abstractfactory/pyblish/issues/140/comments","events_url":"https://api.github.com/repos/abstractfactory/pyblish/issues/140/events","html_url":"https://github.com/abstractfactory/pyblish/issues/140","id":55425540,"number":140,"title":"In-memory plug-ins","user":{"login":"mottosso","id":2152766,"avatar_url":"https://avatars.githubusercontent.com/u/2152766?v=3","gravatar_id":"","url":"https://api.github.com/users/mottosso","html_url":"https://github.com/mottosso","followers_url":"https://api.github.com/users/mottosso/followers","following_url":"https://api.github.com/users/mottosso/following{/other_user}","gists_url":"https://api.github.com/users/mottosso/gists{/gist_id}","starred_url":"https://api.github.com/users/mottosso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mottosso/subscriptions","organizations_url":"https://api.github.com/users/mottosso/orgs","repos_url":"https://api.github.com/users/mottosso/repos","events_url":"https://api.github.com/users/mottosso/events{/privacy}","received_events_url":"https://api.github.com/users/mottosso/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/abstractfactory/pyblish/labels/feature","name":"feature","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/abstractfactory/pyblish/milestones/2","labels_url":"https://api.github.com/repos/abstractfactory/pyblish/milestones/2/labels","id":789677,"number":2,"title":"1.1","description":"The 1.1 release of Pyblish","creator":{"login":"mottosso","id":2152766,"avatar_url":"https://avatars.githubusercontent.com/u/2152766?v=3","gravatar_id":"","url":"https://api.github.com/users/mottosso","html_url":"https://github.com/mottosso","followers_url":"https://api.github.com/users/mottosso/followers","following_url":"https://api.github.com/users/mottosso/following{/other_user}","gists_url":"https://api.github.com/users/mottosso/gists{/gist_id}","starred_url":"https://api.github.com/users/mottosso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mottosso/subscriptions","organizations_url":"https://api.github.com/users/mottosso/orgs","repos_url":"https://api.github.com/users/mottosso/repos","events_url":"https://api.github.com/users/mottosso/events{/privacy}","received_events_url":"https://api.github.com/users/mottosso/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":4,"state":"open","created_at":"2014-09-15T09:56:48Z","updated_at":"2015-01-25T19:09:08Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-01-25T19:09:08Z","updated_at":"2015-01-25T19:09:08Z","closed_at":null,"body":"### Goal\r\n\r\nProvide users with the ability to develop and deploy plug-ins, without resorting to physical files on disk.\r\n\r\nThe 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.\r\n\r\n### Implementation\r\n\r\nA basic interface could looks something like this.\r\n\r\n```python\r\nimport pyblish.api\r\n\r\nclass SelectMyInstances(pyblish.api.Selector):\r\n    ...\r\n    # Implementation of plug-in here\r\n\r\n# Register new plug-in, at run-time.\r\npyblish.api.register_plugin(SelectMyInstances)\r\n```\r\n\r\nAt this point the plug-in would be processed amongst other plug-ins discovered at filesystem-level.\r\n\r\n### Additional uses\r\n\r\nAdditionally, 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:\r\n\r\n1. Access to file-system is limited\r\n1. *Portability* is preferred over *flexibility*\r\n\r\n**Portability**\r\n\r\nWhat 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..\r\n\r\n1. Copy onto your file-system.\r\n2. The path of which you register with Pyblish.\r\n\r\nThese steps could potentially be condensed into:\r\n\r\n1. You running a self-contained script, that implicitly makes available included plug-ins.\r\n\r\nThe file-system remaining untouched.\r\n\r\n### Benefits\r\n\r\nThe 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.\r\n\r\nAt 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.\r\n\r\nThe 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."}}