diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index 66d2c18a8..9725aa562 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -4,10 +4,19 @@ on: branches: - main +# Default to bash in login mode; key to activating conda environment +# https://github.com/mamba-org/provision-with-micromamba#IMPORTANT +defaults: + run: + shell: "bash -l {0}" + permissions: contents: write pages: write +env: + MICROMAMBA_VERSION: 'latest' + jobs: build: name: Deploy docs @@ -19,19 +28,15 @@ jobs: submodules: "recursive" fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.9' - architecture: 'x64' - name: Install dependencies - run: | - python3 -m pip install --upgrade pip # install pip - python3 -m pip install -r requirements-dev.txt # install dev deps + uses: "mamba-org/setup-micromamba@v1" + with: + micromamba-version: "${{ env.MICROMAMBA_VERSION }}" + environment-file: "environments/dev-environment.yaml" + cache-environment: true - name: Install conda-lock - run: | - python3 -m pip install . + run: "pip install ." - name: Build site run: mkdocs build @@ -42,4 +47,4 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./site user_name: 'github-actions[bot]' - user_email: 'github-actions[bot]@users.noreply.github.com' \ No newline at end of file + user_email: 'github-actions[bot]@users.noreply.github.com' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0f762dc1..7a20c8aec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,18 +31,10 @@ jobs: uses: mamba-org/setup-micromamba@v1 with: micromamba-version: ${{ env.MICROMAMBA_VERSION }} - environment-name: test-env + environment-file: environments/dev-environment.yaml init-shell: powershell create-args: >- python=3.11 - mamba - pip - pytest-cov - pytest-xdist - - - name: Install dev deps - run: | - python -m pip install -r requirements-dev.txt - name: install conda-lock run: | @@ -78,23 +70,10 @@ jobs: - uses: mamba-org/setup-micromamba@v1 with: micromamba-version: ${{ env.MICROMAMBA_VERSION }} - environment-name: test-env + environment-file: environments/dev-environment.yaml init-shell: bash create-args: >- python=${{ matrix.python-version }} - mamba - pip - pytest-cov - pytest-xdist - - - name: Install dev deps - shell: bash -eo pipefail -l {0} - run: | - set -x - echo "${PATH}" - which pip - which python - python -m pip install -r requirements-dev.txt - name: install conda-lock shell: bash -eo pipefail -l {0} diff --git a/environments/README.md b/environments/README.md index 42622dfba..77ae95ea6 100644 --- a/environments/README.md +++ b/environments/README.md @@ -7,12 +7,6 @@ mamba activate conda-lock-dev ``` - or: - - ``` - pip install requirements-dev.txt - ``` - * Then, install `conda-lock` in editable mode. This will also install its runtime dependencies as defined in `pyproject.toml`. diff --git a/environments/dev-environment.yaml b/environments/dev-environment.yaml index bee5b5a24..43aa45072 100644 --- a/environments/dev-environment.yaml +++ b/environments/dev-environment.yaml @@ -4,6 +4,7 @@ channels: - conda-forge - nodefaults dependencies: +- mamba - black - check-manifest - doctr diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index b4feceec3..000000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,20 +0,0 @@ -black -check-manifest -doctr -build -freezegun -mypy -pre_commit -pytest -pytest-cov -pytest-xdist -pytest-timeout -tomli; python_version<"3.11" -twine -wheel -mkdocs -mkdocs-material -mkdocs-click -mkdocs-include-markdown-plugin -flaky -docker