diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml deleted file mode 100644 index 6ceb111..0000000 --- a/.github/workflows/CI.yaml +++ /dev/null @@ -1,70 +0,0 @@ -name: ci - -on: - push: - branches: [main] - pull_request: - -jobs: - tests: - runs-on: ubuntu-latest - timeout-minutes: 30 - strategy: - matrix: - python-version: ["3.11", "3.12", "3.13"] - name: Run tests - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install CodeEntropy and its testing dependencies - shell: bash - run: pip install -e .[testing] - - - name: Run test suite - shell: bash - run: pytest --cov CodeEntropy --cov-report term-missing --cov-append . - - - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v2.3.6 - with: - github-token: ${{ secrets.COVERALLS_REPO_TOKEN }} - - docs: - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: 3.12 - - name: Install python dependencies - run: | - pip install --upgrade pip - pip install -e .[docs] - - name: Build docs - run: cd docs && make - - pre-commit: - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.11 - uses: actions/setup-python@v5 - with: - python-version: 3.11 - - name: Install python dependencies - run: | - pip install --upgrade pip - pip install -e .[pre-commit,docs,testing] - - name: Run pre-commit - run: | - pre-commit install - pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) \ No newline at end of file diff --git a/.github/workflows/mdanalysis-compatibility-failure.md b/.github/workflows/mdanalysis-compatibility-failure.md new file mode 100644 index 0000000..87a0fd8 --- /dev/null +++ b/.github/workflows/mdanalysis-compatibility-failure.md @@ -0,0 +1,10 @@ +--- +title: CI Failure: MDAnalysis v{{ env.MDA_VERSION }} / Python {{ env.PYTHON_VERSION }} +labels: CI Failure, MDAnalysis Compatibility +--- + +### Automated MDAnalysis Compatibility Test Failure + +**MDAnalysis version**: `{{ env.MDA_VERSION }}` +**Python version**: `{{ env.PYTHON_VERSION }}` +**Workflow Run**: [Run #{{ env.RUN_NUMBER }}]({{ env.RUN_URL }}) diff --git a/.github/workflows/project-ci.yaml b/.github/workflows/project-ci.yaml new file mode 100644 index 0000000..566b1b7 --- /dev/null +++ b/.github/workflows/project-ci.yaml @@ -0,0 +1,115 @@ +name: CodeEntropy CI + +on: + push: + branches: [main] + pull_request: + schedule: + - cron: '0 8 * * 1' + +jobs: + tests: + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + matrix: + python-version: ["3.11", "3.12", "3.13"] + name: Run tests + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install CodeEntropy and its testing dependencies + run: pip install -e .[testing] + + - name: Run test suite + run: pytest --cov CodeEntropy --cov-report term-missing --cov-append . + + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@v2.3.6 + with: + github-token: ${{ secrets.COVERALLS_REPO_TOKEN }} + + docs: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Install python dependencies + run: | + pip install --upgrade pip + pip install -e .[docs] + - name: Build docs + run: cd docs && make + + pre-commit: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: 3.11 + - name: Install python dependencies + run: | + pip install --upgrade pip + pip install -e .[pre-commit,docs,testing] + - name: Run pre-commit + run: | + pre-commit install + pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) + + mdanalysis-compatibility: + if: github.event_name == 'schedule' + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + matrix: + python-version: ["3.11", "3.12", "3.13"] + mdanalysis-version: ["2.7.0", "2.8.0", "2.9.0", "latest"] + name: MDAnalysis Compatibility Tests + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies with MDAnalysis ${{ matrix.mdanalysis-version }} + run: | + pip install --upgrade pip + pip install -e .[testing] + if [ "${{ matrix.mdanalysis-version }}" = "latest" ]; then + pip install MDAnalysis + else + pip install "MDAnalysis==${{ matrix.mdanalysis-version }}" + fi + + - name: Run compatibility tests + run: pytest --cov CodeEntropy --cov-report=term-missing --cov-append + + - name: Create Issue on Failure + if: failure() + uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PYTHON_VERSION: ${{ matrix.python-version }} + MDA_VERSION: ${{ matrix.mdanalysis-version }} + RUN_NUMBER: ${{ github.run_number }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + with: + filename: .github/mdanalysis-compatibility-failure.md + update_existing: true + search_existing: open \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b30d0d6..e714acd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,10 +30,10 @@ classifiers = [ "Development Status :: 4 - Beta" ] keywords = ["entropy", "macromolecular systems", "MD simulation"] -requires-python = ">=3.8" +requires-python = ">=3.11" dependencies = [ "numpy==2.2.3", - "mdanalysis==2.8.0", + "mdanalysis>=2.7.0", "pandas==2.2.3", "psutil==5.9.5", "PyYAML==6.0.2", diff --git a/tests/test_CodeEntropy/test_run.py b/tests/test_CodeEntropy/test_run.py index 39865cc..4303d9e 100644 --- a/tests/test_CodeEntropy/test_run.py +++ b/tests/test_CodeEntropy/test_run.py @@ -136,9 +136,12 @@ def test_run_entropy_workflow(self): run_manager._config_manager.merge_configs.return_value = mock_args mock_entropy_manager = MagicMock() - with unittest.mock.patch( - "CodeEntropy.run.EntropyManager", return_value=mock_entropy_manager - ), unittest.mock.patch("CodeEntropy.run.mda.Universe") as mock_universe: + with ( + unittest.mock.patch( + "CodeEntropy.run.EntropyManager", return_value=mock_entropy_manager + ), + unittest.mock.patch("CodeEntropy.run.mda.Universe") as mock_universe, + ): run_manager.run_entropy_workflow()