From 7263ba4f39d330f56dc279b4ba88ed0e4b7a2a07 Mon Sep 17 00:00:00 2001 From: Stephan Hohn Date: Mon, 31 Aug 2020 12:53:26 +0000 Subject: [PATCH 01/11] Enable github workflow --- .github/workflows/pythonapp.yml | 30 ++++++++++++++++++++++++++++++ .gitignore | 4 ++++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/pythonapp.yml diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml new file mode 100644 index 0000000..77866ec --- /dev/null +++ b/.github/workflows/pythonapp.yml @@ -0,0 +1,30 @@ +name: Python application + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python setup.py install + - name: Lint with flake8 + run: | + pip install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pip install pytest + pytest diff --git a/.gitignore b/.gitignore index 7fcf867..35e4ad0 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,7 @@ nosetests.xml .mr.developer.cfg .project .pydevproject + +# VSCode +.vscode +.devcontainer From d63f655e8010382ab41abd90013b147ea6fef72e Mon Sep 17 00:00:00 2001 From: Stephan Hohn Date: Mon, 31 Aug 2020 12:56:55 +0000 Subject: [PATCH 02/11] Enable github workflow --- .github/workflows/pythonapp.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 77866ec..7d7b499 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -16,7 +16,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python setup.py install + pip install flake8 pytest requests - name: Lint with flake8 run: | pip install flake8 @@ -28,3 +28,11 @@ jobs: run: | pip install pytest pytest + - name: Build package + run: | + python setup.py sdist bdist_wheel + - name: Archive artifacts + uses: actions/upload-artifact@v1 + with: + name: scdata-pkg + path: dist From 4212d3643f00097d419e8146888336b038dda8df Mon Sep 17 00:00:00 2001 From: Stephan Hohn Date: Mon, 31 Aug 2020 13:02:15 +0000 Subject: [PATCH 03/11] Enable github workflow --- .github/workflows/pythonapp.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 7d7b499..865b83b 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -1,6 +1,14 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + name: Python application on: [push] +#on: +# push: +# branches: [ master, github-actions ] +# pull_request: +# branches: [ master, github-actions ] jobs: build: @@ -8,9 +16,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python 3.8 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: 3.8 - name: Install dependencies @@ -19,20 +27,18 @@ jobs: pip install flake8 pytest requests - name: Lint with flake8 run: | - pip install flake8 # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pip install pytest pytest - name: Build package - run: | - python setup.py sdist bdist_wheel + run: | + python setup.py sdist bdist_wheel - name: Archive artifacts - uses: actions/upload-artifact@v1 - with: - name: scdata-pkg - path: dist + uses: actions/upload-artifact@v1 + with: + name: genesisclient-pkg + path: dist \ No newline at end of file From cea7c87f00b7803eb33492fadf1912c5efa249f2 Mon Sep 17 00:00:00 2001 From: Stephan Hohn Date: Mon, 31 Aug 2020 13:09:18 +0000 Subject: [PATCH 04/11] Enable github workflow --- tests/api/test_api.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/api/test_api.py diff --git a/tests/api/test_api.py b/tests/api/test_api.py new file mode 100644 index 0000000..6ac786b --- /dev/null +++ b/tests/api/test_api.py @@ -0,0 +1,4 @@ +import pytest + +def test_dummy(): + print("Test Dummy") \ No newline at end of file From 725aca72a513655d55cbb8f0e500110359dc07be Mon Sep 17 00:00:00 2001 From: Stephan Hohn Date: Mon, 31 Aug 2020 13:10:52 +0000 Subject: [PATCH 05/11] Enable github workflow --- .github/workflows/pythonapp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 865b83b..6f7be3b 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -24,11 +24,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest requests + pip install flake8 pytest - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names - # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest From 8c2c92fd1c363ef07ab8d27a5a32b925e9a585ed Mon Sep 17 00:00:00 2001 From: Stephan Hohn Date: Mon, 31 Aug 2020 13:13:04 +0000 Subject: [PATCH 06/11] Enable github workflow --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index daf1881..474985f 100644 --- a/setup.py +++ b/setup.py @@ -17,5 +17,6 @@ 'console_scripts': [ 'genesiscl = genesisclient:main' ] - } + }, + setup_requires=['wheel'] ) From 9fd3819fa6e6085cf456f53894cdd0da6b3427af Mon Sep 17 00:00:00 2001 From: Stephan Hohn Date: Mon, 31 Aug 2020 13:24:18 +0000 Subject: [PATCH 07/11] Enable github workflow --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 6f7be3b..b2cf82a 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -41,4 +41,4 @@ jobs: uses: actions/upload-artifact@v1 with: name: genesisclient-pkg - path: dist \ No newline at end of file + path: dist From d8a42df7d54e5f495329deabdb481d8ea4381319 Mon Sep 17 00:00:00 2001 From: Stephan Hohn Date: Mon, 31 Aug 2020 13:43:19 +0000 Subject: [PATCH 08/11] Make -s a required argument --- genesisclient/__init__.py | 2 +- tests/api/test_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/genesisclient/__init__.py b/genesisclient/__init__.py index f8a80b6..e3a0a41 100644 --- a/genesisclient/__init__.py +++ b/genesisclient/__init__.py @@ -538,7 +538,7 @@ def main(): import sys import argparse parser = argparse.ArgumentParser(description='These are todays options:') - parser.add_argument('-s', dest='site', default=None, + parser.add_argument('-s', dest='site', default=None, required=True, help='Genesis site to connect to (DESTATIS or LDNRW)') parser.add_argument('-u', dest='username', default='', help='username for Genesis login') diff --git a/tests/api/test_api.py b/tests/api/test_api.py index 6ac786b..0c3c478 100644 --- a/tests/api/test_api.py +++ b/tests/api/test_api.py @@ -1,4 +1,4 @@ import pytest def test_dummy(): - print("Test Dummy") \ No newline at end of file + print("Test Dummy") From cdde5fb9c005c72668db30c6715b5ff90e7f8ea3 Mon Sep 17 00:00:00 2001 From: Stephan Hohn Date: Mon, 31 Aug 2020 13:49:31 +0000 Subject: [PATCH 09/11] Add choices to arg -s --- genesisclient/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/genesisclient/__init__.py b/genesisclient/__init__.py index e3a0a41..1be34b2 100644 --- a/genesisclient/__init__.py +++ b/genesisclient/__init__.py @@ -538,8 +538,8 @@ def main(): import sys import argparse parser = argparse.ArgumentParser(description='These are todays options:') - parser.add_argument('-s', dest='site', default=None, required=True, - help='Genesis site to connect to (DESTATIS or LDNRW)') + parser.add_argument('-s', dest='site', default=None, required=True, choices=['DESTATIS', 'LDNRW', 'REGIONAL', 'BAYERN'], + help='Genesis site to connect to (possible options are DESTATIS, LDNRW, REGIONAL or BAYERN)') parser.add_argument('-u', dest='username', default='', help='username for Genesis login') parser.add_argument('-p', dest='password', default='', From 525925ab29628c80a292202cc21fa1ba957f363d Mon Sep 17 00:00:00 2001 From: Stephan Hohn Date: Wed, 9 Sep 2020 08:30:53 +0200 Subject: [PATCH 10/11] Github workflow removed --- .github/workflows/pythonapp.yml | 44 --------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 .github/workflows/pythonapp.yml diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml deleted file mode 100644 index b2cf82a..0000000 --- a/.github/workflows/pythonapp.yml +++ /dev/null @@ -1,44 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python application - -on: [push] -#on: -# push: -# branches: [ master, github-actions ] -# pull_request: -# branches: [ master, github-actions ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest - - name: Build package - run: | - python setup.py sdist bdist_wheel - - name: Archive artifacts - uses: actions/upload-artifact@v1 - with: - name: genesisclient-pkg - path: dist From 001b27c329d40f4f13858037a6969c424c543c93 Mon Sep 17 00:00:00 2001 From: Stephan Hohn Date: Thu, 17 Sep 2020 11:54:19 +0200 Subject: [PATCH 11/11] remove test --- tests/api/test_api.py | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 tests/api/test_api.py diff --git a/tests/api/test_api.py b/tests/api/test_api.py deleted file mode 100644 index 0c3c478..0000000 --- a/tests/api/test_api.py +++ /dev/null @@ -1,4 +0,0 @@ -import pytest - -def test_dummy(): - print("Test Dummy")