Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ jobs:
- checkout
- run: rm -fr dist/
- run: python setup.py sdist
- run: python setup.py bdist_wheel
- run: pip install twine
- run: twine upload dist/*
- run: twine upload --username $USERNAME --password $PASSWORD dist/*
workflows:
version: 2
build_and_test:
jobs:
- run-tests
- build-deploy:
context: pypi
requires:
- run-tests
filters:
Expand Down
11 changes: 9 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Dclick
.. image:: https://circleci.com/gh/AnOtterGithubUser/double_click.svg?style=shield
:target: https://circleci.com/gh/AnOtterGithubUser/double_click


.. image:: https://img.shields.io/badge/python-3.7|3.8-blue.svg
:target: https://www.python.org/downloads/


Extend click functionnalities by allowing parameters to be passed in a config file.
Expand Down Expand Up @@ -51,14 +52,20 @@ With `dclick` you just have to change one line:
from dclick import command_with_config
from click import option

@command_with_config('path_to_config.json')
@command_with_config(<path_to_config.yml>)
@option('-n', '--n-epochs', type=int)
def train(n_epochs):
run_training_for(n_epochs):

if __name__ == '__main__':
train()

`path_to_config.yml`

.. code-block:: yaml

n-epochs: 5

Just be careful that the name in the config matches the name of the option. `dclick` takes care of the rest.
You can pass a config as json, yaml or txt. Json and yaml are preferred.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@
test_suite="tests",
tests_require=test_requirements,
url="https://github.com/anottergithubuser/double_click",
version="0.1.3",
version="0.1.4",
zip_safe=False,
)