Skip to content

Commit

Permalink
Switch to uv, add bbcode script, remove dead stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
dcwatson committed Oct 24, 2024
1 parent e0b0554 commit 8b6b631
Show file tree
Hide file tree
Showing 12 changed files with 335 additions and 267 deletions.
37 changes: 17 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,30 @@ name: CI

on: [push, pull_request]

env:
UV_SYSTEM_PYTHON: 1
UV_PYTHON_DOWNLOADS: never
UV_PYTHON_PREFERENCE: only-system

jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install Checkers
run: pip install flake8 black
- name: Flake8
run: flake8
- name: Black
run: black --check .
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v1

test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, pypy2, pypy3]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Run Tests
run: python tests.py
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup uv
uses: astral-sh/setup-uv@v3
- name: Run Tests
run: uv run -m unittest
45 changes: 12 additions & 33 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
*.py[cod]
docs/_build/
.DS_Store
site

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
MANIFEST

# Eclipse/PyDev/VSCode
.project
.pydevproject
.settings
.vscode

# Coverage
.coverage
htmlcov
*.pyc
*.egg-info
__pycache__
.DS_Store
/dist
/build
/pip-wheel-metadata
.vscode
.nova
.coverage
/htmlcov
/site
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### 1.2.0

* Test on Python 3.9 - 3.13
* Install a proper `bbcode` script in addition to being able to run `python -m bbcode`


### 1.1.0

* Now using a `CaseInsensitiveDict` to store tag options, so they retain the source case, but can be accessed case-insensitively.
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

28 changes: 0 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,3 @@ for color in ('red', 'blue', 'green', 'yellow', 'black', 'white'):
# Calling format with context.
html = parser.format(text, somevar='somevalue')
```


Advantages Over [Postmarkup](https://code.google.com/p/postmarkup/)
===================================================================

* More tag options for how/when to escape - for instance, you can specify
whether to escape html or perform cosmetic replacements on a tag-by-tag
basis. Same for auto-linking and transforming newlines.

* More liberal (and accurate) automatic link creation, using John Gruber's
URL regular expression:
http://daringfireball.net/2010/07/improved_regex_for_matching_urls

* Does not swallow unrecognized tags. For example, [3] will be output as
[3], not silently ignored.

* More flexible tag option parser. Tags may have standard bbcode options,
for example [url=something]text[/url], but may also have named options,
for example [url=something alt=icon]text[/url]. These options are passed
to the render function as a standard python dictionary.

* Ability to specify tag opening and closing delimiters (default: [ and ]).
A side benefit of this is being able to use this library to selectively
strip HTML tags from a string by using < and >.

* Includes a runnable unittest suite.

* Python 3 support.
Loading

0 comments on commit 8b6b631

Please sign in to comment.