Skip to content

Commit e3b2ee9

Browse files
authored
Refactor repository to deploy as WHEEL via Github releases (#178)
This commit... 1. refactors folder structure as if sublime_lib was an ordinary python library. 2. adds pyproject.toml to specify all relevant metadata 3. adds relevant scripts and actions to deploy the library as WHEEL via Github releases. Version is bumbed to 1.6.0, but this PR doesn't change any library functionality at all.
1 parent 6c78be3 commit e3b2ee9

51 files changed

Lines changed: 158 additions & 99 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 0 additions & 8 deletions
This file was deleted.

.flake8

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[flake8]
22

33
ignore =
4-
E731, # do not assign a lambda expression, use a def
5-
W503, # line break before binary operator
4+
# do not assign a lambda expression, use a def
5+
E731,
6+
# line break before binary operator
7+
W503,
68

79
exclude =
810
.git,
9-
st3/sublime_lib/vendor,
1011
.venv,
12+
sublime_lib/vendor,
1113

1214
max-line-length = 99

.github/workflows/ci.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/gh-pages.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,18 @@ on:
77

88
jobs:
99
deploy:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v6
1313

14-
- name: Setup Python
15-
uses: actions/setup-python@v1
16-
with:
17-
python-version: '3.x'
14+
- name: Setup uv
15+
uses: astral-sh/setup-uv@v7
1816

19-
- name: Install Dependencies
20-
run: |
21-
python -m pip install -U pip
22-
python -m pip install -U sphinx
23-
python -m pip install -U sphinxcontrib.prettyspecialmethods
17+
- name: Install dev dependencies
18+
run: uv sync --group docs
2419

2520
- name: Build Docs
26-
run: make -C docs clean html
27-
## https://github.com/marketplace/actions/sphinx-build
28-
# uses: ammaraskar/sphinx-action@0.3
29-
# with:
30-
# docs-folder: docs/
31-
# repo-token: ${{ secrets.GITHUB_TOKEN }}
32-
# build-command: "make clean html"
21+
run: uv run sphinx-build -M html "docs/source/" "docs/"
3322

3423
- name: Deploy Docs
3524
uses: peaceiris/actions-gh-pages@v3

.github/workflows/lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
17+
- name: Setup uv
18+
uses: astral-sh/setup-uv@v7
19+
20+
- name: Install lint dependencies
21+
run: uv sync --group lint
22+
23+
- name: Run flake8
24+
run: uv run flake8 sublime_lib
25+
26+
- name: Run pydocstyle (allow failure)
27+
run: uv run pydocstyle sublime_lib
28+
continue-on-error: true

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
release:
10+
name: Create and publish release
11+
env:
12+
GH_TOKEN: ${{ github.token }}
13+
permissions:
14+
contents: write
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v6
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v7
21+
22+
- name: Build wheel
23+
run: uv build --wheel
24+
25+
- name: Create release & upload wheel
26+
run: gh release create --generate-notes --latest -t "$GITHUB_REF_NAME" "$GITHUB_REF_NAME" dist/*.whl

.gitignore

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
# caches
12
__pycache__
23
.mypy_cache
3-
docs/html/
4-
docs/source/modules/
5-
*.doctree
6-
*.pickle
7-
modules.rst
4+
5+
# build artifacts
6+
dist/
7+
_version.py
8+
9+
# docs build artifacts
10+
/docs/html/
11+
/docs/doctrees/
12+
13+
# editor files
14+
*.sublime-project
15+
*.sublime-workspace
16+

.sublime-dependency

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 10 additions & 0 deletions

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ BUILDDIR = .
77
.PHONY: clean
88

99
html:
10-
sphinx-build -M html "$(SOURCEDIR)" "$(BUILDDIR)"
10+
uv run sphinx-build -M html "$(SOURCEDIR)" "$(BUILDDIR)"
1111

1212
clean:
1313
rm -rf doctrees html

0 commit comments

Comments
 (0)