Skip to content

Commit

Permalink
Update pyproject.toml (#137) (#184)
Browse files Browse the repository at this point in the history
Closes #137 

- moved contents of mypy.ini into pyproject.toml
- added docs as optional dependency group
  • Loading branch information
TimD1 authored Oct 17, 2024
1 parent 09ecac6 commit 9bd0456
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Run mypy
shell: bash
run: |
poetry run mypy fgpyo tests --config=ci/mypy.ini
poetry run mypy fgpyo tests --config=pyproject.toml
- name: Run pytest
shell: bash
Expand Down
10 changes: 4 additions & 6 deletions ci/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function banner() {
echo
echo "================================================================================"
echo $*
echo "$*"
echo "================================================================================"
echo
}
Expand All @@ -24,9 +24,9 @@ function run() {
set -e

if [[ $exit_code == 0 ]]; then
echo Passed $name: "[$cmd]"
echo Passed "$name": "[$cmd]"
else
echo Failed $name: "[$cmd]"
echo Failed "$name": "[$cmd]"
if [ -z "$failures" ]; then
failures="$failures $name"
else
Expand All @@ -35,11 +35,9 @@ function run() {
fi
}

parent=$(cd $(dirname $0) && pwd -P)

run "Style Checking" "ruff format fgpyo tests"
run "Linting" "ruff check --fix fgpyo tests"
run "Type Checking" "mypy fgpyo tests --config $parent/mypy.ini"
run "Type Checking" "mypy fgpyo tests --config pyproject.toml"
run "Unit Tests" "python -m pytest -vv -r sx tests"
run "Make docs" "mkdocs build --strict"

Expand Down
16 changes: 0 additions & 16 deletions ci/mypy.ini

This file was deleted.

59 changes: 12 additions & 47 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ strenum = "^0.4.15"

[tool.poetry.group.dev.dependencies]
# dependencies for linting, style checking, and unit testing
black = {version = ">=24.4.2"}
mypy = ">=1.7.0"
pytest = ">=7.4.0"
pytest-cov = ">=2.8.1"
ruff = "0.4.8"
setuptools = ">=68.0.0"

[tool.poetry.group.docs.dependencies]
# dependencies for building docs
mkdocs-autorefs = { version = ">=0.5.0" }
mkdocs-include-markdown-plugin = { version = ">=6.0.1" }
Expand Down Expand Up @@ -70,3 +71,19 @@ unfixable = ["B"]

[tool.ruff.lint.isort]
force-single-line = true

[tool.mypy]
python_version = 3.8
strict_optional = false
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true

0 comments on commit 9bd0456

Please sign in to comment.