Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New spec #8

Merged
merged 20 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
230 changes: 118 additions & 112 deletions .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: GH Actions CI
on:
'on':
push:
branches:
- main
Expand All @@ -10,7 +10,7 @@ on:
# Weekly tests at midnight on Sundays run on main by default:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "0 0 * * 0"
- cron: 0 0 * * 0

concurrency:
# Specific group naming so CI is only cancelled
Expand All @@ -20,7 +20,7 @@ concurrency:

defaults:
run:
shell: bash -l {0}
shell: bash -l {0}

jobs:
environment-config:
Expand All @@ -31,139 +31,145 @@ jobs:
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: '3.11'

- id: get-compatible-python
uses: MDAnalysis/mdanalysis-compatible-python@main
with:
release: "latest"
release: latest

main-tests:
if: "github.repository == 'Becksteinlab/zarrtraj'"
if: github.repository == 'Becksteinlab/zarrtraj'
needs: environment-config
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) }}
mdanalysis-version: ["latest", "develop"]
fail-fast: false
matrix:
os:
- macOS-latest
- ubuntu-latest
- windows-latest
python-version: ["3.10", "3.11", "3.12"]
mdanalysis-version:
- latest
- develop

steps:
- uses: actions/checkout@v4

- name: Build information
run: |
uname -a
df -h
ulimit -a


# More info on options: https://github.com/conda-incubator/setup-miniconda
- name: Install conda dependencies
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
add-pip-as-python-dependency: true
architecture: x64

channels: defaults

activate-environment: zarrtraj-test
auto-update-conda: true
auto-activate-base: false
show-channel-urls: true


- name: Install MDAnalysis version
uses: MDAnalysis/install-mdanalysis@main
with:
version: ${{ matrix.mdanalysis-version }}
install-tests: true
installer: conda
shell: bash -l {0}

- name: Install package
run: |
python --version
python -m pip install . --no-deps

- name: Python information
run: |
which python
which pip
pip list

conda info
conda list


- name: Run tests
run: |
pytest -n 2 -v --cov=zarrtraj --cov-report=xml --color=yes zarrtraj/tests/

- name: codecov
if: github.repository == 'Becksteinlab/zarrtraj' && github.event_name != 'schedule'
uses: codecov/[email protected]
with:
file: coverage.xml
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
verbose: True
token: ${{ secrets.CODECOV_TOKEN }}
slug: Becksteinlab/zarrtraj
- uses: actions/checkout@v4

- name: Build information
run: |
uname -a
df -h
ulimit -a

# More info on options: https://github.com/conda-incubator/setup-miniconda
- name: Install conda dependencies
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
add-pip-as-python-dependency: true
architecture: x64

channels: defaults

activate-environment: zarrtraj-test
auto-update-conda: true
auto-activate-base: false
show-channel-urls: true
# Need this to ensure miniconda installed
# if not already on MacOS
miniconda-version: latest

- name: Install MDAnalysis version
uses: MDAnalysis/install-mdanalysis@main
with:
version: ${{ matrix.mdanalysis-version }}
install-tests: true
installer: conda
shell: bash -l {0}

- name: Install package
run: |
python --version
python -m pip install . --no-deps

- name: Python information
run: |
which python
which pip
pip list
conda info
conda list

- name: Run tests
# Tests must be sequential to avoid
# moto buckets and groups interfering with
# one another
run: |
pytest -v --cov=zarrtraj --cov-report=xml --color=yes zarrtraj/tests/

- name: codecov
if: github.repository == 'Becksteinlab/zarrtraj' && github.event_name !=
'schedule'
uses: codecov/[email protected]
with:
file: coverage.xml
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
slug: Becksteinlab/zarrtraj

pylint_check:
if: "github.repository == 'Becksteinlab/zarrtraj'"
if: github.repository == 'Becksteinlab/zarrtraj'
needs: environment-config
runs-on: ubuntu-latest

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

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ needs.environment-config.outputs.stable-python-version }}

- name: Install Pylint
run: |
which pip
which python
pip install pylint mdanalysis
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ needs.environment-config.outputs.stable-python-version }}

- name: Run Pylint
env:
PYLINTRC: .pylintrc
run: |
pylint zarrtraj
- name: Install Pylint
run: |
which pip
which python
pip install pylint mdanalysis

- name: Run Pylint
env:
PYLINTRC: .pylintrc
run: |
pylint zarrtraj

pypi_check:
if: "github.repository == 'Becksteinlab/zarrtraj'"
if: github.repository == 'Becksteinlab/zarrtraj'
needs: environment-config
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
with:
python-version: ${{ needs.environment-config.outputs.stable-python-version }}

- name: Install dependencies
run: |
pip install pipx twine

- name: Build package
run: |
python -m pipx run build --sdist

- name: Check package build
run: |
DISTRIBUTION=$(ls -t1 dist/zarrtraj-*.tar.gz | head -n 1)
test -n "${DISTRIBUTION}" || { echo "no distribution dist/zarrtraj-*.tar.gz found"; exit 1; }
echo "twine check $DISTRIBUTION"
twine check $DISTRIBUTION
- uses: actions/checkout@v4

- name: Set up Python ${{ needs.environment-config.outputs.stable-python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ needs.environment-config.outputs.stable-python-version }}

- name: Install dependencies
run: |
pip install pipx twine

- name: Build package
run: |
python -m pipx run build --sdist

- name: Check package build
run: |
DISTRIBUTION=$(ls -t1 dist/zarrtraj-*.tar.gz | head -n 1)
test -n "${DISTRIBUTION}" || { echo "no distribution dist/zarrtraj-*.tar.gz found"; exit 1; }
echo "twine check $DISTRIBUTION"
twine check $DISTRIBUTION
1 change: 1 addition & 0 deletions benchmarks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading
Loading