From 6fae1af703e9d4aed04baa8bc7ec7c94d4a6dec9 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 | 35 +++++++++++++++------------- conda-environment.yml | 1 - pyproject.toml | 1 - 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 2044de8b4..ffdd1495e 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,23 @@ 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" + environment-file: conda-environment.yml + cache-environment: true + post-cleanup: "all" + + - name: Install MXCuBE + run: "${MAMBA_EXE} run --name mxcubeweb poetry install" + - name: Linting & Code Quality - run: | - poetry run pre-commit run --all-files + run: "${MAMBA_EXE} run --name mxcubeweb poetry run pre-commit run --all-files" + - name: Test with pytest - run: | - poetry run pytest + run: "${MAMBA_EXE} run --name mxcubeweb poetry run pytest" 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 72144df1b..f049715f0 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"