From f8b1720a706e3a0226dcce2ca6f7f851061f2cd0 Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Sat, 29 Nov 2025 14:07:32 +0100 Subject: [PATCH 01/20] Change folder structure By uploading a Python Wheel, we will not be restricted in our folder structure anymore. --- .flake8 | 2 +- .github/workflows/ci.yml | 2 +- docs/source/conf.py | 2 +- mypy.ini | 2 +- {st3 => src}/.pydocstyle | 0 {st3 => src}/sublime_lib/__init__.py | 0 {st3 => src}/sublime_lib/_compat/__init__.py | 0 {st3 => src}/sublime_lib/_compat/enum.py | 0 {st3 => src}/sublime_lib/_compat/pathlib.py | 0 {st3 => src}/sublime_lib/_compat/typing.py | 0 {st3 => src}/sublime_lib/_compat/typing_stubs.py | 0 {st3 => src}/sublime_lib/_util/__init__.py | 0 {st3 => src}/sublime_lib/_util/collections.py | 0 {st3 => src}/sublime_lib/_util/enum.py | 0 {st3 => src}/sublime_lib/_util/glob.py | 0 {st3 => src}/sublime_lib/_util/guard.py | 0 {st3 => src}/sublime_lib/_util/named_value.py | 0 {st3 => src}/sublime_lib/_util/simple_yaml.py | 0 {st3 => src}/sublime_lib/_util/weak_method.py | 0 {st3 => src}/sublime_lib/activity_indicator.py | 0 {st3 => src}/sublime_lib/encodings.py | 0 {st3 => src}/sublime_lib/flags.py | 0 {st3 => src}/sublime_lib/panel.py | 0 {st3 => src}/sublime_lib/region_manager.py | 0 {st3 => src}/sublime_lib/resource_path.py | 0 {st3 => src}/sublime_lib/settings_dict.py | 0 {st3 => src}/sublime_lib/show_selection_panel.py | 0 {st3 => src}/sublime_lib/syntax.py | 0 {st3 => src}/sublime_lib/vendor/__init__.py | 0 {st3 => src}/sublime_lib/vendor/pathlib/LICENSE.txt | 0 {st3 => src}/sublime_lib/vendor/pathlib/__init__.py | 0 {st3 => src}/sublime_lib/vendor/pathlib/pathlib.py | 0 {st3 => src}/sublime_lib/vendor/pathlib/test_pathlib.py | 0 {st3 => src}/sublime_lib/vendor/python/LICENSE | 0 {st3 => src}/sublime_lib/vendor/python/README | 0 {st3 => src}/sublime_lib/vendor/python/__init__.py | 0 {st3 => src}/sublime_lib/vendor/python/enum.py | 0 {st3 => src}/sublime_lib/vendor/python/types.py | 0 {st3 => src}/sublime_lib/view_stream.py | 0 {st3 => src}/sublime_lib/view_utils.py | 0 {st3 => src}/sublime_lib/window_utils.py | 0 41 files changed, 4 insertions(+), 4 deletions(-) rename {st3 => src}/.pydocstyle (100%) rename {st3 => src}/sublime_lib/__init__.py (100%) rename {st3 => src}/sublime_lib/_compat/__init__.py (100%) rename {st3 => src}/sublime_lib/_compat/enum.py (100%) rename {st3 => src}/sublime_lib/_compat/pathlib.py (100%) rename {st3 => src}/sublime_lib/_compat/typing.py (100%) rename {st3 => src}/sublime_lib/_compat/typing_stubs.py (100%) rename {st3 => src}/sublime_lib/_util/__init__.py (100%) rename {st3 => src}/sublime_lib/_util/collections.py (100%) rename {st3 => src}/sublime_lib/_util/enum.py (100%) rename {st3 => src}/sublime_lib/_util/glob.py (100%) rename {st3 => src}/sublime_lib/_util/guard.py (100%) rename {st3 => src}/sublime_lib/_util/named_value.py (100%) rename {st3 => src}/sublime_lib/_util/simple_yaml.py (100%) rename {st3 => src}/sublime_lib/_util/weak_method.py (100%) rename {st3 => src}/sublime_lib/activity_indicator.py (100%) rename {st3 => src}/sublime_lib/encodings.py (100%) rename {st3 => src}/sublime_lib/flags.py (100%) rename {st3 => src}/sublime_lib/panel.py (100%) rename {st3 => src}/sublime_lib/region_manager.py (100%) rename {st3 => src}/sublime_lib/resource_path.py (100%) rename {st3 => src}/sublime_lib/settings_dict.py (100%) rename {st3 => src}/sublime_lib/show_selection_panel.py (100%) rename {st3 => src}/sublime_lib/syntax.py (100%) rename {st3 => src}/sublime_lib/vendor/__init__.py (100%) rename {st3 => src}/sublime_lib/vendor/pathlib/LICENSE.txt (100%) rename {st3 => src}/sublime_lib/vendor/pathlib/__init__.py (100%) rename {st3 => src}/sublime_lib/vendor/pathlib/pathlib.py (100%) rename {st3 => src}/sublime_lib/vendor/pathlib/test_pathlib.py (100%) rename {st3 => src}/sublime_lib/vendor/python/LICENSE (100%) rename {st3 => src}/sublime_lib/vendor/python/README (100%) rename {st3 => src}/sublime_lib/vendor/python/__init__.py (100%) rename {st3 => src}/sublime_lib/vendor/python/enum.py (100%) rename {st3 => src}/sublime_lib/vendor/python/types.py (100%) rename {st3 => src}/sublime_lib/view_stream.py (100%) rename {st3 => src}/sublime_lib/view_utils.py (100%) rename {st3 => src}/sublime_lib/window_utils.py (100%) diff --git a/.flake8 b/.flake8 index 9fd7e92..d3aff44 100644 --- a/.flake8 +++ b/.flake8 @@ -6,7 +6,7 @@ ignore = exclude = .git, - st3/sublime_lib/vendor, + src/sublime_lib/vendor, .venv, max-line-length = 99 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb9629f..7503fcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,5 +37,5 @@ jobs: - name: Run pydocstyle (allow failure) run: pydocstyle - working-directory: st3/sublime_lib + working-directory: src/sublime_lib continue-on-error: true diff --git a/docs/source/conf.py b/docs/source/conf.py index a1887f0..e7b597b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,7 +14,7 @@ # import os import sys -sys.path.insert(0, os.path.abspath('../../st3')) +sys.path.insert(0, os.path.abspath('../../src')) sys.path.insert(0, os.path.abspath('extensions')) sys.path.insert(0, os.path.abspath('mocks')) diff --git a/mypy.ini b/mypy.ini index 8417946..d5cea5f 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2,7 +2,7 @@ check_untyped_defs = True disallow_untyped_defs = True mypy_path = - st3, + src, stubs, [mypy-sublime_lib.vendor.*] diff --git a/st3/.pydocstyle b/src/.pydocstyle similarity index 100% rename from st3/.pydocstyle rename to src/.pydocstyle diff --git a/st3/sublime_lib/__init__.py b/src/sublime_lib/__init__.py similarity index 100% rename from st3/sublime_lib/__init__.py rename to src/sublime_lib/__init__.py diff --git a/st3/sublime_lib/_compat/__init__.py b/src/sublime_lib/_compat/__init__.py similarity index 100% rename from st3/sublime_lib/_compat/__init__.py rename to src/sublime_lib/_compat/__init__.py diff --git a/st3/sublime_lib/_compat/enum.py b/src/sublime_lib/_compat/enum.py similarity index 100% rename from st3/sublime_lib/_compat/enum.py rename to src/sublime_lib/_compat/enum.py diff --git a/st3/sublime_lib/_compat/pathlib.py b/src/sublime_lib/_compat/pathlib.py similarity index 100% rename from st3/sublime_lib/_compat/pathlib.py rename to src/sublime_lib/_compat/pathlib.py diff --git a/st3/sublime_lib/_compat/typing.py b/src/sublime_lib/_compat/typing.py similarity index 100% rename from st3/sublime_lib/_compat/typing.py rename to src/sublime_lib/_compat/typing.py diff --git a/st3/sublime_lib/_compat/typing_stubs.py b/src/sublime_lib/_compat/typing_stubs.py similarity index 100% rename from st3/sublime_lib/_compat/typing_stubs.py rename to src/sublime_lib/_compat/typing_stubs.py diff --git a/st3/sublime_lib/_util/__init__.py b/src/sublime_lib/_util/__init__.py similarity index 100% rename from st3/sublime_lib/_util/__init__.py rename to src/sublime_lib/_util/__init__.py diff --git a/st3/sublime_lib/_util/collections.py b/src/sublime_lib/_util/collections.py similarity index 100% rename from st3/sublime_lib/_util/collections.py rename to src/sublime_lib/_util/collections.py diff --git a/st3/sublime_lib/_util/enum.py b/src/sublime_lib/_util/enum.py similarity index 100% rename from st3/sublime_lib/_util/enum.py rename to src/sublime_lib/_util/enum.py diff --git a/st3/sublime_lib/_util/glob.py b/src/sublime_lib/_util/glob.py similarity index 100% rename from st3/sublime_lib/_util/glob.py rename to src/sublime_lib/_util/glob.py diff --git a/st3/sublime_lib/_util/guard.py b/src/sublime_lib/_util/guard.py similarity index 100% rename from st3/sublime_lib/_util/guard.py rename to src/sublime_lib/_util/guard.py diff --git a/st3/sublime_lib/_util/named_value.py b/src/sublime_lib/_util/named_value.py similarity index 100% rename from st3/sublime_lib/_util/named_value.py rename to src/sublime_lib/_util/named_value.py diff --git a/st3/sublime_lib/_util/simple_yaml.py b/src/sublime_lib/_util/simple_yaml.py similarity index 100% rename from st3/sublime_lib/_util/simple_yaml.py rename to src/sublime_lib/_util/simple_yaml.py diff --git a/st3/sublime_lib/_util/weak_method.py b/src/sublime_lib/_util/weak_method.py similarity index 100% rename from st3/sublime_lib/_util/weak_method.py rename to src/sublime_lib/_util/weak_method.py diff --git a/st3/sublime_lib/activity_indicator.py b/src/sublime_lib/activity_indicator.py similarity index 100% rename from st3/sublime_lib/activity_indicator.py rename to src/sublime_lib/activity_indicator.py diff --git a/st3/sublime_lib/encodings.py b/src/sublime_lib/encodings.py similarity index 100% rename from st3/sublime_lib/encodings.py rename to src/sublime_lib/encodings.py diff --git a/st3/sublime_lib/flags.py b/src/sublime_lib/flags.py similarity index 100% rename from st3/sublime_lib/flags.py rename to src/sublime_lib/flags.py diff --git a/st3/sublime_lib/panel.py b/src/sublime_lib/panel.py similarity index 100% rename from st3/sublime_lib/panel.py rename to src/sublime_lib/panel.py diff --git a/st3/sublime_lib/region_manager.py b/src/sublime_lib/region_manager.py similarity index 100% rename from st3/sublime_lib/region_manager.py rename to src/sublime_lib/region_manager.py diff --git a/st3/sublime_lib/resource_path.py b/src/sublime_lib/resource_path.py similarity index 100% rename from st3/sublime_lib/resource_path.py rename to src/sublime_lib/resource_path.py diff --git a/st3/sublime_lib/settings_dict.py b/src/sublime_lib/settings_dict.py similarity index 100% rename from st3/sublime_lib/settings_dict.py rename to src/sublime_lib/settings_dict.py diff --git a/st3/sublime_lib/show_selection_panel.py b/src/sublime_lib/show_selection_panel.py similarity index 100% rename from st3/sublime_lib/show_selection_panel.py rename to src/sublime_lib/show_selection_panel.py diff --git a/st3/sublime_lib/syntax.py b/src/sublime_lib/syntax.py similarity index 100% rename from st3/sublime_lib/syntax.py rename to src/sublime_lib/syntax.py diff --git a/st3/sublime_lib/vendor/__init__.py b/src/sublime_lib/vendor/__init__.py similarity index 100% rename from st3/sublime_lib/vendor/__init__.py rename to src/sublime_lib/vendor/__init__.py diff --git a/st3/sublime_lib/vendor/pathlib/LICENSE.txt b/src/sublime_lib/vendor/pathlib/LICENSE.txt similarity index 100% rename from st3/sublime_lib/vendor/pathlib/LICENSE.txt rename to src/sublime_lib/vendor/pathlib/LICENSE.txt diff --git a/st3/sublime_lib/vendor/pathlib/__init__.py b/src/sublime_lib/vendor/pathlib/__init__.py similarity index 100% rename from st3/sublime_lib/vendor/pathlib/__init__.py rename to src/sublime_lib/vendor/pathlib/__init__.py diff --git a/st3/sublime_lib/vendor/pathlib/pathlib.py b/src/sublime_lib/vendor/pathlib/pathlib.py similarity index 100% rename from st3/sublime_lib/vendor/pathlib/pathlib.py rename to src/sublime_lib/vendor/pathlib/pathlib.py diff --git a/st3/sublime_lib/vendor/pathlib/test_pathlib.py b/src/sublime_lib/vendor/pathlib/test_pathlib.py similarity index 100% rename from st3/sublime_lib/vendor/pathlib/test_pathlib.py rename to src/sublime_lib/vendor/pathlib/test_pathlib.py diff --git a/st3/sublime_lib/vendor/python/LICENSE b/src/sublime_lib/vendor/python/LICENSE similarity index 100% rename from st3/sublime_lib/vendor/python/LICENSE rename to src/sublime_lib/vendor/python/LICENSE diff --git a/st3/sublime_lib/vendor/python/README b/src/sublime_lib/vendor/python/README similarity index 100% rename from st3/sublime_lib/vendor/python/README rename to src/sublime_lib/vendor/python/README diff --git a/st3/sublime_lib/vendor/python/__init__.py b/src/sublime_lib/vendor/python/__init__.py similarity index 100% rename from st3/sublime_lib/vendor/python/__init__.py rename to src/sublime_lib/vendor/python/__init__.py diff --git a/st3/sublime_lib/vendor/python/enum.py b/src/sublime_lib/vendor/python/enum.py similarity index 100% rename from st3/sublime_lib/vendor/python/enum.py rename to src/sublime_lib/vendor/python/enum.py diff --git a/st3/sublime_lib/vendor/python/types.py b/src/sublime_lib/vendor/python/types.py similarity index 100% rename from st3/sublime_lib/vendor/python/types.py rename to src/sublime_lib/vendor/python/types.py diff --git a/st3/sublime_lib/view_stream.py b/src/sublime_lib/view_stream.py similarity index 100% rename from st3/sublime_lib/view_stream.py rename to src/sublime_lib/view_stream.py diff --git a/st3/sublime_lib/view_utils.py b/src/sublime_lib/view_utils.py similarity index 100% rename from st3/sublime_lib/view_utils.py rename to src/sublime_lib/view_utils.py diff --git a/st3/sublime_lib/window_utils.py b/src/sublime_lib/window_utils.py similarity index 100% rename from st3/sublime_lib/window_utils.py rename to src/sublime_lib/window_utils.py From 9c42c281bb9cb6bbbdf181811f38e21af27a57d3 Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Sat, 29 Nov 2025 14:12:52 +0100 Subject: [PATCH 02/20] Move .pydocstyle to root --- src/.pydocstyle => .pydocstyle | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/.pydocstyle => .pydocstyle (100%) diff --git a/src/.pydocstyle b/.pydocstyle similarity index 100% rename from src/.pydocstyle rename to .pydocstyle From 275175802a4369163ce5cd8df35dd15675673326 Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Sat, 29 Nov 2025 14:12:58 +0100 Subject: [PATCH 03/20] Add pyproject.toml --- pyproject.toml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a91b393 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,25 @@ +[project] +name = "sublime_lib" +version = "1.6.0" +description = "Utility library for frequently used functionality in Sublime Text" +readme = "README.md" +license = {file = "LICENSE"} +authors = [{name = "FichteFoll"}, {name = "Thom1729"}] +classifiers = [ + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Software Development :: Libraries :: Python Modules", +] +requires-python = ">=3.3" + +[build-system] +requires = ["hatchling>=1.20", "hatch-vcs>=0.4"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.sdist] +exclude = [ + "/.*", + "/stubs", + "*.lock", +] From f82fa0a9b3bcca9299f7210ce7c9fa8c907cf628 Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Sat, 29 Nov 2025 14:13:33 +0100 Subject: [PATCH 04/20] Move coverage configuration to pyproject.toml --- .coveragerc | 8 -------- pyproject.toml | 10 ++++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 1677714..0000000 --- a/.coveragerc +++ /dev/null @@ -1,8 +0,0 @@ -[run] -omit = - */tests/* - */vendor/* - */_compat/* - -[report] -show_missing = True diff --git a/pyproject.toml b/pyproject.toml index a91b393..b3ef808 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,3 +23,13 @@ exclude = [ "/stubs", "*.lock", ] + +[tool.coverage.run] +omit = [ + "*/_compat/*", + "*/tests/*", + "*/vendor/*", +] + +[tool.coverage.report] +show_missing = true From ae2050ade292e13f7a486b73d4bb4f7fca48237e Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Sat, 29 Nov 2025 14:15:10 +0100 Subject: [PATCH 05/20] Remove .sublime-dependency file Since this folder won't be used as a dependency directly anymore. --- .sublime-dependency | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .sublime-dependency diff --git a/.sublime-dependency b/.sublime-dependency deleted file mode 100644 index 8a0f05e..0000000 --- a/.sublime-dependency +++ /dev/null @@ -1 +0,0 @@ -01 From bf6f0b4434b69570322055f26e7961b76e75f62b Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Sat, 29 Nov 2025 14:22:02 +0100 Subject: [PATCH 06/20] Move pydocstyle config into pyproject.toml --- .pydocstyle | 4 ---- pyproject.toml | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 .pydocstyle diff --git a/.pydocstyle b/.pydocstyle deleted file mode 100644 index 3ec40c2..0000000 --- a/.pydocstyle +++ /dev/null @@ -1,4 +0,0 @@ -[pydocstyle] - -match_dir = ^(?!_) -match = ^(?!_).*\.py diff --git a/pyproject.toml b/pyproject.toml index b3ef808..a972763 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,3 +33,7 @@ omit = [ [tool.coverage.report] show_missing = true + +[tool.pydocstyle] +match_dir = "^(?!_)" +match = "^(?!_).*\\.py" From 07d31870b5b336e0948ab510c62e6cd437682718 Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Sat, 29 Nov 2025 14:34:04 +0100 Subject: [PATCH 07/20] Specify dev dependencies & use uv in CI --- .github/workflows/ci.yml | 33 +++++++++++++++------------------ pyproject.toml | 7 +++++++ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7503fcd..531a2e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,36 +6,33 @@ jobs: flake8: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v1 + - name: Setup Python 3.8 + uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.8' - - name: Install flake8 - run: | - python -m pip install -U pip - pip install flake8 + - name: Install dev dependencies + run: uv sync --group dev - - run: flake8 . + - name: Run flake8 + run: uv run flake8 . pydocstyle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v1 + - name: Setup Python 3.8 + uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.8' - - name: Install pydocstyle - run: | - python -m pip install -U pip - pip install pydocstyle + - name: Install dev dependencies + run: uv sync --group dev - name: Run pydocstyle (allow failure) - run: pydocstyle + run: uv run pydocstyle working-directory: src/sublime_lib continue-on-error: true diff --git a/pyproject.toml b/pyproject.toml index a972763..22e4eb3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,13 @@ requires-python = ">=3.3" requires = ["hatchling>=1.20", "hatch-vcs>=0.4"] build-backend = "hatchling.build" +[dependency-groups] +dev = [ + "flake8>=3.9.2", + "mypy>=0.720", + "pydocstyle>=4.0.0", +] + [tool.hatch.build.targets.sdist] exclude = [ "/.*", From b3618d2b97a5b68eb0deb69b11441c673b028d69 Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Sat, 29 Nov 2025 15:05:22 +0100 Subject: [PATCH 08/20] Update .gitignore --- .gitignore | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 00ac3f8..298d126 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,15 @@ +# caches __pycache__ .mypy_cache -docs/html/ -docs/source/modules/ -*.doctree -*.pickle -modules.rst + +# build artifacts +dist/ + +# docs build artifacts +/docs/html/ +/docs/doctrees/ + +# editor files +*.sublime-project +*.sublime-workspace + From bb3d20b3de5caae201760134069016e7e7266c1b Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Dec 2025 17:31:33 +0100 Subject: [PATCH 09/20] CI: common lint workflow using uv Use single worker instance to perform both flake8 and pycodestyle checks. No need to spin up 2 separate VMs for those related tasks. --- .flake8 | 6 +++-- .github/workflows/ci.yml | 38 -------------------------------- .github/workflows/lint.yml | 22 ++++++++++++++++++ pyproject.toml | 2 +- src/sublime_lib/flags.py | 1 - src/sublime_lib/settings_dict.py | 2 +- 6 files changed, 28 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/lint.yml diff --git a/.flake8 b/.flake8 index d3aff44..8fe9687 100644 --- a/.flake8 +++ b/.flake8 @@ -1,8 +1,10 @@ [flake8] ignore = - E731, # do not assign a lambda expression, use a def - W503, # line break before binary operator + # do not assign a lambda expression, use a def + E731, + # line break before binary operator + W503, exclude = .git, diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 531a2e7..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: CI - -on: [push, pull_request] - -jobs: - flake8: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Python 3.8 - uses: actions/setup-python@v5 - with: - python-version: '3.8' - - - name: Install dev dependencies - run: uv sync --group dev - - - name: Run flake8 - run: uv run flake8 . - - pydocstyle: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Python 3.8 - uses: actions/setup-python@v5 - with: - python-version: '3.8' - - - name: Install dev dependencies - run: uv sync --group dev - - - name: Run pydocstyle (allow failure) - run: uv run pydocstyle - working-directory: src/sublime_lib - continue-on-error: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..025485d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,22 @@ +name: lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Setup uv + uses: astral-sh/setup-uv@v7 + + - name: Install lint dependencies + run: uv sync --group lint + + - name: Run flake8 + run: uv run flake8 . + + - name: Run pydocstyle (allow failure) + run: uv run pydocstyle src/sublime_lib + continue-on-error: true diff --git a/pyproject.toml b/pyproject.toml index 22e4eb3..991ad5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ requires = ["hatchling>=1.20", "hatch-vcs>=0.4"] build-backend = "hatchling.build" [dependency-groups] -dev = [ +lint = [ "flake8>=3.9.2", "mypy>=0.720", "pydocstyle>=4.0.0", diff --git a/src/sublime_lib/flags.py b/src/sublime_lib/flags.py index 0027ff5..cd62854 100644 --- a/src/sublime_lib/flags.py +++ b/src/sublime_lib/flags.py @@ -39,7 +39,6 @@ from ._compat.typing import Callable, Optional - __all__ = [ 'DialogResult', 'PointClass', 'FindOption', 'RegionOption', 'PopupOption', 'PhantomLayout', 'OpenFileOption', 'QuickPanelOption', diff --git a/src/sublime_lib/settings_dict.py b/src/sublime_lib/settings_dict.py index a5158b0..c4f8c73 100644 --- a/src/sublime_lib/settings_dict.py +++ b/src/sublime_lib/settings_dict.py @@ -54,7 +54,7 @@ def __eq__(self, other: object) -> bool: and refer to the same underlying settings data. """ return ( - type(self) == type(other) + type(self) is type(other) and isinstance(other, SettingsDict) and self.settings.settings_id == other.settings.settings_id ) From c13d182950346a514430f7b2a6e5946f629032ac Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Dec 2025 17:41:11 +0100 Subject: [PATCH 10/20] CI: generate gh-pages using uv --- .github/workflows/gh-pages.yml | 25 +++++++------------------ docs/Makefile | 2 +- pyproject.toml | 4 ++++ 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 900d369..6ef5bf1 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -7,29 +7,18 @@ on: jobs: deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: '3.x' + - name: Setup uv + uses: astral-sh/setup-uv@v7 - - name: Install Dependencies - run: | - python -m pip install -U pip - python -m pip install -U sphinx - python -m pip install -U sphinxcontrib.prettyspecialmethods + - name: Install dev dependencies + run: uv sync --group docs - name: Build Docs - run: make -C docs clean html - ## https://github.com/marketplace/actions/sphinx-build - # uses: ammaraskar/sphinx-action@0.3 - # with: - # docs-folder: docs/ - # repo-token: ${{ secrets.GITHUB_TOKEN }} - # build-command: "make clean html" + run: uv run sphinx-build -M html "docs/source/" "docs/" - name: Deploy Docs uses: peaceiris/actions-gh-pages@v3 diff --git a/docs/Makefile b/docs/Makefile index 52ca746..0938487 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -7,7 +7,7 @@ BUILDDIR = . .PHONY: clean html: - sphinx-build -M html "$(SOURCEDIR)" "$(BUILDDIR)" + uv run sphinx-build -M html "$(SOURCEDIR)" "$(BUILDDIR)" clean: rm -rf doctrees html diff --git a/pyproject.toml b/pyproject.toml index 991ad5e..4418f8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,10 @@ requires = ["hatchling>=1.20", "hatch-vcs>=0.4"] build-backend = "hatchling.build" [dependency-groups] +docs = [ + "sphinx==4.0.2", + "sphinxcontrib-prettyspecialmethods>=0.1.0", +] lint = [ "flake8>=3.9.2", "mypy>=0.720", From f0591c8d8e496e8f61ed838f9bb0beaa9f6adfee Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Sat, 29 Nov 2025 14:55:25 +0100 Subject: [PATCH 11/20] CI: Add release action --- .github/workflows/release.yml | 26 ++++++++++++++++++++++++++ .gitignore | 1 + README.md | 10 ++++++++++ pyproject.toml | 9 ++++++++- 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..080554f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Publish Release + +on: + push: + tags: + - v* + +jobs: + release: + name: Create and publish release + env: + GH_TOKEN: ${{ github.token }} + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install uv + uses: astral-sh/setup-uv@v7 + + - name: Build wheel + run: uv build --wheel + + - name: Create release & upload wheel + run: gh release create --generate-notes --latest -t "$GITHUB_REF_NAME" "$GITHUB_REF_NAME" dist/*.whl diff --git a/.gitignore b/.gitignore index 298d126..68461f0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ __pycache__ # build artifacts dist/ +_version.py # docs build artifacts /docs/html/ diff --git a/README.md b/README.md index d46d7a2..5bd02db 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,13 @@ Highlights include: - [`SettingsDict`](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.settings_dict.html), which wraps a `sublime.Settings` object with an interface modeled after a standard Python `dict`. - [`ViewStream`](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.view_stream.html), a standard [Python IO stream](https://docs.python.org/3/library/io.html#io.TextIOBase) wrapping a `sublime.View` object; and [OutputPanel](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.output_panel.html), which extends `ViewStream` to provide additional functionality for output panel views. - The [`syntax` submodule](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.syntax.html), providing methods to list all loaded syntax definitions and to find a syntax matching a given scope. + + +## Releasing a new version + +1. Create a tag in the format `v..` +2. Push the tag to origin. + +A github action should be created that builds a WHEEL file, +creates a release for this tag +and attaches the WHEEL file as an artifact. diff --git a/pyproject.toml b/pyproject.toml index 4418f8e..71b981d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sublime_lib" -version = "1.6.0" +dynamic = ["version"] description = "Utility library for frequently used functionality in Sublime Text" readme = "README.md" license = {file = "LICENSE"} @@ -35,6 +35,13 @@ exclude = [ "*.lock", ] +[tool.hatch.version] +source = "vcs" + +[tool.hatch.build.hooks.vcs] +version-file = "src/sublime_lib/_version.py" +tag-pattern = "v{version}" + [tool.coverage.run] omit = [ "*/_compat/*", From d7d392649be51368ac56e9f3d1a063dea15c397e Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Dec 2025 18:03:57 +0100 Subject: [PATCH 12/20] CI: Adjust required python version Stupid restriction, but despite a project supporting e.g. python 3.3, and only some secondary tools like sphinx needing more recent versions to run, uv fails to install it due to specified `required-python` value. Actually an argument to ditch uv, especially as all the CI is damn naive simple, and uv seems over the top for it, but well. It's the current hype. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 71b981d..8e512c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ classifiers = [ "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", ] -requires-python = ">=3.3" +requires-python = ">=3.8" [build-system] requires = ["hatchling>=1.20", "hatch-vcs>=0.4"] From 679be23bd9440d8e278227877104c31c21464178 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Dec 2025 19:10:40 +0100 Subject: [PATCH 13/20] CI: Prevent double actions from PRs within the repo --- .github/workflows/lint.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 025485d..49561df 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,12 @@ name: lint -on: [push, pull_request] +on: + push: + branches: + - master + - develop + pull_request: + workflow_dispatch: jobs: lint: From 55e80bc0d1cdfd6523ff4a87d5c5a88eafe8ca76 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Dec 2025 19:12:40 +0100 Subject: [PATCH 14/20] Move sublime_lib upwards one level --- .flake8 | 2 +- .github/workflows/lint.yml | 4 ++-- pyproject.toml | 2 +- {src/sublime_lib => sublime_lib}/__init__.py | 0 {src/sublime_lib => sublime_lib}/_compat/__init__.py | 0 {src/sublime_lib => sublime_lib}/_compat/enum.py | 0 {src/sublime_lib => sublime_lib}/_compat/pathlib.py | 0 {src/sublime_lib => sublime_lib}/_compat/typing.py | 0 {src/sublime_lib => sublime_lib}/_compat/typing_stubs.py | 0 {src/sublime_lib => sublime_lib}/_util/__init__.py | 0 {src/sublime_lib => sublime_lib}/_util/collections.py | 0 {src/sublime_lib => sublime_lib}/_util/enum.py | 0 {src/sublime_lib => sublime_lib}/_util/glob.py | 0 {src/sublime_lib => sublime_lib}/_util/guard.py | 0 {src/sublime_lib => sublime_lib}/_util/named_value.py | 0 {src/sublime_lib => sublime_lib}/_util/simple_yaml.py | 0 {src/sublime_lib => sublime_lib}/_util/weak_method.py | 0 {src/sublime_lib => sublime_lib}/activity_indicator.py | 0 {src/sublime_lib => sublime_lib}/encodings.py | 0 {src/sublime_lib => sublime_lib}/flags.py | 0 {src/sublime_lib => sublime_lib}/panel.py | 0 {src/sublime_lib => sublime_lib}/region_manager.py | 0 {src/sublime_lib => sublime_lib}/resource_path.py | 0 {src/sublime_lib => sublime_lib}/settings_dict.py | 0 {src/sublime_lib => sublime_lib}/show_selection_panel.py | 0 {src/sublime_lib => sublime_lib}/syntax.py | 0 {src/sublime_lib => sublime_lib}/vendor/__init__.py | 0 {src/sublime_lib => sublime_lib}/vendor/pathlib/LICENSE.txt | 0 {src/sublime_lib => sublime_lib}/vendor/pathlib/__init__.py | 0 {src/sublime_lib => sublime_lib}/vendor/pathlib/pathlib.py | 0 .../vendor/pathlib/test_pathlib.py | 0 {src/sublime_lib => sublime_lib}/vendor/python/LICENSE | 0 {src/sublime_lib => sublime_lib}/vendor/python/README | 0 {src/sublime_lib => sublime_lib}/vendor/python/__init__.py | 0 {src/sublime_lib => sublime_lib}/vendor/python/enum.py | 0 {src/sublime_lib => sublime_lib}/vendor/python/types.py | 0 {src/sublime_lib => sublime_lib}/view_stream.py | 0 {src/sublime_lib => sublime_lib}/view_utils.py | 0 {src/sublime_lib => sublime_lib}/window_utils.py | 0 39 files changed, 4 insertions(+), 4 deletions(-) rename {src/sublime_lib => sublime_lib}/__init__.py (100%) rename {src/sublime_lib => sublime_lib}/_compat/__init__.py (100%) rename {src/sublime_lib => sublime_lib}/_compat/enum.py (100%) rename {src/sublime_lib => sublime_lib}/_compat/pathlib.py (100%) rename {src/sublime_lib => sublime_lib}/_compat/typing.py (100%) rename {src/sublime_lib => sublime_lib}/_compat/typing_stubs.py (100%) rename {src/sublime_lib => sublime_lib}/_util/__init__.py (100%) rename {src/sublime_lib => sublime_lib}/_util/collections.py (100%) rename {src/sublime_lib => sublime_lib}/_util/enum.py (100%) rename {src/sublime_lib => sublime_lib}/_util/glob.py (100%) rename {src/sublime_lib => sublime_lib}/_util/guard.py (100%) rename {src/sublime_lib => sublime_lib}/_util/named_value.py (100%) rename {src/sublime_lib => sublime_lib}/_util/simple_yaml.py (100%) rename {src/sublime_lib => sublime_lib}/_util/weak_method.py (100%) rename {src/sublime_lib => sublime_lib}/activity_indicator.py (100%) rename {src/sublime_lib => sublime_lib}/encodings.py (100%) rename {src/sublime_lib => sublime_lib}/flags.py (100%) rename {src/sublime_lib => sublime_lib}/panel.py (100%) rename {src/sublime_lib => sublime_lib}/region_manager.py (100%) rename {src/sublime_lib => sublime_lib}/resource_path.py (100%) rename {src/sublime_lib => sublime_lib}/settings_dict.py (100%) rename {src/sublime_lib => sublime_lib}/show_selection_panel.py (100%) rename {src/sublime_lib => sublime_lib}/syntax.py (100%) rename {src/sublime_lib => sublime_lib}/vendor/__init__.py (100%) rename {src/sublime_lib => sublime_lib}/vendor/pathlib/LICENSE.txt (100%) rename {src/sublime_lib => sublime_lib}/vendor/pathlib/__init__.py (100%) rename {src/sublime_lib => sublime_lib}/vendor/pathlib/pathlib.py (100%) rename {src/sublime_lib => sublime_lib}/vendor/pathlib/test_pathlib.py (100%) mode change 100755 => 100644 rename {src/sublime_lib => sublime_lib}/vendor/python/LICENSE (100%) rename {src/sublime_lib => sublime_lib}/vendor/python/README (100%) rename {src/sublime_lib => sublime_lib}/vendor/python/__init__.py (100%) rename {src/sublime_lib => sublime_lib}/vendor/python/enum.py (100%) rename {src/sublime_lib => sublime_lib}/vendor/python/types.py (100%) rename {src/sublime_lib => sublime_lib}/view_stream.py (100%) rename {src/sublime_lib => sublime_lib}/view_utils.py (100%) rename {src/sublime_lib => sublime_lib}/window_utils.py (100%) diff --git a/.flake8 b/.flake8 index 8fe9687..c1973de 100644 --- a/.flake8 +++ b/.flake8 @@ -8,7 +8,7 @@ ignore = exclude = .git, - src/sublime_lib/vendor, .venv, + sublime_lib/vendor, max-line-length = 99 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 49561df..3ab3323 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,8 +21,8 @@ jobs: run: uv sync --group lint - name: Run flake8 - run: uv run flake8 . + run: uv run flake8 sublime_lib - name: Run pydocstyle (allow failure) - run: uv run pydocstyle src/sublime_lib + run: uv run pydocstyle sublime_lib continue-on-error: true diff --git a/pyproject.toml b/pyproject.toml index 8e512c4..0161bbc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ exclude = [ source = "vcs" [tool.hatch.build.hooks.vcs] -version-file = "src/sublime_lib/_version.py" +version-file = "sublime_lib/_version.py" tag-pattern = "v{version}" [tool.coverage.run] diff --git a/src/sublime_lib/__init__.py b/sublime_lib/__init__.py similarity index 100% rename from src/sublime_lib/__init__.py rename to sublime_lib/__init__.py diff --git a/src/sublime_lib/_compat/__init__.py b/sublime_lib/_compat/__init__.py similarity index 100% rename from src/sublime_lib/_compat/__init__.py rename to sublime_lib/_compat/__init__.py diff --git a/src/sublime_lib/_compat/enum.py b/sublime_lib/_compat/enum.py similarity index 100% rename from src/sublime_lib/_compat/enum.py rename to sublime_lib/_compat/enum.py diff --git a/src/sublime_lib/_compat/pathlib.py b/sublime_lib/_compat/pathlib.py similarity index 100% rename from src/sublime_lib/_compat/pathlib.py rename to sublime_lib/_compat/pathlib.py diff --git a/src/sublime_lib/_compat/typing.py b/sublime_lib/_compat/typing.py similarity index 100% rename from src/sublime_lib/_compat/typing.py rename to sublime_lib/_compat/typing.py diff --git a/src/sublime_lib/_compat/typing_stubs.py b/sublime_lib/_compat/typing_stubs.py similarity index 100% rename from src/sublime_lib/_compat/typing_stubs.py rename to sublime_lib/_compat/typing_stubs.py diff --git a/src/sublime_lib/_util/__init__.py b/sublime_lib/_util/__init__.py similarity index 100% rename from src/sublime_lib/_util/__init__.py rename to sublime_lib/_util/__init__.py diff --git a/src/sublime_lib/_util/collections.py b/sublime_lib/_util/collections.py similarity index 100% rename from src/sublime_lib/_util/collections.py rename to sublime_lib/_util/collections.py diff --git a/src/sublime_lib/_util/enum.py b/sublime_lib/_util/enum.py similarity index 100% rename from src/sublime_lib/_util/enum.py rename to sublime_lib/_util/enum.py diff --git a/src/sublime_lib/_util/glob.py b/sublime_lib/_util/glob.py similarity index 100% rename from src/sublime_lib/_util/glob.py rename to sublime_lib/_util/glob.py diff --git a/src/sublime_lib/_util/guard.py b/sublime_lib/_util/guard.py similarity index 100% rename from src/sublime_lib/_util/guard.py rename to sublime_lib/_util/guard.py diff --git a/src/sublime_lib/_util/named_value.py b/sublime_lib/_util/named_value.py similarity index 100% rename from src/sublime_lib/_util/named_value.py rename to sublime_lib/_util/named_value.py diff --git a/src/sublime_lib/_util/simple_yaml.py b/sublime_lib/_util/simple_yaml.py similarity index 100% rename from src/sublime_lib/_util/simple_yaml.py rename to sublime_lib/_util/simple_yaml.py diff --git a/src/sublime_lib/_util/weak_method.py b/sublime_lib/_util/weak_method.py similarity index 100% rename from src/sublime_lib/_util/weak_method.py rename to sublime_lib/_util/weak_method.py diff --git a/src/sublime_lib/activity_indicator.py b/sublime_lib/activity_indicator.py similarity index 100% rename from src/sublime_lib/activity_indicator.py rename to sublime_lib/activity_indicator.py diff --git a/src/sublime_lib/encodings.py b/sublime_lib/encodings.py similarity index 100% rename from src/sublime_lib/encodings.py rename to sublime_lib/encodings.py diff --git a/src/sublime_lib/flags.py b/sublime_lib/flags.py similarity index 100% rename from src/sublime_lib/flags.py rename to sublime_lib/flags.py diff --git a/src/sublime_lib/panel.py b/sublime_lib/panel.py similarity index 100% rename from src/sublime_lib/panel.py rename to sublime_lib/panel.py diff --git a/src/sublime_lib/region_manager.py b/sublime_lib/region_manager.py similarity index 100% rename from src/sublime_lib/region_manager.py rename to sublime_lib/region_manager.py diff --git a/src/sublime_lib/resource_path.py b/sublime_lib/resource_path.py similarity index 100% rename from src/sublime_lib/resource_path.py rename to sublime_lib/resource_path.py diff --git a/src/sublime_lib/settings_dict.py b/sublime_lib/settings_dict.py similarity index 100% rename from src/sublime_lib/settings_dict.py rename to sublime_lib/settings_dict.py diff --git a/src/sublime_lib/show_selection_panel.py b/sublime_lib/show_selection_panel.py similarity index 100% rename from src/sublime_lib/show_selection_panel.py rename to sublime_lib/show_selection_panel.py diff --git a/src/sublime_lib/syntax.py b/sublime_lib/syntax.py similarity index 100% rename from src/sublime_lib/syntax.py rename to sublime_lib/syntax.py diff --git a/src/sublime_lib/vendor/__init__.py b/sublime_lib/vendor/__init__.py similarity index 100% rename from src/sublime_lib/vendor/__init__.py rename to sublime_lib/vendor/__init__.py diff --git a/src/sublime_lib/vendor/pathlib/LICENSE.txt b/sublime_lib/vendor/pathlib/LICENSE.txt similarity index 100% rename from src/sublime_lib/vendor/pathlib/LICENSE.txt rename to sublime_lib/vendor/pathlib/LICENSE.txt diff --git a/src/sublime_lib/vendor/pathlib/__init__.py b/sublime_lib/vendor/pathlib/__init__.py similarity index 100% rename from src/sublime_lib/vendor/pathlib/__init__.py rename to sublime_lib/vendor/pathlib/__init__.py diff --git a/src/sublime_lib/vendor/pathlib/pathlib.py b/sublime_lib/vendor/pathlib/pathlib.py similarity index 100% rename from src/sublime_lib/vendor/pathlib/pathlib.py rename to sublime_lib/vendor/pathlib/pathlib.py diff --git a/src/sublime_lib/vendor/pathlib/test_pathlib.py b/sublime_lib/vendor/pathlib/test_pathlib.py old mode 100755 new mode 100644 similarity index 100% rename from src/sublime_lib/vendor/pathlib/test_pathlib.py rename to sublime_lib/vendor/pathlib/test_pathlib.py diff --git a/src/sublime_lib/vendor/python/LICENSE b/sublime_lib/vendor/python/LICENSE similarity index 100% rename from src/sublime_lib/vendor/python/LICENSE rename to sublime_lib/vendor/python/LICENSE diff --git a/src/sublime_lib/vendor/python/README b/sublime_lib/vendor/python/README similarity index 100% rename from src/sublime_lib/vendor/python/README rename to sublime_lib/vendor/python/README diff --git a/src/sublime_lib/vendor/python/__init__.py b/sublime_lib/vendor/python/__init__.py similarity index 100% rename from src/sublime_lib/vendor/python/__init__.py rename to sublime_lib/vendor/python/__init__.py diff --git a/src/sublime_lib/vendor/python/enum.py b/sublime_lib/vendor/python/enum.py similarity index 100% rename from src/sublime_lib/vendor/python/enum.py rename to sublime_lib/vendor/python/enum.py diff --git a/src/sublime_lib/vendor/python/types.py b/sublime_lib/vendor/python/types.py similarity index 100% rename from src/sublime_lib/vendor/python/types.py rename to sublime_lib/vendor/python/types.py diff --git a/src/sublime_lib/view_stream.py b/sublime_lib/view_stream.py similarity index 100% rename from src/sublime_lib/view_stream.py rename to sublime_lib/view_stream.py diff --git a/src/sublime_lib/view_utils.py b/sublime_lib/view_utils.py similarity index 100% rename from src/sublime_lib/view_utils.py rename to sublime_lib/view_utils.py diff --git a/src/sublime_lib/window_utils.py b/sublime_lib/window_utils.py similarity index 100% rename from src/sublime_lib/window_utils.py rename to sublime_lib/window_utils.py From 584bbe2d8a504627ffae5626238914be9279c2bd Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Dec 2025 19:21:04 +0100 Subject: [PATCH 15/20] Fix mypy.ini --- mypy.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy.ini b/mypy.ini index d5cea5f..5e0d507 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2,8 +2,8 @@ check_untyped_defs = True disallow_untyped_defs = True mypy_path = - src, stubs, + sublime_lib, [mypy-sublime_lib.vendor.*] ignore_errors=True From 69adc669f0cac38d880a410be57747914f32f94a Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Dec 2025 19:23:10 +0100 Subject: [PATCH 16/20] Fix sphinx config --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index e7b597b..f64466e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,7 +14,7 @@ # import os import sys -sys.path.insert(0, os.path.abspath('../../src')) +sys.path.insert(0, os.path.abspath('../../sublime_lib')) sys.path.insert(0, os.path.abspath('extensions')) sys.path.insert(0, os.path.abspath('mocks')) From 1f8afff64dbad16c20eb798d0164e47cb769f4ac Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Dec 2025 19:27:27 +0100 Subject: [PATCH 17/20] Remove unittesting.json deferred is the default in current releases --- unittesting.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 unittesting.json diff --git a/unittesting.json b/unittesting.json deleted file mode 100644 index 5fcf8eb..0000000 --- a/unittesting.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "deferred": true -} From a010ae570f10662d1b846ea90bbf9915af50a44e Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Dec 2025 22:01:22 +0100 Subject: [PATCH 18/20] Build python version specific release assets This commit enables python version specific releases without dedicated releases or tag-prefixes by creating ... sublime_lib-m.m.p-py33-none-any.whl sublime_lib-m.m.p-py38-none-any.whl which can be targetted by `"asset": "sublime_lib-*-${py_version}-none-any.whl"` in repositories' release specification. --- .github/workflows/release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 080554f..406e9a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,11 @@ jobs: uses: astral-sh/setup-uv@v7 - name: Build wheel - run: uv build --wheel + run: | + uv build --wheel + wheel=$(ls dist/*.whl) + cp $wheel ${wheel/-py3-/-py33-} + mv $wheel ${wheel/-py3-/-py38-} - name: Create release & upload wheel run: gh release create --generate-notes --latest -t "$GITHUB_REF_NAME" "$GITHUB_REF_NAME" dist/*.whl From 3f309df5ef4d8c66e7c4584f2664653ce0352af0 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Dec 2025 20:55:49 +0100 Subject: [PATCH 19/20] Migrate mypy config --- mypy.ini | 12 ------------ pyproject.toml | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 mypy.ini diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 5e0d507..0000000 --- a/mypy.ini +++ /dev/null @@ -1,12 +0,0 @@ -[mypy] -check_untyped_defs = True -disallow_untyped_defs = True -mypy_path = - stubs, - sublime_lib, - -[mypy-sublime_lib.vendor.*] -ignore_errors=True - -[mypy-sublime_lib._compat.typing_stubs] -disallow_untyped_defs = False diff --git a/pyproject.toml b/pyproject.toml index 0161bbc..d440d5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,14 @@ omit = [ [tool.coverage.report] show_missing = true +[tool.mypy] +check_untyped_defs = true +disallow_untyped_defs = true +mypy_path = [ + "stubs", + "sublime_lib", +] + [tool.pydocstyle] match_dir = "^(?!_)" match = "^(?!_).*\\.py" From 890cf7edf8eebb75d01be853d3d7763610a8d8e9 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Thu, 25 Dec 2025 15:59:50 +0100 Subject: [PATCH 20/20] Deploy singe wheel using tag prefixes later on, to restrict to ST3 --- .github/workflows/release.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 406e9a8..080554f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,11 +20,7 @@ jobs: uses: astral-sh/setup-uv@v7 - name: Build wheel - run: | - uv build --wheel - wheel=$(ls dist/*.whl) - cp $wheel ${wheel/-py3-/-py33-} - mv $wheel ${wheel/-py3-/-py38-} + run: uv build --wheel - name: Create release & upload wheel run: gh release create --generate-notes --latest -t "$GITHUB_REF_NAME" "$GITHUB_REF_NAME" dist/*.whl