Skip to content

Improve version.py generation #8

Closed

Description

@embray

I've been working on my own version.py generation for STScI's packages--it works pretty similarly, but with a couple differences:

  • I also started out making it an extension of the build_py command, but I ended up changing it to regenerate the file on every setup.py run--this ensures that an updated version.py file is created for commands such as 'develop' and 'sdist'. It doesn't seem to add any noticeable time to running setup.py.
  • The version.py uses the SVN revision info getter to automatically update its SVN info on import if the package is installed in develop mode. That way, when installed in develop mode the revision is always up to date. I would want the same for git. It doesn't do this if the package is not installed in develop mode, so it doesn't hurt import time otherwise. The code for doing that is just part of the version.py template.

I'm open to other ideas for exactly how to implement this, but I would want to add these capabilities.

Activity

  1. embray commented on Oct 12, 2011

    @embray
    MemberAuthor

    I should add--in my version of this I just put the version.py directly into the source (rather than in the build/ dir as a build_py extension would do). Then I just use svn:ignore (or in this case .gitignore) on it.

  2. embray commented on Oct 13, 2011

    @embray
    MemberAuthor

    Issue #12 illustrates what I'm talking about here (has GitHub added the ability to attach a pull request to an existing issue yet?)

  3. added a commit that references this issue on Dec 22, 2012
  4. added a commit that references this issue on Apr 26, 2013
  5. added 3 commits that reference this issue on Oct 9, 2013
    60fb422
    b5e4ece
  6. added a commit that references this issue on Jul 20, 2019
  7. added a commit that references this issue on Aug 31, 2020
  8. added a commit that references this issue on Sep 10, 2020
  9. added a commit that references this issue on Jul 2, 2025
    3515a88
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions