Skip to content

Commit

Permalink
FIx CI (#112)
Browse files Browse the repository at this point in the history
* FIx CI

* Fixes codecov failing cron CI because of being called too many times
* Adds 3.11 CI
* Adds 3.12 to upstream CI

* Update and rename readthedocs.yml to .readthedocs.yml

* switch to importlib

* Drop py3.8, add py3.12

* fix CI

* remove as_posix calls

* fix relative path issues

* pin to <7 sphinx

* try fixing rtd

* fix path

* add sphinx theme to req

* upgrade mambaforge

* fix header

* missing init file?

* switch to micromamba action

---------

Co-authored-by: Lily Wang <[email protected]>
  • Loading branch information
IAlibay and lilyminium authored Dec 19, 2023
1 parent 0cf4856 commit 5d2de99
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 46 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ jobs:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: [3.8, 3.9, "3.10"]
python-version: ["3.9", "3.10", "3.11"]
env_file: [env, ]
include:
- name: minimum_requirements
os: ubuntu-latest
python-version: 3.8
python-version: 3.9
env_file: min

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Additional info about the build
shell: bash
Expand All @@ -44,22 +44,21 @@ jobs:
# More info on options: https://github.com/conda-incubator/setup-miniconda
# An environment for the minimum versions
- uses: conda-incubator/setup-miniconda@v2
- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_${{ matrix.env_file }}.yaml
channels: conda-forge, defaults
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true

environment-name: test
create-args: >-
python=${{ matrix.python-version }}
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
pip list
micromamba list
- name: Run tests
# conda setup requires this special shell
Expand All @@ -68,7 +67,9 @@ jobs:
pytest -v --cov=membrane_curvature --cov-report=xml --color=yes membrane_curvature/tests/
- name: CodeCov
uses: codecov/codecov-action@v2
if: ${{ github.repository == 'MDAnalysis/membrane-curvature'
&& github.event_name == 'pull_request' }}
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
Expand All @@ -80,10 +81,10 @@ jobs:
strategy:
fail-fast: false
matrix:
latest-python : ["3.10", "3.11"]
latest-python : ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.latest-python }}
Expand Down
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# readthedocs.yml

version: 2

sphinx:
configuration: docs/conf.py

build:
os: ubuntu-22.04
tools:
python: "mambaforge-22.9"

python:
install:
- method: setuptools
path: .

conda:
environment: docs/requirements.yaml
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.

# Incase the project was not installed
import membrane_curvature
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
Expand Down
3 changes: 2 additions & 1 deletion docs/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ dependencies:
- MDAnalysis
- ipython
- MDAnalysisTests
- sphinx_rtd_theme
# Pip-only installs
- pip:
- nbsphinx
- ipywidgets
- nglview
- nglview
1 change: 1 addition & 0 deletions membrane_curvature/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

26 changes: 14 additions & 12 deletions membrane_curvature/tests/datafiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,24 @@
"GRO_MEMBPROT_FIT" # Gromacs coordinates to load trajectory with fit
]

from pkg_resources import resource_filename
from importlib import resources

_data_ref = resources.files('membrane_curvature.data')

# Membrane protein systems
GRO_MEMBRANE_PROTEIN = resource_filename(__name__, '../data/test_curvature_abca1.gro')
XTC_MEMBRANE_PROTEIN = resource_filename(__name__, '../data/test_curvature_abca1.xtc')
GRO_MEMBRANE_PROTEIN = (_data_ref / 'test_curvature_abca1.gro')
XTC_MEMBRANE_PROTEIN = (_data_ref / 'test_curvature_abca1.xtc')
# PO4 beads only
GRO_PO4 = resource_filename(__name__, '../data/test_curvature_po4_only.gro')
XTC_PO4 = resource_filename(__name__, '../data/test_curvature_po4_only.xtc')
GRO_PO4 = (_data_ref / 'test_curvature_po4_only.gro')
XTC_PO4 = (_data_ref / 'test_curvature_po4_only.xtc')
# big systems
GRO_PO4_SMALL = resource_filename(__name__, '../data/test_po4_small.gro')
XTC_PO4_SMALL = resource_filename(__name__, '../data/test_po4_small.xtc')
GRO_PO4_SMALL = (_data_ref / 'test_po4_small.gro')
XTC_PO4_SMALL = (_data_ref / 'test_po4_small.xtc')
# membrane-only
MEMB_GRO = resource_filename(__name__, '../data/MEMB_traj_short.gro')
MEMB_XTC = resource_filename(__name__, '../data/MEMB_traj_short.xtc')
MEMB_GRO = (_data_ref / 'MEMB_traj_short.gro')
MEMB_XTC = (_data_ref / 'MEMB_traj_short.xtc')
# membrane-protein
GRO_MEMBPROT_FIT = resource_filename(__name__, '../data/Membrane_protein_fit.gro')
XTC_MEMBPROT_FIT = resource_filename(__name__, '../data/Membrane_protein_fit.xtc')
GRO_MEMBPROT_FIT = (_data_ref / 'Membrane_protein_fit.gro')
XTC_MEMBPROT_FIT = (_data_ref / 'Membrane_protein_fit.xtc')

del resource_filename
del resources
15 changes: 0 additions & 15 deletions readthedocs.yml

This file was deleted.

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
# 'Mac OS-X',
# 'Unix',
# 'Windows'], # Valid platforms your code works on, adjust to your flavor
python_requires=">=3.8", # Python version restrictions
python_requires=">=3.9", # Python version restrictions
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
Expand All @@ -70,10 +70,10 @@
'Operating System :: POSIX',
'Topic :: Scientific/Engineering ',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
]
# Manual control if final package is compressible or not, set False to prevent the .egg from being made
# zip_safe=False,
Expand Down

0 comments on commit 5d2de99

Please sign in to comment.