diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 352a24d..4af6e4c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -12,12 +12,28 @@ 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) @@ -25,26 +41,22 @@ jobs: 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 diff --git a/pyproject.toml b/pyproject.toml index 0ef3e8a..18c3e1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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}"' diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 791726c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[sdist] -formats = zip - -[metadata] -license_file = LICENSE.txt - -[options] -setup_requires = setuptools_scm diff --git a/setup.py b/setup.py deleted file mode 100644 index 10b1e0c..0000000 --- a/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -from setuptools import setup, find_packages - - -setup( - name="ufonormalizer", - description=("Script to normalize the XML and other data " - "inside of a UFO."), - author="Tal Leming", - author_email="tal@typesupply.com", - url="https://github.com/unified-font-object/ufoNormalizer", - package_dir={"": "src"}, - packages=find_packages(where="src"), - entry_points={ - 'console_scripts': [ - "ufonormalizer = ufonormalizer:main", - ] - }, - use_scm_version={ - "write_to": 'src/ufonormalizer/_version.py', - "write_to_template": '__version__ = "{version}"', - }, - setup_requires=['setuptools_scm'], - test_suite="tests", - license="OpenSource, BSD-style", - platforms=["Any"], - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Console", - "Environment :: Other Environment", - "Intended Audience :: Developers", - "Intended Audience :: End Users/Desktop", - "License :: OSI Approved :: BSD License", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Topic :: Text Processing :: Fonts", - "Topic :: Multimedia :: Graphics", - "Topic :: Multimedia :: Graphics :: Graphics Conversion", - ], - python_requires='>=3.6', - zip_safe=True, -) diff --git a/src/ufonormalizer/__init__.py b/src/ufonormalizer/__init__.py index 2c8b5c5..ee45a31 100644 --- a/src/ufonormalizer/__init__.py +++ b/src/ufonormalizer/__init__.py @@ -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