Skip to content

Commit

Permalink
fixes for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
milescsmith committed Nov 29, 2021
1 parent 3b6514d commit 5c7c5f4
Show file tree
Hide file tree
Showing 16 changed files with 276 additions and 260 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[flake8]
select = B,B9,C,D,DAR,E,F,N,RST,S,W
ignore = E203,E501,RST201,RST203,RST301,W503
ignore = E203,E501,RST201,RST203,RST301,W503, D100, D103, N802, C901, D205, D212, D415, N803, B950
max-line-length = 80
max-complexity = 10
docstring-convention = google
Expand Down
79 changes: 0 additions & 79 deletions .github/workflows/release.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,7 @@ jobs:
- name: Upload coverage report
uses: codecov/[email protected]
run: |
codecov
env: # Or as an environment variable
super_secret: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ dmypy.json
# Cython debug symbols
cython_debug/

src/pysmooth/debug.py
debug.py
36 changes: 18 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: local
hooks:
- id: black
name: black
entry: black
language: system
types: [python]
require_serial: true
# - id: black
# name: black
# entry: black
# language: system
# types: [python]
# require_serial: true
- id: check-added-large-files
name: Check for added large files
entry: check-added-large-files
Expand All @@ -21,24 +21,24 @@ repos:
entry: check-yaml
language: system
types: [yaml]
- id: end-of-file-fixer
name: Fix End of Files
entry: end-of-file-fixer
language: system
types: [text]
stages: [commit, push, manual]
# - id: end-of-file-fixer
# name: Fix End of Files
# entry: end-of-file-fixer
# language: system
# types: [text]
# stages: [commit, push, manual]
- id: flake8
name: flake8
entry: flake8
language: system
types: [python]
require_serial: true
- id: reorder-python-imports
name: Reorder python imports
entry: reorder-python-imports
language: system
types: [python]
args: [--application-directories=src]
# - id: reorder-python-imports
# name: Reorder python imports
# entry: reorder-python-imports
# language: system
# types: [python]
# args: [--application-directories=src]
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.4]

### Changed

- Miscellaneous fixes for mypy and passing tests
- Add `smooth` to `__all__` for explicit export of the symbol

### Removed

- Custom `Numeric` type for type hinting in lieu of following PEP 484 and the
Numeric Tower


## [1.1.3]

### Changed
Expand All @@ -13,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
function.
- Updated README.rst to include requirements and example usage


## [1.1.2]

Version bump for pypi
Expand Down Expand Up @@ -42,6 +56,7 @@ Version bump for pypi
- `main` function, as it was unused and `pysmooth` is not intended to be a cli
application

[1.2.0]: https://github.com/olivierlacan/keep-a-changelog/compare/1.1.3...1.2.0
[1.1.3]: https://github.com/olivierlacan/keep-a-changelog/compare/1.1.2...1.1.3
[1.1.2]: https://github.com/olivierlacan/keep-a-changelog/compare/1.1.1...1.1.2
[1.1.1]: https://github.com/olivierlacan/keep-a-changelog/compare/1.1.0...1.1.1
Expand Down
11 changes: 11 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[mypy]
strict = True
warn_unreachable = True
pretty = True
show_column_numbers = True
show_error_codes = True
show_error_context = True
disallow_untyped_decorators = False

[mypy-hypothesis.*]
ignore_missing_imports = True
36 changes: 31 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,27 @@
"docs-build",
)

locations = (
"src",
"tests",
)


@session(python=["3.10"])
def isort(session: Session) -> None:
"""Run black code formatter."""
args = session.posargs or locations
session.install("isort")
session.run("isort", *args)


@session(python=["3.10"])
def black(session: Session) -> None:
"""Run black code formatter."""
args = session.posargs or locations
session.install("black[jupyter]")
session.run("black", *args)


def activate_virtualenv_in_precommit_hooks(session: Session) -> None:
"""Activate virtualenv in hooks installed by pre-commit.
Expand Down Expand Up @@ -87,7 +108,6 @@ def precommit(session: Session) -> None:
"""Lint using pre-commit."""
args = session.posargs or ["run", "--all-files", "--show-diff-on-failure"]
session.install(
"black",
"darglint",
"flake8",
"flake8-bandit",
Expand Down Expand Up @@ -115,12 +135,18 @@ def safety(session: Session) -> None:
@session(python=python_versions)
def mypy(session: Session) -> None:
"""Type-check using mypy."""
args = session.posargs or ["src", "tests", "docs/conf.py"]
args = session.posargs or locations
session.install(".")
session.install("mypy", "pytest")
session.run("mypy", *args)
session.run("mypy", "--install-types", "--non-interactive", "out", *args)
if not session.posargs:
session.run("mypy", f"--python-executable={sys.executable}", "noxfile.py")
session.run(
"mypy",
"--install-types",
"--non-interactive",
f"--python-executable={sys.executable}",
"noxfile.py",
)


@session(python=python_versions)
Expand All @@ -138,7 +164,7 @@ def tests(session: Session) -> None:
@session
def coverage(session: Session) -> None:
"""Produce the coverage report."""
args = session.posargs or ["report"]
# args = session.posargs or ["report"]

session.install("coverage[toml]", "codecov")

Expand Down
15 changes: 15 additions & 0 deletions out/tests/test_hypothesis.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from typing import List

def test_hypo_3RS3R_int(x: List[float]) -> None: ...
def test_hypo_3RSS_int(x: List[float]) -> None: ...
def test_hypo_3RSR_int(x: List[float]) -> None: ...
def test_hypo_3R_int(x: List[float]) -> None: ...
def test_hypo_3_int(x: List[float]) -> None: ...
def test_hypo_3_2(x: List[float]) -> None: ...
def test_hypo_S_int(x: List[float]) -> None: ...
def test_hypo_3RS3R_float(x: List[float]) -> None: ...
def test_hypo_3RSS_float(x: List[float]) -> None: ...
def test_hypo_3RSR_float(x: List[float]) -> None: ...
def test_hypo_3R_float(x: List[float]) -> None: ...
def test_hypo_3_float(x: List[float]) -> None: ...
def test_hypo_S_float(x: List[float]) -> None: ...
Loading

0 comments on commit 5c7c5f4

Please sign in to comment.