diff --git a/.github/workflows/anaconda.yml b/.github/workflows/anaconda.yml deleted file mode 100644 index 107a11d..0000000 --- a/.github/workflows/anaconda.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Anaconda Build - -on: - push: - pull_request: - workflow_dispatch: - -jobs: - anaconda_build: - name: Anaconda build / python-3.8 / ubuntu-latest - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: "0" - - name: Create riassigner-build environment - uses: conda-incubator/setup-miniconda@v2 - with: - activate-environment: riassigner-build - auto-update-conda: true - environment-file: conda/environment-build.yml - python-version: 3.8 - - 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: Show environment variables - shell: bash -l {0} - run: | - env | sort - - name: Build the conda package - shell: bash -l {0} - run: | - export BUILDDIR=$RUNNER_TEMP/riassigner/_build - [ "$RUNNING_OS" = "Windows" ] && export BUILDDIR=$RUNNER_TEMP\\riassigner\\_build\\ - conda config --set anaconda_upload no - conda build --numpy 1.18.1 --no-include-recipe \ - --channel bioconda --channel conda-forge \ - --croot ${BUILDDIR} \ - ./conda - - name: Upload package artifact from build - uses: actions/upload-artifact@v2 - with: - name: conda-package-artifact - path: ${{ runner.temp }}/riassigner/_build diff --git a/.github/workflows/publish_pypi.yaml b/.github/workflows/publish_pypi.yaml index 4639740..4ceaa06 100644 --- a/.github/workflows/publish_pypi.yaml +++ b/.github/workflows/publish_pypi.yaml @@ -6,21 +6,11 @@ on: workflow_dispatch: jobs: - publish: + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.7' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - python setup.py sdist bdist_wheel - - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1.5 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + - uses: actions/checkout@v3 + - name: Build and publish to pypi + uses: JRubics/poetry-publish@v1.17 + with: + pypi_token: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml deleted file mode 100644 index ecd4cfa..0000000 --- a/.github/workflows/python-package-conda.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Python Package using Conda - -on: - push: - pull_request: - workflow_dispatch: - -jobs: - build-linux: - runs-on: ubuntu-latest - strategy: - max-parallel: 5 - - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Add conda to system path - run: | - # $CONDA is an environment variable pointing to the root of the miniconda directory - echo $CONDA/bin >> $GITHUB_PATH - - name: Install dependencies - run: | - conda env update --file conda/environment.yml --name base - - name: Lint with flake8 - run: | - conda install flake8 - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - conda install pytest pytest-cov - pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index c83a408..e0445fd 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: [3.7, 3.8, 3.9] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v2 @@ -25,8 +25,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 pytest - pip install --user -r requirements.txt + python -m pip install flake8 pytest poetry + poetry install --no-root - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -35,4 +35,4 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with coverage run: | - pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml + poetry run pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml diff --git a/README.md b/README.md index d4fcd81..061a0ee 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Hecht et al., (2022). RIAssigner: A package for gas chromatographic retention in ``` git clone https://github.com/RECETOX/RIAssigner.git cd RIAssigner -python -m pip install -e . +poetry install ``` (2) Install via [bioconda](https://anaconda.org/bioconda/riassigner) in your existing evironment. ``` @@ -115,3 +115,10 @@ classDiagram ### Testing All functionality is tested with the [pytest](https://docs.pytest.org/en/6.2.x/contents.html) framework. Make sure to run your IDE in the `riassigner-dev` conda environment (or make sure to use the respective python interpreter when developing) to follow formatting guidelines and to be able to execute the tests. + +For testing, install the package dependencies as follows: +``` +git clone https://github.com/RECETOX/RIAssigner.git +cd RIAssigner +poetry install --no-root +``` \ No newline at end of file diff --git a/conda/environment-build.yml b/conda/environment-build.yml deleted file mode 100644 index f9ec218..0000000 --- a/conda/environment-build.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: riassigner-build -channels: - - defaults -dependencies: - - anaconda-client - - conda-build - - conda-verify - - python >=3.7 \ No newline at end of file diff --git a/conda/environment-dev.yml b/conda/environment-dev.yml deleted file mode 100644 index f6b90ab..0000000 --- a/conda/environment-dev.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: riassigner-dev -channels: - - bioconda - - conda-forge - - defaults -dependencies: - - autopep8 - - numpy - - matchms >=0.14.0,<0.18.0 - - pint >=0.17,<0.20 - - pip - - pandas - - prospector - - pytest - - pytest-cov - - python >=3.7 - - rope - - scipy - - build - - twine - - pip: - - -e ..[dev] diff --git a/conda/environment.yml b/conda/environment.yml deleted file mode 100644 index 3c041d4..0000000 --- a/conda/environment.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: riassigner -channels: - - bioconda - - conda-forge - - defaults -dependencies: - - numpy - - matchms >=0.14.0,<0.18.0 - - pandas - - pint >=0.17,<0.20 - - python >=3.7 - - scipy diff --git a/conda/meta.yaml b/conda/meta.yaml deleted file mode 100644 index 08bd280..0000000 --- a/conda/meta.yaml +++ /dev/null @@ -1,58 +0,0 @@ -{% set name = "riassigner" %} -{% set data = load_setup_py_data() %} - -package: - name: riassigner - version: {{ data.get('version') }} - -source: - path: .. - -extra: - channels: - - conda-forge - - bioconda - -build: - noarch: python - preserve_egg_dir: True - number: 0 - script: {{ PYTHON }} -m pip install --no-deps --ignore-installed . -vv - -requirements: - build: - - conda-build - - conda-verify - - pytest-runner - - python - - setuptools - host: - - python >=3.7 - - pip - - pytest-runner - - setuptools - run: - - numpy - - matchms >=0.14.0 - - pint >=0.17 - - pip - - pandas - - python >=3.7,<3.9 - - scipy - -test: - imports: - - RIAssigner - -about: - home: https://github.com/RECETOX/RIAssigner - license: MIT - license_file: LICENSE - summary: 'GC-MS retention index calculation' - description: | - RIAssigner is a python tool for retention index (RI) computation for GC-MS data - dev_url: https://github.com/RECETOX/RIAssigner - -extra: - recipe-maintainers: - - hechth diff --git a/poetry.toml b/poetry.toml new file mode 100644 index 0000000..1bd6a1f --- /dev/null +++ b/poetry.toml @@ -0,0 +1,3 @@ +[virtualenvs] +create = false +prefer-active-python = true \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..bbc5aea --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,47 @@ +[tool.poetry] +name = "RIAssigner" +version = '0.3.3' +description = "Python library for retention index calculation." +authors = ["Helge Hecht ", "Maksym Skoryk "] + +license = "MIT License" +readme = "README.md" +repository = "https://github.com/RECETOX/RIAssigner" +keywords=[ + "gas chromatography", + "mass spectrometry", + "retention index" +] +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8" +] + +packages = [ + { include = "RIAssigner" }, +] + +[tool.poetry.dependencies] +python = "^3.8" +matchms = "^0.14.0, <0.18.0" +numpy = "*" +pandas = "*" +pint = "^0.17, <0.20" +scipy = "*" + +[tool.poetry.group.dev.dependencies] +pytest = "*" +pytest-cov = "*" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + +[tool.poetry_bumpversion.file."RIAssigner/__version__.py"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 5ff0f33..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ --e . --e .[test] \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 94c1633..0000000 --- a/setup.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -import os -from setuptools import find_packages -from setuptools import setup - - -here = os.path.abspath(os.path.dirname(__file__)) - -version = {} -with open(os.path.join(here, "RIAssigner", "__version__.py")) as f: - exec(f.read(), version) - -with open("README.md") as readme_file: - readme = readme_file.read() - -setup( - name="RIAssigner", - version=version["__version__"], - description="Python library for retention index calculation.", - long_description=readme, - long_description_content_type="text/markdown", - author="Helge Hecht, Maksym Skoryk", - author_email="helge.hecht@recetox.muni.cz, maksym.skoryk@recetox.muni.cz", - - maintainer="RECETOX", - maintainer_email="GalaxyToolsDevelopmentandDeployment@space.muni.cz", - url="https://github.com/RECETOX/RIAssigner", - packages=find_packages(exclude=['*tests*']), - license="MIT License", - zip_safe=False, - keywords=[ - "gas chromatography", - "mass spectrometry", - "retention index" - ], - classifiers=[ - "Development Status :: 2 - Pre-Alpha", - "Intended Audience :: Education", - "Intended Audience :: Science/Research", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8" - ], - test_suite="tests", - python_requires='>=3.7', - install_requires=[ - "matchms>=0.14.0,<0.18.0", - "numpy", - "pandas", - "pint>=0.17,<0.20", - "scipy" - ], - extras_require={ - 'test': [ - 'pytest', - 'pytest-cov' - ] - }, -)