Skip to content

Commit

Permalink
Merge pull request #221 from thegridelectric/dev
Browse files Browse the repository at this point in the history
Update dependencies, make mypy, flake8 and pre-commit pass
  • Loading branch information
anschweitzer committed Aug 6, 2024
2 parents 44cf5c7 + 27396cd commit dbb8ab5
Show file tree
Hide file tree
Showing 24 changed files with 500 additions and 705 deletions.
4 changes: 2 additions & 2 deletions .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
select = B,B9,C,DAR,E,F,N,RST,S,W
ignore = E203,E501,RST201,RST203,RST301,W503,B950,RST202,B907
max-line-length = 80
max-complexity = 10
docstring-convention = google
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pip==23.3.1
pip==24.2
nox==2023.4.22
nox-poetry==1.0.3
poetry==1.8.1
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ jobs:
fail-fast: false
matrix:
include:
# - { python: "3.12", os: "ubuntu-latest", session: "pre-commit" }
# - { python: "3.12", os: "ubuntu-latest", session: "safety" }
# - { python: "3.12", os: "ubuntu-latest", session: "mypy" }
- { python: "3.11", os: "ubuntu-latest", session: "pre-commit" }
- { python: "3.12", os: "ubuntu-latest", session: "mypy" }
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
- { python: "3.12", os: "ubuntu-latest", session: "tests" }
# - { python: "3.12", os: "windows-latest", session: "tests" }
# - { python: "3.12", os: "macos-latest", session: "tests" }
# - { python: "3.12", os: "ubuntu-latest", session: "typeguard" }
# - { python: "3.12", os: "ubuntu-latest", session: "xdoctest" }

# - { python: "3.12", os: "ubuntu-latest", session: "docs-build" }

env:
Expand Down
26 changes: 13 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ repos:
entry: check-yaml
language: system
types: [yaml]
- id: darglint
name: darglint
entry: darglint
language: system
types: [python]
stages: [manual]
# - id: darglint
# name: darglint
# entry: darglint
# language: system
# types: [python]
# stages: [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
# args: [--darglint-ignore-regex, .*]
- id: flake8
name: flake8
entry: flake8
language: system
types: [python]
require_serial: true
# args: [--darglint-ignore-regex, .*]
- id: isort
name: isort
entry: isort
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ The [GNodeFactory](https://github.com/thegridelectric/g-node-factory) currently
and does most of the heavy lifting in terms of identity management and authentication in GridWorks. Finally, since the demo
is a distributed simulation, it needs a method of handling time. That's done by a [TimeCoordinator](https://github.com/thegridelectric/gridworks-timecoordinator) GNode.



## Contributing

Contributions are very welcome.
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
furo==2024.1.29
sphinx==7.2.6
furo==2024.7.18
sphinx==8.0.2
sphinx-click==5.1.0
myst_parser==2.0.0
sphinx-rtd-theme
28 changes: 6 additions & 22 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# type: ignore

"""Nox sessions."""

import os
Expand All @@ -7,7 +9,7 @@
from pathlib import Path
from textwrap import dedent

import nox
import nox # noqa


try:
Expand All @@ -28,10 +30,8 @@
nox.needs_version = ">= 2021.6.6"
nox.options.sessions = (
"pre-commit",
# "safety",
"mypy",
"tests",
# "typeguard",
"xdoctest",
"docs-build",
)
Expand Down Expand Up @@ -122,12 +122,12 @@ def precommit(session: Session) -> None:
]
session.install(
"black",
"darglint",
# "darglint",
"flake8",
"flake8-bandit",
"flake8-bugbear",
# "flake8-docstrings",
# "flake8-rst-docstrings",
"flake8-docstrings",
"flake8-rst-docstrings",
"isort",
"pep8-naming",
"pre-commit",
Expand All @@ -139,14 +139,6 @@ def precommit(session: Session) -> None:
activate_virtualenv_in_precommit_hooks(session)


@session(python=python_versions[0])
def safety(session: Session) -> None:
"""Scan dependencies for insecure packages."""
requirements = session.poetry.export_requirements()
session.install("safety")
session.run("safety", "check", "--full-report", f"--file={requirements}")


@session(python=python_versions)
def mypy(session: Session) -> None:
"""Type-check using mypy."""
Expand Down Expand Up @@ -183,14 +175,6 @@ def coverage(session: Session) -> None:
session.run("coverage", *args)


@session(python=python_versions[0])
def typeguard(session: Session) -> None:
"""Runtime type checking using Typeguard."""
session.install(".")
session.install("pytest", "typeguard", "pygments")
session.run("pytest", f"--typeguard-packages={package}", *session.posargs)


@session(python=python_versions)
def xdoctest(session: Session) -> None:
"""Run examples with xdoctest."""
Expand Down
Loading

0 comments on commit dbb8ab5

Please sign in to comment.