Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/workflows/typecheck.yaml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![Build Status](https://img.shields.io/pypi/v/optional.py.svg)](https://pypi.org/project/optional.py/)
[![test](https://github.com/Python-Optional/optional.py/actions/workflows/test.yaml/badge.svg)](https://github.com/Python-Optional/optional.py/actions/workflows/test.yaml)
[![lint](https://github.com/Python-Optional/optional.py/actions/workflows/lint.yaml/badge.svg)](https://github.com/Python-Optional/optional.py/actions/workflows/lint.yaml)
[![typecheck](https://github.com/Python-Optional/optional.py/actions/workflows/typecheck.yaml/badge.svg)](https://github.com/Python-Optional/optional.py/actions/workflows/typecheck.yaml)
[![format](https://github.com/Python-Optional/optional.py/actions/workflows/format.yaml/badge.svg)](https://github.com/Python-Optional/optional.py/actions/workflows/format.yaml)
[![editorconfig](https://github.com/Python-Optional/optional.py/actions/workflows/editorconfig.yaml/badge.svg)](https://github.com/Python-Optional/optional.py/actions/workflows/editorconfig.yaml)
[![License](https://img.shields.io/pypi/l/optional.py.svg)](https://pypi.org/project/optional.py/)
Expand Down
16 changes: 11 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@ commands:
test:
@poetry run python -m pytest

# Lint source code
[parallel]
lint: lint-ruff lint-basedpyright

# Lint code using ruff
lint:
[private]
lint-ruff:
@poetry run python -m ruff check optional tests

# Lint code using basedpyright
[private]
lint-basedpyright:
@poetry run python -m basedpyright optional tests

# Format code using ruff
format:
@poetry run python -m ruff format optional tests

# Check types using mypy
typecheck:
@poetry run python -m mypy optional tests

# Check for editorconfig violations using editorconfig-checker
editorconfig:
@editorconfig-checker
2 changes: 1 addition & 1 deletion optional/optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def of() -> Nothing: ...

@staticmethod
@overload
def of(thing: None) -> Nothing: ...
def of(thing: None) -> Nothing: ... # pyright: ignore[reportOverlappingOverload]

@staticmethod
@overload
Expand Down
2 changes: 1 addition & 1 deletion optional/something.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __eq__(self, other: object) -> bool | NotImplementedType:
if not isinstance(other, Something):
return NotImplemented

return self._value == other._value
return self._value == other._value # pyright: ignore[reportUnknownVariableType, reportUnknownMemberType]

@override
def __repr__(self) -> str:
Expand Down
110 changes: 39 additions & 71 deletions poetry.lock

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

14 changes: 5 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version = "2.0.0"
description = "An implementation of the Optional object in Python"
license = "MIT"
authors = [
{name = "Chad Befus", email = "crbefus@gmail.com"},
{name = "Derek Passen", email = "dpassen1@gmail.com"}
{ name = "Chad Befus", email = "crbefus@gmail.com" },
{ name = "Derek Passen", email = "dpassen1@gmail.com" },
]
readme = "README.md"
repository = "https://github.com/Python-Optional/optional.py"
Expand All @@ -14,22 +14,18 @@ keywords = ["optional datatype library"]
requires-python = ">= 3.10"

[project.optional-dependencies]
dev = ["ruff", "mypy"]
dev = ["ruff", "basedpyright", "typing-extensions"]
test = ["pytest", "pytest-cov", "coveralls", "coverage"]

[tool.poetry]
packages = [
{ include = "optional" },
]
packages = [{ include = "optional" }]

[tool.coverage.report]
exclude_lines = ["@overload"]

[tool.pytest.ini_options]
addopts = "--cov=optional"
testpaths = [
"tests",
]
testpaths = ["tests"]

[tool.ruff]
line-length = 88
Expand Down
4 changes: 4 additions & 0 deletions tests/test_optional.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# pyright: reportUnnecessaryComparison=false
# pyright: reportUnreachable=false
# pyright: reportUnusedCallResult = false

import pytest

from optional import Nothing, Optional, Something
Expand Down
2 changes: 2 additions & 0 deletions tests/test_something.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pyright: reportUnusedCallResult = false

import pytest

from optional import Optional, Something
Expand Down