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.

12 changes: 0 additions & 12 deletions .flake8

This file was deleted.

40 changes: 8 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,15 @@ name: CI
on: [push, pull_request]

jobs:
flake8:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v6
with:
python-version: 3.x

- name: Install flake8
run: |
python -m pip install -U pip
pip install flake8

- run: flake8 .

pydocstyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.x

- name: Install pydocstyle
run: |
python -m pip install -U pip
pip install pydocstyle

- name: Run pydocstyle (allow failure)
run: pydocstyle
working-directory: st3/sublime_lib
continue-on-error: true
python-version: 3
- name: Install black
run: pip --disable-pip-version-check --no-color install black
- name: Run black
run: black --check .
19 changes: 19 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish Release

on:
workflow_dispatch:

jobs:
release:
name: Create and publish release
env:
GH_TOKEN: ${{ github.token }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Building wheel and publishing release
run: scripts/release
22 changes: 19 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
__pycache__
.mypy_cache
# editors
.sublime/
.vscode/

# python cache
__pycache__/
*.pickle
*.py[co]

# tool cache
.pytest_cache/
.mypy_cache/
.venv/
*.lock

# build output
dist/

# documentation
docs/html/
docs/source/modules/
*.doctree
*.pickle
modules.rst
1 change: 0 additions & 1 deletion .sublime-dependency

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Thomas Smith
Copyright (c) 2025 Thomas Smith

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
57 changes: 27 additions & 30 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('../../st3'))
sys.path.insert(0, os.path.abspath('extensions'))
sys.path.insert(0, os.path.abspath('mocks'))

sys.path.insert(0, os.path.abspath("../../st3"))
sys.path.insert(0, os.path.abspath("extensions"))
sys.path.insert(0, os.path.abspath("mocks"))

# -- Project information -----------------------------------------------------

project = 'sublime_lib'
copyright = '2018, Thomas Smith'
author = 'Thomas Smith'
project = "sublime_lib"
copyright = "2018, Thomas Smith"
author = "Thomas Smith"

# The short X.Y version
version = ''
version = ""
# The full version, including alpha/beta/rc tags
release = ''
release = ""


# -- General configuration ---------------------------------------------------
Expand All @@ -40,30 +41,27 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinxcontrib.prettyspecialmethods',
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinxcontrib.prettyspecialmethods",
]

autodoc_member_order = 'bysource'
autodoc_default_options = {
'members': None,
'mock_imports': ['sublime_plugin']
}
autodoc_member_order = "bysource"
autodoc_default_options = {"members": None, "mock_imports": ["sublime_plugin"]}

intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -78,29 +76,28 @@
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'basic'
html_theme = "basic"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
}
html_theme_options = {}

html_experimental_html5_writer = True

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -112,9 +109,7 @@
#
# html_sidebars = {}

html_sidebars = {'**': [
"localtoc.html"
]}
html_sidebars = {"**": ["localtoc.html"]}

html_use_index = False
html_use_smartypants = False
Expand All @@ -123,9 +118,11 @@

def setup(app):
from better_toctree import TocTreeCollector

app.add_env_collector(TocTreeCollector)

app.add_css_file('style.css')
app.add_css_file("style.css")

from strip_annotations import strip_annotations
app.connect('autodoc-process-signature', strip_annotations)

app.connect("autodoc-process-signature", strip_annotations)
8 changes: 4 additions & 4 deletions docs/source/mocks/sublime.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def __repr__(self):


class SublimeMock:
Region = MockType('sublime.Region')
View = MockType('sublime.View')
Window = MockType('sublime.Window')
Settings = MockType('sublime.Settings')
Region = MockType("sublime.Region")
View = MockType("sublime.View")
Window = MockType("sublime.Window")
Settings = MockType("sublime.Settings")

def __getattr__(self, key):
if key.isupper():
Expand Down
12 changes: 0 additions & 12 deletions mypy.ini

This file was deleted.

40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[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 = ["flit_core"]
build-backend = "flit_core.buildapi"

[tool.flit.sdist]
include = ["src/**/*.py"]
exclude = ["**/__pycache__/", "**/.*/", "*.lock"]

[tool.black]
line-length = 100
exclude = "(.mypy_cache|docs/source/extensions|src/sublime_lib/vendor|stubs)/"

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

[tool.coverage.report]
show_missing = true

[tool.pyright]
pythonVersion = "3.3"
typeCheckingMode = "basic"
6 changes: 6 additions & 0 deletions scripts/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# build wheel
uv build --wheel
# create release
version=$(uv version | cut -d ' ' -f 2)
gh release create --generate-notes --latest -t "v${version}" "v${version}" dist/*.whl
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading