Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

Improve conda #244

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c8f6c31
fix install command and publish only once
fdiblen May 19, 2020
a579b6c
Merge branch 'alignment' into improve-conda
fdiblen May 19, 2020
ad56171
merge anaconda and python build workflows
fdiblen May 19, 2020
57856f9
remove python build badge
fdiblen May 19, 2020
aa4b27c
bump to 0.3.2
fdiblen May 19, 2020
f3aff59
update the changelog
fdiblen May 19, 2020
eda8b12
handle data in setup.py
fdiblen May 20, 2020
a6a39a3
change conda info step while testing conda package build
fdiblen May 20, 2020
7fe99d2
automatically activate conda environments
fdiblen May 20, 2020
13d2293
test generated conda package by installing it
fdiblen May 20, 2020
8859b04
remove conda/conda_build_config.yaml
fdiblen May 20, 2020
a4635fa
add BUILD_FOLDER variable
fdiblen May 20, 2020
a9d02d5
Update setup.py
fdiblen May 20, 2020
59001cf
list conda environments for debugging
fdiblen May 20, 2020
eaed848
Merge branch 'improve-conda' of github.com:matchms/matchms into impro…
fdiblen May 20, 2020
57f7704
remove the build step
fdiblen May 20, 2020
eb30213
deactivate previous environment before creating a new environment
fdiblen May 20, 2020
b712c28
Merge branch 'master' into improve-conda
fdiblen May 20, 2020
d2fc329
data is added by setup.py, build scripts ware removed
fdiblen May 20, 2020
0e97ac7
Merge branch 'improve-conda' of github.com:matchms/matchms into impro…
fdiblen May 20, 2020
9abd42a
remove condarc
fdiblen May 20, 2020
27467bd
use defaults for conda ction
fdiblen May 20, 2020
aa2f9a0
add Python to action names
fdiblen May 20, 2020
bb75b60
split workflows and test the conda package on windows/unix separately
fdiblen May 20, 2020
d1cc37d
update temp folder for windows
fdiblen May 20, 2020
7f9112c
update CHANGELOG.md
fdiblen May 20, 2020
49e2b5b
add strategy section to build workflow
fdiblen May 20, 2020
81ef3cc
add strategy section to publish workflow
fdiblen May 20, 2020
2062f7a
make distinction for workflow jobs using different names
fdiblen May 20, 2020
2399b7f
updated conda build files
jspaaks May 20, 2020
c023bd2
change strategy - needs order in build
fdiblen May 20, 2020
4faa138
Merge branch 'improve-conda' of github.com:matchms/matchms into impro…
fdiblen May 20, 2020
61fdfab
test build only on ubuntu
fdiblen May 20, 2020
3cde0e7
remove deactivate step
fdiblen May 20, 2020
41f2852
test the build workflow as a single job
fdiblen May 20, 2020
b18026d
remove extra checkouts
fdiblen May 20, 2020
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
82 changes: 0 additions & 82 deletions .github/workflows/build.yml

This file was deleted.

114 changes: 109 additions & 5 deletions .github/workflows/conda_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on: [push, pull_request]

jobs:

