Skip to content

make_version.py issues #776

Closed
Closed

Description

@jibsen

As mentioned in #769, make_version.py does not appear to work from its new location in the scripts folder. The issues I noticed were:

  • print needs parenthesis for Python 3 compatibility
  • scripts/tokenize.py shadows a system module that make_version.py includes
  • it insists on looking for .git in the same folder as the script rather than it's working folder

Activity

  1. added
    Engineering
    on Nov 15, 2016
  2. mihaipopescu commented on Nov 20, 2016

    @mihaipopescu
    Collaborator

    I don't think this is fixed. We should reopen this one and take a look.

  3. mihaipopescu commented on Nov 22, 2016

    @mihaipopescu
    Collaborator

    @jibsen Thanks for checking this. I have few questions.

    print needs parenthesis for Python 3 compatibility

    I don't think it does. I have Python 2.7 and it works. Can you elaborate why do you think otherwise?

    scripts/tokenize.py shadows a system module that make_version.py includes

    I don't understand. I don't see any connection between the two scripts.

    @gmaurel Can you reopen this issue ? Also pretty please don't close issues that don't have any resolution (like this one) as they can get lost. If you really want to do it you can add a comment with a reason why.

  4. jibsen commented on Nov 24, 2016

    @jibsen
    ContributorAuthor

    In Python 3, print is a function, so it requires parenthesis. In order for the script to work with both Python 2 and 3, we need to add parenthesis.

    For better or worse, Python files in the local folder may shadow Python modules. make_version.py imports subprocess, which somewhere down the line inside the Python 3 libraries imports tokenize. Python 2 does not import this, but you can get the same effect if for instance you create a file threading.py in the scripts folder containing only the word raise. Basically, since this isn't a package with its own namespace, I think we'll need to steer clear of any filenames that might shadow Python libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Engineering

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions