Skip to content

Commit fa52300

Browse files
authored
Drop support for Python < 3.10, add py.typed and switch to uv/ruff/pyright (#14)
* Updates * add release workflow * ruff fix * just sync * format * update gitignore
1 parent 53831de commit fa52300

File tree

11 files changed

+282
-502
lines changed

11 files changed

+282
-502
lines changed

.flake8

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

.github/workflows/ci.yml

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,27 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1215
steps:
13-
- uses: actions/checkout@v2
14-
15-
- uses: actions/setup-python@v2
16-
with:
17-
python-version: 3.11
18-
19-
- name: cache poetry install
20-
uses: actions/cache@v3
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
2118
with:
22-
path: ~/.local
23-
key: poetry-0
19+
python-version: ${{ matrix.python-version }}
20+
- run: pip install uv
21+
- run: uv venv
22+
- run: uv sync
23+
- run: uv run pytest
2424

25-
- uses: snok/install-poetry@v1
26-
with:
27-
virtualenvs-create: true
28-
virtualenvs-in-project: true
29-
30-
- name: cache deps
31-
id: cache-deps
32-
uses: actions/cache@v3
33-
with:
34-
path: .venv
35-
key: pydeps-${{ hashFiles('**/poetry.lock') }}
36-
37-
- run: poetry install --no-interaction --no-root
38-
if: steps.cache-deps.outputs.cache-hit != 'true'
39-
40-
- run: poetry install --no-interaction
41-
42-
- run: poetry run pytest tests.py
43-
- run: poetry run black mudder.py tests.py
44-
- run: poetry run flake8 mudder.py
25+
lint:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-python@v5
30+
- run: pip install uv
31+
- run: uv venv
32+
- run: uv sync
33+
- run: uv run ruff format --check .
34+
- run: uv run ruff check .
35+
- run: uv run pyright .

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
# IMPORTANT: this permission is mandatory for trusted publishing
13+
id-token: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.13"
19+
- run: pip install uv
20+
- run: uv build
21+
- run: uv publish

.gitignore

Lines changed: 125 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,125 @@
1-
.mypy_cache
2-
**/__pycache__
3-
*.egg-info
4-
dist
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
.hypothesis/
51+
.pytest_cache/
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
local_settings.py
60+
db.sqlite3
61+
62+
# Flask stuff:
63+
instance/
64+
.webassets-cache
65+
66+
# Scrapy stuff:
67+
.scrapy
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# PyBuilder
73+
target/
74+
75+
# Jupyter Notebook
76+
.ipynb_checkpoints
77+
78+
# IPython
79+
profile_default/
80+
ipython_config.py
81+
82+
# pyenv
83+
.python-version
84+
85+
# pipenv
86+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
87+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
88+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
89+
# install all needed dependencies.
90+
#Pipfile.lock
91+
92+
# celery beat schedule file
93+
celerybeat-schedule
94+
95+
# SageMath parsed files
96+
*.sage.py
97+
98+
# Environments
99+
.env
100+
.venv
101+
env/
102+
venv/
103+
ENV/
104+
env.bak/
105+
venv.bak/
106+
107+
# Spyder project settings
108+
.spyderproject
109+
.spyproject
110+
111+
# Rope project settings
112+
.ropeproject
113+
114+
# mkdocs documentation
115+
/site
116+
117+
# mypy
118+
.mypy_cache/
119+
.dmypy.json
120+
dmypy.json
121+
122+
# Pyre type checker
123+
.pyre/
124+
.DS_Store
125+
.vscode/

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ This library is a port of [fasiha/mudderjs][1] to Python.
44

55
From the original readme:
66

7-
> Generate lexicographically-spaced strings between two strings from
8-
> pre-defined alphabets.
7+
> Generate lexicographically-spaced strings between two strings from pre-defined
8+
> alphabets.
99
10-
[1]: https://github.com/fasiha/mudderjs
10+
This technique is also known as
11+
[_fractional indexing_](https://observablehq.com/@dgreensp/implementing-fractional-indexing).
1112

13+
[1]: https://github.com/fasiha/mudderjs
1214

1315
## Example
1416

@@ -17,7 +19,6 @@ Usage is nearly identical to the original:
1719
```python
1820
from mudder import SymbolTable
1921

20-
2122
hex_ = SymbolTable('0123456789abcdef')
2223
hexstrings = hex_.mudder('ffff', 'fe0f', num_strings=3)
2324
print(hexstrings)

0 commit comments

Comments
 (0)