Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix github action by updating pytest from conda to mamba #129

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions .github/workflows/conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
if [ "${{ github.event.release.tag_name }}" != "" ]; then
version=$(echo ${{ github.event.release.tag_name }} | sed 's/^v//')
else
version="$(awk -F= '/^PACKAGE_VERSION/ { print $2}' pyincore-viz/globals.py | sed 's/[ "]//g').${{ github.run_number }}"
version="$(awk -F= '/^PACKAGE_VERSION/ { print $2}' pyincore_viz/globals.py | sed 's/[ "]//g').${{ github.run_number }}"
fi
echo "VERSION=${version}" >> $GITHUB_ENV
echo "VERSION=${version}"
Expand All @@ -49,23 +49,28 @@ jobs:
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}

- name: Install miniconda
uses: conda-incubator/setup-miniconda@v2
- name: Install micromamba
uses: mamba-org/setup-micromamba@v1
with:
miniconda-version: "latest"
python-version: 3.8
use-mamba: true
mamba-version: "*"
channels: conda-forge,in-core
use-only-tar-bz2: true
conda-build-version: "*"
create-args: >-
python=3.9
conda
environment-file: environment.yml
generate-run-shell: true
condarc: |
channels:
- IN-CORE
- conda-forge
- defaults

- name: Build conda package
run: |
conda install conda-build
mkdir dist
conda build --output-folder dist \
--label ${{ env.LABEL }} \
recipes
shell: micromamba-shell {0}

