From e702fae2c69e8023d2d82ed3ffc281918034c5ce Mon Sep 17 00:00:00 2001 From: Matteo Giantomassi Date: Sun, 21 Jul 2024 23:58:49 +0200 Subject: [PATCH] Fixes --- .github/workflows/abipy-lint.yml | 41 ----------------------------- .github/workflows/gh-pages.yml | 27 ++++++++++++++----- .github/workflows/test.yml | 3 ++- docs/workflows/manager_examples.rst | 2 +- 4 files changed, 24 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/abipy-lint.yml diff --git a/.github/workflows/abipy-lint.yml b/.github/workflows/abipy-lint.yml deleted file mode 100644 index cdfff3492..000000000 --- a/.github/workflows/abipy-lint.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: AbiPy linting - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - max-parallel: 4 - matrix: - python-version: [3.7] - - 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: | - python -m pip install --upgrade pip - - name: Lint with pycodestyle - run: | - pip install pycodestyle - pycodestyle abipy - #- name: Lint with mypy - # run: | - # pip install mypy - # mypy abipy - - name: Lint with flake8 - run: | - pip install flake8 - # stop the build if there are Python syntax errors or undefined names - flake8 --count --show-source --statistics abipy - # exit-zero treats all errors as warnings. - #flake8 --count --exit-zero --max-complexity=20 --statistics abipy - #- name: Lint with pylint - # run: | - # pip install pylint - # # stop the build if there are Python syntax errors or undefined names - # pylint --exit-zero abipy diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 0d6284bbf..d6cf73c74 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -21,19 +21,34 @@ jobs: build: # prevent this action from running on forks if: github.repository == 'abinit/abipy' + defaults: + run: + shell: bash -l {0} # enables conda/mamba env activation by reading bash profile runs-on: ubuntu-latest steps: - - name: Checkout + - name: Check out Abipy repo uses: actions/checkout@v4 - name: Setup Pages uses: actions/configure-pages@v3 - - name: Build with Jekyll - uses: actions/jekyll-build-pages@v1 - with: - source: ./docs - destination: ./_site + - name: Installing abinit from conda-forge and abipy with python=${{ matrix.config.python }} + run: | + conda create -n abipy python=${{ matrix.config.python }} --yes + conda activate abipy + conda install abinit -c conda-forge --yes + abinit --version + abinit --build + pip install . # --editable + mkdir -p $HOME/.abinit/abipy/ + cp abipy/data/managers/travis_manager.yml $HOME/.abinit/abipy/manager.yml + cp abipy/data/managers/simple_scheduler.yml $HOME/.abinit/abipy/scheduler.yml + + - name: Build docs with Sphinx + run: | + cd docs + pip install -r requirements.txt + make -j - name: Upload artifact uses: actions/upload-pages-artifact@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cfaabc89a..2bb955810 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,7 +53,7 @@ jobs: conda install abinit -c conda-forge --yes abinit --version abinit --build - pip install . # --editable + pip install . --editable mkdir -p $HOME/.abinit/abipy/ cp abipy/data/managers/travis_manager.yml $HOME/.abinit/abipy/manager.yml cp abipy/data/managers/simple_scheduler.yml $HOME/.abinit/abipy/scheduler.yml @@ -62,4 +62,5 @@ jobs: run: | conda activate abipy #abicheck.py --with-flow + pip install -r requirements-test.txt pytest --splits 10 --group ${{ matrix.split }} # --durations-path tests/files/.pytest-split-durations tests diff --git a/docs/workflows/manager_examples.rst b/docs/workflows/manager_examples.rst index c4e0d41c6..bbf309706 100644 --- a/docs/workflows/manager_examples.rst +++ b/docs/workflows/manager_examples.rst @@ -597,7 +597,7 @@ Travis job: mpi_runner: mpirun pre_run: - - source activate abinit-environment + - conda activate abipy limits: min_cores: 1 max_cores: 2