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: 6 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

*.py linguist-language=Python

*.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
76 changes: 53 additions & 23 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
- boilerplate
- idiomatic
- rc1
- rc2
- rc3
pull_request:
branches:
- master
- dev
- gha
- boilerplate

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,32 +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: Install package
run: |
python -m pip install pytest
python -m pip install -e .
- 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: |
python tests/run_unittest.py

- 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/py2be-*.whl
python -c "import py2be; assert py2be.__version__ == '0.1.1'; print(py2be.__version__)"

build-py27:

runs-on: ubuntu-latest
Expand Down
14 changes: 8 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
# directories (by name)

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

/_build/
/build/
/dist-old/
/dist/
/scratch/
build/
dist/
dist-old/
scratch/

*.egg-info/


# directories (by pattern)

**/__pycache__/


# files (by name)

Expand All @@ -32,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 @@
py2be
2 changes: 2 additions & 0 deletions .sis/script_info_lines.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
py2be is a simple Python library determining whether strings indicate truey or falsey values
Copyright (c) 2025-2026, Matthew Wilson and Synesis Information Systems
52 changes: 51 additions & 1 deletion .vimrc
Original file line number Diff line number Diff line change
@@ -1,7 +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
set tw=0

" 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
39 changes: 18 additions & 21 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,42 @@
"[json]": {
"editor.tabSize": 2,
},
"[markdown]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
},
"[python]": {
"diffEditor.ignoreTrimWhitespace": false,
"editor.insertSpaces": true,
"editor.rulers": [ 60, 76 ],
"editor.rulers": [ 50, 60, 76, 120 ],
"editor.tabSize": 4,
},
"[ruby]": {
"[shellscript]": {
"editor.insertSpaces": true,
"editor.rulers": [ 60, 76 ],
"editor.tabSize": 2,
},
"[rust]": {
"editor.insertSpaces": true,
"editor.rulers": [ 60, 76 ],
"editor.tabSize": 4,
},
"[toml]": {
"editor.insertSpaces": false,
"editor.tabSize": 2,
},
"cmake.configureOnOpen": false,
"[yaml]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
},
"editor.detectIndentation": false,
"editor.insertSpaces": false,
"editor.renderWhitespace": "all",
"editor.rulers": [ 76 ],
"editor.tabSize": 2,
"files.exclude": {
"**/*.egg-info": true,
"**/*.swp": true,
"**/__pycache__": true,
},
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"git.mergeEditor": false,
"rust-analyzer.cargo.noDefaultFeatures": true,
"rust-analyzer.cargo.features": [
// "implement-Truthy-for-AsStr",
"implement-Truthy-for-bool",
"implement-Truthy-for-CsStr",
"implement-Truthy-for-CsString",
"implement-Truthy-for-OsStr",
"implement-Truthy-for-OsString",
"implement-Truthy-for-str",
"implement-Truthy-for-String",
],
"rust-analyzer.completion.autoimport.enable": false,
"rust-analyzer.showUnlinkedFileNotification": 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 @@
# py2be - 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 ########################### -->
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# py2be - Changes <!-- omit in toc -->


## 0.1.1 - 14th September 2026

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


## 0.1.0 - 2nd July 2026

* modularised implementation (`constants`, `parse`, `truthy`);
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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 benchmarks *.py
recursive-include examples *.py
recursive-include tests *.py
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# py2be - News <!-- omit in toc -->

| Date | News Item | Details |
| ------------------- | ------------------------------------------------------------------------------ | ----------------------------------------- |
| 14th September 2026 | [**py2be** 0.1.1](https://github.com/synesissoftware/py2be/releases/tag/0.1.1) | Packaging / CI modernisation |
| 2nd July 2026 | [**py2be** 0.1.0](https://github.com/synesissoftware/py2be/releases/tag/0.1.0) | Modularised truthy parsing and benchmarks |
| 2nd July 2026 | [**py2be** 0.0.4](https://github.com/synesissoftware/py2be/releases/tag/0.0.4) | Packaging, public API, CI, examples |
| 1st September 2025 | [**py2be** 0.0.3](https://github.com/synesissoftware/py2be/releases/tag/0.0.3) | GitHub Actions, badges, `.gitattributes` |
| 11th August 2025 | [**py2be** 0.0.2](https://github.com/synesissoftware/py2be/releases/tag/0.0.2) | Name fixes |
| 11th August 2025 | [**py2be** 0.0.1](https://github.com/synesissoftware/py2be/releases/tag/0.0.1) | Initial version |


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