Skip to content

Commit e75e874

Browse files
authored
Merge pull request #146 from googlefonts/python-standards
Use new Python package approach
2 parents 61b3e5f + c624a59 commit e75e874

File tree

7 files changed

+76
-119
lines changed

7 files changed

+76
-119
lines changed

.github/workflows/publish-release.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
name: Build distribution
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
with:
1515
submodules: recursive
1616
fetch-depth: 0
1717
- name: Set up Python
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v5
1919
with:
2020
python-version: '3.x'
2121

@@ -50,7 +50,7 @@ jobs:
5050
- name: Build a binary wheel and a source tarball
5151
run: python3 -m build
5252
- name: Store the distribution packages
53-
uses: actions/upload-artifact@v3
53+
uses: actions/upload-artifact@v4
5454
with:
5555
name: python-package-distributions
5656
path: dist/
@@ -69,12 +69,12 @@ jobs:
6969
id-token: write # IMPORTANT: mandatory for trusted publishing
7070
steps:
7171
- name: Download all the dists
72-
uses: actions/download-artifact@v3
72+
uses: actions/download-artifact@v4
7373
with:
7474
name: python-package-distributions
7575
path: dist/
7676
- name: Publish distribution 📦 to PyPI
77-
uses: pypa/[email protected].11
77+
uses: pypa/[email protected].14
7878
with:
7979
# repository-url: https://test.pypi.org/legacy/ # for testing purposes
8080
verify-metadata: false # twine previously didn't verify metadata when uploading

.github/workflows/test.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
12+
jobs:
13+
build:
14+
runs-on: ${{ matrix.platform }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: ["3.8", "3.9", "3.10", "3.11"]
19+
platform: [ubuntu-latest, windows-latest]
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
24+
fetch-depth: 0
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
- name: Install packages
30+
run: |
31+
pip install '.[dev]'
32+
pip install black pylint
33+
- name: Check formatting
34+
run: |
35+
black --diff --check Lib --exclude ".*_pb2.*|_version.py"
36+
- name: Run Tests
37+
run: |
38+
pytest tests

.github/workflows/tox.yml

-29
This file was deleted.

pyproject.toml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=45",
4+
"setuptools_scm[toml]>=6.2"
5+
]
6+
build-backend = "setuptools.build_meta"
7+
8+
[tool.setuptools.packages.find]
9+
where = ["Lib"]
10+
11+
[tool.setuptools_scm]
12+
git_describe_command = "git describe --match 'v*' --tags"
13+
14+
[project]
15+
dynamic = ["version"]
16+
17+
name = "gflanguages"
18+
description = "A python API for evaluating language support in the Google Fonts collection."
19+
readme = "README.md"
20+
authors = [
21+
{ name = "Simon Cozens", email = "[email protected]" }
22+
]
23+
24+
dependencies = [
25+
"protobuf>=3.7.0, <4"
26+
]
27+
28+
[project.optional-dependencies]
29+
dev = [
30+
"uharfbuzz",
31+
"youseedee",
32+
"pytest"
33+
]

requirements.txt

-1
This file was deleted.

setup.py

-61
This file was deleted.

tox.ini

-23
This file was deleted.

0 commit comments

Comments
 (0)