-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from khaeru/packaging2
Set up basic packaging
- Loading branch information
Showing
40 changed files
with
2,554 additions
and
1,451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: lint | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
# For setuptools-scm. With fetch --tags below, this ensures that | ||
# enough history is fetched to contain the latest tag, so that | ||
# setuptools-scm can generate the version number. Update: | ||
# - See https://github.com/khaeru/genno/releases, at "NN commits to | ||
# master since this release". The value should be at least equal to | ||
# NN + the number of commits on any PR branch. | ||
# - Reset to a lower value, e.g. 100, after a new release. | ||
depth: 100 | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
continue-on-error: true | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: ${{ env.depth }} | ||
|
||
- name: Fetch tags (for setuptools-scm) | ||
run: git fetch --tags --depth=${{ env.depth }} | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
# This should match the "Latest version testable on GitHub Actions" | ||
# in pytest.yml | ||
python-version: "3.8" | ||
|
||
- name: Cache Python packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cache/pip | ||
~/Library/Caches/pip | ||
~/appdata/local/pip/cache | ||
key: lint-${{ runner.os }} | ||
|
||
- name: Upgrade pip, wheel, setuptools-scm | ||
run: python -m pip install --upgrade pip wheel setuptools-scm | ||
|
||
- name: Check "black" code style | ||
run: | | ||
pip install black | ||
black --check . | ||
- name: Lint with flake8 & isort | ||
run: | | ||
pip install flake8 isort | ||
flake8 --count --max-complexity=26 --show-source --statistics | ||
isort --check-only . | ||
- name: Check typing with mypy | ||
run: | | ||
pip install mypy pytest xarray | ||
mypy . | ||
- name: Test package build | ||
run: | | ||
pip install twine wheel | ||
python3 setup.py bdist_wheel sdist | ||
twine check dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Python and packaging files | ||
*.egg-info | ||
__pycache__ | ||
build | ||
dist | ||
|
||
# pytest, pytest-benchmark, pytest-cov | ||
.benchmarks | ||
.coverage | ||
.pytest_cache | ||
htmlcov | ||
|
||
# mypy | ||
.mypy_cache | ||
|
||
# sphinx | ||
doc/_build |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Include ixmp test fixtures, e.g. pre-populated Scenario objects | ||
# TODO remove this dependency | ||
# NB genno must follow ixmp, since pytest prefers fixtures etc. from later in the list | ||
pytest_plugins = ["ixmp.testing", "genno.testing"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# This file only contains a selection of the most common options. For a full | ||
# list see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
|
||
# -- Project information --------------------------------------------------------------- | ||
|
||
project = "genno" | ||
copyright = "2021, Genno Contributors" | ||
author = "Genno Contributors" | ||
|
||
|
||
# -- General configuration ------------------------------------------------------------- | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be extensions coming | ||
# with Sphinx (named 'sphinx.ext.*') or your custom ones. | ||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.autosummary", | ||
"sphinx.ext.intersphinx", | ||
"sphinx.ext.napoleon", | ||
] | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ["_templates"] | ||
|
||
# List of patterns, relative to source directory, that match files and directories to | ||
# ignore when looking for source files. This pattern also affects html_static_path and | ||
# html_extra_path. | ||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] | ||
|
||
|
||
# -- Options for HTML output ----------------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for a list of | ||
# builtin themes. | ||
html_theme = "sphinx_rtd_theme" | ||
|
||
# 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 = ["_static"] | ||
|
||
# -- Options for sphinx.ext.intersphinx ------------------------------------------------ | ||
|
||
intersphinx_mapping = { | ||
"dask": ("https://docs.dask.org/en/stable/", None), | ||
"pint": ("https://pint.readthedocs.io/en/stable/", None), | ||
"python": ("https://docs.python.org/3/", None), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.