From 54af06c6d2bfaa591961a856f733231c3fcdfe83 Mon Sep 17 00:00:00 2001 From: Michael Collins Date: Thu, 9 May 2024 19:36:52 -0700 Subject: [PATCH 1/9] Update pyproject.toml --- docspec-python/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docspec-python/pyproject.toml b/docspec-python/pyproject.toml index fd16452..352b718 100644 --- a/docspec-python/pyproject.toml +++ b/docspec-python/pyproject.toml @@ -17,7 +17,7 @@ packages = [{ include = "docspec_python", from="src" }] python = "^3.7" docspec = "^2.2.1" "nr.util" = ">=0.7.0" -black = "^23.1.0" +black = ">=23.1.0" [tool.poetry.dev-dependencies] black = "*" From 463fa57228b78fc500959a26a5a51846992dfd8d Mon Sep 17 00:00:00 2001 From: Michael Collins Date: Thu, 9 May 2024 19:36:52 -0700 Subject: [PATCH 2/9] Bump black to `>=23.1.0` Along with this, also needed to bump pydoc-markdown. And for good measure, added docs/_site to .gitignore so `slap run docs:build` won't show a bunch of new files to add. --- .changelog/_unreleased.toml | 5 +++++ .gitignore | 1 + slap.toml | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changelog/_unreleased.toml diff --git a/.changelog/_unreleased.toml b/.changelog/_unreleased.toml new file mode 100644 index 0000000..86b371d --- /dev/null +++ b/.changelog/_unreleased.toml @@ -0,0 +1,5 @@ +[[entries]] +id = "7e6f481f-0e4b-4502-981c-cf98a757dd6d" +type = "improvement" +description = "Bump black to `>=23.1.0`" +author = "@mcintel" diff --git a/.gitignore b/.gitignore index 291629a..5afd009 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ build/ .vscode/ .python-version +docs/_site # Generate files for documentation. changelog.md diff --git a/slap.toml b/slap.toml index 92e348a..1d9ec7e 100644 --- a/slap.toml +++ b/slap.toml @@ -6,4 +6,4 @@ enabled = false "docs:dev" = "cd docs && novella --serve" [install.extras] -docs = ["mako", "mkdocs", "mkdocs-material", "novella==0.1.15", "pydoc-markdown==4.6.0", "databind ^1.5.0"] +docs = ["mako", "mkdocs", "mkdocs-material", "novella==0.1.15", "pydoc-markdown >=4.6.0", "databind >=1.5.0"] From 90eff17a163bc0c52fb43996bcfc32c5df01da38 Mon Sep 17 00:00:00 2001 From: Michael Collins Date: Sat, 11 May 2024 10:40:11 -0700 Subject: [PATCH 3/9] Fix lint errors --- docspec/src/docspec/__init__.py | 10 ++++------ docspec/src/docspec/__main__.py | 2 +- docspec/test/docspec/test_deserialize.py | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docspec/src/docspec/__init__.py b/docspec/src/docspec/__init__.py index 4c07a24..3408fad 100644 --- a/docspec/src/docspec/__init__.py +++ b/docspec/src/docspec/__init__.py @@ -515,17 +515,15 @@ def load_modules( @t.overload -def dump_module( +def dump_module( # noqa module: Module, target: t.Union[str, t.IO[str]], dumper: t.Callable[[t.Any, t.IO[str]], None] = json.dump -) -> None: - ... +) -> None: ... @t.overload -def dump_module( +def dump_module( # noqa module: Module, target: None = None, dumper: t.Callable[[t.Any, t.IO[str]], None] = json.dump -) -> t.Dict[str, t.Any]: - ... +) -> t.Dict[str, t.Any]: ... def dump_module( diff --git a/docspec/src/docspec/__main__.py b/docspec/src/docspec/__main__.py index b81e008..96a37a3 100644 --- a/docspec/src/docspec/__main__.py +++ b/docspec/src/docspec/__main__.py @@ -25,7 +25,7 @@ import docspec try: - from termcolor import colored + from termcolor import colored # type: ignore except ImportError: def colored(s, *args, **kwargs): # type: ignore diff --git a/docspec/test/docspec/test_deserialize.py b/docspec/test/docspec/test_deserialize.py index 0e5980b..8e3029c 100644 --- a/docspec/test/docspec/test_deserialize.py +++ b/docspec/test/docspec/test_deserialize.py @@ -92,7 +92,7 @@ def test_serialize_deserialize(module: docspec.Module) -> None: assert deser == module def _deep_comparison(a: t.Any, b: t.Any, path: list[str | int], seen: set[int]) -> None: - assert type(a) == type(b), path + assert isinstance(a, type(b)), path if isinstance(a, weakref.ref): a, b = a(), b() assert a == b, path From e9889839a28e3b2fefb6a0ceca2e21faaf7a793a Mon Sep 17 00:00:00 2001 From: Michael Collins Date: Sun, 12 May 2024 09:13:18 -0700 Subject: [PATCH 4/9] Revert type: ignored My version of mypy required this, but the GitHub actions is flagging it as unused. --- docspec/src/docspec/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docspec/src/docspec/__main__.py b/docspec/src/docspec/__main__.py index 96a37a3..b81e008 100644 --- a/docspec/src/docspec/__main__.py +++ b/docspec/src/docspec/__main__.py @@ -25,7 +25,7 @@ import docspec try: - from termcolor import colored # type: ignore + from termcolor import colored except ImportError: def colored(s, *args, **kwargs): # type: ignore From 73f0d34c92ae868d4afa515d232cb57df7c7724c Mon Sep 17 00:00:00 2001 From: Michael Collins Date: Mon, 13 May 2024 10:47:55 -0700 Subject: [PATCH 5/9] Fix more lint errors --- docspec-python/src/docspec_python/__init__.py | 10 ++++------ docspec-python/src/docspec_python/parser.py | 15 +++++---------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/docspec-python/src/docspec_python/__init__.py b/docspec-python/src/docspec_python/__init__.py index dd33ffb..5b1f027 100644 --- a/docspec-python/src/docspec_python/__init__.py +++ b/docspec-python/src/docspec_python/__init__.py @@ -91,24 +91,22 @@ def load_python_modules( @t.overload -def parse_python_module( +def parse_python_module( # noqa filename: t.Union[str, Path], module_name: t.Optional[str] = None, options: t.Optional[ParserOptions] = None, encoding: t.Optional[str] = None, -) -> Module: - ... +) -> Module: ... @t.overload -def parse_python_module( +def parse_python_module( # noqa fp: t.TextIO, filename: t.Union[str, Path], module_name: t.Optional[str] = None, options: t.Optional[ParserOptions] = None, encoding: t.Optional[str] = None, -) -> Module: - ... +) -> Module: ... def parse_python_module( # type: ignore diff --git a/docspec-python/src/docspec_python/parser.py b/docspec-python/src/docspec_python/parser.py index 378fea3..059a9c5 100644 --- a/docspec-python/src/docspec_python/parser.py +++ b/docspec-python/src/docspec_python/parser.py @@ -107,18 +107,15 @@ def dedent_docstring(s: str) -> str: @t.overload -def find(predicate: t.Callable[[T], t.Any], iterable: t.Iterable[T], as_type: None = None) -> T | None: - ... +def find(predicate: t.Callable[[T], t.Any], iterable: t.Iterable[T], as_type: None = None) -> T | None: ... # noqa @t.overload -def find(predicate: t.Callable[[T], t.Any], iterable: t.Iterable[T], as_type: type[V]) -> V | None: - ... +def find(predicate: t.Callable[[T], t.Any], iterable: t.Iterable[T], as_type: type[V]) -> V | None: ... # noqa @t.overload -def find(predicate: None, iterable: t.Iterable[T], as_type: type[V]) -> V | None: - ... +def find(predicate: None, iterable: t.Iterable[T], as_type: type[V]) -> V | None: ... # noqa def find( @@ -149,13 +146,11 @@ def find( @t.overload -def get(predicate: t.Callable[[T], object], iterable: t.Iterable[T], as_type: None = None) -> T: - ... +def get(predicate: t.Callable[[T], object], iterable: t.Iterable[T], as_type: None = None) -> T: ... # noqa @t.overload -def get(predicate: t.Callable[[T], object], iterable: t.Iterable[T], as_type: type[V]) -> V: - ... +def get(predicate: t.Callable[[T], object], iterable: t.Iterable[T], as_type: type[V]) -> V: ... # noqa def get(predicate: t.Callable[[T], object], iterable: t.Iterable[T], as_type: type[V] | None = None) -> T | V: From 4c1fec7cc48c1b1623646fe19ccdd49d02c20324 Mon Sep 17 00:00:00 2001 From: Michael Collins Date: Tue, 4 Jun 2024 08:54:36 -0700 Subject: [PATCH 6/9] Remove python 3.7 from test action --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index c034903..14c7192 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.x"] + python-version: ["3.8", "3.9", "3.10", "3.x"] project: ["docspec", "docspec-python"] steps: - uses: actions/checkout@v3 From 1db6da900b552858af5e01c44396141ffbfa842a Mon Sep 17 00:00:00 2001 From: Michael Collins Date: Tue, 4 Jun 2024 08:55:08 -0700 Subject: [PATCH 7/9] Pin black to 24.x --- docspec-python/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docspec-python/pyproject.toml b/docspec-python/pyproject.toml index 352b718..919712f 100644 --- a/docspec-python/pyproject.toml +++ b/docspec-python/pyproject.toml @@ -17,7 +17,7 @@ packages = [{ include = "docspec_python", from="src" }] python = "^3.7" docspec = "^2.2.1" "nr.util" = ">=0.7.0" -black = ">=23.1.0" +black = "^24.4.2" [tool.poetry.dev-dependencies] black = "*" From 3f0eccf591fc2a1318b5025e3671a2b9264d08da Mon Sep 17 00:00:00 2001 From: Michael Collins Date: Mon, 4 Nov 2024 09:50:51 -0800 Subject: [PATCH 8/9] Bump min python to 3.8 --- docspec-python/pyproject.toml | 2 +- docspec/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docspec-python/pyproject.toml b/docspec-python/pyproject.toml index 919712f..b6c427d 100644 --- a/docspec-python/pyproject.toml +++ b/docspec-python/pyproject.toml @@ -14,7 +14,7 @@ homepage = "https://github.com/NiklasRosenstein/docspec/" packages = [{ include = "docspec_python", from="src" }] [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" docspec = "^2.2.1" "nr.util" = ">=0.7.0" black = "^24.4.2" diff --git a/docspec/pyproject.toml b/docspec/pyproject.toml index e8318b7..3d7a07a 100644 --- a/docspec/pyproject.toml +++ b/docspec/pyproject.toml @@ -9,7 +9,7 @@ homepage = "https://github.com/NiklasRosenstein/docspec/" packages = [{include="docspec", from="src"}] [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" "databind.core" = "^4.2.6" "databind.json" = "^4.2.6" Deprecated = "^1.2.12" From 877d5ef0aa6d5519d7596ed9c90c408f472641a0 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Tue, 3 Dec 2024 16:06:42 +0100 Subject: [PATCH 9/9] disable "changelog-update" job for the time being; --- .github/workflows/python.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 14c7192..bc77509 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -24,14 +24,14 @@ jobs: - run: slap install --only ${{ matrix.project }} --no-venv-check -v - run: DOCSPEC_TEST_NO_DEVELOP=true slap test ${{ matrix.project }} - changelog-update: - name: "Insert the Pull Request URL into new changelog entries" - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - steps: - - uses: actions/checkout@v2 - - uses: NiklasRosenstein/slap@gha/changelog/update/v2 - with: { version: '*' } + # changelog-update: + # name: "Insert the Pull Request URL into new changelog entries" + # runs-on: ubuntu-latest + # if: github.event_name == 'pull_request' + # steps: + # - uses: actions/checkout@v2 + # - uses: NiklasRosenstein/slap@gha/changelog/update/v2 + # with: { version: '*' } docs: runs-on: ubuntu-latest