From e5854d803ddd132152fbf1c716ee89de7096c1ec Mon Sep 17 00:00:00 2001 From: Ben Heil Date: Fri, 15 Nov 2019 13:21:28 -0500 Subject: [PATCH 1/7] Add a workflow for managing packages with miniconda --- ci/python-package-conda.yml | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 ci/python-package-conda.yml diff --git a/ci/python-package-conda.yml b/ci/python-package-conda.yml new file mode 100644 index 0000000..5b875ff --- /dev/null +++ b/ci/python-package-conda.yml @@ -0,0 +1,66 @@ +name: Python package + +on: [push] + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + # $CONDA is an environment variable pointing to the root of the miniconda directory + $CONDA/bin/conda env update --file environment.yml --name base + - name: Lint with flake8 + run: | + $CONDA/bin/conda install flake8 + # stop the build if there are Python syntax errors or undefined names + $CONDA/bin/flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + $CONDA/bin/flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + conda install pytest + $CONDA/bin/pytest + + build-windows: + runs-on: windows-latest + strategy: + max-parallel: 5 + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + C:\Miniconda\condabin\conda.bat env update --file environment.yml --name base + C:\Miniconda\condabin\conda.bat init powershell + - name: Lint with flake8 + run: | + # Activate the base environment + C:\Miniconda\condabin\conda.bat activate base + C:\Miniconda\condabin\conda.bat 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: | + # Activate the base environment + C:\Miniconda\condabin\conda.bat activate base + C:\Miniconda\condabin\conda.bat install pytest + pytest From 5ce3567640c2063db63470e24b62bb1f1ca00317 Mon Sep 17 00:00:00 2001 From: Ben Heil Date: Fri, 15 Nov 2019 13:23:52 -0500 Subject: [PATCH 2/7] Added properties.json file --- ci/properties/python-package-conda.properties.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ci/properties/python-package-conda.properties.json diff --git a/ci/properties/python-package-conda.properties.json b/ci/properties/python-package-conda.properties.json new file mode 100644 index 0000000..4b3a8da --- /dev/null +++ b/ci/properties/python-package-conda.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Python package", + "description": "Create and test a Python package on multiple Python versions.", + "iconName": "python", + "categories": ["Python"] +} \ No newline at end of file From 22872514212609e36ad427dfd8ff8b527142802e Mon Sep 17 00:00:00 2001 From: Ben Heil Date: Fri, 15 Nov 2019 13:26:42 -0500 Subject: [PATCH 3/7] Improved description and fixed name --- ci/properties/python-package-conda.properties.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/properties/python-package-conda.properties.json b/ci/properties/python-package-conda.properties.json index 4b3a8da..1f6436d 100644 --- a/ci/properties/python-package-conda.properties.json +++ b/ci/properties/python-package-conda.properties.json @@ -1,6 +1,6 @@ { - "name": "Python package", - "description": "Create and test a Python package on multiple Python versions.", + "name": "Python Package using Anaconda", + "description": "Create and test a Python package on multiple Python versions using Anaconda for package management.", "iconName": "python", "categories": ["Python"] -} \ No newline at end of file +} From 2697ad6a58a388c5fca1a398a07b30a86c2df62c Mon Sep 17 00:00:00 2001 From: Ben Heil Date: Fri, 15 Nov 2019 13:27:03 -0500 Subject: [PATCH 4/7] Changed name to be more descriptive --- ci/python-package-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/python-package-conda.yml b/ci/python-package-conda.yml index 5b875ff..c01c4fc 100644 --- a/ci/python-package-conda.yml +++ b/ci/python-package-conda.yml @@ -1,4 +1,4 @@ -name: Python package +name: Python Package using Anaconda on: [push] From 2740936be443d46a9dc0907df6103ab070156d18 Mon Sep 17 00:00:00 2001 From: Rob McGuire Date: Fri, 17 Jul 2020 19:54:48 -0700 Subject: [PATCH 5/7] Move "checkout" comment adjacent to its step --- ci/terraform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/terraform.yml b/ci/terraform.yml index 7fc401b..e6cf027 100644 --- a/ci/terraform.yml +++ b/ci/terraform.yml @@ -60,8 +60,8 @@ jobs: run: shell: bash - # Checkout the repository to the GitHub Actions runner steps: + # Checkout the repository to the GitHub Actions runner - name: Checkout uses: actions/checkout@v2 From e6a92cdf5ee5eaa44fb07f4748bb7554c97eca4c Mon Sep 17 00:00:00 2001 From: Ben Heil Date: Sat, 22 Aug 2020 09:09:50 -0400 Subject: [PATCH 6/7] Update with requested changes from @andymckay --- ci/python-package-conda.yml | 43 ++++--------------------------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/ci/python-package-conda.yml b/ci/python-package-conda.yml index c01c4fc..9bd93b6 100644 --- a/ci/python-package-conda.yml +++ b/ci/python-package-conda.yml @@ -7,15 +7,13 @@ jobs: runs-on: ubuntu-latest strategy: max-parallel: 5 - matrix: - python-version: [2.7, 3.5, 3.6, 3.7, 3.8] steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 with: - python-version: ${{ matrix.python-version }} + python-version: 3.8 - name: Install dependencies run: | # $CONDA is an environment variable pointing to the root of the miniconda directory @@ -31,36 +29,3 @@ jobs: run: | conda install pytest $CONDA/bin/pytest - - build-windows: - runs-on: windows-latest - strategy: - max-parallel: 5 - matrix: - python-version: [2.7, 3.5, 3.6, 3.7, 3.8] - - steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - C:\Miniconda\condabin\conda.bat env update --file environment.yml --name base - C:\Miniconda\condabin\conda.bat init powershell - - name: Lint with flake8 - run: | - # Activate the base environment - C:\Miniconda\condabin\conda.bat activate base - C:\Miniconda\condabin\conda.bat 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: | - # Activate the base environment - C:\Miniconda\condabin\conda.bat activate base - C:\Miniconda\condabin\conda.bat install pytest - pytest From 781ae15668cb644f30fb31b6e9d103aed9a6cdab Mon Sep 17 00:00:00 2001 From: Ben Heil Date: Sun, 23 Aug 2020 22:21:14 -0400 Subject: [PATCH 7/7] Corrected the name: the action uses Conda but not Anaconda --- ci/python-package-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/python-package-conda.yml b/ci/python-package-conda.yml index 9bd93b6..1567e18 100644 --- a/ci/python-package-conda.yml +++ b/ci/python-package-conda.yml @@ -1,4 +1,4 @@ -name: Python Package using Anaconda +name: Python Package using Conda on: [push]