Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues with automatic version number #76

Closed
sebastianneubauer opened this issue Oct 9, 2015 · 7 comments
Closed

issues with automatic version number #76

sebastianneubauer opened this issue Oct 9, 2015 · 7 comments
Labels
enhancement New feature or request
Milestone

Comments

@sebastianneubauer
Copy link

It seems, if the package setup.py is not in the git repository root directory, the generated version string is different than in the root dir:
root dir:
python setup.py --version
0.0.post0.dev1+11079f0
subfolder:
python setup.py --version
0.0.1.dev1

@FlorianWilhelm
Copy link
Member

This is kind of unintended usage. Did everything else work? Can you explain what you exactly did?
Somehow setuptools_scm switches back to the default versioning.

@sebastianneubauer
Copy link
Author

Mmmh, I feared an answer like this, but in my experience we cannot come around accepting, that the pressure to use pyscaffold is sometimes smaller than the pressure to not have setup.py in the root of a repository. Often for example there are many packages in one repository, because they should have a common version (same version control)...then it makes sense to have them both in subfolders and both have a separate pyscaffold...
As far as I can see, everything except for the versioning is working...of course in order to be really usefull and intended in this scenario, one should be able to tell pyscaffold not to create a repo...

@FlorianWilhelm
Copy link
Member

Ok, it should be no problem to let PyScaffold only create a repo if the current directory is not already a git repo. The problem is the strange versioning... do you want to look into it? My guess is it is setuptools_scm related. With a debugger it should be no problem to find the cause. I am on holidays right now and cant do it.

@FlorianWilhelm FlorianWilhelm added the enhancement New feature or request label Oct 12, 2015
@FlorianWilhelm FlorianWilhelm added this to the 2.5 milestone Oct 12, 2015
@sebastianneubauer
Copy link
Author

Ok, I can have a look...

@sebastianneubauer
Copy link
Author

I analyzed the issue with the versioning and found the reason. Setuptools has a configuration parameter "root" which defaults to ".".
We can quite easily fix this issue by setting the correct root dir. The root folder can be identified with the following:

 repo_dir = subprocess.Popen(['git', 'rev-parse', '--show-toplevel'], stdout=subprocess.PIPE).communicate()[0].rstrip().decode('utf-8')

@FlorianWilhelm
Copy link
Member

Thanks, that was fast. Is this a parameter of setuptools or setuptools_scm? The latter I guess. I'll think with a few changes in integration.py we can resolve this issue. I'll look into it after my holidays.

@FlorianWilhelm
Copy link
Member

Thanks to @treebee this is fixed in release v2.4.3!

FlorianWilhelm added a commit that referenced this issue Apr 25, 2016
…5390e9

f5390e9 limit pypi deploy to python 2.7
3518f4e add pypi deploy on tags
af99acd update changelog
f85de3c Merge pull request #85 from esben/master
ff948dc fix bug when using callable version_scheme
c178ee7 add regression test for callable use_scm_version
4835e4d Merge pull request #82 from untitaker/error-message3
1bd11bc Improve error message, third take
e8ef5cd drop python 3.2 since pip dropped it
c5a25ed Merge pull request #80 from agronholm/master
3dd12d0 Added Python version classifiers to setup.py
ab3853e Merge pull request #76 from brianmay/fix_v_prefix
1ef9235 Update comment for previous change
77da109 Ensure we call tag_to_version

git-subtree-dir: pyscaffold/contrib/setuptools_scm
git-subtree-split: f5390e98b426da854838738c86a48b87742e259d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants