Skip to content

Commit

Permalink
Merge pull request #2 from sef43/cookiecutter
Browse files Browse the repository at this point in the history
Switch to cookiecutter template
  • Loading branch information
sef43 authored May 24, 2023
2 parents 99071de + e826f76 commit 842c65e
Show file tree
Hide file tree
Showing 45 changed files with 4,220 additions and 119 deletions.
16 changes: 16 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Codecov configuration to make it a bit less noisy
coverage:
status:
patch: false
project:
default:
threshold: 50%
comment:
layout: "header"
require_changes: false
branches: null
behavior: default
flags: null
paths: null
ignore:
- "openmm-mdanalysis-reporter/_version.py"
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
openmm-mdanalysis-reporter/_version.py export-subst
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve

---

## Expected behavior ##

<!-- A clear and concise description of what you want to do and what you think should happen. (Code to reproduce the behavior can be added below). -->


## Actual behavior ##

<!-- What happened instead. Add as much detail as you can. Include (copy and paste) stack traces and any output. -->


## Code to reproduce the behavior ##

<!-- Show us how to reproduce the failure. If you can, use trajectory files from the test data. Use the code snipped below as a starting point. -->

``` python
import openmm-mdanalysis-reporter

...

```

## Current environment ##

- Which version are you using? (run `python -c "import openmm-mdanalysis-reporter; print(openmm-mdanalysis-reporter.__version__)"`)
- Which version of Python (`python -V`)?
- Which operating system?
- What is the output of `pip list`?
- If you use conda, what is the output of `conda list`?
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project

---

## Is your feature request related to a problem? ##
<!-- A clear and concise description of what the problem is. For example, I'm always frustrated when [...] -->


## Describe the solution you'd like ##
<!-- A description of what you want to happen. For example, I'd like to be able to do [...] -->


## Describe alternatives you've considered ##
<!-- A description of any alternative solutions or features you've considered or possible solutions that you've seen elsewhere. -->


## Additional context ##
<!-- Add any other context or screenshots about the feature request here. -->
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

<!-- Does this PR fix an issue or relate to an existing discussion? Please link it below after "Fixes #" -->

Fixes #

Changes made in this Pull Request:
<!-- Summarise changes made with dot points below -->
-
-


PR Checklist
------------
- [ ] Tests?
- [ ] Docs?
- [ ] CHANGELOG updated?
- [ ] Issue raised/referenced?
61 changes: 0 additions & 61 deletions .github/workflows/CI.yml

This file was deleted.

167 changes: 167 additions & 0 deletions .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
name: GH Actions CI
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# 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"

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

main-tests:
if: "github.repository == 'sef43/openmm-mdanalysis-reporter'"
needs: environment-config
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: ${{ fromJSON(needs.environment-config.outputs.python-matrix) }}
mdanalysis-version: ["latest", "develop"]

steps:
- uses: actions/checkout@v3

- 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

miniforge-variant: Mambaforge
use-mamba: true
channels: conda-forge, defaults

activate-environment: openmm-mdanalysis-reporter-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: false
installer: mamba
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=mdareporter --cov-report=xml --color=yes mdareporter/tests/
- name: codecov
if: github.repository == 'sef43/openmm-mdanalysis-reporter' && github.event_name != 'schedule'
uses: codecov/codecov-action@v3
with:
file: coverage.xml
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
verbose: True


pylint_check:
if: "github.repository == 'sef43/openmm-mdanalysis-reporter'"
needs: environment-config
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- 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: Run Pylint
env:
PYLINTRC: .pylintrc
run: |
pylint openmm-mdanalysis-reporter
# pypi_check:
# if: "github.repository == 'sef43/openmm-mdanalysis-reporter'"
# needs: environment-config
# runs-on: ubuntu-latest

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

# - 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 setuptools cython numpy twine

# - name: Build package
# run: |
# python setup.py sdist

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

0 comments on commit 842c65e

Please sign in to comment.