From 2e5dbe8261f3dba99d7e97716f922daf9176207b Mon Sep 17 00:00:00 2001 From: AnOtterGithubUser Date: Sun, 29 Nov 2020 00:21:55 +0100 Subject: [PATCH 1/9] Use circle ci context for credentials --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 64a6449..ab5ba07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: From 588593af1456584579fbc023a85dccd5072a7843 Mon Sep 17 00:00:00 2001 From: AnOtterGithubUser <34810937+AnOtterGithubUser@users.noreply.github.com> Date: Fri, 18 Dec 2020 10:32:21 +0100 Subject: [PATCH 2/9] Update readme (#21) * Use circle ci context for credentials (#20) * Change demo in readme --- README.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 5eb9345..8cdfd69 100644 --- a/README.rst +++ b/README.rst @@ -51,7 +51,7 @@ 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): @@ -59,6 +59,12 @@ With `dclick` you just have to change one line: 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. From 611f1a9ab846a097d0b41e3eaf7a6583680a49c6 Mon Sep 17 00:00:00 2001 From: AnOtterGithubUser Date: Fri, 18 Dec 2020 10:40:38 +0100 Subject: [PATCH 3/9] Update README --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 8cdfd69..79c40bd 100644 --- a/README.rst +++ b/README.rst @@ -51,7 +51,7 @@ 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.yml') + @command_with_config() @option('-n', '--n-epochs', type=int) def train(n_epochs): run_training_for(n_epochs): From aad8b7c504ffb0db6ce8eaa158bb75a7f01e9d27 Mon Sep 17 00:00:00 2001 From: AnOtterGithubUser Date: Fri, 18 Dec 2020 11:05:07 +0100 Subject: [PATCH 4/9] Add python versions badge to README --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 79c40bd..2693573 100644 --- a/README.rst +++ b/README.rst @@ -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. From f42e0bf94113765f11ec90831284940266a055c5 Mon Sep 17 00:00:00 2001 From: AnOtterGithubUser Date: Fri, 18 Dec 2020 11:06:03 +0100 Subject: [PATCH 5/9] Add python 3.6 to tested environments --- .circleci/config.yml | 1 + tox.ini | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ab5ba07..847d92b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,7 @@ jobs: - checkout - run: sudo apt update - run: sudo apt upgrade + - run: sudo apt install python3.6 - run: sudo apt install python3.7 - run: sudo pip install tox - run: tox diff --git a/tox.ini b/tox.ini index 9daa976..a26000e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37, py38 +envlist = py36, py37, py38 [testenv] setenv = From c4a40821ccec7ea0332529072dae5dc7719d3a4d Mon Sep 17 00:00:00 2001 From: AnOtterGithubUser Date: Fri, 18 Dec 2020 22:20:48 +0100 Subject: [PATCH 6/9] Remove python 3.6 in CI --- .circleci/config.yml | 1 - tox.ini | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 847d92b..ab5ba07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,6 @@ jobs: - checkout - run: sudo apt update - run: sudo apt upgrade - - run: sudo apt install python3.6 - run: sudo apt install python3.7 - run: sudo pip install tox - run: tox diff --git a/tox.ini b/tox.ini index a26000e..9daa976 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36, py37, py38 +envlist = py37, py38 [testenv] setenv = From 1cf232b0e38245c19df55fbc90a0866ae4a0a028 Mon Sep 17 00:00:00 2001 From: AnOtterGithubUser Date: Fri, 18 Dec 2020 22:38:11 +0100 Subject: [PATCH 7/9] Test with MFA --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 9daa976..45b3a56 100644 --- a/tox.ini +++ b/tox.ini @@ -9,4 +9,3 @@ deps = commands = pip install -U pip pytest -v --basetemp={envtmpdir} - From 7b33e0cd8045be5ff36b62d906130e51c3dbcf1e Mon Sep 17 00:00:00 2001 From: AnOtterGithubUser Date: Fri, 18 Dec 2020 22:41:01 +0100 Subject: [PATCH 8/9] Test again --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 45b3a56..9daa976 100644 --- a/tox.ini +++ b/tox.ini @@ -9,3 +9,4 @@ deps = commands = pip install -U pip pytest -v --basetemp={envtmpdir} + From f9919337496a41acd11b6454187195b89aae343e Mon Sep 17 00:00:00 2001 From: AnOtterGithubUser Date: Fri, 18 Dec 2020 22:50:09 +0100 Subject: [PATCH 9/9] Increment version number in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cc38dbf..1f96a86 100644 --- a/setup.py +++ b/setup.py @@ -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, )