- name: Upload conda package
if: github.event_name == 'release'
Expand All @@ -75,6 +80,7 @@ jobs:
--user IN-CORE \
--label ${{ env.LABEL }} \
dist/*/pyincore-viz-${{ env.VERSION }}-*.tar.bz2
shell: micromamba-shell {0}

- name: Upload binaries to release
if: github.event_name == 'release'
Expand Down
32 changes: 20 additions & 12 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
# ----------------------------------------------------------------------
unit-test:
runs-on: ubuntu-latest
strategy:
matrix:
vars: [ { python-version: '3.8', sleep: '0s' }, { python-version: '3.9', sleep: '60s' } ]
# { python-version: '3.10', sleep: '120s' }, { python-version: '3.11', sleep: '180s' } ]
name: Python ${{ matrix.vars.python-version }} Test
steps:
- name: Checkout source code
uses: actions/checkout@v2
Expand All @@ -28,25 +33,28 @@ jobs:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('environment.yml') }}

- name: Install miniconda
uses: conda-incubator/setup-miniconda@v2
- name: Install micromamba
uses: mamba-org/setup-micromamba@v1
with:
miniconda-version: "latest"
mamba-version: "*"
use-mamba: true
python-version: 3.8
activate-environment: base
channels: conda-forge,in-core
create-args: >-
python=${{ matrix.vars.python-version }}
pytest
environment-file: environment.yml
use-only-tar-bz2: true
conda-build-version: "*"
generate-run-shell: true

- name: Sleep for ${{ matrix.vars.sleep }} to avoid multiple pytests run concurrently
uses: jakejarvis/wait-action@master
with:
time: ${{ matrix.vars.sleep }}

- name: Run pyincore viz tests with pytest
run: |
echo "${{secrets.PYTEST_USER_TOKEN}}" > tests/pyincore_viz/.incorepw
$CONDA/bin/pytest --cache-clear -s tests/pyincore_viz/test_pyincore_viz.py --junitxml=test-reports/viz_results.xml
python -m pytest tests/pyincore_viz/test_pyincore_viz.py
shell: micromamba-shell {0}

- name: Run analysis viz tests with pytest
run: |
echo "${{secrets.PYTEST_USER_TOKEN}}" > tests/pyincore_viz/.incorepw
$CONDA/bin/pytest --cache-clear -s tests/pyincore_viz/test_analysis_viz.py --junitxml=test-reports/analysis_results.xml
python -m pytest tests/pyincore_viz/test_analysis_viz.py
shell: micromamba-shell {0}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Changed
- Pytest changed to use micromamba [#128](https://github.com/IN-CORE/pyincore-viz/issues/128)

### Fixed
- Conda package building and uploading github action [#131](https://github.com/IN-CORE/pyincore-viz/issues/131)

## [1.8.2] - 2023-06-14

### Changed
Expand Down
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: pyincore_viz
channels:
- conda-forge
- defaults
- in-core
dependencies:
- gdal
- branca>=0.3.0
Expand All @@ -18,7 +19,7 @@ dependencies:
- pandas>=0.24.1
- pillow
- pycodestyle>=2.6.0
- pyincore>=1.7.0
- pyincore>=1.11.0
- pytest>=3.9.0
- python-jose>=3.0
- rasterio>=1.3.3
2 changes: 1 addition & 1 deletion recipes/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ requirements:
- owslib>=0.17.1
- pandas>=0.24.1
- pillow
- pyincore>=1.7.0
- pyincore>=1.11.0
- rasterio>=1.3.3

test:
Expand Down
2 changes: 1 addition & 1 deletion requirements.min
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ owslib>=0.17.1
pandas>=0.24.1
pillow
pycodestyle>=2.6.0
pyincore>=1.7.0
pyincore>=1.11.0
pytest>=3.9.0
python-jose>=3.0
rasterio>=1.3.3
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ owslib>=0.17.1
pandas>=0.24.1
pillow
pycodestyle>=2.6.0
pyincore>=1.7.0
pyincore>=1.11.0
pytest>=3.9.0
python-jose>=3.0
rasterio>=1.3.3
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
'owslib>=0.17.1',
'pandas>=0.24.1',
'pillow',
'pyincore>=1.7.0',
'pyincore>=1.11.0',
'rasterio>=1.3.3'
],

Expand Down
186 changes: 93 additions & 93 deletions versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,96 +4,96 @@ This file is autogenerated and lists the latest versions of all dependencies. Th

| PIP Package | Conda Package | Required Version | Matched Version (pip) |
|-------------|---------------|------------------|-----------------------|
| branca | | \>=0.3.0| 0.6.0 |
| contextily | | \>=1.0.0| 1.3.0 |
| deprecated | | | 1.2.14 |
| geopandas | | \>=0.6.1| 0.13.2 |
| ipyleaflet | | \>=0.16.0| 0.17.3 |
| ipywidgets | | \>=7.6.0| 8.0.7 |
| lxml | | \>=4.6.3| 4.9.3 |
| matplotlib | | \>=2.1.0| 3.7.2 |
| networkx | | \>=2.2| 3.1 |
| numpy | | \>=1.16.1| 1.25.2 |
| owslib | | \>=0.17.1| 0.29.2 |
| pandas | | \>=0.24.1| 2.0.3 |
| pillow | | | 10.0.0 |
| pycodestyle | | \>=2.6.0| 2.11.0 |
| pyincore | | \>=1.7.0| 1.12.0a1 |
| pytest | | \>=3.9.0| 7.4.0 |
| python-jose | | \>=3.0| 3.3.0 |
| rasterio | | \>=1.3.3| 1.3.8 |
| affine | | | 2.4.0 |
| asttokens | | | 2.2.1 |
| attrs | | | 23.1.1.dev47 |
| backcall | | | 0.2.0 |
| certifi | | | 2023.7.22 |
| charset-normalizer | | | 3.2.0 |
| click | | | 8.1.6 |
| click-plugins | | | 1.1.1 |
| cligj | | | 0.7.2 |
| comm | | | 0.1.3 |
| contourpy | | | 1.1.0 |
| cycler | | | 0.11.0 |
| debugpy | | | 1.6.7 |
| decorator | | | 5.1.1 |
| ecdsa | | | 0.18.0 |
| exceptiongroup | | | 1.1.2 |
| executing | | | 1.2.0 |
| fiona | | | 1.9.4.post1 |
| fonttools | | | 4.41.1 |
| geographiclib | | | 2.0 |
| geopy | | | 2.3.0 |
| idna | | | 3.4 |
| iniconfig | | | 2.0.0 |
| ipykernel | | | 6.25.0 |
| ipython | | | 8.14.0 |
| jedi | | | 0.19.0 |
| jinja2 | | | 3.1.2 |
| joblib | | | 1.3.1 |
| jupyter-client | jupyter_client | | 8.3.0 |
| jupyter-core | jupyter_core | | 5.3.1 |
| jupyterlab-widgets | jupyterlab_widgets | | 3.0.8 |
| kiwisolver | | | 1.4.4 |
| markupsafe | | | 2.1.3 |
| matplotlib-inline | | | 0.1.6 |
| mercantile | | | 1.2.1 |
| nest-asyncio | | | 1.5.7 |
| packaging | | | 23.1 |
| parso | | | 0.8.3 |
| pexpect | | | 4.8.0 |
| pickleshare | | | 0.7.5 |
| platformdirs | | | 3.10.0 |
| pluggy | | | 1.2.0 |
| ply | | | 3.11 |
| prompt-toolkit | | | 3.0.39 |
| psutil | | | 5.9.5 |
| ptyprocess | | | 0.7.0 |
| pure-eval | | | 0.2.2 |
| pyasn1 | | | 0.5.0 |
| pygments | | | 2.15.1 |
| pyomo | | | 6.6.1 |
| pyparsing | | | 3.0.9 |
| pyproj | | | 3.6.0 |
| python-dateutil | | | 2.8.2 |
| pytz | | | 2023.3 |
| pyyaml | | | 6.0.1 |
| pyzmq | | | 25.1.1b2 |
| requests | | | 2.31.0 |
| rsa | | | 4.9 |
| rtree | | | 1.0.1 |
| scipy | | | 1.11.1 |
| shapely | | | 2.0.1 |
| six | | | 1.16.0 |
| snuggs | | | 1.4.7 |
| stack-data | stack_data | | 0.6.2 |
| tomli | | | 2.0.1 |
| tornado | | | 6.4.dev1 |
| traitlets | | | 5.9.0 |
| traittypes | | | 0.2.1 |
| tzdata | | | 2023.3 |
| urllib3 | | | 2.0.4 |
| wcwidth | | | 0.2.6 |
| widgetsnbextension | | | 4.0.8 |
| wntr | | | 1.0.0 |
| wrapt | | | 1.15.0 |
| xyzservices | | | 2023.7.0 |
| branca | | \>=0.3.0 | 0.6.0 |
| contextily | | \>=1.0.0 | 1.3.0 |
| deprecated | | | 1.2.14 |
| geopandas | | \>=0.6.1 | 0.13.2 |
| ipyleaflet | | \>=0.16.0 | 0.17.3 |
| ipywidgets | | \>=7.6.0 | 8.0.7 |
| lxml | | \>=4.6.3 | 4.9.3 |
| matplotlib | | \>=2.1.0 | 3.7.2 |
| networkx | | \>=2.2 | 3.1 |
| numpy | | \>=1.16.1 | 1.25.2 |
| owslib | | \>=0.17.1 | 0.29.2 |
| pandas | | \>=0.24.1 | 2.0.3 |
| pillow | | | 10.0.0 |
| pycodestyle | | \>=2.6.0 | 2.11.0 |
| pyincore | | \>=1.11.0 | 1.12.0a1 |
| pytest | | \>=3.9.0 | 7.4.0 |
| python-jose | | \>=3.0 | 3.3.0 |
| rasterio | | \>=1.3.3 | 1.3.8 |
| affine | | | 2.4.0 |
| asttokens | | | 2.2.1 |
| attrs | | | 23.1.1.dev47 |
| backcall | | | 0.2.0 |
| certifi | | | 2023.7.22 |
| charset-normalizer | | | 3.2.0 |
| click | | | 8.1.6 |
| click-plugins | | | 1.1.1 |
| cligj | | | 0.7.2 |
| comm | | | 0.1.3 |
| contourpy | | | 1.1.0 |
| cycler | | | 0.11.0 |
| debugpy | | | 1.6.7 |
| decorator | | | 5.1.1 |
| ecdsa | | | 0.18.0 |
| exceptiongroup | | | 1.1.2 |
| executing | | | 1.2.0 |
| fiona | | | 1.9.4.post1 |
| fonttools | | | 4.41.1 |
| geographiclib | | | 2.0 |
| geopy | | | 2.3.0 |
| idna | | | 3.4 |
| iniconfig | | | 2.0.0 |
| ipykernel | | | 6.25.0 |
| ipython | | | 8.14.0 |
| jedi | | | 0.19.0 |
| jinja2 | | | 3.1.2 |
| joblib | | | 1.3.1 |
| jupyter-client | jupyter_client | | 8.3.0 |
| jupyter-core | jupyter_core | | 5.3.1 |
| jupyterlab-widgets | jupyterlab_widgets | | 3.0.8 |
| kiwisolver | | | 1.4.4 |
| markupsafe | | | 2.1.3 |
| matplotlib-inline | | | 0.1.6 |
| mercantile | | | 1.2.1 |
| nest-asyncio | | | 1.5.7 |
| packaging | | | 23.1 |
| parso | | | 0.8.3 |
| pexpect | | | 4.8.0 |
| pickleshare | | | 0.7.5 |
| platformdirs | | | 3.10.0 |
| pluggy | | | 1.2.0 |
| ply | | | 3.11 |
| prompt-toolkit | | | 3.0.39 |
| psutil | | | 5.9.5 |
| ptyprocess | | | 0.7.0 |
| pure-eval | | | 0.2.2 |
| pyasn1 | | | 0.5.0 |
| pygments | | | 2.15.1 |
| pyomo | | | 6.6.1 |
| pyparsing | | | 3.0.9 |
| pyproj | | | 3.6.0 |
| python-dateutil | | | 2.8.2 |
| pytz | | | 2023.3 |
| pyyaml | | | 6.0.1 |
| pyzmq | | | 25.1.1b2 |
| requests | | | 2.31.0 |
| rsa | | | 4.9 |
| rtree | | | 1.0.1 |
| scipy | | | 1.11.1 |
| shapely | | | 2.0.1 |
| six | | | 1.16.0 |
| snuggs | | | 1.4.7 |
| stack-data | stack_data | | 0.6.2 |
| tomli | | | 2.0.1 |
| tornado | | | 6.4.dev1 |
| traitlets | | | 5.9.0 |
| traittypes | | | 0.2.1 |
| tzdata | | | 2023.3 |
| urllib3 | | | 2.0.4 |
| wcwidth | | | 0.2.6 |
| widgetsnbextension | | | 4.0.8 |
| wntr | | | 1.0.0 |
| wrapt | | | 1.15.0 |
| xyzservices | | | 2023.7.0 |
Loading