diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index db383e6..7079784 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -12,41 +12,21 @@ on: # (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule) - cron: "0 0 * * 0" -concurrency: - # Specific group naming so CI is only cancelled - # within same PR or on merge to main - group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true + defaults: run: shell: bash -l {0} jobs: - environment-config: - runs-on: ubuntu-latest - outputs: - stable-python-version: ${{ steps.get-compatible-python.outputs.stable-python }} - python-matrix: ${{ steps.get-compatible-python.outputs.python-versions }} - steps: - - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - - id: get-compatible-python - uses: MDAnalysis/mdanalysis-compatible-python@main - with: - release: "latest" - main-tests: - if: "github.repository == 'lunamorrow/mda_openbabel_converter'" - needs: environment-config + if: "github.repository == 'MDAnalysis/mda-openbabel-converter'" runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [macOS-latest, ubuntu-latest, windows-latest] - python-version: ${{ fromJSON(needs.environment-config.outputs.python-matrix) }} + python-version: ["3.10", "3.11", "3.12"] mdanalysis-version: ["latest", "develop"] steps: @@ -61,12 +41,11 @@ jobs: # More info on options: https://github.com/conda-incubator/setup-miniconda - name: Install conda dependencies - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: python-version: ${{ matrix.python-version }} environment-file: devtools/conda-envs/test_env.yaml add-pip-as-python-dependency: true - architecture: x64 miniforge-variant: Mambaforge use-mamba: true @@ -85,11 +64,19 @@ jobs: install-tests: false installer: mamba shell: bash -l {0} - + + - name: Setup Conda Environment + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: devtools/conda-envs/test_env.yaml + environment-name: mda-ob + create-args: >- + python==${{ matrix.python-version }} + - name: Install package run: | python --version - python -m pip install . --no-deps + python -m pip install . --no-deps - name: Python information run: | @@ -103,29 +90,29 @@ jobs: - name: Run tests run: | - pytest -n 2 -v --cov=mda_openbabel_converter --cov-report=xml --color=yes mda_openbabel_converter/tests/ + pytest -n auto -v --cov=mda_openbabel_converter --cov-report=xml --color=yes mda_openbabel_converter/tests/ - name: codecov - if: github.repository == 'lunamorrow/mda_openbabel_converter' && github.event_name != 'schedule' + if: github.repository == 'MDAnalysis/mda_openbabel_converter' && github.event_name != 'schedule' uses: codecov/codecov-action@v3 with: + token: ${{ secrets.CODECOV_TOKEN }} file: coverage.xml name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} verbose: True pylint_check: - if: "github.repository == 'lunamorrow/mda_openbabel_converter'" - needs: environment-config + if: "github.repository == 'MDAnalysis/mda_openbabel_converter'" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: ${{ needs.environment-config.outputs.stable-python-version }} + python-version: "3.11" - name: Install Pylint run: | @@ -141,17 +128,16 @@ jobs: pypi_check: - if: "github.repository == 'lunamorrow/mda_openbabel_converter'" - needs: environment-config + if: "github.repository == 'MDAnalysis/mda-openbabel-converter'" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ needs.environment-config.outputs.stable-python-version }} - uses: actions/setup-python@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: ${{ needs.environment-config.outputs.stable-python-version }} + python-version: "3.11" - name: Install dependencies run: | diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml index dc4279b..37b6ccc 100644 --- a/devtools/conda-envs/test_env.yaml +++ b/devtools/conda-envs/test_env.yaml @@ -10,6 +10,9 @@ dependencies: # MDAnalysis - MDAnalysis + # OpenBabel + - openbabel + # Testing - pytest - pytest-cov diff --git a/mda_openbabel_converter/data/files.py b/mda_openbabel_converter/data/files.py index b1f0149..a9518b2 100644 --- a/mda_openbabel_converter/data/files.py +++ b/mda_openbabel_converter/data/files.py @@ -12,6 +12,5 @@ "MDANALYSIS_LOGO", # example file of MDAnalysis logo ] -from pkg_resources import resource_filename - -MDANALYSIS_LOGO = resource_filename(__name__, "mda.txt") +import importlib.resources +MDANALYSIS_LOGO = importlib.resources.files(__name__) / "mda.txt"