Skip to content

Commit

Permalink
ci: migrate to GH Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jan 28, 2021
1 parent 0c4476f commit 62a6cb3
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 142 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Checks

on:
push:
pull_request:
schedule:
- cron: "0 0 1 * *"

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.7', '3.8']
os: [macos-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
# prerequisites
python -m pip install --upgrade pip wheel
python -m pip install codecov coverage flake8 pytest
# install dependencies
pip install -e .[CLI]
# show installed packages
pip freeze
- name: Test with pytest
run: |
coverage run --source=nanite setup.py test
- name: Lint with flake8
run: |
flake8 .
- name: Submit code coverage
run: |
coverage report -m
codecov
33 changes: 33 additions & 0 deletions .github/workflows/deploy_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release to PyPI

on:
push:
tags:
- '*'

jobs:
deploy:

runs-on: macos-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install -e .
- name: Build and publish
env:
TWINE_USERNAME: ci_afm
TWINE_PASSWORD: ${{ secrets.PYPI_PWD }}
run: |
python setup.py sdist bdist_wheel
twine upload --skip-existing dist/*
65 changes: 0 additions & 65 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion .travis/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions .travis/linux_build_wheel.sh

This file was deleted.

2 changes: 0 additions & 2 deletions .travis/linux_setup_python.sh

This file was deleted.

3 changes: 0 additions & 3 deletions .travis/osx_build_wheel.sh

This file was deleted.

55 changes: 0 additions & 55 deletions .travis/osx_setup_python.sh

This file was deleted.

2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
1.7.1
- build: migrate to GitHub Actions
1.7.0
- enh: simplified writing new model functions by introducing default
modeling and residual wrappers
Expand Down
24 changes: 13 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.

# Get version number from nanite._version file
import matplotlib
import mock
import os.path as op
import sys
Expand All @@ -26,7 +27,6 @@
# include extensions
sys.path.append(op.abspath('extensions'))

import matplotlib
matplotlib.use("agg")

for mod in ["tkinter",
Expand Down Expand Up @@ -72,6 +72,9 @@
'github_changelog',
]

# specify bibtex files (required for sphinxcontrib.bibtex>=2.0)
bibtex_bibfiles = ['nanite.bib']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand All @@ -95,11 +98,11 @@
# built documents.
#
# The short X.Y version.
#
#
# The full version, including alpha/beta/rc tags.
# This gets 'version'
exec(open(op.join(pdir, "nanite/_version.py")).read())
release = version #@UndefinedVariable
release = version # noqa: F821
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
Expand Down Expand Up @@ -136,7 +139,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['data']
# html_static_path = ['data']


# -- Options for HTMLHelp output ------------------------------------------
Expand Down Expand Up @@ -196,12 +199,11 @@
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"python": ('https://docs.python.org/', None),
"numpy": ('http://docs.scipy.org/doc/numpy', None),
"scipy": ('https://docs.scipy.org/doc/scipy/reference/', None),
"sklearn": ('https://scikit-learn.org/stable/', None),
"afmformats": ('https://afmformats.readthedocs.io/en/stable', None),
intersphinx_mapping = {
"python": ('https://docs.python.org/', None),
"numpy": ('http://docs.scipy.org/doc/numpy', None),
"scipy": ('https://docs.scipy.org/doc/scipy/reference/', None),
"sklearn": ('https://scikit-learn.org/stable/', None),
"afmformats": ('https://afmformats.readthedocs.io/en/stable', None),
}
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ matplotlib
# Remove sphinx from requirements b/c it lead to issues
# on rtd and it's a dependency of the rtd theme anyway.
# sphinx>=1.6.4,<2
sphinxcontrib.bibtex
sphinx_rtd_theme
sphinxcontrib.bibtex>=2.0
sphinx_rtd_theme
2 changes: 1 addition & 1 deletion docs/sec_z_bib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Bilbliography
=============

.. bibliography:: nanite.bib
.. bibliography::

0 comments on commit 62a6cb3

Please sign in to comment.