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

Versioneer #489

Closed
wants to merge 7 commits into
from

Conversation

Projects
None yet
2 participants
@mikofski
Contributor

mikofski commented Jan 18, 2017

Fixes issue in release robot that doesn't detect unannotated tags. IE if tag created with out the -a option.

Also add test of get_recent_tags that compares 95 tags from beginning of dulwich repo.

$ nosetests dulwich/contrib/test_release_robot.py  -v
test_dulwich_tags (dulwich.contrib.test_release_robot.TagPatternTests) ... ok
test_tag_pattern (dulwich.contrib.test_release_robot.TagPatternTests) ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.062s

OK

Also change docstring to give example similar to this gist of how to emulate versioneer.

mikofski added some commits Jan 17, 2017

Merge tag 'dulwich-0.16.3' into versioneer
Release 0.16.3.

# gpg: Signature made Sat, Jan 14, 2017 12:02:08 PM PST
# gpg:                using RSA key 9A2D24A504D1E9F8
# gpg: Can't check signature: public key not found
fix release robot issue for commit only tag
- if tag is not annotated, then it will be a commit object, instead of
creating a tag object
- don't check if ref object is tag, instead check if "tags" is in the
ref name
- change docstring to show how release_robot could be used as alternate
to versioneer, ie: copy and paste gist

https://gist.github.com/mikofski/e923750b415e4e4961b65a8eb42999e8#file-xyz__init__-py
- don't use contrib folder as default projdir, instead default to '.'
- return tag meta data if there is any from get_recent_tags() as tuple
(tag time, tag id, tag name) otherwise it's (None, None, None)
- remove test_tag_pattern from release_robot since it's in
test_release_robot()
- add test of current 95 dulwich tags to test_release_robot

Signed-off-by: Mark Mikofski <mark.mikofski@sunpowercorp.com>
@jelmer

This comment has been minimized.

Show comment
Hide comment
@jelmer

jelmer Jan 18, 2017

Member

Thanks for the patch.

One of the tests seems to be timezone-specific:

======================================================================
FAIL: test_dulwich_tags (dulwich.contrib.test_release_robot.TagPatternTests)

Traceback (most recent call last):
File "dulwich/contrib/test_release_robot.py", line 58, in test_dulwich_tags
self.assertEqual(metadata[0].isoformat(), test_data[0]) # date
AssertionError: '2017-01-14T20:21:52' != u'2016-04-24T15:39:37'

Member

jelmer commented Jan 18, 2017

Thanks for the patch.

One of the tests seems to be timezone-specific:

======================================================================
FAIL: test_dulwich_tags (dulwich.contrib.test_release_robot.TagPatternTests)

Traceback (most recent call last):
File "dulwich/contrib/test_release_robot.py", line 58, in test_dulwich_tags
self.assertEqual(metadata[0].isoformat(), test_data[0]) # date
AssertionError: '2017-01-14T20:21:52' != u'2016-04-24T15:39:37'

@jelmer

This comment has been minimized.

Show comment
Hide comment
@jelmer

jelmer Jan 18, 2017

Member

Ah, I see what's happening. Please construct a test repository and run tests against that, rather than using the dulwich repository itself.

This is problematic because it means local changes cause the tests to fail, and also because anybody who is running dulwich from e.g. a tarball won't be able to run the test.

Member

jelmer commented Jan 18, 2017

Ah, I see what's happening. Please construct a test repository and run tests against that, rather than using the dulwich repository itself.

This is problematic because it means local changes cause the tests to fail, and also because anybody who is running dulwich from e.g. a tarball won't be able to run the test.

mikofski added some commits Jan 18, 2017

use github repo instead of actual repo
* does this fix the assert failures for commit times?
* setup class to clone github dulwich repo
* teardown class to close repo and remove repo dir
* move constants for tag test to class
* separate tag test into its own test class
* set tag meta to None for unannotated tags, instead of (None, None,
None)
* change test and test data wrt to unannotated tags
* clarify get_recent_tags() docstring

Signed-off-by: Mark Mikofski <mark.mikofski@sunpowercorp.com>
fix repo issue
* use zipped test repo instead of github repo
* add some logging
* put each test repo in temp dir, no race conditions on travis?

Signed-off-by: Mark Mikofski <mark.mikofski@sunpowercorp.com>
fix strings for python-3, do not log
Signed-off-by: Mark Mikofski <mark.mikofski@sunpowercorp.com>
@mikofski

This comment has been minimized.

Show comment
Hide comment
@mikofski

mikofski Jan 18, 2017

Contributor

it's passing both Python versions for me now:

Python-2

$ py -2 -m nose dulwich/contrib/test_release_robot.py -v --nologcapture
test get recent tags ... ok
test tag patterns ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.118s

OK

Python-3

$ py -3 -m nose dulwich/contrib/test_release_robot.py -v --nologcapture
test get recent tags ... ok
test tag patterns ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.131s

OK

feel free to squash commits. it's a mess. I had to use zip file and a tempdir

Contributor

mikofski commented Jan 18, 2017

it's passing both Python versions for me now:

Python-2

$ py -2 -m nose dulwich/contrib/test_release_robot.py -v --nologcapture
test get recent tags ... ok
test tag patterns ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.118s

OK

Python-3

$ py -3 -m nose dulwich/contrib/test_release_robot.py -v --nologcapture
test get recent tags ... ok
test tag patterns ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.131s

OK

feel free to squash commits. it's a mess. I had to use zip file and a tempdir

@jelmer

This comment has been minimized.

Show comment
Hide comment
@jelmer

jelmer Jan 18, 2017

Member
Member

jelmer commented Jan 18, 2017

@mikofski

This comment has been minimized.

Show comment
Hide comment
@mikofski

mikofski Jan 18, 2017

Contributor

workin' on it

Contributor

mikofski commented Jan 18, 2017

workin' on it

@mikofski

This comment has been minimized.

Show comment
Hide comment
@mikofski

mikofski Jan 19, 2017

Contributor

ok, I think it's ready now

Contributor

mikofski commented Jan 19, 2017

ok, I think it's ready now

@jelmer

This comment has been minimized.

Show comment
Hide comment
@jelmer

jelmer Jan 19, 2017

Member

Looks good to me now. thanks!

Member

jelmer commented on bb7e4f7 Jan 19, 2017

Looks good to me now. thanks!

@jelmer

This comment has been minimized.

Show comment
Hide comment
@jelmer

jelmer Jan 20, 2017

Member

Merged, thanks!

Member

jelmer commented Jan 20, 2017

Merged, thanks!

@jelmer jelmer closed this Jan 20, 2017

@mikofski mikofski deleted the mikofski:versioneer branch Jul 4, 2018

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