Skip to content
Open
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
8 changes: 0 additions & 8 deletions .coveragerc

This file was deleted.

8 changes: 5 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[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,
st3/sublime_lib/vendor,
.venv,
sublime_lib/vendor,

max-line-length = 99
41 changes: 0 additions & 41 deletions .github/workflows/ci.yml

This file was deleted.

25 changes: 7 additions & 18 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: lint

on:
push:
branches:
- master
- develop
pull_request:
workflow_dispatch:

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 sublime_lib

- name: Run pydocstyle (allow failure)
run: uv run pydocstyle sublime_lib
continue-on-error: true
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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
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
19 changes: 14 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# caches
__pycache__
.mypy_cache
docs/html/
docs/source/modules/
*.doctree
*.pickle
modules.rst

# build artifacts
dist/
_version.py

# docs build artifacts
/docs/html/
/docs/doctrees/

# editor files
*.sublime-project
*.sublime-workspace

1 change: 0 additions & 1 deletion .sublime-dependency

This file was deleted.

10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<major>.<minor>.<patch>`
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.
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('../../st3'))
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'))

Expand Down
12 changes: 0 additions & 12 deletions mypy.ini

This file was deleted.

65 changes: 65 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[project]
name = "sublime_lib"
dynamic = ["version"]
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.8"

[build-system]
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",
"pydocstyle>=4.0.0",
]

[tool.hatch.build.targets.sdist]
exclude = [
"/.*",
"/stubs",
"*.lock",
]

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "sublime_lib/_version.py"
tag-pattern = "v{version}"

[tool.coverage.run]
omit = [
"*/_compat/*",
"*/tests/*",
"*/vendor/*",
]

[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"
4 changes: 0 additions & 4 deletions st3/.pydocstyle

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion st3/sublime_lib/flags.py → sublime_lib/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

from ._compat.typing import Callable, Optional


__all__ = [
'DialogResult', 'PointClass', 'FindOption', 'RegionOption',
'PopupOption', 'PhantomLayout', 'OpenFileOption', 'QuickPanelOption',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions unittesting.json

This file was deleted.

Loading