From 8a56a75b0de1a5e5810f40941deb18e99921bf21 Mon Sep 17 00:00:00 2001 From: Marcus Oskarsson Date: Thu, 12 Oct 2023 21:11:15 +0200 Subject: [PATCH] Using micromamba --- .github/workflows/build_and_test.yml | 39 ++++++++++++++++------------ conda-environment.yml | 1 - pyproject.toml | 1 - 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 2044de8b4..3678d1a58 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -1,4 +1,4 @@ -name: Build and test +name: Lint and test on: [push, pull_request] @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 5 matrix: - python-version: ["3.10"] #, "3.9", "3.10"] + python-version: ["3.10"] #, "3.9", "3.10"] # Skip `pull_request` runs on local PRs for which `push` runs are already triggered if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository @@ -35,20 +35,27 @@ jobs: uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - - name: Add conda to system path - run: | - # $CONDA is an environment variable pointing to the root of the miniconda directory - echo $CONDA/bin >> $GITHUB_PATH - - name: Install ldap dependencies + + - name: Install LDAP dependencies run: sudo apt-get -y install libsasl2-dev libldap2-dev libssl-dev - - name: Install dependencies - run: | - conda install -c conda-forge mamba - mamba env update --file conda-environment.yml --name base - python -m poetry install --with dev + + - name: Set up Conda environment + uses: mamba-org/setup-micromamba@v1 + with: + micromamba-version: "latest" + init-shell: bash + environment-file: conda-environment.yml + cache-environment: true + post-cleanup: "all" + + - name: Install MXCuBE + run: python -m poetry install --with dev + shell: bash + - name: Linting & Code Quality - run: | - poetry run pre-commit run --all-files + run: poetry run pre-commit run --all-files + shell: bash + - name: Test with pytest - run: | - poetry run pytest + run: poetry run pytest + shell: bash diff --git a/conda-environment.yml b/conda-environment.yml index 69942cba3..1651cd06f 100644 --- a/conda-environment.yml +++ b/conda-environment.yml @@ -5,7 +5,6 @@ dependencies: - python >=3.8,<3.11 - openldap - python-ldap=3.4.0 - - pip - poetry - nodejs - redis-server diff --git a/pyproject.toml b/pyproject.toml index 71e16d13f..3f269bdae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,6 @@ bcrypt = "^4.0.1" [tool.poetry.dev-dependencies] myst-parser = "^2.0.0" -pylint = [ { version = "==2.13.9", python = "<=3.7.1" }, { version = "2.15.3", python = ">=3.8" } ] pre-commit = "2.20.0" pytest = "7.1.3" pytest-cov = "4.0.0"