Skip to content
Merged
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
44 changes: 44 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
root = true

# Language indent/EOL/charset overlap with .vscode/settings.json.
# Rulers, renderWhitespace, detectIndentation, mergeEditor, and
# language-server settings cannot be expressed here — they stay in
# settings.json.

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

# [json]
[*.json]
indent_size = 2
indent_style = space

# [markdown]
[*.md]
indent_size = 2
indent_style = space

# [python]
[*.py]
indent_size = 4
indent_style = space

# [shellscript]
[*.{bash,sh,zsh}]
indent_size = 2
indent_style = space

# [toml]
[*.toml]
indent_size = 2
indent_style = tab

# [yaml]
[*.{yaml,yml}]
indent_size = 2
indent_style = space
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.c linguist-language=C
*.cpp linguist-language=C++
*.h linguist-language=C
*.hpp linguist-language=C++
*.html linguist-detectable=false
*.py linguist-language=Python
*.sh linguist-detectable=false
*.vimrc linguist-detectable=false
makefile linguist-detectable=false
77 changes: 55 additions & 22 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
# This workflow will install Python dependencies, run tests, and smoke
# the sdist/wheel on a range of Python versions.
#
# Created: 14th September 2026
# Updated: 14th September 2026
#

name: Python package

Expand All @@ -8,16 +12,43 @@ on:
branches:
- master
- dev
- gha
- time_str
- boilerplate
- idiomatic
- rc1
- rc2
- rc3
pull_request:
branches:
- master
- dev
- gha
- time_str

permissions:
contents: read

defaults:
run:
shell: bash

jobs:
lint:
name: Lint (ruff)
runs-on: ubuntu-latest

steps:
- name: Checking out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.14"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff

- name: Lint with ruff
run: |
ruff check .

build:

runs-on: ubuntu-latest
Expand All @@ -34,29 +65,31 @@ jobs:
- "3.14"

steps:
- uses: actions/checkout@v4
- name: Checking out code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
run: |
python3 -m unittest discover
python -m pip install pytest
python -m pip install -e .

- name: Test with pytest
run: |
pytest

- name: Build and install smoke
run: |
python -m pip install build
python -m build
python -m pip install dist/diagnosticism-*.whl
python -c "import diagnosticism; assert diagnosticism.__version__ == '0.18.1'; print(diagnosticism.__version__)"

build-py27:

runs-on: ubuntu-latest
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# directories (by name)

/.bin/
/.pytest_cache/
/.ruff_cache/
/.venv/

build/
dist/
Expand All @@ -13,6 +16,8 @@ scratch/

# directories (by pattern)

**/__pycache__/


# files (by name)

Expand All @@ -30,4 +35,3 @@ notes.txt
*.swp
*.tmp
*.zip

1 change: 1 addition & 0 deletions .sis/project_name.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Diagnosticism.Python
3 changes: 3 additions & 0 deletions .sis/script_info_lines.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Diagnosticism.Python provides basic diagnostic facilities for Python
Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
Copyright (c) 2019, Matthew Wilson and Synesis Software
52 changes: 52 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
" Synesis Python project .vimrc — aligned with .vscode/settings.json (Python)

set nocompatible
filetype indent plugin on
syntax enable
set autoindent
set backspace=indent,eol,start
set hlsearch
set incsearch
set number

" files.insertFinalNewline
set eol
set fixeol

" editor.renderWhitespace: all
set list
set listchars=tab:->,trail:-,extends:>,precedes:<,nbsp:+

" editor.detectIndentation: false — global defaults match [python] (editor.tabSize: 4, insertSpaces: true)
set colorcolumn=76
set expandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4

" colorcolumn draws a full-column tint in Vim (not a VS Code-style 1px line).
" Keep it subtle via the ColorColumn highlight group; reapply after colorscheme changes.
if has('termguicolors')
" set termguicolors
endif

function! s:ConfigureColorColumn() abort
highlight ColorColumn ctermbg=236 guibg=#2a2a2a cterm=NONE gui=NONE
endfunction

call s:ConfigureColorColumn()
autocmd ColorScheme * call s:ConfigureColorColumn()

" files.trimTrailingWhitespace
autocmd BufWritePre * %s/\s\+$//e

augroup sis_python
autocmd!

" [json] / [markdown] / [yaml]
autocmd FileType json,markdown,yaml setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2

" [python] — match .vscode [python] tabSize 4 / insertSpaces true / rulers 50,60,76,120
autocmd FileType python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=50,60,76,120

" [shellscript]
autocmd FileType sh,bash,zsh setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 colorcolumn=60,76

" [toml]
autocmd FileType toml setlocal noexpandtab tabstop=2 shiftwidth=2 softtabstop=2
augroup END
40 changes: 35 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
{
"[json]": {
"editor.tabSize": 2,
},
"[markdown]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
},
"[python]": {
"diffEditor.ignoreTrimWhitespace": false,
"editor.insertSpaces": true,
"editor.rulers": [ 51, 61, 76 ],
"editor.tabSize": 4,
"diffEditor.ignoreTrimWhitespace": false,
"editor.insertSpaces": true,
"editor.rulers": [ 50, 60, 76, 120 ],
"editor.tabSize": 4,
},
"[shellscript]": {
"editor.insertSpaces": true,
"editor.rulers": [ 60, 76 ],
"editor.tabSize": 2,
},
"[toml]": {
"editor.insertSpaces": false,
"editor.tabSize": 2,
},
"[yaml]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
},
"editor.detectIndentation": false,
"editor.insertSpaces": false,
"editor.renderWhitespace": "all",
"editor.rulers": [ 76 ],
"editor.rulers": [ 76 ],
"editor.tabSize": 2,
"files.exclude": {
"**/*.egg-info": true,
"**/*.swp": true,
"**/__pycache__": true,
},
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"git.mergeEditor": false,
"python.analysis.typeCheckingMode": "standard",
"python.languageServer": "Pylance",
}
21 changes: 21 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Diagnosticism.Python - Authors <!-- omit in toc -->


## Major Contributors

| Name | GitHub |
| ----------- | --------------------------------- |
| Matt Wilson | [mwsis](https://github.com/mwsis) |


## Defect reports, fixes and suggestions (for which we are very grateful)

| Name | GitHub |
| ------- | ------ |
| \<none> | |


Contributions are welcomed.


<!-- ########################### end of file ########################### -->
13 changes: 7 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# **Diagnosticism.Python** Changes
# Diagnosticism.Python - Changes <!-- omit in toc -->


## 0.18.1 - 14th September 2026

* packaging, documentation, and CI modernisation (PEP 621 hybrid, canonical CI, **ruff**, helper scripts);


## 0.18.0 - 6th August 2026

Expand Down Expand Up @@ -201,10 +207,5 @@
* + project boilerplate


## previous versions

None specified.


<!-- ########################### end of file ########################### -->

2 changes: 1 addition & 1 deletion EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Diagnosticism.Python Examples
# Diagnosticism.Python - Examples <!-- omit in toc -->

| Name | Source | Summary |
| ---- | ------ | ------- |
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License - Diagnosticism.Python
Diagnosticism.Python - BSD 3-Clause License

Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems
Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include LICENSE README.md CHANGES.md EXAMPLES.md TODO.md
include AUTHORS.md CHANGES.md EXAMPLES.md LICENSE NEWS.md README.md TODO.md
recursive-include examples *.py
recursive-include tests *.py
Loading
Loading