Skip to content

Pipenv #17

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
layout pipenv
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
dist: xenial
language: python

branches:
except:
- gh-pages

python:
- 2.7
- 3.4
- 3.5
- 3.6
- '2.7'
- '3.4'
- '3.5'
- '3.6'
- '3.7'
#- pypy
#- pypy3

before_install:

install:
- pip install tox tox-travis
Expand Down
15 changes: 15 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
gitchangelog = "*"
twine = "*"
pytest = "*"
pytest-xdist = "*"

[packages]
pyros-genmsg = "*"
pyros-genpy = "*"
filefinder2 = "*"
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ Usage:
with rosimport.RosImporter():

import my_msgs.msg # directly from a my_msgs/msg directory containing My.msg ros definition
# Or relatively :
from . import msg

# modules are still available, but importer has been deactivated.
Relative imports are supported, as well as all the import semantics of python3 (even in python2, thanks for filefinder2)

TODO : TermtoSVG / ASCIInema !
12 changes: 12 additions & 0 deletions example/MyPyRosPkg/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import sys
import rosimport

with rosimport.RosImporter():

from . import msg

print("dir(msg) ->" + repr(dir(msg)))

import inspect
print("inspect.getsource(msg.mymsg) ->")
print(inspect.getsource(msg.mymsg))
1 change: 1 addition & 0 deletions example/MyPyRosPkg/msg/mymsg.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
string mystring
28 changes: 28 additions & 0 deletions example/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
HOW TO USE
==========

Use a virtualenv. If you are not sure how, you can do some very useful reading at https://packaging.python.org/tutorials/managing-dependencies/

If you have direnv (and pipenv) on your machine, this is done as soon as you 'cd' into rosimport working tree.


1) Install rosimport in the virtualenv::

(rosimport--FuygrvY)alexv@AlexV-ROS-vbox:~/rosimport$ pipenv install -e .
Installing -e .…
Adding rosimport to Pipfile's [packages]…
✔ Installation Succeeded
Pipfile.lock (474337) out of date, updating to (c8604e)…
Locking [dev-packages] dependencies…
✔ Success!
Locking [packages] dependencies…
✔ Success!
Updated Pipfile.lock (474337)!
Installing dependencies from Pipfile.lock (474337)…
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 5/5 — 00:00:02
(rosimport--FuygrvY)alexv@AlexV-ROS-vbox:~/rosimport$

2) Import the package to trigger the import sequence



14 changes: 0 additions & 14 deletions requirements-dev.txt

This file was deleted.

9 changes: 5 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# content of: tox.ini , put in same dir as setup.py
[tox]
envlist = py27, py34, py35, py36
envlist = py27, py34, py35, py36, py37
#, pypy
#, pypy3
skip_missing_interpreters=true
Expand All @@ -10,6 +10,7 @@ skip_missing_interpreters=true
3.4 = py34
3.5 = py35
3.6 = py36
3.7 = py37

# not tested yet
#pypy = pypy
Expand All @@ -28,12 +29,12 @@ skipsdist=True

[testenv]
whitelist_externals = git
deps =
# only when we want to test latest unreleased filefinder2 | genpy | genmsg
-rrequirements-dev.txt

# to always force recreation and avoid unexpected side effects
recreate=True
deps=
pytest
pytest-xdist

commands=
git submodule sync -q
Expand Down