Closed Stedders closed 3 years ago
Can we keep the click migration in a separate PR?
I'm pretty sure we would need to ditch the dependency injection in order to use click, so I don't want to commit to migrating yet.
Ok, I think I have a working solution but can you advise if you are happy with the methodology
Benefits are that the version only needs to be specified using tags, no need to add to setup.py, and if the source is modified before installation the version reflects it.
The only change is that the tagging methodology has to follow PEP-440 (so v0.1.0-alpha is not valid it would need to be 0.1.0a).
Version is now just a text string read from the py file. If you would like it saved as a text file I will need to do some Makefile shenanigans to install it.
Thanks for the quick update.
It seems straightforward to make it a text file, no? I made the change here on a new branch - am I missing something?
The only reason I think it matters is that a version string like 0.1.0a1.dev10+g98667e9.d20210314
is not valid python, so we shouldn't be putting it into a .py
.
Happy to merge this if we can make it a text file without too much hassle.
Happy to look at the change, agree that it shouldn't be in the python file as raw text.
The issue is that Makefile install does not copy non-python files, I will look at how I can add it to the payload.
I just ran make install
on my branch, and it looks like gp --version
works.
Perhaps when we use pip to install, it won't copy across a non-python file?
Are you sure that is not the local git install?
I see the same behaviour in the repo but incorrect in a different shell...
/media/Dev/projects/git-plan$ git plan --version
0.1.0a1.dev2+g98667e9.d20210314
~/code/untitled$ git plan --version
dev
...and yes, the problem is pip install -e .
not copying it.
I think there is a simple fix in setup.py, just looking at it.
Yes, you're right. It was finding the repo file.
I think that'll do it. Added to sertup.py.
Doesn't work for me. It looks like the _version
file wasn't copied across to the .local/share/git-plan/venv/.../git_plan/
directory.
Weird, it was working for me and now it isn't....I blame myself. :smile:
Will look again.
Haha no worries. Once it's working I'll get this merged!
Is now good, I was trying a couple of methods to include it.
Files to include are added to the MANIFEST.in file, they don't need to be in setup.py.
Crosses fingers...
Version is derived using the version-query library.
Printing using click.echo to start the process of migrating to click.