diff --git a/conda-testenv.recipe/build.sh b/conda-testenv.recipe/build.sh new file mode 100644 index 0000000..3a09514 --- /dev/null +++ b/conda-testenv.recipe/build.sh @@ -0,0 +1 @@ +python setup.py install --single-version-externally-managed --record=record.txt diff --git a/conda-testenv.recipe/meta.yaml b/conda-testenv.recipe/meta.yaml new file mode 100644 index 0000000..e647fc1 --- /dev/null +++ b/conda-testenv.recipe/meta.yaml @@ -0,0 +1,31 @@ +{% set data = load_setuptools() %} + +package: + name: conda-testenv + version: {{data.get('version')}} + +source: + path: ../ + +requirements: + build: + - python + - setuptools + + run: + - python + - setuptools + - conda + - conda-build + +test: + imports: + - conda_testenv + commands: + - conda-testenv --help + - conda-testenv --version + - conda testenv --help + +about: + license: BSD-3 + home: https://github.com/SciTools/conda-testenv diff --git a/conda_testenv/__init__.py b/conda_testenv/__init__.py index e69de29..e44e9d1 100644 --- a/conda_testenv/__init__.py +++ b/conda_testenv/__init__.py @@ -0,0 +1,3 @@ +from ._version import get_versions +__version__ = get_versions()['version'] +del get_versions diff --git a/conda_testenv/cli.py b/conda_testenv/cli.py index ed57be4..a1d5eed 100644 --- a/conda_testenv/cli.py +++ b/conda_testenv/cli.py @@ -1,5 +1,6 @@ import argparse +import conda_testenv import conda_testenv.test_env as test_env @@ -8,6 +9,10 @@ def main(): 'of all packages installed ' 'in a conda environment') + parser.add_argument('--version', action='version', + version=conda_testenv.__version__, + help="Show conda-testenv's version, and exit.") + parser.add_argument('-p', dest='prefix') args = parser.parse_args()