Improved Tools Update

32 views
Skip to first unread message

Tom Leese

unread,
Jan 7, 2015, 1:20:34 PM1/7/15
to Student Robotics
Hi all,

Over the past few weeks I have been working to improve the SR tools
infrastructure to make it easier to package, develop and test them while
also adding a few useful, but long-desired, tools.

The main list of changes are:

* The tools are now installable as a proper Python package using
'Setuptools'.
* Sphinx based documentation is now in the repository and currently
being hosted on Read the Docs [0].
* Man pages are now available separately for all the commands
(generated with Sphinx).
* Python 3 is officially supported (and is better supported than
Python 2).
* A new 'inv-history' command has been added allowing historical
information about an asset to be viewed.
* An 'inv-validate' tool has been created (prompted by this list post
[1]) to check the inventory is in a valid state.
* A few tests were written during development (and a Travis CI
configuration file has been added).

Although the tools have been tested and I'm fairly confident all the
commands work, I would appreciate some other people testing before I
merge the changes into the 'master' branch. I intend on doing this on
the 31st January to give people some time to adapt.

To install the new tools, clone the 'tools.git' repo, change to the
'new-tools' branch and read the 'README.md' file. The documentation
currently talks about installing from the 'master' branch under the
assumption this will be the case shortly.

Tom

[0]: https://srtools.readthedocs.org/en/latest/
[1]: https://groups.google.com/d/topic/srobo-devel/yF29dHWCOmQ/discussion

Jeremy Morse

unread,
Jan 8, 2015, 1:05:37 PM1/8/15
to srobo...@googlegroups.com
Hi Tom,

Thanks for putting effort into all this,

On 07/01/15 18:20, Tom Leese wrote:
> * Man pages are now available separately for all the commands
> (generated with Sphinx).

Man pages as in, accessible via "man sr-budget-query" or similar? If so,
that's pretty enjoyable.

> * A new 'inv-history' command has been added allowing historical
> information about an asset to be viewed.
> * An 'inv-validate' tool has been created (prompted by this list post
> [1]) to check the inventory is in a valid state.

These both sound intensely useful!

As I understand it, seeing how you're using distutils/setuptools this
means the tools will be installed by default in some machine-global
location? This isn't fully ideal as some people don't have root on
machines they use (such as all uni-based linux machines in Bristol), or
have pip or virtualenv (Bristol again). Are there any options for local,
non-virtualenv based installation?

(I don't think this is a biggie, really -- it could have been ~7 years
ago, but every man and his dog now own a laptop).

> Although the tools have been tested and I'm fairly confident all the
> commands work, I would appreciate some other people testing before I
> merge the changes into the 'master' branch. I intend on doing this on
> the 31st January to give people some time to adapt.

I can be a guinea pig in about a weeks time.

--
Thanks,
Jeremy

signature.asc

Tom Leese

unread,
Jan 8, 2015, 1:15:44 PM1/8/15
to srobo...@googlegroups.com
Hi Jeremy,

On 08/01/15 18:05, Jeremy Morse wrote:
> Man pages as in, accessible via "man sr-budget-query" or similar? If
> so, that's pretty enjoyable.

Yep, that's exactly right. The process of installing them is a bit more
involved than with the tools themselves. You need to generate the man
pages with "make man" in the 'docs' directory and then copy them to
'/usr/share/man', but I will document this process shortly.

> Are there any options for local, non-virtualenv based installation?

There are! It is possible to install the package locally by using the
'--user' flag on both 'setup.py' and pip. This puts the package into
'.local/lib/pythonX.X/site-packages' and the 'sr' script into
'.local/bin'. The local binary directory should already be in PATH on
most modern distros and Python adds the local site-packages directory to
'sys.path' for you.

> I can be a guinea pig in about a weeks time.

That's great, the more people who check their workflow hasn't broken
(except for the installation process of course!) the better.

Tom

Alistair Lynn

unread,
Jan 8, 2015, 6:45:38 PM1/8/15
to srobo...@googlegroups.com
Hi Tom–

> Yep, that's exactly right. The process of installing them is a bit more
> involved than with the tools themselves. You need to generate the man pages
> with "make man" in the 'docs' directory and then copy them to
> '/usr/share/man', but I will document this process shortly.

Separately to installing them as man pages, would it be sensible to
have the normal installation have an `sr help` command which invokes
man on the right files?

Alistair

Tom Leese

unread,
Jan 9, 2015, 5:33:09 AM1/9/15
to srobo...@googlegroups.com
Hi Alistair,

On 08/01/15 23:45, Alistair Lynn wrote:
> Separately to installing them as man pages, would it be sensible to
> have the normal installation have an `sr help` command which invokes
> man on the right files?

That seems like a good idea. I guess that might not work so well on
Windows, but that's not a major issue since the man pages themselves
won't work. I probably won't get much of a chance to work on the tools
until after exams in two weeks though.

Tom

Peter Law

unread,
Jan 9, 2015, 1:41:16 PM1/9/15
to Student Robotics
Alistair wrote:
>> Separately to installing them as man pages, would it be sensible to have
>> the normal installation have an `sr help` command which invokes man on the
>> right files?

+1 to this.

> That seems like a good idea. I guess that might not work so well on Windows,

We could try looking for any 'man' instances the user has lying around
-- both cygwin and git's cut-down (I think) of it provide man, so it
seems fairly likely that people using the tools would have it around
in some form.

Peter

Tom Leese

unread,
Jan 31, 2015, 4:42:29 PM1/31/15
to srobo...@googlegroups.com
Hi all,


On Wednesday, 7 January 2015 18:20:34 UTC, Tom Leese wrote:
Although the tools have been tested and I'm fairly confident all the
commands work, I would appreciate some other people testing before I
merge the changes into the 'master' branch. I intend on doing this on
the 31st January to give people some time to adapt.

This has since happened [0].

I've decided against just merging and pushing to master to avoid annoying people who are not expecting it! I have, however, made it so that when it does get merged, the tools will continue working but with a deprecation message.

Hopefully we can get the new tools merged shortly.

Tom

Tom Leese

unread,
Apr 29, 2015, 10:52:05 AM4/29/15
to srobo...@googlegroups.com
Hi all,

On Saturday, 31 January 2015 21:42:29 UTC, Tom Leese wrote:
Hopefully we can get the new tools merged shortly.

It's been almost 5 months since I announced that I would be merging the new tools into master. It's now a new SR year, so I've taken the decision to merge the tools into master.

Running 'sr update' on an existing SR tools installation should not break anything except that now you'll see a deprecation message. For new users, running 'pip install git+git://srobo.org/tools.git' should be sufficient. The man pages are now installed using Pip so it's a single command to install everything. Of course, this merge also means that the tools run on Python 3.

No doubt I've missed a few bugs and issues, and I'm afraid I cannot guarantee that no one's workflow will be broken; however let me know ASAP if bugs do appear and I can fix them. Personally I've not had any problems with the inventory, spending and budget tools.

Tom
Reply all
Reply to author
Forward
0 new messages