Skip to content
Commits on Source (11)
qiime2/_version.py export-subst
q2cli/_version.py export-subst
......@@ -63,5 +63,3 @@ target/
# vi
.*.swp
.DS_Store
......@@ -14,10 +14,12 @@ install:
- wget -q https://raw.githubusercontent.com/qiime2/environment-files/master/latest/staging/qiime2-latest-py36-linux-conda.yml
- conda env create -q -n test-env --file qiime2-latest-py36-linux-conda.yml
- source activate test-env
- conda install -q nose
- pip install -q flake8
- conda install nose
- pip install -q https://github.com/qiime2/q2lint/archive/master.zip
- make install
script:
- make lint
- make test
- QIIMETEST= source tab-qiime
- QIIMETEST= qiime info
Contributing to QIIME 2
-----------------------
QIIME 2 is an open-source project, and we are very interested in contributions from the community. Please get in touch through the [QIIME 2 Forum](https://forum.qiime2.org) if you'd like to get involved.
include versioneer.py
include qiime2/_version.py
include q2cli/_version.py
......@@ -15,12 +15,12 @@ test: all
install: all
$(PYTHON) setup.py install && \
mkdir -p $(PREFIX)/etc/conda/activate.d && \
cp hooks/00_activate_qiime2_envs.sh $(PREFIX)/etc/conda/activate.d/ && \
mkdir -p $(PREFIX)/etc/conda/deactivate.d && \
cp hooks/00_deactivate_qiime2_envs.sh $(PREFIX)/etc/conda/deactivate.d/
cp hooks/50_activate_q2cli_tab_completion.sh $(PREFIX)/etc/conda/activate.d/
dev: all
pip install -e .
pip install -e . && \
mkdir -p $(PREFIX)/etc/conda/activate.d && \
cp hooks/50_activate_q2cli_tab_completion.sh $(PREFIX)/etc/conda/activate.d/
clean: distclean
......
# QIIME 2
# q2cli
A [click-based](http://click.pocoo.org/) command line interface for [QIIME 2](https://github.com/qiime2/qiime2).
[![Build Status](https://travis-ci.org/qiime2/qiime2.svg?branch=master)](https://travis-ci.org/qiime2/qiime2)
## Installation and getting help
Source code repository for the QIIME 2 framework. Visit [https://qiime2.org](https://qiime2.org) to learn more about the QIIME 2 project.
Visit https://qiime2.org to learn more about q2cli and the QIIME 2 project.
## Enabling tab completion
### Bash
To enable tab completion in Bash, run the following command or add it to your `.bashrc`/`.bash_profile`:
```bash
source tab-qiime
```
### ZSH
To enable tab completion in ZSH, run the following commands or add them to your `.zshrc`:
```bash
autoload bashcompinit && bashcompinit && source tab-qiime
```
#!/usr/bin/env bash
# Bash completion script that defers to a cached completion script representing
# the state of the current QIIME 2 deployment.
#
# This script is intended to be executed on the command-line or in
# .bashrc/.bash_profile:
#
# source tab-qiime
#
_qiime_completion()
{
# Attempt to find the cached completion script. If q2cli isn't installed, or
# is an incompatible version, don't attempt completion.
local completion_path="$(python -c "import q2cli.util; print(q2cli.util.get_completion_path())" 2> /dev/null)"
if [[ $? != 0 ]]; then
unset COMPREPLY
return 0
fi
# If the completion script exists, attempt completion by invoking the script
# in a subshell, supplying COMP_WORDS and COMP_CWORD. Capture the output as
# the completion reply. If the completion script failed, don't attempt
# completion.
if [[ -f "$completion_path" ]] ; then
COMPREPLY=( $(COMP_WORDS="${COMP_WORDS[*]}" COMP_CWORD="${COMP_CWORD}" "$completion_path" 2> /dev/null) )
if [[ $? != 0 ]]; then
unset COMPREPLY
return 0
fi
else
unset COMPREPLY
return 0
fi
return 0
}
# Enable default readline and bash completion behavior when `_qiime_completion`
# doesn't have a reply.
complete -F _qiime_completion -o default -o bashdefault qiime
# Execute a `qiime` command (any command will do) so that tab-completion will
# work out-of-the-box (e.g. with a fresh installation of q2cli). Running a
# command will create or refresh the cache if necessary, which contains the
# actual completion script.
#
# Ignore stdout to avoid displaying help text to users enabling tab-completion.
# stderr displays the note about cache refreshing, as that can take a few
# moments to complete.
qiime > /dev/null
{% set data = load_setup_py_data() %}
{% set version = data.get('version') %}
{% set version = data.get('version') or 'placehold' %}
{% set release = '.'.join(version.split('.')[:2]) %}
package:
name: qiime2
name: q2cli
version: {{ version }}
source:
......@@ -10,6 +11,8 @@ source:
build:
script: make install
entry_points:
- qiime=q2cli.__main__:qiime
requirements:
host:
......@@ -18,23 +21,16 @@ requirements:
run:
- python {{ python }}
- pyyaml
- decorator
- pandas
- tzlocal
- python-dateutil
- pyparsing ==2.3.0
- bibtexparser
- networkx
- pip
- click
- qiime2 {{ release }}.*
test:
imports:
- qiime2
- q2cli
commands:
# TODO don't require devs to remember setting this env var before running
# tests. The value can be anything.
- QIIMETEST= python -c "import qiime2.plugins.dummy_plugin"
- QIIMETEST= qiime --help
about:
home: https://qiime2.org
......
qiime (2019.7.0-1) UNRELEASED; urgency=medium
* New upstream version
* debhelper-compat 12
* Standards-Version: 4.4.0
* Respect DEB_BUILD_OPTIONS in override_dh_auto_test target
* Remove trailing whitespace in debian/changelog
* Remove trailing whitespace in debian/control
* Trim trailing whitespace.
* (Build-)Depends: python3-click
TODO: Build-time test failure
ModuleNotFoundError: No module named 'qiime2'
-- Andreas Tille <tille@debian.org> Fri, 02 Aug 2019 23:15:44 +0200
qiime (2019.4.0-1) unstable; urgency=medium
* Team upload.
......@@ -476,4 +491,3 @@ qiime (1.1.0-1) experimental; urgency=low
* Initial release.
-- Sri Girish Srinivasa Murthy <srigirish@evolbio.mpg.de> Tue, 20 Jul 2010 00:03:02 +0200
......@@ -5,18 +5,19 @@ Uploaders: Steffen Moeller <moeller@debian.org>,
Andreas Tille <tille@debian.org>
Section: science
Priority: optional
Build-Depends: debhelper (>= 12~),
Build-Depends: debhelper-compat (= 12),
dh-python,
python3,
python3-setuptools,
python3-nose,
python3-bibtexparser,
python3-click,
python3-decorator,
python3-pandas,
python3-tzlocal,
python3-yaml,
python3-networkx
Standards-Version: 4.3.0
Standards-Version: 4.4.0
Vcs-Browser: https://salsa.debian.org/med-team/qiime
Vcs-Git: https://salsa.debian.org/med-team/qiime.git
Homepage: https://qiime2.org
......@@ -27,6 +28,7 @@ Depends: ${shlibs:Depends},
${misc:Depends},
${python3:Depends},
python3-bibtexparser,
python3-click,
python3-decorator,
python3-pandas,
python3-tzlocal,
......
......@@ -18,4 +18,6 @@ export PYBUILD_AFTER_TEST=rm -rf {build_dir}/qiime2.egg-* {build_dir}/site.py {b
dh $@ --with python3 --buildsystem=pybuild
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
LC_ALL=C.UTF-8 dh_auto_test -- -s custom --test-args="cd {build_dir}; QIIMETEST= nosetests3"
endif
#!/bin/sh
export MPLBACKEND='Agg'
export R_LIBS_USER=$CONDA_PREFIX/lib/R/library/
export PYTHONNOUSERSITE=$CONDA_PREFIX/lib/python*/site-packages/
#!/bin/sh
unset MPLBACKEND
unset R_LIBS_USER
unset PYTHONNOUSERSITE
if [ -n "${ZSH_VERSION-}" ]; then
autoload bashcompinit && bashcompinit && source tab-qiime
elif [ -n "${BASH_VERSION-}" ]; then
source tab-qiime
fi
......@@ -6,6 +6,7 @@
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------
from ._version import get_versions
class ValidationError(Exception):
pass
__version__ = get_versions()['version']
del get_versions
......@@ -6,37 +6,39 @@
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------
import os
import unittest
import click
from qiime2.core.path import OutPath
import q2cli.commands
class TestOutPath(unittest.TestCase):
def test_new_outpath(self):
f = OutPath()
self.assertIsInstance(f, OutPath)
self.assertTrue(f.is_file())
ROOT_COMMAND_HELP = """\
QIIME 2 command-line interface (q2cli)
--------------------------------------
g = OutPath(dir=True)
self.assertIsInstance(g, OutPath)
self.assertTrue(g.is_dir())
To get help with QIIME 2, visit https://qiime2.org.
def test_new_outpath_context_mgr(self):
with OutPath() as f:
path = str(f)
self.assertIsInstance(f, OutPath)
self.assertTrue(os.path.isfile(path))
self.assertFalse(os.path.isfile(path))
To enable tab completion in Bash, run the following command or add it to your \
.bashrc/.bash_profile:
def test_destructor(self):
f = OutPath()
path = str(f)
source tab-qiime
self.assertTrue(os.path.isfile(path))
f._destructor()
self.assertFalse(os.path.isfile(path))
To enable tab completion in ZSH, run the following commands or add them to \
your .zshrc:
autoload bashcompinit && bashcompinit && source tab-qiime
"""
# Entry point for CLI
@click.command(cls=q2cli.commands.RootCommand, invoke_without_command=True,
no_args_is_help=True, help=ROOT_COMMAND_HELP)
@click.version_option(prog_name='q2cli',
message='%(prog)s version %(version)s\nRun `qiime info` '
'for more version details.')
def qiime():
pass
if __name__ == '__main__':
unittest.main()
qiime()
......@@ -23,9 +23,9 @@ def get_keywords():
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
git_refnames = " (tag: 2019.4.0)"
git_full = "f60a7d43a97f065d4e3248e3df93703aa48d95ab"
git_date = "2019-05-03 04:14:45 +0000"
git_refnames = " (tag: 2019.7.0)"
git_full = "06b978c96c8efce8be0c8213e744cb4b389f2bc6"
git_date = "2019-07-30 18:15:53 +0000"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
......@@ -42,8 +42,8 @@ def get_config():
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.parentdir_prefix = "qiime2-"
cfg.versionfile_source = "qiime2/_version.py"
cfg.parentdir_prefix = "q2cli-"
cfg.versionfile_source = "q2cli/_version.py"
cfg.verbose = False
return cfg
......