From 86a2a6b1ae0dd3e75f80ca675721e3829f8ec34f Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Thu, 15 Apr 2021 15:47:53 +0100 Subject: [PATCH 01/15] Create pylint.yml --- .github/workflows/pylint.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/pylint.yml diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 0000000000..c16ba223d6 --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,22 @@ +name: Pylint + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - 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 + pip install pylint + - name: Analysing the code with pylint + run: | + pylint `ls -R|grep .py$|xargs` From c53df7922aaf7901e48063276f20f07fc45359a6 Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Thu, 15 Apr 2021 15:55:06 +0100 Subject: [PATCH 02/15] Create python-package.yml --- .github/workflows/python-package.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/python-package.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000000..4fd3d3d290 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,39 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.7, 3.8, 3.9] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - 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 From 6dc0e6aa94ee92af2bcc2080e6332585f931ea7f Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Thu, 15 Apr 2021 16:06:06 +0100 Subject: [PATCH 03/15] Update pylint.yml --- .github/workflows/pylint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index c16ba223d6..e557530cba 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -17,6 +17,7 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint + pip install -e . - name: Analysing the code with pylint run: | pylint `ls -R|grep .py$|xargs` From 0aa7171c42575073885bfd10e0362ea296a558fc Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Thu, 22 Apr 2021 15:20:30 +0100 Subject: [PATCH 04/15] Update python-package.yml --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4fd3d3d290..0be53adf5c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -31,9 +31,9 @@ jobs: - 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 src --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 + flake8 src --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | pytest From ca63efda054e54968c9a94f2db825523a9bbf1e9 Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Thu, 22 Apr 2021 17:02:18 +0100 Subject: [PATCH 05/15] Update pylint.yml --- .github/workflows/pylint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index e557530cba..abf6e7496b 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -17,7 +17,8 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint - pip install -e . + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + # pip install -e . - name: Analysing the code with pylint run: | pylint `ls -R|grep .py$|xargs` From 2edc2959a9e3c1a4ed907711b23c455e87e4626a Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Thu, 22 Apr 2021 17:07:07 +0100 Subject: [PATCH 06/15] Update pylint.yml --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index abf6e7496b..fd3c176b07 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -17,7 +17,7 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi # pip install -e . - name: Analysing the code with pylint run: | From 8a64e2e7740f8d66d95f9963cf30a779cf5bd7dc Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Tue, 11 May 2021 15:58:59 +0100 Subject: [PATCH 07/15] Update pylint.yml --- .github/workflows/pylint.yml | 66 +++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index fd3c176b07..ff48711fd3 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -1,24 +1,72 @@ name: Pylint -on: [push] +on: + push: + branches: + - main + pull_request: + branches: + - main jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + + strategy: + matrix: + py-version: + - 3.5 + - 3.6 + - 3.7 + - 3.8 + - 3.9 + py-arch: + - x64 + mpi: + #- mpich + - openmpi + os: + - ubuntu-latest + #- ubuntu-18.04 + #- ubuntu-20.04 + #- macos-10.15 + #- macos-latest steps: - uses: actions/checkout@v2 + - name: Install MPI (${{ matrix.mpi }}) + run: apt install -y openmpi-bin libopenmpi-dev - name: Set up Python 3.8 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: ${{ matrix.py-versionn }} + architecture: ${{ matrix.py-arch }} + - name: Install prerequisites + run: | + apt install -y + build-essential gfortran libgsl-dev cmake + libfftw3-3 libfftw3-dev + libgmp3-dev libmpfr6 libmpfr-dev + libhdf5-serial-dev hdf5-tools + libblas-dev liblapack-dev - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pylint - # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - # pip install -e . - - name: Analysing the code with pylint + python -m pip install + pylint + pycodestyle + pydocstyle + flake8 + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install AMUSE run: | - pylint `ls -R|grep .py$|xargs` + pip install -e . + - name: Analyse the code with flake8 + run: flake8 src/amuse + - name: Analyse the code with pycodestyle + run: pycodestyle src/amuse + - name: Analyse the code with pydocstyle + run: pydocstyle src/amuse + - name: Analysing the code with pylint + run: pylint src/amuse From 85ef0f8644268ed7a4684bd8403d467199d62202 Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Tue, 11 May 2021 16:01:01 +0100 Subject: [PATCH 08/15] Update pylint.yml --- .github/workflows/pylint.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index ff48711fd3..2bd9df3e6d 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -16,11 +16,11 @@ jobs: strategy: matrix: py-version: - - 3.5 - - 3.6 + #- 3.5 + #- 3.6 - 3.7 - - 3.8 - - 3.9 + #- 3.8 + #- 3.9 py-arch: - x64 mpi: @@ -35,21 +35,21 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install MPI (${{ matrix.mpi }}) - run: apt install -y openmpi-bin libopenmpi-dev + #- name: Install MPI (${{ matrix.mpi }}) + # run: apt install -y openmpi-bin libopenmpi-dev - name: Set up Python 3.8 uses: actions/setup-python@v2 with: python-version: ${{ matrix.py-versionn }} architecture: ${{ matrix.py-arch }} - - name: Install prerequisites - run: | - apt install -y - build-essential gfortran libgsl-dev cmake - libfftw3-3 libfftw3-dev - libgmp3-dev libmpfr6 libmpfr-dev - libhdf5-serial-dev hdf5-tools - libblas-dev liblapack-dev + #- name: Install prerequisites + # run: | + # apt install -y + # build-essential gfortran libgsl-dev cmake + # libfftw3-3 libfftw3-dev + # libgmp3-dev libmpfr6 libmpfr-dev + # libhdf5-serial-dev hdf5-tools + # libblas-dev liblapack-dev - name: Install dependencies run: | python -m pip install --upgrade pip @@ -59,9 +59,9 @@ jobs: pydocstyle flake8 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Install AMUSE - run: | - pip install -e . + #- name: Install AMUSE + # run: | + # pip install -e . - name: Analyse the code with flake8 run: flake8 src/amuse - name: Analyse the code with pycodestyle From ebe8e9ed3c539bf39256c6991c647704fc7294e0 Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Tue, 11 May 2021 16:02:45 +0100 Subject: [PATCH 09/15] Update pylint.yml --- .github/workflows/pylint.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 2bd9df3e6d..201bf27c59 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -53,12 +53,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install - pylint - pycodestyle - pydocstyle - flake8 - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + python -m pip install pylint pycodestyle pydocstyle flake8 + # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi #- name: Install AMUSE # run: | # pip install -e . From a5005e23e4a0a6424e16015aff9d6da37993fe0b Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Tue, 11 May 2021 16:18:02 +0100 Subject: [PATCH 10/15] Update pylint.yml --- .github/workflows/pylint.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 201bf27c59..898089b36a 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -58,11 +58,11 @@ jobs: #- name: Install AMUSE # run: | # pip install -e . - - name: Analyse the code with flake8 - run: flake8 src/amuse + #- name: Analyse the code with flake8 + # run: flake8 src/amuse - name: Analyse the code with pycodestyle run: pycodestyle src/amuse - - name: Analyse the code with pydocstyle - run: pydocstyle src/amuse - - name: Analysing the code with pylint - run: pylint src/amuse + #- name: Analyse the code with pydocstyle + # run: pydocstyle src/amuse + #- name: Analysing the code with pylint + # run: pylint src/amuse From 8d9efc2abf49b4fd0b05ae2ba742dd33530780ed Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Tue, 11 May 2021 16:29:25 +0100 Subject: [PATCH 11/15] Update pylint.yml --- .github/workflows/pylint.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 898089b36a..4fc58eefb0 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -40,7 +40,7 @@ jobs: - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: ${{ matrix.py-versionn }} + python-version: ${{ matrix.py-version }} architecture: ${{ matrix.py-arch }} #- name: Install prerequisites # run: | @@ -59,10 +59,10 @@ jobs: # run: | # pip install -e . #- name: Analyse the code with flake8 - # run: flake8 src/amuse - - name: Analyse the code with pycodestyle - run: pycodestyle src/amuse + # run: flake8 `git diff --name-only --diff-filter=ACMRTUXB master | grep -E "(.py$)"` + #- name: Analyse the code with pycodestyle + # run: pycodestyle `git diff --name-only --diff-filter=ACMRTUXB main | grep -E "(.py$)"` #- name: Analyse the code with pydocstyle # run: pydocstyle src/amuse - #- name: Analysing the code with pylint - # run: pylint src/amuse + - name: Analysing the code with pylint + run: pylint `git diff --name-only --diff-filter=ACMRTUXB master | grep -E "(.py$)"` From 9ad96237207021af31db81a143d82b7c7a0a703f Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Tue, 11 May 2021 16:31:04 +0100 Subject: [PATCH 12/15] Update pylint.yml --- .github/workflows/pylint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 4fc58eefb0..a92a84d346 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -59,10 +59,10 @@ jobs: # run: | # pip install -e . #- name: Analyse the code with flake8 - # run: flake8 `git diff --name-only --diff-filter=ACMRTUXB master | grep -E "(.py$)"` + # run: flake8 `git diff --name-only --diff-filter=ACMRTUXB main | grep -E "(.py$)"` #- name: Analyse the code with pycodestyle # run: pycodestyle `git diff --name-only --diff-filter=ACMRTUXB main | grep -E "(.py$)"` #- name: Analyse the code with pydocstyle - # run: pydocstyle src/amuse + # run: pydocstyle `git diff --name-only --diff-filter=ACMRTUXB main | grep -E "(.py$)"` - name: Analysing the code with pylint - run: pylint `git diff --name-only --diff-filter=ACMRTUXB master | grep -E "(.py$)"` + run: pylint `git diff --name-only --diff-filter=ACMRTUXB main | grep -E "(.py$)"` From f2eac55de8ff59a13463f27d50887c546390432c Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Tue, 11 May 2021 16:34:29 +0100 Subject: [PATCH 13/15] Update pylint.yml --- .github/workflows/pylint.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index a92a84d346..f2eec6bb61 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -65,4 +65,7 @@ jobs: #- name: Analyse the code with pydocstyle # run: pydocstyle `git diff --name-only --diff-filter=ACMRTUXB main | grep -E "(.py$)"` - name: Analysing the code with pylint - run: pylint `git diff --name-only --diff-filter=ACMRTUXB main | grep -E "(.py$)"` + run: | + for file in `git diff --name-only --diff-filter=ACMRTUXB main | grep -E "(.py$)"`; do + pylint $file; + done From 942c9f4ba9311969d085d2eaeb431cb05fcd8424 Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Tue, 11 May 2021 16:35:57 +0100 Subject: [PATCH 14/15] Test change --- src/amuse/plot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/amuse/plot.py b/src/amuse/plot.py index d40e4fe2e3..f2168102e8 100644 --- a/src/amuse/plot.py +++ b/src/amuse/plot.py @@ -1,3 +1,4 @@ +#! /env/bin python3 try: import matplotlib.pyplot as native_plot from mpl_toolkits.mplot3d import Axes3D From 557f47cdb5ca9592ed0d2c08683d8c0442be103c Mon Sep 17 00:00:00 2001 From: Steven Rieder Date: Tue, 11 May 2021 16:40:48 +0100 Subject: [PATCH 15/15] Update plot.py --- src/amuse/plot.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/amuse/plot.py b/src/amuse/plot.py index f2168102e8..d40e4fe2e3 100644 --- a/src/amuse/plot.py +++ b/src/amuse/plot.py @@ -1,4 +1,3 @@ -#! /env/bin python3 try: import matplotlib.pyplot as native_plot from mpl_toolkits.mplot3d import Axes3D