Skip to content
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

pip installable #1

Merged
merged 20 commits into from
Dec 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build
dist
omero-cli-render-*
*.egg*
.cache
*.DS_Store
.*un~
*.pyc
.omero
2 changes: 2 additions & 0 deletions .omeroci/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This directory implements scripts to unify
build and release actions across repos.
22 changes: 22 additions & 0 deletions .omeroci/bump-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/python

from argparse import ArgumentParser
from fileinput import input
from os.path import dirname
from os.path import join
from os.path import pardir
from re import compile

setup_file = join(dirname(__file__), pardir, "setup.py")
setup_re = compile("^(version\s=\s')\S+(')$")

def replace_version(file, re, version):
for line in input([file], inplace=1):
replacement = r"\g<1>%s\g<2>" % version
print re.sub(replacement, line),

if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("version")
args = parser.parse_args()
replace_version(setup_file, setup_re, args.version)
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: python

virtualenv:
system_site_packages: true

sudo: required

services:
- docker

before_install:
- git clone --recurse-submodules git://github.com/openmicroscopy/omero-test-infra .omero

script:
- .omero/cli-docker
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
0.1 (October 2017)
------------------

- Initial release
339 changes: 339 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include *.txt
include *.rst
prune dist
prune build
39 changes: 39 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.. image:: https://travis-ci.org/ome/omero-cli-render.svg?branch=master
:target: https://travis-ci.org/ome/omero-cli-render

.. image:: https://badge.fury.io/py/omero-cli-render.svg
:target: https://badge.fury.io/py/omero-cli-render

omero-cli-render
================

Plugin for use in the OMERO CLI.

Requirements
============

* OMERO 5.4.0 or newer
* Python 2.6+


Installing from PyPI
====================

This section assumes that an OMERO.py is already installed.

Install the command-line tool using `pip <https://pip.pypa.io/en/stable/>`_:

::

$ pip install -U omero-cli-render

License
-------

This project, similar to many Open Microscopy Environment (OME) projects, is
licensed under the terms of the GNU General Public License (GPL) v2 or later.

Copyright
---------

2017, The Open Microscopy Environment
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
description-file = README.rst
126 changes: 126 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 University of Dundee.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
import os
import sys

from setuptools import setup
from setuptools.command.test import test as test_command


class PyTest(test_command):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll look into migrating this to a library for re-use.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user_options = [
('test-path=', 't', "base dir for test collection"),
('test-ice-config=', 'i',
"use specified 'ice config' file instead of default"),
('test-pythonpath=', 'p', "prepend 'pythonpath' to PYTHONPATH"),
('test-marker=', 'm', "only run tests including 'marker'"),
('test-no-capture', 's', "don't suppress test output"),
('test-failfast', 'x', "Exit on first error"),
('test-verbose', 'v', "more verbose output"),
('test-quiet', 'q', "less verbose output"),
('junitxml=', None, "create junit-xml style report file at 'path'"),
('pdb', None, "fallback to pdb on error"),
]

def initialize_options(self):
test_command.initialize_options(self)
self.test_pythonpath = None
self.test_string = None
self.test_marker = None
self.test_path = 'test'
self.test_failfast = False
self.test_quiet = False
self.test_verbose = False
self.test_no_capture = False
self.junitxml = None
self.pdb = False
self.test_ice_config = None

def finalize_options(self):
test_command.finalize_options(self)
self.test_args = [self.test_path]
if self.test_string is not None:
self.test_args.extend(['-k', self.test_string])
if self.test_marker is not None:
self.test_args.extend(['-m', self.test_marker])
if self.test_failfast:
self.test_args.extend(['-x'])
if self.test_verbose:
self.test_args.extend(['-v'])
if self.test_quiet:
self.test_args.extend(['-q'])
if self.junitxml is not None:
self.test_args.extend(['--junitxml', self.junitxml])
if self.pdb:
self.test_args.extend(['--pdb'])
self.test_suite = True
if 'ICE_CONFIG' not in os.environ:
os.environ['ICE_CONFIG'] = self.test_ice_config

def run_tests(self):
if self.test_pythonpath is not None:
sys.path.insert(0, self.test_pythonpath)
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)


def read(fname):
"""
Utility function to read the README file.
:rtype : String
"""
return open(os.path.join(os.path.dirname(__file__), fname)).read()


version = '0.1.0'
url = "https://github.com/ome/omero-cli-render/"

setup(
version=version,
packages=['', 'omero.plugins'],
package_dir={"": "src"},
name='omero-cli-render',
description="Plugin for use in the OMERO CLI.",
long_description=read('README.rst'),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Plugins',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: GNU General Public License v2 '
'or later (GPLv2+)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Topic :: Software Development :: Libraries :: Python Modules',
], # Get strings from
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
author='The Open Microscopy Team',
author_email='ome-devel@lists.openmicroscopy.org.uk',
license='GPL-2.0+',
url='%s' % url,
zip_safe=False,
download_url='%s/v%s.tar.gz' % (url, version),
keywords=['OMERO.CLI', 'plugin'],
cmdclass={'test': PyTest},
tests_require=['pytest', 'restview', 'mox'],
)