From 8ac684e72e55d0c60ac4c985604372328f61b64b Mon Sep 17 00:00:00 2001 From: Michael Boyle Date: Mon, 24 Aug 2020 16:15:14 -0400 Subject: [PATCH 01/10] Closer to compatibility with pypy3 --- .github/workflows/build.yml | 32 ++++++++++++++++---------------- pyproject.toml | 8 ++++---- quaternionic/__init__.py | 2 +- quaternionic/algebra.py | 2 +- quaternionic/arrays.py | 2 +- quaternionic/distance.py | 3 +-- quaternionic/utilities.py | 23 +++++++++++++++++++++-- tests/test_array.py | 2 +- tests/test_utilities.py | 3 ++- 9 files changed, 48 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea2dc93..b8842e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,14 +4,17 @@ on: [push, pull_request] jobs: build: - name: Build and test on ${{ matrix.os }} + name: ${{ matrix.os }} python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.6, 3.7, 3.8] + python-version: [3.6, 3.7, 3.8, pypy3] + # exclude: + # - os: windows-latest + # python-version: pypy3 steps: - name: Check out code @@ -23,22 +26,21 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install poetry - shell: bash -l {0} run: | python -m pip install --upgrade pip - #pip install poetry # Only install poetry like this in containers - pip install --no-warn-script-location --user --pre poetry -U # Temporary: https://github.com/python-poetry/poetry/issues/2711 + #python -m pip install poetry # Only install poetry like this in containers + python -m pip install --no-warn-script-location --user --pre poetry -U # Temporary: https://github.com/python-poetry/poetry/issues/2711 - name: Run poetry - shell: bash -l {0} run: | + rm poetry.lock python -m poetry build python -m poetry install python -m poetry run pytest --cov --cov-branch --cov-report=xml - name: Upload coverage if: "matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest'" - shell: bash -l {0} + shell: bash run: | bash <(curl -s https://codecov.io/bash) @@ -59,17 +61,16 @@ jobs: python-version: 3.8 - name: Install poetry and this package - shell: bash -l {0} run: | python -m pip install --upgrade pip - pip install toml - #pip install poetry # Only install poetry like this in containers - pip install --no-warn-script-location --user --pre poetry -U # Temporary: https://github.com/python-poetry/poetry/issues/2711 + python -m pip install toml + #python -m pip install poetry # Only install poetry like this in containers + python -m pip install --no-warn-script-location --user --pre poetry -U # Temporary: https://github.com/python-poetry/poetry/issues/2711 python -m poetry build python -m poetry install - name: Bump version - shell: bash -l {0} + shell: bash run: | export version_bump_rule=$(echo ${{ github.event.head_commit.message }} | python .github/scripts/parse_bump_rule.py ) echo "version_bump_rule: '${version_bump_rule}'" @@ -79,7 +80,7 @@ jobs: echo "::set-env name=new_version_tag::v${new_version}" # Save env variable for later steps - name: Tag and push new version - shell: bash -l {0} + shell: bash run: | git config user.name github-actions git config user.email github-actions@github.com @@ -103,10 +104,9 @@ jobs: - name: Publish to PyPI if: "!contains(github.event.head_commit.message, '[no pypi]')" - shell: bash -l {0} env: - # Get key from https://pypi.org/manage/account/token/, and - # copy it to Github > repo > Settings > Secrets + # 1) Get key from https://pypi.org/manage/account/token/ + # 2) Copy it to Github > repo > Settings > Secrets POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} run: | python -m poetry build diff --git a/pyproject.toml b/pyproject.toml index a936758..04111fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,10 +9,10 @@ homepage = "https://github.com/moble/quaternionic" [tool.poetry.dependencies] python = "^3.6" +importlib-metadata = {version = "^1.0", python = "<3.8"} numpy = "^1.13" scipy = "^1.0" -numba = "^0.50" -importlib-metadata = {version = "^1.0", python = "<3.8"} +numba = {version = "^0.50", markers = "implementation_name == 'cpython'"} mkdocs = {version = "^1.1.2", optional = true} mktheapidocs = {extras = ["plugin"], version = "^0.2.0", optional = true} @@ -38,5 +38,5 @@ junit_family="xunit2" addopts = "-v --tb=short --doctest-glob='' --cov --cov-branch --cov-report xml" [build-system] -requires = ["poetry>=1.0.10"] -build-backend = "poetry.masonry.api" +requires = ["poetry-core>=1.0.10"] +build-backend = "poetry.core.masonry.api" diff --git a/quaternionic/__init__.py b/quaternionic/__init__.py index ec502d9..9c1a9bd 100644 --- a/quaternionic/__init__.py +++ b/quaternionic/__init__.py @@ -9,7 +9,7 @@ __version__ = importlib_metadata.version(__name__) -from .utilities import jit, guvectorize +from .utilities import jit, guvectorize, float64, boolean from . import algebra, properties, converters, distance, utilities algebra_ufuncs = type('AlgebraUfuncs', (object,), dict())() diff --git a/quaternionic/algebra.py b/quaternionic/algebra.py index 183ebfc..32114bf 100644 --- a/quaternionic/algebra.py +++ b/quaternionic/algebra.py @@ -36,7 +36,7 @@ import numpy as np -from numba import float64, boolean +from . import float64, boolean from .utilities import attach_typelist_and_signature diff --git a/quaternionic/arrays.py b/quaternionic/arrays.py index 63b762f..8789e02 100644 --- a/quaternionic/arrays.py +++ b/quaternionic/arrays.py @@ -114,7 +114,7 @@ def __array_ufunc__(self, ufunc, method, *args, **kwargs): raise NotImplementedError(f"Unrecognized arguments to {type(self).__name__}.__array_ufunc__: {kwargs}") if method in ["reduce", "accumulate", "reduceat", "outer", "at"]: - raise NotImplementedError(f"Only __call__ method works for quaternionic arrays") + raise NotImplementedError(f"Only __call__ method works for quaternionic arrays; got {method}") this_type = lambda o: isinstance(o, type(self)) diff --git a/quaternionic/distance.py b/quaternionic/distance.py index 1ce232b..e72ec61 100644 --- a/quaternionic/distance.py +++ b/quaternionic/distance.py @@ -3,8 +3,7 @@ # import numpy as np -from numba import float64 -from . import jit, guvectorize, algebra +from . import jit, guvectorize, algebra, float64 from .utilities import ndarray_args _divide = jit(algebra.divide) diff --git a/quaternionic/utilities.py b/quaternionic/utilities.py index 17f4ee1..e3264f0 100644 --- a/quaternionic/utilities.py +++ b/quaternionic/utilities.py @@ -2,8 +2,8 @@ # See LICENSE file for details: # +import sys import functools -import numba ufunc_attributes = [ 'nin', 'nout', 'nargs', 'ntypes', 'types', 'identity', 'signature', @@ -133,7 +133,6 @@ def pyguvectorize(types, signature): """ import functools import numpy as np - import numba as nb inputs, output = signature.split('->') inputs = inputs.split(',') slice_a = slice(None) if inputs[0]=='()' else 0 @@ -196,3 +195,23 @@ def pyguvectorize_module_functions(module, obj): if isinstance(v, types.FunctionType) and hasattr(v, 'types') and hasattr(v, 'signature'): v_ufunc = pyguvectorize(v.types, v.signature)(v) setattr(obj, k, v_ufunc) + + +if sys.implementation.name.lower() == 'pypy': # pragma: no branch + class _FakeNumbaType(object): + def __init__(self, name): + self.name = name + @property + def dtype(self): + return self + def __getitem__(self, *args, **kwargs): + return self + float64 = _FakeNumbaType('float64') + boolean = _FakeNumbaType('boolean') + jit = lambda f: f + guvectorize = pyguvectorize +else: + import numba + from numba import float64, boolean + jit = functools.partial(numba.njit, cache=True) + guvectorize = functools.partial(numba.guvectorize, nopython=True, cache=True) diff --git a/tests/test_array.py b/tests/test_array.py index 6d90adf..6c96d32 100644 --- a/tests/test_array.py +++ b/tests/test_array.py @@ -362,7 +362,7 @@ def test_quaternion_sqrt(Qs, Q_names, Q_conditions, array): assert np.allclose(np.sqrt(srq) * np.sqrt(srq), srq, rtol=sqrt_precision) # Test a huge batch of random quaternions np.random.seed(1234) - a = array(np.random.uniform(-10, 10, size=10_000*4).reshape((-1, 4))) + a = array(np.random.uniform(-10, 10, size=10000*4).reshape((-1, 4))) assert np.allclose(a, np.square(np.sqrt(a)), rtol=10*sqrt_precision, atol=0) # Test some edge cases _quaternion_resolution = 10 * np.finfo(float).resolution diff --git a/tests/test_utilities.py b/tests/test_utilities.py index 2ee12e3..1c37dd9 100644 --- a/tests/test_utilities.py +++ b/tests/test_utilities.py @@ -1,4 +1,4 @@ -import functools +import sys import numpy as np import quaternionic import pytest @@ -66,6 +66,7 @@ def f1(a, b, c): assert isinstance(d3, np.ndarray) and isinstance(d3, quaternionic.array) +@pytest.mark.skipif(sys.implementation.name.lower() == 'pypy', reason="No numba on pypy") def test_types_to_ftylist(): import numba types_to_ftylist = quaternionic.utilities.convert_numpy_ufunc_type_to_numba_ftylist From bee7c4ed610c1a3434fc217692fa74ab163d3643 Mon Sep 17 00:00:00 2001 From: Michael Boyle Date: Mon, 24 Aug 2020 16:43:52 -0400 Subject: [PATCH 02/10] Update poetry.lock --- poetry.lock | 88 ++++++++++++++++++++++------------------------------- 1 file changed, 37 insertions(+), 51 deletions(-) diff --git a/poetry.lock b/poetry.lock index 658fd30..f44ce32 100644 --- a/poetry.lock +++ b/poetry.lock @@ -17,7 +17,6 @@ version = "1.4.4" [[package]] category = "dev" description = "Atomic file writes." -marker = "sys_platform == \"win32\"" name = "atomicwrites" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -29,13 +28,12 @@ description = "Classes Without Boilerplate" name = "attrs" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "19.3.0" +version = "20.1.0" [package.extras] -azure-pipelines = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "pytest-azurepipelines"] -dev = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "sphinx", "pre-commit"] -docs = ["sphinx", "zope.interface"] -tests = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] +dev = ["coverage (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "sphinx", "sphinx-rtd-theme", "pre-commit"] +docs = ["sphinx", "sphinx-rtd-theme", "zope.interface"] +tests = ["coverage (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] [[package]] category = "main" @@ -95,7 +93,6 @@ version = "7.1.2" [[package]] category = "main" description = "Cross-platform colored terminal text." -marker = "sys_platform == \"win32\"" name = "colorama" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" @@ -147,7 +144,6 @@ version = "1.2.0" [[package]] category = "main" description = "Read metadata from Python packages" -marker = "python_version < \"3.8\"" name = "importlib-metadata" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" @@ -185,7 +181,6 @@ i18n = ["Babel (>=0.8)"] [[package]] category = "main" description = "Lightweight pipelining: using Python functions as pipeline jobs." -marker = "python_version > \"2.7\"" name = "joblib" optional = false python-versions = ">=3.6" @@ -197,14 +192,11 @@ description = "Python LiveReload is an awesome tool for web developers" name = "livereload" optional = false python-versions = "*" -version = "2.6.2" +version = "2.6.3" [package.dependencies] six = "*" - -[package.dependencies.tornado] -python = ">=2.8" -version = "*" +tornado = {version = "*", markers = "python_version > \"2.7\""} [[package]] category = "main" @@ -212,7 +204,7 @@ description = "lightweight wrapper around basic LLVM functionality" name = "llvmlite" optional = false python-versions = ">=3.6" -version = "0.33.0" +version = "0.34.0rc1" [[package]] category = "main" @@ -225,11 +217,7 @@ version = "0.5.8" [package.dependencies] future = ">=0.16.0" six = ">=1.11.0" - -[package.dependencies.nltk] -optional = true -python = ">=2.8" -version = ">=3.2.5" +nltk = {version = ">=3.2.5", optional = true, markers = "python_version > \"2.7\" and extra == \"languages\""} [package.extras] languages = ["nltk (>=3.2.5,<3.5)", "nltk (>=3.2.5)"] @@ -243,9 +231,7 @@ python-versions = ">=3.5" version = "3.2.2" [package.dependencies] -[package.dependencies.importlib-metadata] -python = "<3.8" -version = "*" +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [package.extras] testing = ["coverage", "pyyaml"] @@ -273,10 +259,7 @@ PyYAML = ">=3.10" click = ">=3.3" livereload = ">=2.5.1" tornado = ">=5.0" - -[package.dependencies.lunr] -extras = ["languages"] -version = "0.5.8" +lunr = {version = "0.5.8", extras = ["languages"]} [[package]] category = "main" @@ -290,10 +273,7 @@ version = "0.2.0.post0.dev8" black = "*" click = "*" numpydoc = "*" - -[package.dependencies.mkdocs] -optional = true -version = ">=1.1" +mkdocs = {version = ">=1.1", optional = true, markers = "extra == \"plugin\""} [package.extras] plugin = ["mkdocs (>=1.1)"] @@ -309,7 +289,6 @@ version = "8.4.0" [[package]] category = "main" description = "Natural Language Toolkit" -marker = "python_version > \"2.7\"" name = "nltk" optional = false python-versions = "*" @@ -340,7 +319,6 @@ version = "0.50.1" [package.dependencies] llvmlite = ">=0.33.0.dev0,<0.34" numpy = ">=1.15" -setuptools = "*" [[package]] category = "main" @@ -394,9 +372,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" version = "0.13.1" [package.dependencies] -[package.dependencies.importlib-metadata] -python = "<3.8" -version = ">=0.12" +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} [package.extras] dev = ["pre-commit", "tox"] @@ -434,19 +410,16 @@ python-versions = ">=3.5" version = "6.0.1" [package.dependencies] -atomicwrites = ">=1.0" attrs = ">=17.4.0" -colorama = "*" iniconfig = "*" more-itertools = ">=4.0.0" packaging = "*" pluggy = ">=0.12,<1.0" py = ">=1.8.2" toml = "*" - -[package.dependencies.importlib-metadata] -python = "<3.8" -version = ">=0.12" +atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} +colorama = {version = "*", markers = "sys_platform == \"win32\""} +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} [package.extras] checkqa_mypy = ["mypy (0.780)"] @@ -467,6 +440,17 @@ pytest = ">=4.6" [package.extras] testing = ["fields", "hunter", "process-tests (2.0.2)", "six", "pytest-xdist", "virtualenv"] +[[package]] +category = "main" +description = "Math extension for Python-Markdown" +name = "python-markdown-math" +optional = false +python-versions = ">=3.4" +version = "0.7" + +[package.dependencies] +Markdown = ">=3.0" + [[package]] category = "main" description = "World timezone definitions, modern and historical" @@ -549,12 +533,10 @@ Jinja2 = ">=2.3" Pygments = ">=2.0" alabaster = ">=0.7,<0.8" babel = ">=1.3" -colorama = ">=0.3.5" docutils = ">=0.12" imagesize = "*" packaging = "*" requests = ">=2.5.0" -setuptools = "*" snowballstemmer = ">=1.1" sphinxcontrib-applehelp = "*" sphinxcontrib-devhelp = "*" @@ -562,6 +544,7 @@ sphinxcontrib-htmlhelp = "*" sphinxcontrib-jsmath = "*" sphinxcontrib-qthelp = "*" sphinxcontrib-serializinghtml = "*" +colorama = {version = ">=0.3.5", markers = "sys_platform == \"win32\""} [package.extras] docs = ["sphinxcontrib-websupport"] @@ -658,7 +641,6 @@ version = "6.0.4" [[package]] category = "main" description = "Fast, Extensible Progress Meter" -marker = "python_version > \"2.7\"" name = "tqdm" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*" @@ -691,7 +673,6 @@ socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7,<2.0)"] [[package]] category = "main" description = "Backport of pathlib-compatible object wrapper for zip files" -marker = "python_version < \"3.8\"" name = "zipp" optional = false python-versions = ">=3.6" @@ -704,10 +685,11 @@ testing = ["jaraco.itertools", "func-timeout"] [extras] mkdocs = ["mkdocs"] mktheapidocs = ["mktheapidocs"] +python-markdown-math = ["python-markdown-math"] [metadata] -content-hash = "005d6a1a7c4ef056dee85a983644d8166f2e3b84d94cbe9ba18cdfbc3686321a" -lock-version = "1.0" +content-hash = "f2f15892a75e0cb26fb1fe3b986bbbbc09c38aba4b2a6b4952cbadff290ce20b" +lock-version = "1.1" python-versions = "^3.6" [metadata.files] @@ -724,8 +706,8 @@ atomicwrites = [ {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, ] attrs = [ - {file = "attrs-19.3.0-py2.py3-none-any.whl", hash = "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c"}, - {file = "attrs-19.3.0.tar.gz", hash = "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"}, + {file = "attrs-20.1.0-py2.py3-none-any.whl", hash = "sha256:2867b7b9f8326499ab5b0e2d12801fa5c98842d2cbd22b35112ae04bf85b4dff"}, + {file = "attrs-20.1.0.tar.gz", hash = "sha256:0ef97238856430dcf9228e07f316aefc17e8939fc8507e18c6501b761ef1a42a"}, ] babel = [ {file = "Babel-2.8.0-py2.py3-none-any.whl", hash = "sha256:d670ea0b10f8b723672d3a6abeb87b565b244da220d76b4dba1b66269ec152d4"}, @@ -819,7 +801,7 @@ joblib = [ {file = "joblib-0.16.0.tar.gz", hash = "sha256:8f52bf24c64b608bf0b2563e0e47d6fcf516abc8cfafe10cfd98ad66d94f92d6"}, ] livereload = [ - {file = "livereload-2.6.2.tar.gz", hash = "sha256:d1eddcb5c5eb8d2ca1fa1f750e580da624c0f7fcb734aa5780dc81b7dcbd89be"}, + {file = "livereload-2.6.3.tar.gz", hash = "sha256:776f2f865e59fde56490a56bcc6773b6917366bce0c267c60ee8aaf1a0959869"}, ] llvmlite = [ {file = "llvmlite-0.34.0rc1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:bd09db8900865744e04c6d1ed154b3153a8848985794b341fd472a22a69f7d76"}, @@ -981,6 +963,10 @@ pytest-cov = [ {file = "pytest-cov-2.10.1.tar.gz", hash = "sha256:47bd0ce14056fdd79f93e1713f88fad7bdcc583dcd7783da86ef2f085a0bb88e"}, {file = "pytest_cov-2.10.1-py2.py3-none-any.whl", hash = "sha256:45ec2d5182f89a81fc3eb29e3d1ed3113b9e9a873bcddb2a71faaab066110191"}, ] +python-markdown-math = [ + {file = "python-markdown-math-0.7.tar.gz", hash = "sha256:17a12175e8b2052a1c3402fca410841c551c678046293b1f7c280ccfe7b302a0"}, + {file = "python_markdown_math-0.7-py3-none-any.whl", hash = "sha256:31b4f7b0b73ef1c4ab3f27aeb13c828f07de35f4bd4df166ec954df0a11f2ddc"}, +] pytz = [ {file = "pytz-2020.1-py2.py3-none-any.whl", hash = "sha256:a494d53b6d39c3c6e44c3bec237336e14305e4f29bbf800b599253057fbb79ed"}, {file = "pytz-2020.1.tar.gz", hash = "sha256:c35965d010ce31b23eeb663ed3cc8c906275d6be1a34393a1d73a41febf4a048"}, From f7c5eaa8864b1797da0a09d18339789a811e0997 Mon Sep 17 00:00:00 2001 From: Michael Boyle Date: Mon, 24 Aug 2020 16:44:13 -0400 Subject: [PATCH 03/10] Remove redundant jit, guvectorize defs --- quaternionic/utilities.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/quaternionic/utilities.py b/quaternionic/utilities.py index e3264f0..f9c770e 100644 --- a/quaternionic/utilities.py +++ b/quaternionic/utilities.py @@ -10,9 +10,6 @@ 'reduce', 'accumulate', 'reduceat', 'outer', 'at' ] -jit = functools.partial(numba.njit, cache=True) -guvectorize = functools.partial(numba.guvectorize, nopython=True, cache=True) - def type_self_return(f): """Decorate jitted functions to return with type of first argument""" From c90af882b72df7b6478105bc54d3e24b0fa39249 Mon Sep 17 00:00:00 2001 From: Michael Boyle Date: Mon, 24 Aug 2020 16:44:27 -0400 Subject: [PATCH 04/10] Enable mathjax in documentation --- mkdocs.yml | 5 +++++ pyproject.toml | 3 +++ 2 files changed, 8 insertions(+) diff --git a/mkdocs.yml b/mkdocs.yml index e7d1368..1f93500 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -12,6 +12,11 @@ plugins: theme: name: 'readthedocs' +extra_javascript: + - https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML + markdown_extensions: + - mdx_math: + enable_dollar_delimiter: true - markdown.extensions.codehilite: guess_lang: false diff --git a/pyproject.toml b/pyproject.toml index 04111fd..899c66c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,17 +15,20 @@ scipy = "^1.0" numba = {version = "^0.50", markers = "implementation_name == 'cpython'"} mkdocs = {version = "^1.1.2", optional = true} mktheapidocs = {extras = ["plugin"], version = "^0.2.0", optional = true} +python-markdown-math = {version = "^0.7", optional = true} [tool.poetry.dev-dependencies] pytest = "^6.0" pytest-cov = "^2.10.1" mkdocs = "^1.1.2" mktheapidocs = {extras = ["plugin"], version = "^0.2.0"} +python-markdown-math = {version = "^0.7"} black = "^19.10b0" [tool.poetry.extras] mkdocs = ["mkdocs"] mktheapidocs = ["mktheapidocs"] +python-markdown-math = ["python-markdown-math"] [tool.black] line-length = 120 From f0db99bdc43f52b95c149887452faa9b11468044 Mon Sep 17 00:00:00 2001 From: Michael Boyle Date: Mon, 24 Aug 2020 16:59:41 -0400 Subject: [PATCH 05/10] Ignore non-numba branch on cpython coverage --- quaternionic/utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quaternionic/utilities.py b/quaternionic/utilities.py index f9c770e..429ed7b 100644 --- a/quaternionic/utilities.py +++ b/quaternionic/utilities.py @@ -194,7 +194,7 @@ def pyguvectorize_module_functions(module, obj): setattr(obj, k, v_ufunc) -if sys.implementation.name.lower() == 'pypy': # pragma: no branch +if sys.implementation.name.lower() == 'pypy': # pragma: no cover class _FakeNumbaType(object): def __init__(self, name): self.name = name From e883657662b9f537b046b96e6e9ce806535632b1 Mon Sep 17 00:00:00 2001 From: Michael Boyle Date: Mon, 24 Aug 2020 17:00:00 -0400 Subject: [PATCH 06/10] Ignore black dependency on !=cpython --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 899c66c..a467054 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ pytest-cov = "^2.10.1" mkdocs = "^1.1.2" mktheapidocs = {extras = ["plugin"], version = "^0.2.0"} python-markdown-math = {version = "^0.7"} -black = "^19.10b0" +black = {version = "^19.10b0", markers = "implementation_name == 'cpython'"} [tool.poetry.extras] mkdocs = ["mkdocs"] From 4894375794f7b0b17cb34a73b340b0405579e895 Mon Sep 17 00:00:00 2001 From: Michael Boyle Date: Mon, 24 Aug 2020 17:03:13 -0400 Subject: [PATCH 07/10] Remove more dev dependencies on non-cpython --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a467054..c4004e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,9 +20,9 @@ python-markdown-math = {version = "^0.7", optional = true} [tool.poetry.dev-dependencies] pytest = "^6.0" pytest-cov = "^2.10.1" -mkdocs = "^1.1.2" -mktheapidocs = {extras = ["plugin"], version = "^0.2.0"} -python-markdown-math = {version = "^0.7"} +mkdocs = {version = "^1.1.2", markers = "implementation_name == 'cpython'" +mktheapidocs = {extras = ["plugin"], version = "^0.2.0", markers = "implementation_name == 'cpython'"} +python-markdown-math = {version = "^0.7", markers = "implementation_name == 'cpython'"} black = {version = "^19.10b0", markers = "implementation_name == 'cpython'"} [tool.poetry.extras] From 0591aa72d92d09b0f12b5207508558d4fc9884a8 Mon Sep 17 00:00:00 2001 From: Michael Boyle Date: Mon, 24 Aug 2020 17:04:34 -0400 Subject: [PATCH 08/10] Close missing brace --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c4004e6..c038057 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ python-markdown-math = {version = "^0.7", optional = true} [tool.poetry.dev-dependencies] pytest = "^6.0" pytest-cov = "^2.10.1" -mkdocs = {version = "^1.1.2", markers = "implementation_name == 'cpython'" +mkdocs = {version = "^1.1.2", markers = "implementation_name == 'cpython'"} mktheapidocs = {extras = ["plugin"], version = "^0.2.0", markers = "implementation_name == 'cpython'"} python-markdown-math = {version = "^0.7", markers = "implementation_name == 'cpython'"} black = {version = "^19.10b0", markers = "implementation_name == 'cpython'"} From 8abbc0ba50de9ef73c09c4859cab69c67fb2d01c Mon Sep 17 00:00:00 2001 From: Michael Boyle Date: Mon, 24 Aug 2020 17:07:40 -0400 Subject: [PATCH 09/10] Try harder to exclude docs deps --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c038057..2281659 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,9 +13,9 @@ importlib-metadata = {version = "^1.0", python = "<3.8"} numpy = "^1.13" scipy = "^1.0" numba = {version = "^0.50", markers = "implementation_name == 'cpython'"} -mkdocs = {version = "^1.1.2", optional = true} -mktheapidocs = {extras = ["plugin"], version = "^0.2.0", optional = true} -python-markdown-math = {version = "^0.7", optional = true} +mkdocs = {version = "^1.1.2", optional = true, markers = "implementation_name == 'cpython'"} +mktheapidocs = {extras = ["plugin"], version = "^0.2.0", optional = true, markers = "implementation_name == 'cpython'"} +python-markdown-math = {version = "^0.7", optional = true, markers = "implementation_name == 'cpython'"} [tool.poetry.dev-dependencies] pytest = "^6.0" From 4f236b6d5075d32a757093ab60d0cc98ab2e095f Mon Sep 17 00:00:00 2001 From: Michael Boyle Date: Mon, 24 Aug 2020 17:21:52 -0400 Subject: [PATCH 10/10] Remove pypy3; scipy doesn't work --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8842e3..43c3d7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.6, 3.7, 3.8, pypy3] + python-version: [3.6, 3.7, 3.8] #, pypy3] # exclude: # - os: windows-latest # python-version: pypy3