Skip to content

Implement static package versioning#113

Merged
pwildenhain merged 3 commits intomasterfrom
fix-versioning
May 8, 2020
Merged

Implement static package versioning#113
pwildenhain merged 3 commits intomasterfrom
fix-versioning

Conversation

@pwildenhain
Copy link
Copy Markdown
Collaborator

Fixes #87

I saw that you had the versioning in it's own file before, but I think that wasn't getting picked up when doing GitHub installs.

I thought this would be the most straightforward solution since:

  • The information in version.py seems to be else where in the package such as the __init__.py and also the setup.py
  • As far as I could tell they're wasn't a huge benefit to having the version in the __init__.py AND in the setup.py, though I could be missing something.
  • This seems a little easier to bump the version, by just changing it in the setup.py

@pwildenhain pwildenhain requested a review from sburns March 30, 2020 17:29
@pwildenhain pwildenhain self-assigned this Mar 30, 2020
@sburns
Copy link
Copy Markdown
Collaborator

sburns commented Mar 30, 2020

Yeah in practice its the same, it comes down to what files you expect to see changed during a PR review. Technically, this is backwards incompatible as you're removing __version__ from the top-level package.

Someone might be doing

import redcap
do_something_with(redcap.__version__)

That will AttributeError if this PR lands.

@pwildenhain
Copy link
Copy Markdown
Collaborator Author

Good catch! I've added that variable back in for backwards compatibility. I know it's not ideal to have it documented in two places (i.e why you had the other process 😉) though I think this is worth the short term benefit of making the package version work when installing from GitHub. And in the long term, we might be able to come up with a different strategy that meets both needs.

@pwildenhain
Copy link
Copy Markdown
Collaborator Author

Alternatively, if you don't want to double document this, we could try refactoring the get_version() function to look more like this: https://github.com/jendrikseipp/vulture/blob/master/setup.py#L18 ?

Or do you think that still wouldn't solve our problem?

Tested this locally and it sucessfully recognized the version. 🙇‍♂️ many thanks to `vulture`
@pwildenhain
Copy link
Copy Markdown
Collaborator Author

I tested installing from this branch and successfully got version 1.0.2 🎉 Now we can have the version in one place and have it be recognized when installing from GitHub :octocat: 👯‍♀️

@pwildenhain pwildenhain merged commit e0e8a89 into master May 8, 2020
@pwildenhain pwildenhain deleted the fix-versioning branch May 8, 2020 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version is set to 0.0.0 after installing with pip

2 participants