Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
build_docs:
name: Build docs
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ jobs:
name: Build docs
needs: [build_wheels, build_wheels_old]
runs-on: ubuntu-latest
permissions:
contents: write
Comment on lines +114 to +115
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build_docs runs on pull_request as well as release, but the job now has contents: write for all events. That grants a write-capable GITHUB_TOKEN to PR code (including Sphinx builds / installed wheel artifacts), which is a security risk. Consider splitting this into a read-only docs build job for PRs and a separate deploy job (conditioned on release.published) with contents: write, or otherwise ensuring write permissions are only present for the deploy path.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is limited in scope, and I'd leave it as-is for now. Might consider in another PR

steps:
- uses: actions/checkout@v6

Expand Down Expand Up @@ -161,7 +163,8 @@ jobs:
build_and_test_on_Fedora:
runs-on: ubuntu-24.04
container: fedora:42
permissions: write-all
permissions:
contents: read
steps:
- run: dnf install -y dnf-utils git gcc-c++ libstdc++-devel libstdc++-static
- run: dnf install -y python3-build python3-devel python3-pytest python3-pillow python3-glfw
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Skia python binding

[![CI](https://github.com/kyamagu/skia-python/actions/workflows/ci.yml/badge.svg)](https://github.com/kyamagu/skia-python/actions/workflows/ci.yml)
[![CI](https://github.com/skia-python/skia-python/actions/workflows/ci.yml/badge.svg)](https://github.com/skia-python/skia-python/actions/workflows/ci.yml)
[![PyPI version](https://badge.fury.io/py/skia-python.svg)](https://badge.fury.io/py/skia-python)

Python binding to [Skia Graphics Library](https://skia.org/).
Expand Down Expand Up @@ -44,24 +44,24 @@ Or:
yum install fontconfig mesa-libGL mesa-libEGL libglvnd-egl mesa-dri-drivers
```

For unsupported environment, check the [build instruction](https://kyamagu.github.io/skia-python/install.html).
For unsupported environments, check the [build instructions](https://skia-python.github.io/skia-python/install.html).

## Examples

- [Showcase](https://github.com/kyamagu/skia-python/blob/main/notebooks/Showcase.ipynb)
- [Canvas Overview](https://github.com/kyamagu/skia-python/blob/main/notebooks/Canvas-Overview.ipynb)
- [Canvas Creation](https://github.com/kyamagu/skia-python/blob/main/notebooks/Canvas-Creation.ipynb)
- [Path Overview](https://github.com/kyamagu/skia-python/blob/main/notebooks/Path-Overview.ipynb)
- [Paint Overview](https://github.com/kyamagu/skia-python/blob/main/notebooks/Paint-Overview.ipynb)
- [Python Image I/O](https://github.com/kyamagu/skia-python/blob/main/notebooks/Python-Image-IO.ipynb)
- [Drawing Texts](https://github.com/kyamagu/skia-python/blob/main/notebooks/Drawing-Texts.ipynb)
- [Showcase](https://github.com/skia-python/skia-python/blob/main/notebooks/Showcase.ipynb)
- [Canvas Overview](https://github.com/skia-python/skia-python/blob/main/notebooks/Canvas-Overview.ipynb)
- [Canvas Creation](https://github.com/skia-python/skia-python/blob/main/notebooks/Canvas-Creation.ipynb)
- [Path Overview](https://github.com/skia-python/skia-python/blob/main/notebooks/Path-Overview.ipynb)
- [Paint Overview](https://github.com/skia-python/skia-python/blob/main/notebooks/Paint-Overview.ipynb)
- [Python Image I/O](https://github.com/skia-python/skia-python/blob/main/notebooks/Python-Image-IO.ipynb)
- [Drawing Texts](https://github.com/skia-python/skia-python/blob/main/notebooks/Drawing-Texts.ipynb)

## Documentation

https://kyamagu.github.io/skia-python
https://skia-python.github.io/skia-python

- [Tutorial](https://kyamagu.github.io/skia-python/tutorial/)
- [Reference](https://kyamagu.github.io/skia-python/reference.html)
- [Tutorial](https://skia-python.github.io/skia-python/tutorial/)
- [Reference](https://skia-python.github.io/skia-python/reference.html)

- For breaking changes and tips on migration from `m87`: See [Migration Guide](Migration_from_v8x_to_v13x.md), also
see the detailed changes below, especially [README.m116](relnotes/README.m116.md).
Expand All @@ -80,4 +80,4 @@ https://kyamagu.github.io/skia-python

## Contributing

Feel free to [post an issue](https://github.com/kyamagu/skia-python/issues) or [PR](https://github.com/kyamagu/skia-python/pulls).
Feel free to [post an issue](https://github.com/skia-python/skia-python/issues) or [PR](https://github.com/skia-python/skia-python/pulls).
8 changes: 4 additions & 4 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ A few differences are:
Contributing
------------

Development happens at `Github`_. Feel free to post to `issues`_ or make `PR`_.
Development happens at `GitHub`_. Feel free to post to `issues`_ or make `PR`_.

.. _Github: https://github.com/kyamagu/skia-python
.. _issues: https://github.com/kyamagu/skia-python/issues
.. _PR: https://github.com/kyamagu/skia-python/pulls
.. _GitHub: https://github.com/skia-python/skia-python
.. _issues: https://github.com/skia-python/skia-python/issues
.. _PR: https://github.com/skia-python/skia-python/pulls
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ skia-python
Skia is an open source 2D graphics library which provides common APIs that work
across a variety of hardware and software platforms.

`skia-python` development happens at `Github`_.
`skia-python` development happens at `GitHub`_.

.. _Skia Graphics Library: https://skia.org/

.. _Github: https://github.com/kyamagu/skia-python
.. _GitHub: https://github.com/skia-python/skia-python


Documentation
Expand Down
2 changes: 1 addition & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ First, clone the repo.

.. code-block:: bash

git clone --recursive https://github.com/kyamagu/skia-python.git
git clone --recursive https://github.com/skia-python/skia-python.git
cd skia-python

The repository bundles `skia` and its build tools (`depot_tools`) as submodules.
Expand Down
14 changes: 7 additions & 7 deletions docs/tutorial/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Tutorial
Notebook examples
-----------------

- `Showcase <https://github.com/kyamagu/skia-python/blob/master/notebooks/Showcase.ipynb>`_
- `Canvas Overview <https://github.com/kyamagu/skia-python/blob/master/notebooks/Canvas-Overview.ipynb>`_
- `Canvas Creation <https://github.com/kyamagu/skia-python/blob/master/notebooks/Canvas-Creation.ipynb>`_
- `Path Overview <https://github.com/kyamagu/skia-python/blob/master/notebooks/Path-Overview.ipynb>`_
- `Paint Overview <https://github.com/kyamagu/skia-python/blob/master/notebooks/Paint-Overview.ipynb>`_
- `Drawing Texts <https://github.com/kyamagu/skia-python/blob/master/notebooks/Drawing-Texts.ipynb>`_
- `Python Image I/O <https://github.com/kyamagu/skia-python/blob/master/notebooks/Python-Image-IO.ipynb>`_
- `Showcase <https://github.com/skia-python/skia-python/blob/main/notebooks/Showcase.ipynb>`_
- `Canvas Overview <https://github.com/skia-python/skia-python/blob/main/notebooks/Canvas-Overview.ipynb>`_
- `Canvas Creation <https://github.com/skia-python/skia-python/blob/main/notebooks/Canvas-Creation.ipynb>`_
- `Path Overview <https://github.com/skia-python/skia-python/blob/main/notebooks/Path-Overview.ipynb>`_
- `Paint Overview <https://github.com/skia-python/skia-python/blob/main/notebooks/Paint-Overview.ipynb>`_
- `Drawing Texts <https://github.com/skia-python/skia-python/blob/main/notebooks/Drawing-Texts.ipynb>`_
- `Python Image I/O <https://github.com/skia-python/skia-python/blob/main/notebooks/Python-Image-IO.ipynb>`_
2 changes: 1 addition & 1 deletion docs/tutorial/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Alternatively, :py:class:`Canvas` content can be exported to numpy array::
skia.kRGBA_8888_ColorType)

For more examples, check the
`Python Image I/O notebook <https://github.com/kyamagu/skia-python/blob/master/notebooks/Python-Image-IO.ipynb>`_.
`Python Image I/O notebook <https://github.com/skia-python/skia-python/blob/main/notebooks/Python-Image-IO.ipynb>`_.

APIs at a glance
----------------
Expand Down
4 changes: 2 additions & 2 deletions notebooks/Paint-Overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"source": [
"Anytime you draw something in Skia, and want to specify what color it is, or how it blends with the background, or what style or font to draw it in, you specify those attributes in a paint.\n",
"\n",
"Unlike [Canvas](https://kyamagu.github.io/skia-python/_generate/skia.Canvas.html), paints do not maintain an internal stack of state (i.e. there is no save/restore on a paint). However, paints are relatively light-weight, so the client may create and maintain any number of paint objects, each set up for a particular use. Factoring all of these color and stylistic attributes out of the canvas state, and into (multiple) paint objects, allows canvas' save/restore to be that much more efficient, as all they have to do is maintain the stack of matrix and clip settings."
"Unlike [Canvas](https://skia-python.github.io/skia-python/_generate/skia.Canvas.html), paints do not maintain an internal stack of state (i.e. there is no save/restore on a paint). However, paints are relatively light-weight, so the client may create and maintain any number of paint objects, each set up for a particular use. Factoring all of these color and stylistic attributes out of the canvas state, and into (multiple) paint objects, allows canvas' save/restore to be that much more efficient, as all they have to do is maintain the stack of matrix and clip settings."
]
},
{
Expand Down Expand Up @@ -179,7 +179,7 @@
"- `ColorFilter` - modify the source color(s) before applying the xfermode (e.g. color matrix)\n",
"- `Xfermode` - e.g. porter-duff transfermodes, blend modes\n",
"\n",
"Paints also hold a reference to a [Typeface](https://kyamagu.github.io/skia-python/_generate/skia.Typeface.html). The typeface represents a specific font style, to be used for measuring and drawing text. Speaking of which, paints are used not only for drawing text, but also for measuring it.\n",
"Paints also hold a reference to a [Typeface](https://skia-python.github.io/skia-python/_generate/skia.Typeface.html). The typeface represents a specific font style, to be used for measuring and drawing text. Speaking of which, paints are used not only for drawing text, but also for measuring it.\n",
"\n",
"```\n",
"paint.measureText(...)\n",
Expand Down
10 changes: 5 additions & 5 deletions relnotes/README.m116.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
This is a partial port of [skia-python](https://github.com/kyamagu/skia-python/)
This is a partial port of [skia-python](https://github.com/skia-python/skia-python/)
from `m87` to `m116`, possibly disabling any `m87` APIs that have no close `m116` equivalents.

It concentrates on OT-SVG, and fixing these two issues:

* [SkSVGDOM::renderNode() is not exposed in python](https://github.com/kyamagu/skia-python/issues/192)
* [three-args contructor to SkMemoryStream not exposed.](https://github.com/kyamagu/skia-python/issues/194)
* [SkSVGDOM::renderNode() is not exposed in python](https://github.com/skia-python/skia-python/issues/192)
* [three-args constructor to SkMemoryStream not exposed.](https://github.com/skia-python/skia-python/issues/194)

The SVG module left experimental in `m88` upstream. It has received many improvements since.

Expand All @@ -13,8 +13,8 @@ are also exposed for access. This experimental functionality is available to
Linux/FreeType users only.

Special mention of [0lru](https://github.com/0lru) who provided a
[draft m98 pull](https://github.com/kyamagu/skia-python/pull/181) for which some ideas
of this update had taken from.
[draft m98 pull](https://github.com/skia-python/skia-python/pull/181) from which some ideas
for this update were taken.

# General overview of changes between `m87` and `m116`

Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ def build_extensions(self):
setup(
name=NAME,
version=__version__,
author='Kota Yamaguchi',
author_email='[email protected]',
url='https://github.com/kyamagu/skia-python',
author='Kota Yamaguchi, Hin-Tak Leung',
author_email='[email protected], [email protected]',
url='https://github.com/skia-python/skia-python',
description='Skia python binding',
long_description=open('README.md', 'r').read(),
long_description_content_type='text/markdown',
Expand Down
Loading