Skip to content

Use six in pyrevitlib #2823

@sanzoghenzo

Description

@sanzoghenzo

Following #2811

we could use six to ensure compatibility with both python 2 and 3, instead of manually patching pyrevitlib's code.

As of now, the problem to introduce this is that site-packages, that is where six is placed, is not loaded by PyRevitLoaderApplication (as opposed to PyRevitRunner that loads both pyrevitlib and site-packages before running the user script).

We have two possible options:

  1. add site-packages to the syspaths in PyRevitLoaderApplication
  2. copy over the six module inside pyrevitlib. From the documentation:

    six consists of only one Python file, so it is painless to copy into a project

My thoughts: since #2647 is on the way, both options should be temporary, so option 1 would be better (no need to copy things around, and no need to change imports afterwards). But I don't know if this would introduce unwanted side effects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    New FeatureNew feature request [class->Implemented #{number}: {title}]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions