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
42 changes: 27 additions & 15 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,51 @@ on:
required: true

jobs:
build:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v5

- uses: actions/setup-python@v6
with:
python-version: '3.x'

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Lint
run: uvx flake8 --count --show-source --statistics

build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- name: Log reason (manual run only)
if: github.event_name == 'workflow_dispatch'
run: |
echo "Reason for triggering: ${{ github.event.inputs.reason }}"

- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v5

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.7.0
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 coveralls
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Lint with flake8
run: |
flake8 --count --show-source --statistics
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Run test suite & upload coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This will test that both source distributions and wheels work.
run: |
coverage run setup.py test
coveralls --service=github
uv build
uv run --isolated --no-project --with dist/*.whl python -m unittest
uv run --isolated --no-project --with dist/*.tar.gz --with coverage coverage run -m unittest
uvx coveralls --service=github
33 changes: 31 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
requires = ["setuptools>=80", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "ufonormalizer"
dynamic = ["version"]
description = "Script to normalize the XML and other data inside of a UFO."
readme = "README.md"
license-files = ["LICENSE.txt"]
requires-python = ">=3.6"
authors = [{ name = "Tal Leming", email = "tal@typesupply.com" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Multimedia :: Graphics",
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
"Topic :: Text Processing :: Fonts",
]

[project.urls]
Homepage = "https://github.com/unified-font-object/ufoNormalizer"

[project.scripts]
ufonormalizer = "ufonormalizer:main"

[tool.setuptools_scm]
write_to = 'src/ufonormalizer/_version.py'
write_to_template = '__version__ = "{version}"'
8 changes: 0 additions & 8 deletions setup.cfg

This file was deleted.

43 changes: 0 additions & 43 deletions setup.py

This file was deleted.

4 changes: 2 additions & 2 deletions src/ufonormalizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def main(args=None):
outputPath = args.output
onlyModified = not args.all
if not os.path.exists(inputPath):
parser.error(f'Input path does not exist: "{ inputPath }".')
parser.error(f'Input path does not exist: "{inputPath}".')
if os.path.splitext(inputPath)[-1].lower() != ".ufo":
parser.error(f'Input path is not a UFO: "{ inputPath }".')
parser.error(f'Input path is not a UFO: "{inputPath}".')

if args.float_precision >= 0:
floatPrecision = args.float_precision
Expand Down