Skip to content

Commit

Permalink
Updated files with 'repo_helper'.
Browse files Browse the repository at this point in the history
  • Loading branch information
repo-helper[bot] committed Mar 1, 2021
1 parent 7cfc048 commit 3f339fb
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 66 deletions.
2 changes: 2 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ tag = True
[bumpversion:file:doc-source/index.rst]

[bumpversion:file:repo_helper.yml]

[bumpversion:file:pyproject.toml]
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install tox
python -m pip install --upgrade tox virtualenv
- name: "Run mypy"
run: "python -m tox -e mypy"
11 changes: 9 additions & 2 deletions .github/workflows/python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: "windows-2019"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.4'
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.5'

strategy:
fail-fast: False
Expand All @@ -23,7 +23,7 @@ jobs:
- {python-version: "3.7", testenvs: "py37,build", experimental: False}
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
- {python-version: "3.10.0-alpha.4", testenvs: "py310-dev,build", experimental: True}
- {python-version: "3.10.0-alpha.5", testenvs: "py310-dev,build", experimental: True}

steps:
- name: Checkout 🛎️
Expand All @@ -43,3 +43,10 @@ jobs:
- name: "Run Tests for Python ${{ matrix.config.python-version }}"
run: python -m tox -e "${{ matrix.config.testenvs }}"

- name: "Upload Coverage 🚀"
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: "coverage-${{ matrix.config.python-version }}"
path: .coverage
6 changes: 3 additions & 3 deletions .github/workflows/python_ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: "ubuntu-20.04"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.4'
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.5'

strategy:
fail-fast: False
Expand All @@ -23,7 +23,7 @@ jobs:
- {python-version: "3.7", testenvs: "py37,build", experimental: False}
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
- {python-version: "3.10.0-alpha.4", testenvs: "py310-dev,build", experimental: True}
- {python-version: "3.10.0-alpha.5", testenvs: "py310-dev,build", experimental: True}

steps:
- name: Checkout 🛎️
Expand All @@ -45,9 +45,9 @@ jobs:
- name: "Run Tests for Python ${{ matrix.config.python-version }}"
run: python -m tox -e "${{ matrix.config.testenvs }}"


- name: "Upload Coverage 🚀"
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: "coverage-${{ matrix.config.python-version }}"
path: .coverage
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/python_ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: "macos-latest"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.4'
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10.0-alpha.5'

strategy:
fail-fast: False
Expand All @@ -23,7 +23,7 @@ jobs:
- {python-version: "3.7", testenvs: "py37,build", experimental: False}
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
- {python-version: "3.10.0-alpha.4", testenvs: "py310-dev,build", experimental: True}
- {python-version: "3.10.0-alpha.5", testenvs: "py310-dev,build", experimental: True}

steps:
- name: Checkout 🛎️
Expand All @@ -43,3 +43,10 @@ jobs:
- name: "Run Tests for Python ${{ matrix.config.python-version }}"
run: python -m tox -e "${{ matrix.config.testenvs }}"

- name: "Upload Coverage 🚀"
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: "coverage-${{ matrix.config.python-version }}"
path: .coverage
33 changes: 0 additions & 33 deletions .isort.cfg

This file was deleted.

9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,19 @@ repos:
- id: pyupgrade
args:
- --py36-plus
- --keep-runtime-typing

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.9
hooks:
- id: remove-crlf
- id: forbid-crlf

- repo: https://github.com/domdfcoding/yapf-isort
rev: v0.5.5
- repo: https://github.com/repo-helper/formate
rev: v0.4.2
hooks:
- id: yapf-isort
exclude: ^(doc-source/conf|__pkginfo__|make_conda_recipe|setup)\.py$
- id: formate
exclude: ^(doc-source/conf|__pkginfo__|make_conda_recipe|setup)\.(_)?py$

