Skip to content

Commit

Permalink
Set up CI with Azure Pipelines (#17)
Browse files Browse the repository at this point in the history
* Set up CI with Azure Pipelines

[skip ci]

* update azure-pipelines (#18)

Co-authored-by: ethan <32364921+sangyx@users.noreply.github.com>
  • Loading branch information
hameerabbasi and sangyx committed May 27, 2020
1 parent 5c70b2d commit bfb8151
Show file tree
Hide file tree
Showing 15 changed files with 233 additions and 72 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ instance/

# Sphinx documentation
docs/_build/
_build/
_static
make.bat
Makefile
Expand Down
83 changes: 83 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
jobs:
- job: Tests
pool:
vmImage: 'ubuntu-16.04'

steps:
- script: |
echo "##vso[task.prependpath]$CONDA/bin"
conda env create -f .conda/environment.yml
displayName: Prepare conda
- script: |
source activate uarray
pip install git+https://github.com/Quansight-Labs/uarray.git
pip install git+https://github.com/Quansight-Labs/unumpy.git
pip install -e . --no-deps
displayName: Install package
- script: |
source activate uarray
pytest
displayName: Run tests
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/coverage.xml"

- job: TestsMinimalEnv
pool:
vmImage: 'ubuntu-16.04'

steps:
- script: |
echo "##vso[task.prependpath]$CONDA/bin"
conda env create -f .conda/environment_minimal.yml
displayName: Prepare conda
- script: |
source activate uarray_min
pip install git+https://github.com/Quansight-Labs/uarray.git
pip install git+https://github.com/Quansight-Labs/unumpy.git
pip install -e . --no-deps
displayName: Install package
- script: |
source activate uarray_min
pytest
displayName: Run tests
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/coverage.xml"

- job: Docs
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: |
echo "##vso[task.prependpath]$CONDA/bin"
conda env create -f .conda/environment.yml
displayName: Prepare conda
- script: |
source activate uarray
pip install git+https://github.com/Quansight-Labs/uarray.git
pip install git+https://github.com/Quansight-Labs/unumpy.git
pip install -e . --no-deps
displayName: Install package
- script: |
source activate uarray
sphinx-build -W -b html docs/ _build/html
displayName: Build docs
- script: |
source activate uarray
doc8
displayName: Lint docs
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'Documentation'
targetPath: '$(System.DefaultWorkingDirectory)/_build/html'

trigger:
branches:
include:
- master

pr:
- master
3 changes: 3 additions & 0 deletions doc8.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[doc8]
max-line-length=88
ignore-path=docs/generated,docs/_build,_build,*.egg-info
2 changes: 1 addition & 1 deletion docs/_templates/autosummary/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}
.. auto{{ objtype }}:: {{ objname }}
2 changes: 1 addition & 1 deletion docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
{{ name }}.{{ item }}
{% endfor %}
{% endif %}
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion docs/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
{{ function }}
{% endfor %}

{% endif %}
{% endif %}
39 changes: 20 additions & 19 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,26 @@
#
import os
import sys
# sys.path.insert(0, os.path.abspath('.'))

# sys.path.insert(0, os.path.abspath("."))
from typing import List, Dict

sys.path.insert(0, os.path.abspath("../src"))

# -- Project information -----------------------------------------------------

project = 'udiff'
copyright = '2020, Quansight-Labs'
author = 'Quansight-Labs'
project = "udiff"
copyright = "2020, Quansight-Labs"
author = "Quansight-Labs"

# The full version, including alpha/beta/rc tags
release = '0.6.0-alpha'
release = "0.6.0-alpha"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# extensions coming with Sphinx (named "sphinx.ext.*") or your custom
# ones.
extensions: List[str] = [
"sphinx.ext.autodoc",
Expand All @@ -42,12 +43,12 @@
]

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

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
# source_suffix = [".rst", ".md"]
source_suffix = ".rst"

# The master toctree document.
Expand All @@ -73,7 +74,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"
html_logo = "logo.png"
html_favicon = "logo.png"

Expand All @@ -91,18 +92,18 @@
# -- Options for LaTeX output ------------------------------------------------

latex_elements: Dict[str, str] = {
# The paper size ('letterpaper' or 'a4paper').
# The paper size ("letterpaper" or "a4paper").
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# "papersize": "letterpaper",
# The font size ("10pt", "11pt" or "12pt").
#
# 'pointsize': '10pt',
# "pointsize": "10pt",
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# "preamble": "",
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# "figure_align": "htbp",
}

# Grouping the document tree into LaTeX files. List of tuples
Expand Down Expand Up @@ -146,11 +147,11 @@
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''
# epub_identifier = ""

# A unique identification for the text.
#
# epub_uid = ''
# epub_uid = ""

# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]
Expand All @@ -163,9 +164,9 @@
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
"uarray": ("https://uarray.org/en/latest/", None),
"unumpy": ("https://unumpy.uarray.org/en/latest/", None)
"unumpy": ("https://unumpy.uarray.org/en/latest/", None),
}

doctest_global_setup = """
import udiff
"""
"""
2 changes: 1 addition & 1 deletion docs/generated/udiff.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
udiff
======

.. automodule:: udiff
.. automodule:: udiff
6 changes: 4 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ What's new in ``udiff``?
-------------------------

:obj:`udiff` is committed to providing a universal differentiation mechanism built on a
generic backend system. It's possible to get the differential of various calculations of different data types(scalar, tensor and matrix). In addition, it's possible to change the used backend via a context manager.
generic backend system. It's possible to get the differential of various
calculations of different data types(scalar, tensor and matrix). In addition, it's
possible to change the used backend via a context manager.

.. toctree::
:hidden:
Expand All @@ -32,4 +34,4 @@ Bug reports are gladly accepted at the `GitHub issue tracker`_.
GitHub also hosts the `code repository`_.

.. _GitHub issue tracker: https://github.com/Quansight-Labs/udiff/issues
.. _code repository: https://github.com/Quansight-Labs/udiff
.. _code repository: https://github.com/Quansight-Labs/udiff
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[pytest]
junit_family = xunit2
addopts = --doctest-modules --junitxml=junit/test-results.xml --cov-report=xml --cov-report=term --cov --cov-report html --cov . --cov-config .coveragerc
addopts = --black --doctest-modules --junitxml=junit/test-results.xml --cov-report=xml --cov-report=term --cov --cov-report html --cov . --cov-config .coveragerc
doctest_optionflags= IGNORE_EXCEPTION_DETAIL
18 changes: 4 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@
author_email="hameerabbasi@yahoo.com",
description="Automatic differentiation with uarray/unumpy.",
platforms="Posix; MacOS X; Windows",
packages=setuptools.find_packages(
where="src",
exclude=["tests*"]
),
package_dir={
"": "src"
},
packages=setuptools.find_packages(where="src", exclude=["tests*"]),
package_dir={"": "src"},
include_package_data=True,
install_requires=(
"uarray >= 0.6.0",
"unumpy >= 0.6.0"
),
install_requires=("uarray >= 0.6.0", "unumpy >= 0.6.0"),
classifiers=[
"Development Status :: 1 - Alpha",
"Natural Language :: English",
Expand All @@ -30,8 +22,6 @@
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
project_urls={
"Source": "https://github.com/Quansight-Labs/udiff",
},
project_urls={"Source": "https://github.com/Quansight-Labs/udiff",},
zip_safe=False,
)
Loading

0 comments on commit bfb8151

Please sign in to comment.