From e3c64cfe1fd6a54036fa3e0f6cd6d205ab54cb59 Mon Sep 17 00:00:00 2001 From: Manuel Garcia Date: Mon, 29 Apr 2024 13:15:25 +0200 Subject: [PATCH 1/5] Update authors in pyproject.toml --- pyproject.toml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 73de2c6..85f53f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,14 +5,15 @@ build-backend = "hatchling.build" [project] name = "fairly" version = "1.0.0" -authors = [ - { name="Serkan Girgin", email="s.girgin@utwente.nl" }, - { name="Manuel Garcia Alvarez", email="m.g.garciaalvarez@tudelft.nl" }, - { name="Jose Urra Llanusa", email="j.c.urrallanusa@tudelft.nl" }, ] description = "A package to create, publish, and download research datasets" readme = "README.rst" license = { file="LICENSE" } requires-python = ">=3.8" +authors = [ + { name="Serkan Girgin", email="s.girgin@utwente.nl" }, + { name="Manuel Garcia Alvarez", email="m.g.garciaalvarez@tudelft.nl" }, + { name="Jose Urra Llanusa", email="j.c.urrallanusa@tudelft.nl" }, + ] classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", From 731f9c546169b92889f75757929135ebbd9faf40 Mon Sep 17 00:00:00 2001 From: Manuel Garcia Date: Mon, 29 Apr 2024 16:57:54 +0200 Subject: [PATCH 2/5] Refactor CLI module to remove unused import in __init__.py --- src/cli/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/cli/__init__.py b/src/cli/__init__.py index 331197d..61e6063 100644 --- a/src/cli/__init__.py +++ b/src/cli/__init__.py @@ -1,5 +1,4 @@ import sys -import pprint as pp from ruamel.yaml import YAML import typer From 1533e8d432c3ed63d33fc503bf720a360264b926 Mon Sep 17 00:00:00 2001 From: Manuel Garcia Date: Mon, 29 Apr 2024 17:18:01 +0200 Subject: [PATCH 3/5] refactor package layout to 'src layout' --- pyproject.toml | 2 +- src/{ => fairly}/cli/__init__.py | 11 +- src/{ => fairly}/cli/config.py | 0 src/{ => fairly}/cli/dataset.py | 274 +++++++++++++++---------------- tests/test_cli.py | 2 +- 5 files changed, 143 insertions(+), 146 deletions(-) rename src/{ => fairly}/cli/__init__.py (91%) rename src/{ => fairly}/cli/config.py (100%) rename src/{ => fairly}/cli/dataset.py (96%) diff --git a/pyproject.toml b/pyproject.toml index 85f53f5..c14e558 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,4 +44,4 @@ dev = [ "Funding" = "https://nwo.nl/en/researchprogrammes/open-science/open-science-fund" [project.scripts] -fairly = "cli:app" +fairly = "fairly.cli:app" diff --git a/src/cli/__init__.py b/src/fairly/cli/__init__.py similarity index 91% rename from src/cli/__init__.py rename to src/fairly/cli/__init__.py index 61e6063..f857c16 100644 --- a/src/cli/__init__.py +++ b/src/fairly/cli/__init__.py @@ -3,15 +3,12 @@ from ruamel.yaml import YAML import typer import fairly - -import cli.dataset -import cli.config - - +from fairly.cli import dataset +from fairly.cli import config app = typer.Typer() -app.add_typer(cli.dataset.app, name="dataset") -app.add_typer(cli.config.app, name="config") +app.add_typer(dataset.app, name="dataset") +app.add_typer(config.app, name="config") @app.command() def list_repos(): diff --git a/src/cli/config.py b/src/fairly/cli/config.py similarity index 100% rename from src/cli/config.py rename to src/fairly/cli/config.py diff --git a/src/cli/dataset.py b/src/fairly/cli/dataset.py similarity index 96% rename from src/cli/dataset.py rename to src/fairly/cli/dataset.py index acfcdb2..25b7146 100644 --- a/src/cli/dataset.py +++ b/src/fairly/cli/dataset.py @@ -1,138 +1,138 @@ -import typer - -from rich.progress import Progress, SpinnerColumn, TextColumn - -import fairly - - -app = typer.Typer(pretty_exceptions_show_locals=False) - -@app.command() -def create( - path: str = typer.Argument(help="Path where the dataset will be created"), - template: str = typer.Option("default", help="Metadata template to be used for the dataset"), -) -> None: - '''Create a local dataset under path with default template\n - - fairly dataset create \n - - Create a local dataset under path with the specified template\n -