- repo: https://github.com/domdfcoding/dep_checker
rev: v0.4.1
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ confidence=
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=all
enable=assert-on-tuple,astroid-error,bad-except-order,bad-inline-option,bad-option-value,bad-reversed-sequence,bare-except,binary-op-exception,boolean-datetime,catching-non-exception,cell-var-from-loop,confusing-with-statement,consider-merging-isinstance,consider-using-enumerate,consider-using-ternary,continue-in-finally,cyclic-import,deprecated-pragma,django-not-available,duplicate-except,duplicate-key,eval-used,exec-used,expression-not-assigned,fatal,file-ignored,fixme,global-at-module-level,global-statement,global-variable-not-assigned,global-variable-undefined,http-response-with-content-type-json,http-response-with-json-dumps,invalid-all-object,invalid-characters-in-docstring,len-as-condition,literal-comparison,locally-disabled,locally-enabled,lost-exception,lowercase-l-suffix,misplaced-bare-raise,missing-kwoa,mixed-line-endings,model-has-unicode,model-missing-unicode,model-no-explicit-unicode,model-unicode-not-callable,multiple-imports,multiple-statements,new-db-field-with-default,non-ascii-bytes-literals,nonexistent-operator,not-in-loop,notimplemented-raised,overlapping-except,parse-error,pointless-statement,pointless-string-statement,raising-bad-type,raising-non-exception,raw-checker-failed,redefine-in-handler,redefined-argument-from-local,redefined-builtin,redundant-content-type-for-json-response,reimported,relative-import,return-outside-function,simplifiable-if-statement,singleton-comparison,syntax-error,trailing-comma-tuple,trailing-newlines,unbalanced-tuple-unpacking,undefined-all-variable,undefined-loop-variable,unexpected-line-ending-format,unidiomatic-typecheck,unnecessary-lambda,unnecessary-pass,unnecessary-semicolon,unneeded-not,unpacking-non-sequence,unreachable,unrecognized-inline-option,used-before-assignment,useless-else-on-loop,using-constant-test,wildcard-import,yield-outside-function,useless-return
enable=assert-on-tuple,astroid-error,bad-except-order,bad-inline-option,bad-option-value,bad-reversed-sequence,bare-except,binary-op-exception,boolean-datetime,catching-non-exception,cell-var-from-loop,confusing-with-statement,consider-merging-isinstance,consider-using-enumerate,consider-using-ternary,continue-in-finally,cyclic-import,deprecated-pragma,django-not-available,duplicate-except,duplicate-key,eval-used,exec-used,expression-not-assigned,fatal,file-ignored,fixme,global-at-module-level,global-statement,global-variable-not-assigned,global-variable-undefined,http-response-with-content-type-json,http-response-with-json-dumps,invalid-all-object,invalid-characters-in-docstring,len-as-condition,literal-comparison,locally-disabled,locally-enabled,lost-exception,lowercase-l-suffix,misplaced-bare-raise,missing-kwoa,mixed-line-endings,model-has-unicode,model-missing-unicode,model-no-explicit-unicode,model-unicode-not-callable,multiple-imports,new-db-field-with-default,non-ascii-bytes-literals,nonexistent-operator,not-in-loop,notimplemented-raised,overlapping-except,parse-error,pointless-statement,pointless-string-statement,raising-bad-type,raising-non-exception,raw-checker-failed,redefine-in-handler,redefined-argument-from-local,redefined-builtin,redundant-content-type-for-json-response,reimported,relative-import,return-outside-function,simplifiable-if-statement,singleton-comparison,syntax-error,trailing-comma-tuple,trailing-newlines,unbalanced-tuple-unpacking,undefined-all-variable,undefined-loop-variable,unexpected-line-ending-format,unidiomatic-typecheck,unnecessary-lambda,unnecessary-pass,unnecessary-semicolon,unneeded-not,unpacking-non-sequence,unreachable,unrecognized-inline-option,used-before-assignment,useless-else-on-loop,using-constant-test,wildcard-import,yield-outside-function,useless-return

[REPORTS]

Expand Down
10 changes: 6 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Contributing

.. This file based on https://github.com/PyGithub/PyGithub/blob/master/CONTRIBUTING.md
``mathematical`` uses `tox <https://tox.readthedocs.io>`_ to automate testing and packaging, and `pre-commit <https://pre-commit.com>`_ to maintain code quality.
``mathematical`` uses `tox <https://tox.readthedocs.io>`_ to automate testing and packaging,
and `pre-commit <https://pre-commit.com>`_ to maintain code quality.

Install ``pre-commit`` with ``pip`` and install the git hook:

Expand All @@ -17,13 +18,13 @@ Install ``pre-commit`` with ``pip`` and install the git hook:
Coding style
--------------

`yapf-isort <https://pypi.org/project/yapf-isort/>`_ is used for code formatting.
`formate <https://formate.readthedocs.io>`_ is used for code formatting.

It can be run manually via ``pre-commit``:

