Skip to content

Commit

Permalink
Merge pull request #5 from MolSSI/improved_text
Browse files Browse the repository at this point in the history
Improved text output in support of SEAMM
  • Loading branch information
paulsaxe authored May 5, 2021
2 parents b545b3f + 4239903 commit cebf3f0
Show file tree
Hide file tree
Showing 8 changed files with 574 additions and 38 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: CI

on:
push:
branches:
- "master"
- "main"
pull_request:
branches:
- "master"
- "main"
schedule:
# Run by default Sunday morning at 3:30:
# 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: "30 3 * * 0"

jobs:
lint:
name: Lint ubuntu-latest Py3.8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Run linters
shell: bash -l {0}
run: |
flake8 reference_handler
yapf --diff --recursive reference_handler
test:
name: Test ${{ matrix.os }} Py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
needs: lint
strategy:
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: [3.7, 3.8]
steps:
- uses: actions/checkout@v1
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: Install package
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Run tests
shell: bash -l {0}
run: |
pytest -v --cov=reference_handler --cov-report=xml --color=yes reference_handler/tests/
- name: CodeCov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
162 changes: 162 additions & 0 deletions .github/workflows/Release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Release

on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# Existing codes likely still have "master" as the primary branch
# Both are tracked here to keep legacy and new codes working
release:
types: [published]
branches:
- "master"
- "main"

jobs:
lint:
name: Lint ${{ matrix.os }} Py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]

steps:
- uses: actions/checkout@v1

- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml

# channels: conda-forge,defaults

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

- name: Install package

# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Run linters

# conda setup requires this special shell
shell: bash -l {0}

run: |
flake8 reference_handler reference_handler/tests
yapf --diff --recursive reference_handler
test:
name: Test ${{ matrix.os }} Py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
needs: lint
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v1

- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true

- name: Install package

# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Run tests

# conda setup requires this special shell
shell: bash -l {0}

run: |
pytest -v --cov=reference_handler --cov-report=xml --color=yes reference_handler/tests/
- name: CodeCov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}

deploy:
name: PyPi ${{ matrix.os }} Py${{ matrix.python-version }}
# Run only for tagged releases.
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
runs-on: ${{ matrix.os }}
needs: [lint, test]
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]

steps:
- uses: actions/checkout@v1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ 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
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/
ls -l dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include LICENSE
include MANIFEST.in
include versioneer.py
include requirements*.txt

graft reference_handler
global-exclude *.py[cod] __pycache__ *.so
2 changes: 2 additions & 0 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ dependencies:

# Pip-only installs
- pip:
- bibtexparser

# Testing
- yapf

1 change: 1 addition & 0 deletions reference_handler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# Handle versioneer
from ._version import get_versions

versions = get_versions()
__version__ = versions['version']
__git_revision__ = versions['full-revisionid']
Expand Down
Loading

0 comments on commit cebf3f0

Please sign in to comment.