build:
name: ${{ matrix.python-version }} / ${{ matrix.os }}
analysis:
name: Analysis-Python ${{ matrix.python-version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -14,13 +14,71 @@ jobs:
python-version: ['3.7']
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: goanpeca/setup-miniconda@v1
with:
activate-environment: matchms-dev
environment-file: conda/environment-dev.yml
python-version: ${{ matrix.python-version }}
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Python info
shell: bash -l {0}
run: |
which python
python --version
- name: Conda list
shell: bash -l {0}
run: conda list
- name: Check style against standards using prospector
shell: bash -l {0}
run: prospector -o grouped -o pylint:pylint-report.txt
- name: Check whether import statements are used consistently
shell: bash -l {0}
run: isort --check-only --diff --conda-env matchms-dev --recursive --wrap-length 79 --lines-after-imports 2 --force-single-line --no-lines-before FUTURE --no-lines-before STDLIB --no-lines-before THIRDPARTY --no-lines-before FIRSTPARTY --no-lines-before LOCALFOLDER matchms/ tests/ integration-tests/
- name: Build documentation
jspaaks marked this conversation as resolved.
Show resolved Hide resolved
shell: bash -l {0}
run: |
make coverage html
working-directory: readthedocs/
env:
SPHINXOPTS: '-n' # enable nit-picky mode
- name: Check documentation coverage threshold
if: matrix.os == 'ubuntu-latest'
shell: bash -l {0}
run: |
cat readthedocs/_build/coverage/python.txt
UNCOVERED_MEMBERS=$(grep '*' readthedocs/_build/coverage/python.txt | wc -l)
UNCOVERED_MEMBERS_ALLOWED=25
if (( $UNCOVERED_MEMBERS > $UNCOVERED_MEMBERS_ALLOWED )) ; then echo "There are currently ${UNCOVERED_MEMBERS} uncovered members in the documentation, which is more than the ${UNCOVERED_MEMBERS_ALLOWED} allowed."; exit 1;fi
echo "The code is sufficiently documented with ${UNCOVERED_MEMBERS} uncovered members out of ${UNCOVERED_MEMBERS_ALLOWED} allowed.";
- name: Test
if: matrix.os != 'ubuntu-latest'
shell: bash -l {0}
run: |
python setup.py test
- name: Test with coverage
if: matrix.os == 'ubuntu-latest'
shell: bash -l {0}
run: |
pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml
- name: Correct coverage paths
if: matrix.os == 'ubuntu-latest'
run: sed -i "s+$PWD/++g" coverage.xml
- name: SonarCloud Scan
if: matrix.os == 'ubuntu-latest'
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Create matchms-build environment
uses: goanpeca/setup-miniconda@v1
with:
activate-environment: matchms-build
auto-activate-base: false
auto-update-conda: true
environment-file: conda/environment-build.yml
miniconda-version: 'latest'
python-version: ${{ matrix.python-version }}
- name: Show conda config
shell: bash -l {0}
Expand All @@ -29,11 +87,15 @@ jobs:
conda list
conda config --show-sources
conda config --show
conda env list
- name: Python info
shell: bash -l {0}
run: |
which python
python --version
- name: Conda list
shell: bash -l {0}
run: conda list
- name: Build the conda package
shell: bash -l {0}
run: |
Expand All @@ -44,3 +106,45 @@ jobs:
--channel bioconda --channel conda-forge \
--croot $BUILD_FOLDER \
./conda

- name: Create a test environment to test the package
uses: goanpeca/setup-miniconda@v1
with:
activate-environment: matchms-test
python-version: ${{ matrix.python-version }}
- name: Show conda config
shell: bash -l {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
conda env list
- name: Python info
shell: bash -l {0}
run: |
which python
python --version
- name: Conda list
shell: bash -l {0}
run: conda list
- name: Test local conda package on unix
if: matrix.os != 'windows-latest'
shell: bash -l {0}
run: |
export BUILD_FOLDER=/tmp/matchms/_build
conda install \
--channel bioconda \
--channel conda-forge \
--channel file://${BUILD_FOLDER}/noarch/ \
matchms
- name: Test local conda package on windows
if: matrix.os == 'windows-latest'
shell: bash -l {0}
run: |
export BUILD_FOLDER=%TEMP%\matchms\_build
conda install \
--channel bioconda \
--channel conda-forge \
--channel file:\\${BUILD_FOLDER}\noarch\ \
matchms
32 changes: 19 additions & 13 deletions .github/workflows/conda_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@ on:
jobs:

publish:
name: ${{ matrix.python-version }} / ${{ matrix.os }}
name: Publish-Python ${{ matrix.python-version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
os: ['ubuntu-latest']
python-version: ['3.7']
steps:
- uses: actions/checkout@v2
- uses: goanpeca/setup-miniconda@v1
with:
activate-environment: matchms-build
auto-activate-base: false
auto-update-conda: true
environment-file: conda/environment-build.yml
miniconda-version: 'latest'
python-version: ${{ matrix.python-version }}
- name: Show conda config
shell: bash -l {0}
Expand Down Expand Up @@ -51,13 +48,25 @@ jobs:
run: |
export BUILD_FOLDER=/tmp/matchms/_build
anaconda --token ${{ secrets.ANACONDA_TOKEN }} upload --user nlesc --force $BUILD_FOLDER/noarch/*.tar.bz2

testpublished:
name: Test Published-Python ${{ matrix.python-version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: publish
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
python-version: ['3.7']
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: goanpeca/setup-miniconda@v1
with:
activate-environment: matchms-test
auto-activate-base: false
auto-update-conda: true
activate-environment: matchms-dev
environment-file: conda/environment-dev.yml
channels: conda-forge,bioconda,nlesc
miniconda-version: 'latest'
python-version: ${{ matrix.python-version }}
- name: Show conda config
shell: bash -l {0}
Expand All @@ -69,10 +78,7 @@ jobs:
- name: Install the conda package from anaconda repository
shell: bash -l {0}
run: |
conda install conda build -c bioconda -c conda-forge -c nlesc matchms
- name: Install development dependencies
shell: bash -l {0}
run: python -m pip install -r conda/requirements-dev.txt
conda install -c bioconda -c conda-forge -c nlesc matchms
- name: Test the installed conda package
shell: bash -l {0}
run: |
Expand Down
35 changes: 29 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

- [diff](https://github.com/matchms/matchms/compare/0.3.1...HEAD) since 0.3.1

### Added

- ...
Expand All @@ -23,13 +21,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

- Moved ``spec2vec`` similarity related functionality from ``matchms`` to https://github.com/iomega/spec2vec

## [0.3.2] - 2020-05-20

- [All changes](https://github.com/matchms/matchms/compare/0.3.1...HEAD) since 0.3.1

### Changed

- improve conda workflow [#244](https://github.com/matchms/matchms/pull/244)
- merge anaconda and python build workflows
- fix conda package install command in build workflow
- publish only on ubuntu machine
- data folder is handled by setup.py but not meta.yml
- split workflows into two parts
- install conda package generated by the workflow
- test conda packages on windows and unix separately
- update workflow names
- use default settings for conda action

### Removed

- remove python build badge [#244](https://github.com/matchms/matchms/pull/244)
- Moved ``spec2vec`` similarity related functionality from ``matchms`` to [iomega/spec2vec](https://github.com/iomega/spec2vec)
- removed build step in build workflow
- removed conda build scripts: conda/build.sh and conda/bld.bat
- removed conda/condarc.yml
- removed conda_build_config.yaml

## [0.3.1] - 2020-05-19

### Added

- improve conda package https://github.com/matchms/matchms/pull/225
- improve conda package [#225](https://github.com/matchms/matchms/pull/225)
- Build scripts for Windows and Unix(MacOS and Linux) systems
- verify conda package after uploading to anaconda repository by installing it
- conda package also includes `matchms/data` folder
Expand All @@ -47,9 +70,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- skip builds for Python 2.X
- more flexible package versions
- add deployment requirements to meta.yml
- verify conda package https://github.com/matchms/matchms/pull/225
- verify conda package [#225](https://github.com/matchms/matchms/pull/225)
- use conda/environment.yml when building the package
- split anaconda workflow https://github.com/matchms/matchms/pull/225
- split anaconda workflow [#225](https://github.com/matchms/matchms/pull/225)
- conda build: tests conda packages on every push and pull request
- conda publish: publish and test conda package on release
- update the developer instructions
Expand Down
Loading