Skip to content

Commit

Permalink
not registering console scripts so don't need process.main; ruff form…
Browse files Browse the repository at this point in the history
…atting
  • Loading branch information
jhkennedy committed Oct 10, 2024
1 parent c5302ff commit 10557dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ def main() -> None:
parser.add_argument('--bucket-prefix', default='', help='Add a bucket prefix to product(s)')

# TODO: Your arguments here
parser.add_argument('--greeting', default='Hello world!',
help='Write this greeting to a product file')
parser.add_argument('--greeting', default='Hello world!', help='Write this greeting to a product file')

args = parser.parse_args()

logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s',
datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.INFO)
logging.basicConfig(
format='%(asctime)s - %(levelname)s - %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.INFO
)

product_file = {{cookiecutter.__process_name}}(
greeting=args.greeting,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,3 @@ def {{cookiecutter.__process_name}}(greeting: str = 'Hello world!') -> Path:
product_file = Path('greeting.txt')
product_file.write_text(greeting)
return product_file


def main() -> None:
"""{{cookiecutter.__process_name}} entrypoint."""
parser = argparse.ArgumentParser(
prog='{{cookiecutter.__process_name}}',
description=__doc__,
)
parser.add_argument('--greeting', default='Hello world!',
help='Write this greeting to a product file')
parser.add_argument('--version', action='version', version=f'%(prog)s {__version__}')
args = parser.parse_args()

{{cookiecutter.__process_name}}(**args.__dict__)


if __name__ == "__main__":
main()

0 comments on commit 10557dc

Please sign in to comment.