-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test .whl files with
build-and-inspect-python-package
action
- Loading branch information
Showing
5 changed files
with
117 additions
and
36 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Build & test whl | ||
|
||
on: [push] | ||
|
||
jobs: | ||
|
||
build-package: | ||
name: Build & verify package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: hynek/build-and-inspect-python-package@v2 | ||
id: baipp | ||
|
||
outputs: | ||
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} | ||
|
||
testwheel: | ||
name: Test whl | ||
runs-on: ubuntu-latest | ||
needs: build-package | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
- "3.13-dev" | ||
steps: | ||
|
||
- name: Download pre-built packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist | ||
- name: Extract source tarball | ||
run: tar xf dist/*.tar.gz --strip-components=1 | ||
- name: Remove source code | ||
run: rm -R emoji | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install tox | ||
run: python -Im pip install tox | ||
- name: Run tox on wheel | ||
run: python -Im tox run --installpkg dist/*.whl |
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 |
---|---|---|
|
@@ -5,25 +5,35 @@ on: | |
types: [published] | ||
|
||
jobs: | ||
deploy: | ||
build-package: | ||
name: Build & verify package | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
attestations: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: hynek/build-and-inspect-python-package@v2 | ||
with: | ||
attest-build-provenance-github: 'true' | ||
|
||
deploy: | ||
name: Publish to pypi.org | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/project/emoji/ | ||
runs-on: ubuntu-latest | ||
needs: build-package | ||
permissions: | ||
id-token: write | ||
attestations: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade build wheel | ||
- name: Build package | ||
run: | | ||
python -m build | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/[email protected] | ||
- name: Download package built by build-and-inspect-python-package | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist | ||
- name: Upload package to PyPI | ||
uses: pypa/[email protected] |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: updateGithubPages | ||
name: Update GithubPages documentation | ||
|
||
on: | ||
workflow_dispatch: | ||
|
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 |
---|---|---|
|
@@ -8,8 +8,8 @@ description = "Emoji for Python" | |
readme = "README.rst" | ||
requires-python = ">=3.7" | ||
authors = [ | ||
{name = "Taehoon Kim", email = "[email protected]"}, | ||
{name = "Kevin Wurster", email = "[email protected]"}, | ||
{ name = "Taehoon Kim", email = "[email protected]" }, | ||
{ name = "Kevin Wurster", email = "[email protected]" }, | ||
] | ||
keywords = ["emoji"] | ||
classifiers = [ | ||
|
@@ -32,31 +32,26 @@ classifiers = [ | |
"Topic :: Internet :: WWW/HTTP :: Dynamic Content", | ||
"Topic :: Multimedia :: Graphics :: Presentation", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Typing :: Typed" | ||
] | ||
dependencies = [ | ||
"typing_extensions >= 4.7.0", | ||
"Typing :: Typed", | ||
] | ||
dependencies = ["typing_extensions >= 4.7.0"] | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
homepage = "https://github.com/carpedm20/emoji/" | ||
repository = "https://github.com/carpedm20/emoji/" | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"pytest>=7.4.4", | ||
"coverage", | ||
] | ||
dev = ["pytest>=7.4.4", "coverage"] | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["emoji*"] | ||
|
||
[tool.setuptools.package-data] | ||
emoji = ["py.typed"] | ||
emoji = ["py.typed", "unicode_codes/emoji.json", "unicode_codes/emoji_*.json"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "emoji.__version__"} | ||
version = { attr = "emoji.__version__" } | ||
|
||
[tool.pytest.ini_options] | ||
pythonpath = [".", "utils"] | ||
|
@@ -68,12 +63,12 @@ pythonPlatform = "All" | |
typeCheckingMode = "strict" | ||
extraPaths = ["utils"] | ||
exclude = [ | ||
"**/__pycache__", | ||
".git", | ||
".venv", | ||
"build", | ||
"utils/gh-pages", | ||
"utils/get_codes_from_unicode_emoji_data_files.py", | ||
"**/__pycache__", | ||
".git", | ||
".venv", | ||
"build", | ||
"utils/gh-pages", | ||
"utils/get_codes_from_unicode_emoji_data_files.py", | ||
] | ||
|
||
|
||
|
@@ -83,4 +78,20 @@ line-length = 88 | |
quote-style = "single" | ||
[tool.ruff.lint] | ||
select = ["E4", "E7", "E9", "F", "B", "Q"] | ||
ignore =["Q000", "Q003"] | ||
ignore = ["Q000", "Q003"] | ||
|
||
[tool.tox] | ||
legacy_tox_ini = """ | ||
[tox] | ||
minversion = 4.15.0 | ||
[testenv] | ||
description = Run the tests with pytest | ||
package = wheel | ||
wheel_build_env = .pkg | ||
changedir = tests | ||
deps = | ||
pytest>=6 | ||
commands = | ||
pytest {tty:--color=yes} --basetemp="{envtmpdir}" {posargs} | ||
""" |