From cb54bd04ca1721ac4a582e34b0d791e4d1109bbf Mon Sep 17 00:00:00 2001 From: Pablo Iturrieta <69042881+pabloitu@users.noreply.github.com> Date: Tue, 30 May 2023 18:01:44 +0200 Subject: [PATCH] dev: uses now mamba to build actions environment. (#228) build: removed developer and testing dependencies from YML and requirements.txt, but specified them in requirements_dev.txt --- .github/workflows/build-sphinx-no-deploy.yml | 19 ++++---- .github/workflows/build-sphinx.yml | 19 ++++---- .github/workflows/build-test.yml | 47 +++++++++----------- requirements.txt | 7 --- requirements.yml | 6 --- requirements_dev.txt | 18 ++++++++ 6 files changed, 57 insertions(+), 59 deletions(-) create mode 100644 requirements_dev.txt diff --git a/.github/workflows/build-sphinx-no-deploy.yml b/.github/workflows/build-sphinx-no-deploy.yml index f669c541..1146d029 100644 --- a/.github/workflows/build-sphinx-no-deploy.yml +++ b/.github/workflows/build-sphinx-no-deploy.yml @@ -13,17 +13,16 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + - uses: mamba-org/setup-micromamba@v1 with: - python-version: '3.10' - activate-environment: csep-dev - channels: conda-forge - - - name: Install dependencies - run: | - conda env update --file requirements.yml - conda info -a - conda list + generate-run-shell: true + environment-file: requirements.yml + create-args: >- + python=3.10 + pillow + sphinx + sphinx-gallery + sphinx-rtd-theme - name: Install pyCSEP run: | diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml index cc4544e0..a6549be2 100644 --- a/.github/workflows/build-sphinx.yml +++ b/.github/workflows/build-sphinx.yml @@ -13,17 +13,16 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + - uses: mamba-org/setup-micromamba@v1 with: - python-version: '3.10' - activate-environment: csep-dev - channels: conda-forge - - - name: Install dependencies - run: | - conda env update --file requirements.yml - conda info -a - conda list + generate-run-shell: true + environment-file: requirements.yml + create-args: >- + python=3.10 + pillow + sphinx + sphinx-gallery + sphinx-rtd-theme - name: Install pyCSEP run: | diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 6033a18f..289f6a14 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -3,12 +3,12 @@ name: tests on: push: branches-ignore: - - 'v*' + - 'v*' pull_request: jobs: build: - if: github.repository == 'SCECCode/pycsep' + if: github.repository == 'SCECcode/pycsep' runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -20,30 +20,25 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: ${{ matrix.python-version }} - activate-environment: csep-dev - channels: conda-forge + - uses: actions/checkout@v2 + - uses: mamba-org/setup-micromamba@v1 + with: + generate-run-shell: true + environment-file: requirements.yml + create-args: >- + python=${{ matrix.python-version }} - - name: Install dependencies - run: | - conda env update --file requirements.yml - conda info -a - conda list + - name: Install pyCSEP + run: | + pip install --no-deps -e . + python -c "import csep; print('Version: ', csep.__version__)" - - name: Install pyCSEP - run: | - pip install --no-deps -e . - python -c "import csep; print('Version: ', csep.__version__)" + - name: Test with pytest + run: | + pip install vcrpy==4.3.1 pytest pytest-cov + pytest --cov=./ --cov-config=.coveragerc - - name: Test with pytest - run: | - conda install pytest-cov - pytest --cov=./ --cov-config=.coveragerc - - - name: Upload coverage - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' - run: | - bash <(curl -s https://codecov.io/bash) || echo 'Codecov failed to upload' + - name: Upload coverage + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' + run: | + bash <(curl -s https://codecov.io/bash) || echo 'Codecov failed to upload' diff --git a/requirements.txt b/requirements.txt index 6a95af5b..df3845be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,13 +6,6 @@ cartopy obspy pyproj python-dateutil -pytest -vcrpy -pytest-cov shapely -sphinx -sphinx-gallery -sphinx-rtd-theme -pillow mercantile diff --git a/requirements.yml b/requirements.yml index 14caee7e..be2fd220 100644 --- a/requirements.yml +++ b/requirements.yml @@ -11,13 +11,7 @@ dependencies: - pyproj - obspy - python-dateutil - - pytest - cartopy - shapely - - sphinx - - sphinx-gallery - - sphinx_rtd_theme - - pillow - - vcrpy - mercantile diff --git a/requirements_dev.txt b/requirements_dev.txt new file mode 100644 index 00000000..6a95af5b --- /dev/null +++ b/requirements_dev.txt @@ -0,0 +1,18 @@ +numpy +scipy +pandas +matplotlib +cartopy +obspy +pyproj +python-dateutil +pytest +vcrpy +pytest-cov +shapely +sphinx +sphinx-gallery +sphinx-rtd-theme +pillow +mercantile +