Skip to content

Commit

Permalink
Fixed init bug and bumped version.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdhutchins committed Apr 13, 2019
1 parent 59776f2 commit fef0cfa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[tool.poetry]
name = "renv"
version = "0.3.0"
version = "0.3.1"
license = "MIT"
description = """The renv package is a CLI tool for creating environments for the R statistical programming
language. It takes advantage of the python venv module and its modular EnvBuilder class."""
authors = ["Rob Gilmore <[email protected]>", "Shaurita Hutchins <[email protected]>", "Santina Lin <[email protected]>"]
description = """The renv package is a CLI tool for creating environments for the R statistical programming language. It takes advantage of the python venv module and its modular EnvBuilder class."""
authors = ["Rob Gilmore <[email protected]>", "Santina Lin <[email protected]>", "Shaurita Hutchins <[email protected]>"]
readme = "README.md"
repository = "https://github.com/datasnakes/renv"
keywords = ["R", "virtual", "environment", "reproducible", "statistics"]
Expand Down
22 changes: 14 additions & 8 deletions renv/renv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@


@click.group(invoke_without_command=True)
@click.option('--r_home', '-r', default=None, required=True,
@click.option('--r_home', '-r', default=None,
help="Provide the root of the directory tree where R is installed ($R_HOME). This would be R's "
"installation directory when using ./configure --prefix=<r_home>.")
@click.option('--env_name', '-e', default=None, required=True,
@click.option('--env_name', '-e', default=None,
help="Name of the environment.")
@click.option("--path", "-p", default="~/.beRi",
help="An absolute installation path for renv.", show_default=True)
Expand Down Expand Up @@ -40,14 +40,20 @@ def renv(ctx, r_home, env_name, path, name, bindir, libdir, includedir, recommen
if path != "~/.beRi":
raise NotImplementedError("Renv only supports installing into the home directory at this time.")


venvR = get_system_venv()
ctx.obj['venvR'] = venvR
builder = venvR(env_name=env_name, path=path, name=name, r_home=r_home, recommended_packages=recommended_packages,
clear=clear, upgrade=upgrade, prompt=prompt, verbose=verbose, bindir=bindir, libdir=libdir,
rincludedir=includedir)
env_bin = builder.build_venv()
click.secho("To activate: source " + env_bin+ "/activate",
fg="green")
if env_name and r_home:
builder = venvR(env_name=env_name, path=path, name=name, r_home=r_home, recommended_packages=recommended_packages,
clear=clear, upgrade=upgrade, prompt=prompt, verbose=verbose, bindir=bindir, libdir=libdir,
rincludedir=includedir)
env_bin = builder.build_venv()
click.secho("To activate: source " + env_bin+ "/activate",
fg="green")
elif env_name is None and init is None:
click.secho("Missing -e/--env_name parameter", fg="red")
elif r_home is None and init is None:
click.secho("Missing -r/--r_home parameter", fg="red")
@renv.command(help="Initialize renv using the <path>/<name>.")
@click.pass_context
def init(ctx):
Expand Down

0 comments on commit fef0cfa

Please sign in to comment.