From d8ee25868343cb47f75a18f08bd155aabf50f9c1 Mon Sep 17 00:00:00 2001 From: Artem Veremey Date: Tue, 1 Jun 2021 12:20:29 -0700 Subject: [PATCH] Restructuring Anaconda installations (#480) --- .github/workflows/{Mac.yml => mac.yml} | 28 +++++--------------- .github/workflows/test.yml | 34 ++++++++++++------------ .github/workflows/windows.yml | 36 ++++++++++---------------- build/conda/conda-3-7-env-full.yaml | 13 ++++++++++ build/conda/conda-3-8-env-full.yaml | 13 ++++++++++ build/conda/conda-3-8-env.yaml | 10 +++++++ conda-environment.yaml | 7 ----- 7 files changed, 72 insertions(+), 69 deletions(-) rename .github/workflows/{Mac.yml => mac.yml} (75%) create mode 100644 build/conda/conda-3-7-env-full.yaml create mode 100644 build/conda/conda-3-8-env-full.yaml create mode 100644 build/conda/conda-3-8-env.yaml delete mode 100644 conda-environment.yaml diff --git a/.github/workflows/Mac.yml b/.github/workflows/mac.yml similarity index 75% rename from .github/workflows/Mac.yml rename to .github/workflows/mac.yml index 3c8fec1996c..c1c71e86226 100644 --- a/.github/workflows/Mac.yml +++ b/.github/workflows/mac.yml @@ -4,11 +4,11 @@ env: GTFF_USE_PROMPT_TOOLKIT: false GTFF_USE_ION: false GTFF_ENABLE_QUICK_EXIT: true + PYTHONNOUSERSITE: 1 on: push: branches: - "main" - - "full-builds" workflow_dispatch: inputs: comments: @@ -35,28 +35,21 @@ jobs: uses: actions/cache@v2 with: path: ~/conda_pkgs_dir - key: conda-macos-3-8-${{ hashFiles('requirements*.txt') }} + key: conda-macos-3-8-${{ hashFiles('build/conda/conda-3-8-env-full.yaml') }} - name: Setup Miniconda uses: conda-incubator/setup-miniconda@v2 with: - python-version: '3.8' miniconda-version: 'latest' auto-update-conda: true - channels: conda-forge + channels: conda-forge,defaults show-channel-urls: true - environment-file: conda-environment.yaml + channel-priority: flexible + environment-file: build/conda/conda-3-8-env-full.yaml activate-environment: testing # Needed for caching use-only-tar-bz2: true - - name: Update pip version (Bash) - shell: bash -l {0} - run: | - conda update pip - pip --version - pip cache dir - - name: Get pip cache dir shell: bash -l {0} id: pip-cache @@ -67,22 +60,15 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.pip-cache.outputs.dir }} - key: macos-pip-${{ hashFiles('**/requirements.txt') }} + key: macos-3-8-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: | macos-pip- - - name: Install gensim with conda - shell: bash -l {0} - run: | - conda install numpy=1.19.5 - conda install gensim=3.8.3 - conda install -c conda-forge cvxpy=1.1.12 - - name: Install dependencies (Bash) shell: bash -l {0} run: | conda info - pip install --user --requirement requirements-full.txt + pip install --requirement requirements-full.txt - name: List installed packages (Bash) shell: bash -l {0} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a585d06e91..993af855931 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -153,17 +153,24 @@ jobs: fail-fast: false matrix: os: ['ubuntu', 'windows'] - python-version: ['3.9'] + python-version: ['3.8'] dependencies: [''] include: - os: ubuntu - python: 3.9 + python: 3.8 - os: windows - python: 3.9 + python: 3.8 env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python }} + PYTHONNOUSERSITE: 1 steps: + - name: Set git to use LF + if: runner.os == 'Windows' + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - name: Checkout uses: actions/checkout@v2 with: @@ -180,7 +187,7 @@ jobs: uses: actions/cache@v2 with: path: ~/conda_pkgs_dir - key: conda-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('requirements*.txt') }} + key: conda-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('build/conda/conda-3-8-env.yaml') }} - name: Setup Miniconda uses: conda-incubator/setup-miniconda@v2 @@ -188,9 +195,10 @@ jobs: python-version: ${{ matrix.python }} miniconda-version: "latest" auto-update-conda: true - channels: conda-forge + channels: conda-forge,defaults show-channel-urls: true - environment-file: conda-environment.yaml + channel-priority: flexible + environment-file: build/conda/conda-3-8-env.yaml activate-environment: testing # Needed for caching use-only-tar-bz2: true @@ -201,13 +209,6 @@ jobs: run: >- c:\windows\system32\icacls C:\Users\runneradmin\AppData\Local\Temp /grant "everyone":F /t - - name: Update pip version (Bash) - shell: bash -l {0} - run: | - conda update pip - pip --version - pip cache dir - - name: Get pip cache dir shell: bash -l {0} id: pip-cache @@ -218,17 +219,14 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-3-8-pip-${{ hashFiles('requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Install dependencies (Bash) shell: bash -l {0} run: | - conda info - conda install numpy=1.19.5 - conda install -c conda-forge cvxpy=1.1.12 - pip install --user --requirement requirements.txt + pip install --requirement requirements.txt - name: List installed packages (Bash) shell: bash -l {0} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5150c82023c..df2413b6424 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -4,11 +4,11 @@ env: GTFF_USE_PROMPT_TOOLKIT: false GTFF_USE_ION: false GTFF_ENABLE_QUICK_EXIT: true + PYTHONNOUSERSITE: 1 on: push: branches: - "main" - - "full-builds" workflow_dispatch: inputs: comments: @@ -19,6 +19,12 @@ jobs: name: Windows-latest, Conda-latest, Python 3.7 runs-on: windows-latest steps: + - name: Set git to use LF + if: runner.os == 'Windows' + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - name: Checkout uses: actions/checkout@v2 with: @@ -35,17 +41,17 @@ jobs: uses: actions/cache@v2 with: path: ~/conda_pkgs_dir - key: conda-windows-3-7-${{ hashFiles('requirements*.txt') }} + key: conda-windows-3-7-${{ hashFiles('build/conda/conda-3-7-env-full.yaml') }} - name: Setup Miniconda uses: conda-incubator/setup-miniconda@v2 with: - python-version: '3.7' miniconda-version: 'latest' auto-update-conda: true - channels: conda-forge + channels: conda-forge,defaults show-channel-urls: true - environment-file: conda-environment.yaml + channel-priority: flexible + environment-file: build/conda/conda-3-7-env-full.yaml activate-environment: testing # Needed for caching use-only-tar-bz2: true @@ -56,13 +62,6 @@ jobs: run: >- c:\windows\system32\icacls C:\Users\runneradmin\AppData\Local\Temp /grant "everyone":F /t - - name: Update pip version (Bash) - shell: bash -l {0} - run: | - conda update pip - pip --version - pip cache dir - - name: Get pip cache dir shell: bash -l {0} id: pip-cache @@ -73,24 +72,15 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.pip-cache.outputs.dir }} - key: windows-pip-${{ hashFiles('**/requirements.txt') }} + key: windows-3-7-pip-${{ hashFiles('requirements-full.txt') }} restore-keys: | windows-pip- - - name: Install fbprophet with conda - shell: bash -l {0} - run: | - conda install numpy=1.19.5 - conda install -c conda-forge fbprophet=0.6 - conda install spyder - conda install gensim=3.8.3 - conda install -c conda-forge cvxpy=1.1.12 - - name: Install dependencies (Bash) shell: bash -l {0} run: | conda info - pip install --user --requirement requirements-full.txt + pip install --requirement requirements-full.txt - name: List installed packages (Bash) shell: bash -l {0} diff --git a/build/conda/conda-3-7-env-full.yaml b/build/conda/conda-3-7-env-full.yaml new file mode 100644 index 00000000000..310d6530e4a --- /dev/null +++ b/build/conda/conda-3-7-env-full.yaml @@ -0,0 +1,13 @@ +channels: + - conda-forge + - defaults +dependencies: + - python=3.7 + - pip + - poetry=1.1.6 + - numpy=1.19.5 + - fbprophet=0.6 + - spyder + - gensim=3.8.3 + - cvxpy=1.1.12 + - pytest diff --git a/build/conda/conda-3-8-env-full.yaml b/build/conda/conda-3-8-env-full.yaml new file mode 100644 index 00000000000..7b7c98ad704 --- /dev/null +++ b/build/conda/conda-3-8-env-full.yaml @@ -0,0 +1,13 @@ +channels: + - conda-forge + - defaults +dependencies: + - python=3.8 + - pip + - poetry=1.1.6 + - numpy=1.19.5 + - fbprophet=0.7.1 + - spyder + - gensim=3.8.3 + - cvxpy=1.1.12 + - pytest diff --git a/build/conda/conda-3-8-env.yaml b/build/conda/conda-3-8-env.yaml new file mode 100644 index 00000000000..74e162642bd --- /dev/null +++ b/build/conda/conda-3-8-env.yaml @@ -0,0 +1,10 @@ +channels: + - conda-forge + - defaults +dependencies: + - python=3.8 + - pip + - poetry=1.1.6 + - numpy=1.19.5 + - cvxpy=1.1.12 + - pytest diff --git a/conda-environment.yaml b/conda-environment.yaml deleted file mode 100644 index b585cf560ec..00000000000 --- a/conda-environment.yaml +++ /dev/null @@ -1,7 +0,0 @@ -channels: - - conda-forge -dependencies: - - python - - poetry - - jupyter - - pytest