Skip to content

Commit

Permalink
added CI stuff modeled after diffsims
Browse files Browse the repository at this point in the history
  • Loading branch information
din14970 committed Feb 4, 2021
1 parent 70e1b62 commit 994e561
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 2 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: build

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build-and-test:
name: ${{ matrix.os }}/py${{ matrix.python-version }}/pip
runs-on: ${{ matrix.os }}
timeout-minutes: 60
env:
MPLBACKEND: agg
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display versions of Python and Pip
run: python -V; pip -V
- name: Setup conda
uses: s-weigans/setup-conda@v1
with:
update-conda:true
conda-channels: conda-forge
- name: Check conda version
run: conda --version
- name: Install depedencies and package
shell: bash
run: pip install -U -e .; conda install match-series
- name: Run tests
run: pytest --cov=pymatchseries --pyargs pymatchseries
- name: Generate line coverage
if: ${{ matrix.os == 'ubuntu-latest' }}
run: coverage report --show-missing
- name: Upload coverage to Coveralls
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true

coveralls-finish:
needs: build-with-pip
runs-on: ubuntu-latest
steps:
- name: Coveralls finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
18 changes: 16 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
from setuptools import setup, find_packages
from itertools import chain

with open("README.md") as f:
readme = f.read()


# Projects with optional features for building the documentation and running
# tests. From setuptools:
# https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies
extra_feature_requirements = {
"doc": ["sphinx >= 3.0.2", "sphinx-rtd-theme >= 0.4.3"],
"tests": ["pytest >= 5.4", "pytest-cov >= 2.8.1", "coverage >= 5.0"],
}
extra_feature_requirements["dev"] = ["black >= 19.3b0", "pre-commit >= 1.16"] + list(
chain(*list(extra_feature_requirements.values()))
)

setup(
name="pyMatchSeries",
version="0.0.1",
version="0.1.0",
description=("A python wrapper for the non-rigid-registration "
"code match-series"),
url='https://github.com/din14970/pyMatchSeries',
Expand All @@ -20,11 +33,12 @@
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8'],
keywords='TEM',
extras_require=extra_feature_requirements,
packages=find_packages(exclude=["*tests*", "*examples*"]),
package_data={'': ['pymatchseries/default_parameters.param']},
include_package_data=True,
install_requires=[
'hyperspy',
'hyperspy>=1.6.1',
'Pillow',
'tabulate',
],
Expand Down

0 comments on commit 994e561

Please sign in to comment.