Skip to content

Commit

Permalink
Merge pull request #246 from mottosso/master
Browse files Browse the repository at this point in the history
De-vendoring packages for Python 3 compatibility
  • Loading branch information
mottosso committed Feb 7, 2016
2 parents cbc33bf + 73c25a6 commit 58ba367
Show file tree
Hide file tree
Showing 106 changed files with 51 additions and 20,346 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Version 1.3.0
- CLI --data now handles inproperly formatted data (by treating it as strings)
- DEPRECATED: Services
- DEPRECATED: pyblish.logic.process
- BACKWARD INCOMPATIBLE: Vendored packages nose, yaml and coverage no longer included
- BACKWARD INCOMPATIBLE: CLI side-car configuration files no longer picked up.
- BACKWARD INCOMPATIBLE: CLI side-car data files no longer picked up.

Expand Down
8 changes: 7 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
install:
- set PATH=C:\Python27-x64;%PATH%
- set PATH=C:\Python27-x64\scripts;%PATH%
- pip install nose
- pip install coverage

build_script:
- run_coverage.py
- python run_coverage.py
52 changes: 0 additions & 52 deletions pyblish/_help.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions pyblish/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
$ pyblish --help
Attributes:
DATA_PATH: Default location of user-data for the cli.
SCREEN_WIDTH: Used in right-aligned printed elements.
TAB: Default tab-width.
LOG_LEVEL: Mapping between cli flags and logging flags.
intro_message: Message displayed during each command.
Note:
Expand All @@ -31,7 +29,6 @@

from pyblish.vendor import click

# Current Click context
_ctx = None
_help = {
"main": {
Expand Down
9 changes: 0 additions & 9 deletions pyblish/config.yaml

This file was deleted.

17 changes: 6 additions & 11 deletions pyblish/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,10 @@ def emit(self, record):


def extract_traceback(exception):
try:
exc_type, exc_value, exc_traceback = sys.exc_info()
exception.traceback = traceback.extract_tb(exc_traceback)[-1]

except:
pass

finally:
del(exc_type, exc_value, exc_traceback)
"""Inject current traceback and store in exception"""
exc_type, exc_value, exc_traceback = sys.exc_info()
exception.traceback = traceback.extract_tb(exc_traceback)[-1]
del(exc_type, exc_value, exc_traceback)


def time():
Expand Down Expand Up @@ -352,9 +347,9 @@ def deprecated(func):

@functools.wraps(func)
def wrapper(*args, **kwargs):
if sys.version_info >= (2, 7):
if sys.version_info[0] == 2:
warnings.warn_explicit(
"Call to deprecated function {}.".format(func.__name__),
"Call to deprecated function %s." % func.__name__,
category=DeprecationWarning,
filename=func.func_code.co_filename,
lineno=func.func_code.co_firstlineno + 1)
Expand Down
7 changes: 5 additions & 2 deletions pyblish/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,13 +1126,13 @@ def discover(type=None, regex=None, paths=None):

# Include plug-ins from registration.
# Directly registered plug-ins take precedence.
for name, plugin in _registered_plugins.iteritems():
for name, plugin in _registered_plugins.items():
if name in plugins:
log.debug("Duplicate plug-in found: %s", plugin)
continue
plugins[name] = plugin

plugins = plugins.values()
plugins = list(plugins.values())
sort(plugins) # In-place

return plugins
Expand Down Expand Up @@ -1264,5 +1264,8 @@ def sort(plugins):
"""

if not isinstance(plugins, list):
raise TypeError("plugins must be of type list")

plugins.sort(key=lambda p: p.order)
return plugins
8 changes: 4 additions & 4 deletions pyblish/plugins/collect_current_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import pyblish.lib


class CollectCurrentDate(pyblish.api.Collector):
class CollectCurrentDate(pyblish.api.ContextPlugin):
"""Inject the current time into the Context"""

order = pyblish.api.CollectorOrder

def process(self, context):
"""Formatting is coming from configuration"""
date = pyblish.lib.time()
context.data['date'] = date
context.data['date'] = pyblish.lib.time()
6 changes: 4 additions & 2 deletions pyblish/plugins/collect_current_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import pyblish.api


class CollectCurrentUser(pyblish.api.Collector):
class CollectCurrentUser(pyblish.api.ContextPlugin):
"""Inject the currently logged on user into the Context"""

order = pyblish.api.CollectorOrder

def process(self, context):
context.set_data('user', value=getpass.getuser())
context.data['user'] = getpass.getuser()
4 changes: 3 additions & 1 deletion pyblish/plugins/collect_current_working_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import pyblish.api


class CollectCurrentWorkingDirectory(pyblish.api.Collector):
class CollectCurrentWorkingDirectory(pyblish.api.ContextPlugin):
"""Inject the current working directory into Context"""

order = pyblish.api.CollectorOrder

def process(self, context):
context.data['cwd'] = os.getcwd()
2 changes: 0 additions & 2 deletions pyblish/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ def _convenience(order, *args, **kwargs):
plugins = [p for p in plugin.discover()
if p.order < order]

print [p.id for p in plugins]

args = list(args)
if len(args) > 1:
args[1] = plugins
Expand Down
120 changes: 0 additions & 120 deletions pyblish/vendor/coverage/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions pyblish/vendor/coverage/__main__.py

This file was deleted.

Loading

0 comments on commit 58ba367

Please sign in to comment.