From 073ad97df19164640f978011ab24b733d03d14b7 Mon Sep 17 00:00:00 2001 From: tom Date: Sat, 29 Oct 2022 12:24:01 +0100 Subject: [PATCH 1/7] Add codeql action --- .github/workflows/codeql.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..7e40680b6 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,24 @@ +name: "GitHub CodeQL" + +on: + push: + branches: [master] + pull_request: + +jobs: + CodeQL: + runs-on: ubuntu-latest + permissions: + security-events: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: python, cpp + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 From 2d8fe81d554ed84333b4a6ab6cbc246631c1e6aa Mon Sep 17 00:00:00 2001 From: tom Date: Sat, 29 Oct 2022 12:33:37 +0100 Subject: [PATCH 2/7] Try auto build --- .github/workflows/codeql.yml | 4 +++- README.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7e40680b6..3115854d3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,7 +2,6 @@ name: "GitHub CodeQL" on: push: - branches: [master] pull_request: jobs: @@ -20,5 +19,8 @@ jobs: with: languages: python, cpp + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 diff --git a/README.md b/README.md index 3a3a170b4..f73f7814c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://github.com/duartegroup/autodE/actions/workflows/pytest.yml/badge.svg)](https://github.com/duartegroup/autodE/actions) [![codecov](https://codecov.io/gh/duartegroup/autodE/branch/master/graph/badge.svg)](https://codecov.io/gh/duartegroup/autodE/branch/master) [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/duartegroup/autodE.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/duartegroup/autodE/context:python) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/duartegroup/autodE.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/duartegroup/autodE/context:cpp) [![Conda Recipe](https://img.shields.io/badge/recipe-autode-green.svg)](https://anaconda.org/conda-forge/autode) [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/autode.svg)](https://anaconda.org/conda-forge/autode) +[![Build Status](https://github.com/duartegroup/autodE/actions/workflows/pytest.yml/badge.svg)](https://github.com/duartegroup/autodE/actions) [![codecov](https://codecov.io/gh/duartegroup/autodE/branch/master/graph/badge.svg)](https://codecov.io/gh/duartegroup/autodE/branch/master) [![GitHub CodeQL](https://github.com/duartegroup/autodE/actions/workflows/codeql.yml/badge.svg)](https://github.com/duartegroup/autodE/actions/workflows/codeql.yml) [![Conda Recipe](https://img.shields.io/badge/recipe-autode-green.svg)](https://anaconda.org/conda-forge/autode) [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/autode.svg)](https://anaconda.org/conda-forge/autode) ![alt text](autode/common/llogo.png) *** From 1b02325b256d8c94eebb7bc0f0d79887739c4a12 Mon Sep 17 00:00:00 2001 From: tom Date: Sat, 29 Oct 2022 12:47:47 +0100 Subject: [PATCH 3/7] Update build --- .gitignore | 3 ++- setup.py | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 06a5a4860..6ccf65a08 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ \build/ \dist/ \.idea/ +.eggs/ **__MACOSX/ autode/ext/*.cpp **cmake-build-debug/ @@ -18,4 +19,4 @@ tests/*.xyz *.so *.inp *.pyc -**.autode_calculations +.autode_calculations diff --git a/setup.py b/setup.py index 64b3bd39d..44b9cd147 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ from setuptools import setup -from Cython.Build import cythonize from setuptools.extension import Extension extensions = [Extension('cconf_gen', ['autode/conformers/cconf_gen.pyx']), @@ -7,16 +6,13 @@ sources=['autode/ext/ade_dihedrals.pyx'], include_dirs=['autode/ext/include'], language='c++', - extra_compile_args=["-std=c++11", - "-Wno-missing-braces", "-O3"], + extra_compile_args=["-std=c++11", "-Wno-missing-braces", "-O3"], extra_link_args=["-std=c++11"]), - Extension('ade_rb_opt', sources=['autode/ext/ade_rb_opt.pyx'], include_dirs=['autode/ext/include'], language='c++', - extra_compile_args=["-std=c++11", - "-Wno-missing-braces", "-O3"], + extra_compile_args=["-std=c++11", "-Wno-missing-braces", "-O3"], extra_link_args=["-std=c++11"])] setup(name='autode', @@ -43,7 +39,12 @@ include_package_data=True, package_data={'autode.transition_states': ['lib/*.txt'], 'autode.solvent': ['lib/*.xyz']}, - ext_modules=cythonize(extensions, language_level="3"), + setup_requires=[ + 'setuptools>=18.0', + 'cython', + ], + ext_modules=extensions, + install_requires=["Cython"], url='https://github.com/duartegroup/autodE', license='MIT', author='autodE contributors', From d07a458cdbba273548727177283b0abd27251730 Mon Sep 17 00:00:00 2001 From: tom Date: Sat, 29 Oct 2022 13:35:46 +0100 Subject: [PATCH 4/7] Different setup --- doc/install.rst | 2 +- pyproject.toml | 3 +++ setup.py | 8 ++------ 3 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 pyproject.toml diff --git a/doc/install.rst b/doc/install.rst index 260ff8a11..6d4ac9875 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -53,7 +53,7 @@ then, install the appropriate dependencies (you may want to create a new `virtua environment `_) and install:: $ conda install --file requirements.txt --channel conda-forge - $ pip install . --no-deps + $ pip install . .. note:: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..ebe2ac5b9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "cython"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 44b9cd147..ae50db49b 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ from setuptools import setup from setuptools.extension import Extension +from Cython.Build import cythonize extensions = [Extension('cconf_gen', ['autode/conformers/cconf_gen.pyx']), Extension('ade_dihedrals', @@ -39,12 +40,7 @@ include_package_data=True, package_data={'autode.transition_states': ['lib/*.txt'], 'autode.solvent': ['lib/*.xyz']}, - setup_requires=[ - 'setuptools>=18.0', - 'cython', - ], - ext_modules=extensions, - install_requires=["Cython"], + ext_modules=cythonize(extensions, language_level="3"), url='https://github.com/duartegroup/autodE', license='MIT', author='autodE contributors', From 724ece0212d01fd41be6a61e782b6001ef2ab89c Mon Sep 17 00:00:00 2001 From: tom Date: Sat, 29 Oct 2022 13:38:47 +0100 Subject: [PATCH 5/7] Build --- .github/workflows/codeql.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3115854d3..7914d1208 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,6 +19,9 @@ jobs: with: languages: python, cpp + - name: Install build requirements + run: pip install cython + - name: Autobuild uses: github/codeql-action/autobuild@v2 From efcbb6202a805f801f55b7477438f305e7885ed5 Mon Sep 17 00:00:00 2001 From: tom Date: Sat, 29 Oct 2022 13:39:50 +0100 Subject: [PATCH 6/7] Concurrency --- .github/workflows/pytest.yml | 4 ++++ .github/workflows/pytest_cov.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index a1e5d234d..8a2e72d9e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -6,6 +6,10 @@ on: - master pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: name: Env (${{ matrix.python-version }}, ${{ matrix.os }}) diff --git a/.github/workflows/pytest_cov.yml b/.github/workflows/pytest_cov.yml index e6e8f49f5..93d1d9c5e 100644 --- a/.github/workflows/pytest_cov.yml +++ b/.github/workflows/pytest_cov.yml @@ -6,6 +6,10 @@ on: - master pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: name: Env (${{ matrix.python-version }}, ${{ matrix.os }}) From 13808aec6402b4e8ecfbf757beca729c97eccb18 Mon Sep 17 00:00:00 2001 From: tom Date: Sat, 29 Oct 2022 13:42:48 +0100 Subject: [PATCH 7/7] Pip3 --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7914d1208..25cafa525 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,7 +20,7 @@ jobs: languages: python, cpp - name: Install build requirements - run: pip install cython + run: pip3 install cython - name: Autobuild uses: github/codeql-action/autobuild@v2