-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from googlefonts/python-standards
Use new Python package approach
- Loading branch information
Showing
7 changed files
with
76 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,12 @@ jobs: | |
name: Build distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
|
||
|
@@ -50,7 +50,7 @@ jobs: | |
- name: Build a binary wheel and a source tarball | ||
run: python3 -m build | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
@@ -69,12 +69,12 @@ jobs: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/[email protected].11 | ||
uses: pypa/[email protected].14 | ||
with: | ||
# repository-url: https://test.pypi.org/legacy/ # for testing purposes | ||
verify-metadata: false # twine previously didn't verify metadata when uploading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
platform: [ubuntu-latest, windows-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install packages | ||
run: | | ||
pip install '.[dev]' | ||
pip install black pylint | ||
- name: Check formatting | ||
run: | | ||
black --diff --check Lib --exclude ".*_pb2.*|_version.py" | ||
- name: Run Tests | ||
run: | | ||
pytest tests |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=45", | ||
"setuptools_scm[toml]>=6.2" | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["Lib"] | ||
|
||
[tool.setuptools_scm] | ||
git_describe_command = "git describe --match 'v*' --tags" | ||
|
||
[project] | ||
dynamic = ["version"] | ||
|
||
name = "gflanguages" | ||
description = "A python API for evaluating language support in the Google Fonts collection." | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "Simon Cozens", email = "[email protected]" } | ||
] | ||
|
||
dependencies = [ | ||
"protobuf>=3.7.0, <4" | ||
] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"uharfbuzz", | ||
"youseedee", | ||
"pytest" | ||
] |
This file was deleted.
Oops, something went wrong.