Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:nnadeau/pybotics into release-0.3.2
Browse files Browse the repository at this point in the history
* 'master' of github.com:nnadeau/pybotics:
  ignoring args
  fixing SyntaxError: duplicate argument '_' in function definition
  format arg shadowed built in name and isn't used; ignoring variable
  converting short sha to int for PEP440 compliance
  using travis variables to help versioning
  debugging travis ci
  parsing git branch to append commit sha to branch versions when uploading to testPyPI
  fixing vulture lint
  fixed return value for pandoc 1.12.2.1

  fixing json-object path due to old pandoc version used on old travis ci trusty image
  debugging travis ci
  downgraded pandocfilters due to compatibility with Travis CI trusty
  upgraded travis pandoc command
  added pandocfilters==1.4.1 to ci requirements
  added pandoc filter
  cleaned ci yml
  updated README
  allowing test branch to deploy for now
  attempting master deploy to pypi test server
  • Loading branch information
nnadeau committed Jun 20, 2017
2 parents 69f3926 + a571a9f commit 3491b50
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 4 deletions.
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ 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 -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 .

Expand All @@ -57,6 +59,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:
all_branches: true
distributions: sdist bdist_wheel
repo: nnadeau/pybotics
python: 3.6
- provider: pypi
skip_cleanup: true
user: nnadeau
Expand All @@ -76,3 +89,4 @@ deploy:
branch: master
repo: nnadeau/pybotics
python: 3.6

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions ci-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ pytest-cov==2.5.1

# misc
GitPython==2.1.5
pandocfilters==1.2.4
25 changes: 25 additions & 0 deletions clean_readme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from pandocfilters import toJSONFilter


def strip_links(key, value, *_):
# strip readme badges
if key == 'Para':
if value[0]['t'] == 'Link' and value[0]['c'][0][0]['t'] == 'Image':
return []

# turn links to text
if key == 'Link':
return value[0]

# 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, '', '')
33 changes: 30 additions & 3 deletions update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,36 @@
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))
logging.info('Repo:\t{}'.format(repo))

latest_tag = repo.tags[-1]
logging.info('Latest tag:\t{}'.format(latest_tag))

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))

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')
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 = '{}.dev{}'.format(latest_tag, int(short_sha, 16))

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))
Expand Down

0 comments on commit 3491b50

Please sign in to comment.