From 8bee21a65260b8f4fde3817992b3a981e8647107 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Sun, 18 Jun 2017 12:30:28 -0400 Subject: [PATCH 01/19] attempting master deploy to pypi test server --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index b11a0345..c82c9fb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,6 +57,17 @@ notifications: email: false deploy: + - provider: pypi + skip_cleanup: true + user: nnadeau + password: + secure: "gN+oTjGRS3snYKcVtgy11GgdKHOVTygRxFLz0GCf0FLgN20FJpaTAq92b4+i1n2akvu+0spIE91UO7Ii39InLR79nJXgJZ8Z1XsRuf8lZ44dkvy/jaUdsMgYeLKGGTXpc/8CdK2DaU4BMSVGNlzIDPg8HySSv1sAAR4kQ070p1Gl/XwT0GvX/r0WrfA023rWlG9HnOnq8c/MtZVRX9SPxxDGv4YhWSZsIAyO6zawbzaOFtmamX2Pc13m1tWftpYtGWWGKW7Kmf9/zW7sbXbcikyKDB66lNyB2ARrN1l9OdRXkjHN457YpMOxAg71azazcim6JdarYtjeVpuS1b98UVReE897uSdylzp1sq99ZMJ5GFpu345K7sShvPH6DCJOQnaoiXQSW60oQ8BqS6NpmxfKsOj3KOXSbbV8S2ygr5FcbTpsxD3d9qOGTo/DcwN2/2nVxXUO6ZjsPCaKNjTFk6Mwv9v17lGQGebq4hG4Za/k5T78B91ELSqDfZ2+x+kJzJ50Vd1yfPayxh4mEyAAqnnVYELuxIbXx+AZjMf9hZyEeKkCIebQU++LVoJraYSdG6YbhX2qBjj4r0/YmcskOrZO3SmEvCsMV/kgZMwEcgH0u/cRxUPkvGKTEgiBtSJ5K9ytG6JmS15nFy6SaYPtXeNnBaAdLtmF6PmEgF2CL4g=" + server: https://testpypi.python.org/pypi + on: +# branch: master + distributions: sdist bdist_wheel + repo: nnadeau/pybotics + python: 3.6 - provider: pypi skip_cleanup: true user: nnadeau @@ -76,3 +87,4 @@ deploy: branch: master repo: nnadeau/pybotics python: 3.6 + From 89109ee5e01016929c698bf0dad28b8e48229ca6 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Sun, 18 Jun 2017 12:36:41 -0400 Subject: [PATCH 02/19] allowing test branch to deploy for now --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c82c9fb4..6c25fc78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,6 +65,7 @@ deploy: server: https://testpypi.python.org/pypi on: # branch: master + all_branches: true distributions: sdist bdist_wheel repo: nnadeau/pybotics python: 3.6 From 0557cd059e45b567e0316ad90b9bb7636f683018 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Sun, 18 Jun 2017 13:04:50 -0400 Subject: [PATCH 03/19] updated README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 7b952b1d..8c0bc168 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,10 @@ pose = ur10_robot.fk() # forward kinematics, returns 4x4 pose transform - [Calibration](https://github.com/nnadeau/pybotics/blob/master/examples/example_calibration.ipynb) - Trajectory and path planning +## Development +- All branches are deployed to [PyPI's Test Site](https://testpypi.python.org/pypi/pybotics/) +- Only tags on the `master` branch are deployed to [PyPI](https://pypi.python.org/pypi/pybotics) + ## References - Craig, John J. Introduction to robotics: mechanics and control. Vol. 3. Upper Saddle River: Pearson Prentice Hall, 2005. - Corke, Peter. Robotics, vision and control: fundamental algorithms in MATLAB. Vol. 73. Springer, 2011. From 74e7c14438e42ae17e5dcc3bd95425673172e6d2 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Sun, 18 Jun 2017 13:05:59 -0400 Subject: [PATCH 04/19] cleaned ci yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6c25fc78..d1fd616e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,7 +64,6 @@ deploy: secure: "gN+oTjGRS3snYKcVtgy11GgdKHOVTygRxFLz0GCf0FLgN20FJpaTAq92b4+i1n2akvu+0spIE91UO7Ii39InLR79nJXgJZ8Z1XsRuf8lZ44dkvy/jaUdsMgYeLKGGTXpc/8CdK2DaU4BMSVGNlzIDPg8HySSv1sAAR4kQ070p1Gl/XwT0GvX/r0WrfA023rWlG9HnOnq8c/MtZVRX9SPxxDGv4YhWSZsIAyO6zawbzaOFtmamX2Pc13m1tWftpYtGWWGKW7Kmf9/zW7sbXbcikyKDB66lNyB2ARrN1l9OdRXkjHN457YpMOxAg71azazcim6JdarYtjeVpuS1b98UVReE897uSdylzp1sq99ZMJ5GFpu345K7sShvPH6DCJOQnaoiXQSW60oQ8BqS6NpmxfKsOj3KOXSbbV8S2ygr5FcbTpsxD3d9qOGTo/DcwN2/2nVxXUO6ZjsPCaKNjTFk6Mwv9v17lGQGebq4hG4Za/k5T78B91ELSqDfZ2+x+kJzJ50Vd1yfPayxh4mEyAAqnnVYELuxIbXx+AZjMf9hZyEeKkCIebQU++LVoJraYSdG6YbhX2qBjj4r0/YmcskOrZO3SmEvCsMV/kgZMwEcgH0u/cRxUPkvGKTEgiBtSJ5K9ytG6JmS15nFy6SaYPtXeNnBaAdLtmF6PmEgF2CL4g=" server: https://testpypi.python.org/pypi on: -# branch: master all_branches: true distributions: sdist bdist_wheel repo: nnadeau/pybotics From e59935ac71888f244376dceb3b988acaf08a508f Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 08:03:58 -0400 Subject: [PATCH 05/19] added pandoc filter --- clean_readme.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 clean_readme.py diff --git a/clean_readme.py b/clean_readme.py new file mode 100644 index 00000000..f4fe7d4a --- /dev/null +++ b/clean_readme.py @@ -0,0 +1,25 @@ +from pandocfilters import toJSONFilter + + +def strip_links(key, value, format, meta): + # strip readme badges + if key == 'Para': + if value[0]['t'] == 'Link' and value[0]['c'][1][0]['t'] == 'Image': + return [] + + # turn links to text + if key == 'Link': + return value[1] + + # strip raw html, logo, and ruled lines + if key in ['RawBlock', 'HorizontalRule', 'Image']: + return [] + + +if __name__ == "__main__": + toJSONFilter(strip_links) + + # debugging + # with open('README.json') as f: + # doc = json.load(f) + # walk(doc, strip_links, '', '') From ad05e9271d40befd129ea781e4e7b904e3346431 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 08:05:30 -0400 Subject: [PATCH 06/19] added pandocfilters==1.4.1 to ci requirements --- ci-requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-requirements.txt b/ci-requirements.txt index 1c0d8ac6..ab42c23c 100644 --- a/ci-requirements.txt +++ b/ci-requirements.txt @@ -13,3 +13,4 @@ pytest-cov==2.5.1 # misc GitPython==2.1.5 +pandocfilters==1.4.1 From b90a3569164e062894761c4bf0e29f86b12e0caf Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 08:05:42 -0400 Subject: [PATCH 07/19] upgraded travis pandoc command --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b11a0345..d2036d2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ install: - pip install -r ci-requirements.txt - python update_version.py - pandoc -v -- pandoc --from=markdown --to=rst --output=README.rst README.md +- pandoc -s -f markdown_github -t json README.md | python clean_readme.py | pandoc -s -f json -t rst -o README.rst - cat README.rst - pip install . From 8b112f55b3bf5f8db3794fe6e57fed85c56a7574 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 08:26:44 -0400 Subject: [PATCH 08/19] downgraded pandocfilters due to compatibility with Travis CI trusty --- ci-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-requirements.txt b/ci-requirements.txt index ab42c23c..c1353e10 100644 --- a/ci-requirements.txt +++ b/ci-requirements.txt @@ -13,4 +13,4 @@ pytest-cov==2.5.1 # misc GitPython==2.1.5 -pandocfilters==1.4.1 +pandocfilters==1.2.4 From b9a03385615e351b04dcf70b1a0386ad99a36269 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 08:31:12 -0400 Subject: [PATCH 09/19] debugging travis ci --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index d2036d2d..eb5868e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,6 +36,8 @@ install: - pip install -r ci-requirements.txt - python update_version.py - pandoc -v +- pandoc -s -f markdown_github -t json -o README.json README.md +- cat README.json - pandoc -s -f markdown_github -t json README.md | python clean_readme.py | pandoc -s -f json -t rst -o README.rst - cat README.rst - pip install . From be4c91e2a9b98172253d9e78da2bd8264a21065e Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 08:38:53 -0400 Subject: [PATCH 10/19] fixing json-object path due to old pandoc version used on old travis ci trusty image --- clean_readme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clean_readme.py b/clean_readme.py index f4fe7d4a..5655f27c 100644 --- a/clean_readme.py +++ b/clean_readme.py @@ -4,7 +4,7 @@ def strip_links(key, value, format, meta): # strip readme badges if key == 'Para': - if value[0]['t'] == 'Link' and value[0]['c'][1][0]['t'] == 'Image': + if value[0]['t'] == 'Link' and value[0]['c'][0][0]['t'] == 'Image': return [] # turn links to text From 6eac2fc4eb995cd66c7cfc28705939ddb77cb67b Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 09:34:06 -0400 Subject: [PATCH 11/19] =?UTF-8?q?fixed=20return=20value=20for=20pandoc=201?= =?UTF-8?q?.12.2.1=E2=80=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clean_readme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clean_readme.py b/clean_readme.py index 5655f27c..20895b4b 100644 --- a/clean_readme.py +++ b/clean_readme.py @@ -9,7 +9,7 @@ def strip_links(key, value, format, meta): # turn links to text if key == 'Link': - return value[1] + return value[0] # strip raw html, logo, and ruled lines if key in ['RawBlock', 'HorizontalRule', 'Image']: From ca4963d087a4170962e19bacb5f731693ad6aefe Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 09:38:00 -0400 Subject: [PATCH 12/19] fixing vulture lint --- clean_readme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clean_readme.py b/clean_readme.py index 20895b4b..c4447ce4 100644 --- a/clean_readme.py +++ b/clean_readme.py @@ -1,7 +1,7 @@ from pandocfilters import toJSONFilter -def strip_links(key, value, format, meta): +def strip_links(key, value, format, _): # strip readme badges if key == 'Para': if value[0]['t'] == 'Link' and value[0]['c'][0][0]['t'] == 'Image': From 075d486c11c0dbd3a3c81440ccb12ff788bd120f Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 10:50:17 -0400 Subject: [PATCH 13/19] parsing git branch to append commit sha to branch versions when uploading to testPyPI --- update_version.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/update_version.py b/update_version.py index a453ea6e..5d23671c 100644 --- a/update_version.py +++ b/update_version.py @@ -10,9 +10,23 @@ logging.info('Root path:\t{}'.format(root_path)) repo = git.Repo(root_path) -tag = repo.tags[-1] -version = tag.name -logging.info('Latest git tag:\t{}'.format(version)) +latest_tag = repo.tags[-1] +current_branch = repo.active_branch +sha = repo.head.object.hexsha +short_sha = repo.git.rev_parse(sha, short=4) + +logging.info('Repo:\t{}'.format(repo)) +logging.info('Latest tag:\t{}'.format(latest_tag)) +logging.info('Current branch:\t{}'.format(current_branch)) +logging.info('Last commit sha:\t{}'.format(sha)) +logging.info('Last commit short sha:\t{}'.format(short_sha)) + +if str(current_branch) == 'master': + version = '{}'.format(latest_tag) +else: + version = '{}+{}'.format(latest_tag, short_sha) + +logging.info('Package version:\t{}'.format(version)) output_file = os.path.join(root_path, 'VERSION') logging.info('Writing version info to:\t{}'.format(output_file)) From 2f62010e34cea1d0d1040796a385e50e616d07cf Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 11:01:51 -0400 Subject: [PATCH 14/19] debugging travis ci --- update_version.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/update_version.py b/update_version.py index 5d23671c..4c903773 100644 --- a/update_version.py +++ b/update_version.py @@ -10,15 +10,31 @@ logging.info('Root path:\t{}'.format(root_path)) repo = git.Repo(root_path) -latest_tag = repo.tags[-1] -current_branch = repo.active_branch -sha = repo.head.object.hexsha -short_sha = repo.git.rev_parse(sha, short=4) - logging.info('Repo:\t{}'.format(repo)) + +latest_tag = repo.tags[-1] logging.info('Latest tag:\t{}'.format(latest_tag)) -logging.info('Current branch:\t{}'.format(current_branch)) + +# current_branch = repo.active_branch +# logging.info('Current branch:\t{}'.format(current_branch)) + +travis_commit = os.environ.get('TRAVIS_COMMIT') +logging.info('Travis commit:\t{}'.format(travis_commit)) + +travis_branch = os.environ.get('TRAVIS_BRANCH') +logging.info('Travis branch:\t{}'.format(travis_branch)) + +travis_pr_branch = os.environ.get('TRAVIS_PULL_REQUEST_BRANCH') +logging.info('Travis PR branch:\t{}'.format(travis_pr_branch)) + +travis_tag = os.environ.get('TRAVIS_TAG') +logging.info('Travis tag:\t{}'.format(travis_tag)) + + +sha = repo.head.object.hexsha logging.info('Last commit sha:\t{}'.format(sha)) + +short_sha = repo.git.rev_parse(sha, short=4) logging.info('Last commit short sha:\t{}'.format(short_sha)) if str(current_branch) == 'master': From 75e341037951e008743dc5ac8cbcabeda0bcb331 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 11:07:26 -0400 Subject: [PATCH 15/19] using travis variables to help versioning --- update_version.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/update_version.py b/update_version.py index 4c903773..fcf2ea49 100644 --- a/update_version.py +++ b/update_version.py @@ -15,12 +15,15 @@ latest_tag = repo.tags[-1] logging.info('Latest tag:\t{}'.format(latest_tag)) -# current_branch = repo.active_branch -# logging.info('Current branch:\t{}'.format(current_branch)) - travis_commit = os.environ.get('TRAVIS_COMMIT') logging.info('Travis commit:\t{}'.format(travis_commit)) +sha = repo.head.object.hexsha +logging.info('Last commit sha:\t{}'.format(sha)) + +short_sha = repo.git.rev_parse(sha, short=4) +logging.info('Last commit short sha:\t{}'.format(short_sha)) + travis_branch = os.environ.get('TRAVIS_BRANCH') logging.info('Travis branch:\t{}'.format(travis_branch)) @@ -30,14 +33,7 @@ travis_tag = os.environ.get('TRAVIS_TAG') logging.info('Travis tag:\t{}'.format(travis_tag)) - -sha = repo.head.object.hexsha -logging.info('Last commit sha:\t{}'.format(sha)) - -short_sha = repo.git.rev_parse(sha, short=4) -logging.info('Last commit short sha:\t{}'.format(short_sha)) - -if str(current_branch) == 'master': +if len(travis_tag) > 0: version = '{}'.format(latest_tag) else: version = '{}+{}'.format(latest_tag, short_sha) From ceefc6395c9a1f76c67e039b033dd1c61790cdfc Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 11:27:17 -0400 Subject: [PATCH 16/19] converting short sha to int for PEP440 compliance --- update_version.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/update_version.py b/update_version.py index fcf2ea49..358612c0 100644 --- a/update_version.py +++ b/update_version.py @@ -31,12 +31,13 @@ logging.info('Travis PR branch:\t{}'.format(travis_pr_branch)) travis_tag = os.environ.get('TRAVIS_TAG') +travis_tag = travis_tag if travis_tag is not None else '' logging.info('Travis tag:\t{}'.format(travis_tag)) if len(travis_tag) > 0: version = '{}'.format(latest_tag) else: - version = '{}+{}'.format(latest_tag, short_sha) + version = '{}.dev{}'.format(latest_tag, int(short_sha, 16)) logging.info('Package version:\t{}'.format(version)) From 9a9d68c60e03cbd2626f797872100667feedc4e6 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 11:58:55 -0400 Subject: [PATCH 17/19] format arg shadowed built in name and isn't used; ignoring variable --- clean_readme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clean_readme.py b/clean_readme.py index c4447ce4..758a189a 100644 --- a/clean_readme.py +++ b/clean_readme.py @@ -1,7 +1,7 @@ from pandocfilters import toJSONFilter -def strip_links(key, value, format, _): +def strip_links(key, value, _, _): # strip readme badges if key == 'Para': if value[0]['t'] == 'Link' and value[0]['c'][0][0]['t'] == 'Image': From 7a61c9beef3c8a72060a0a4d2bdc54eda3d32ba7 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 12:06:39 -0400 Subject: [PATCH 18/19] fixing SyntaxError: duplicate argument '_' in function definition --- clean_readme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clean_readme.py b/clean_readme.py index 758a189a..15558445 100644 --- a/clean_readme.py +++ b/clean_readme.py @@ -1,7 +1,7 @@ from pandocfilters import toJSONFilter -def strip_links(key, value, _, _): +def strip_links(key, value, fmt, _): # strip readme badges if key == 'Para': if value[0]['t'] == 'Link' and value[0]['c'][0][0]['t'] == 'Image': From c24b66e270f154d8d371094d2cccb69e64bf1473 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Tue, 20 Jun 2017 12:16:13 -0400 Subject: [PATCH 19/19] ignoring args --- clean_readme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clean_readme.py b/clean_readme.py index 15558445..72249198 100644 --- a/clean_readme.py +++ b/clean_readme.py @@ -1,7 +1,7 @@ from pandocfilters import toJSONFilter -def strip_links(key, value, fmt, _): +def strip_links(key, value, *_): # strip readme badges if key == 'Para': if value[0]['t'] == 'Link' and value[0]['c'][0][0]['t'] == 'Image':