.. code-block:: bash
$ pre-commit run yapf-isort -a
$ pre-commit run formate -a
Or, to run the complete autoformatting suite:
Expand All @@ -36,7 +37,8 @@ Or, to run the complete autoformatting suite:
Automated tests
-------------------

Tests are run with ``tox`` and ``pytest``. To run tests for a specific Python version, such as Python 3.6, run:
Tests are run with ``tox`` and ``pytest``.
To run tests for a specific Python version, such as Python 3.6:

.. code-block:: bash
Expand Down
10 changes: 6 additions & 4 deletions doc-source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Overview

.. This file based on https://github.com/PyGithub/PyGithub/blob/master/CONTRIBUTING.md
``mathematical`` uses `tox <https://tox.readthedocs.io>`_ to automate testing and packaging, and `pre-commit <https://pre-commit.com>`_ to maintain code quality.
``mathematical`` uses `tox <https://tox.readthedocs.io>`_ to automate testing and packaging,
and `pre-commit <https://pre-commit.com>`_ to maintain code quality.

Install ``pre-commit`` with ``pip`` and install the git hook:

Expand All @@ -16,13 +17,13 @@ Install ``pre-commit`` with ``pip`` and install the git hook:
Coding style
--------------

`yapf-isort <https://pypi.org/project/yapf-isort/>`_ is used for code formatting.
`formate <https://formate.readthedocs.io>`_ is used for code formatting.

It can be run manually via ``pre-commit``:

.. prompt:: bash

pre-commit run yapf-isort -a
pre-commit run formate -a


Or, to run the complete autoformatting suite:
Expand All @@ -35,7 +36,8 @@ Or, to run the complete autoformatting suite:
Automated tests
-------------------

Tests are run with ``tox`` and ``pytest``. To run tests for a specific Python version, such as Python 3.6, run:
Tests are run with ``tox`` and ``pytest``.
To run tests for a specific Python version, such as Python 3.6:

.. prompt:: bash

Expand Down
52 changes: 52 additions & 0 deletions formate.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[hooks]
dynamic_quotes = 10
collections-import-rewrite = 20
reformat-generics = 40
noqa-reformat = 60
ellipsis-reformat = 70
squish_stubs = 80

[config]
indent = "\t"
line_length = 115

[hooks.yapf]
priority = 30

[hooks.isort]
priority = 50

[hooks.yapf.kwargs]
yapf_style = ".style.yapf"

[hooks.isort.kwargs]
indent = "\t\t"
multi_line_output = 8
import_heading_stdlib = "stdlib"
import_heading_thirdparty = "3rd party"
import_heading_firstparty = "this package"
import_heading_localfolder = "this package"
balanced_wrapping = false
lines_between_types = 0
use_parentheses = true
remove_redundant_aliases = true
default_section = "THIRDPARTY"
known_third_party = [
"coincidence",
"coverage",
"coverage_pyver_pragma",
"domdf_python_tools",
"github",
"numpy",
"pandas",
"pytest",
"pytest_cov",
"pytest_randomly",
"pytest_rerunfailures",
"pytest_timeout",
"pytz",
"requests",
"scipy",
"typing_extensions",
]
known_first_party = "mathematical"
22 changes: 21 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
[build-system]
requires = ["setuptools>=40.6.0", "wheel>=0.34.2"]
requires = [ "setuptools>=40.6.0", "wheel>=0.34.2",]
build-backend = "setuptools.build_meta"

[project]
name = "mathematical"
version = "0.4.0"
description = "Mathematical tools for Python\u2002📐\u2002🐍\u2002🛠️"
readme = "README.rst"
keywords = [ "mathematics", "utilities",]
dynamic = [ "requires-python", "classifiers", "dependencies",]
[[project.authors]]
email = "dominic@davis-foster.co.uk"
name = "Dominic Davis-Foster"

[project.license]
file = "LICENSE"

[project.urls]
Homepage = "https://github.com/domdfcoding/mathematical"
"Issue Tracker" = "https://github.com/domdfcoding/mathematical/issues"
"Source Code" = "https://github.com/domdfcoding/mathematical"
Documentation = "https://mathematical.readthedocs.io/en/latest"
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# This file is managed by 'repo_helper'. Don't edit it directly.

# stdlib
import shutil
import sys

# 3rd party
Expand All @@ -19,3 +20,5 @@
py_modules=[],
version=__version__,
)

shutil.rmtree("mathematical.egg-info", ignore_errors=True)

0 comments on commit 3f339fb

Please sign in to comment.