Skip to content

Commit

Permalink
MAINT: remove default config from download
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinHuttley committed Feb 23, 2025
1 parent 1aa489a commit a0c5b1a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ Some commands can be run in parallel but have moderate memory requirements. If y
Options:
-c, --configpath PATH Path to config file specifying databases, (only species
or compara at present). [default:
/Users/gavin/miniconda3/envs/eti/lib/python3.12/site-
packages/ensembl_tui/data/sample.cfg]
or compara at present).
-d, --debug Maximum verbosity, and reduces number of downloads,
etc...
-v, --verbose
Expand Down
11 changes: 6 additions & 5 deletions src/ensembl_tui/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def _species_names_from_csv(ctx, param, species) -> list[str] | None:
_cfgpath = click.option(
"-c",
"--configpath",
default=eti_download.DEFAULT_CFG,
type=pathlib.Path,
help="Path to config file specifying databases, (only "
"species or compara at present).",
Expand Down Expand Up @@ -209,12 +208,14 @@ def download(configpath: pathlib.Path, debug: bool, verbose: bool) -> None:
"""download data from Ensembl's ftp site"""
from rich import progress

if configpath.name == eti_download.DEFAULT_CFG:
# TODO is this statement correct if we're seting a root dir now?
if not configpath:
eti_util.print_colour(
text="WARN: using the built in demo cfg, will write to /tmp",
colour="yellow",
text="No config specified, exiting.",
colour="red",
style="bold",
)
sys.exit(1)

config = eti_config.read_config(configpath, root_dir=pathlib.Path.cwd())

if verbose:
Expand Down
6 changes: 6 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ def test_download(tmp_config):
assert r.exit_code == 0, r.output


def test_download_no_config():
r = RUNNER.invoke(eti_cli.download, ["-d"], catch_exceptions=False)
assert r.exit_code != 0, r.output
assert "No config" in r.output


def test_exportrc(tmp_dir):
"""exportrc works correctly"""
outdir = tmp_dir / "exported"
Expand Down

0 comments on commit a0c5b1a

Please sign in to comment.