Skip to content

Commit

Permalink
Backports for 5.3 maintenance branch (#965)
Browse files Browse the repository at this point in the history
* Use the "sphinx-copybutton" extension in documentation (#948)

* DOC: Use the sphinx-copybutton extension in documentation

	modified:   ci/edmtool.py
	modified:   docs/source/conf.py
	modified:   enable/__init__.py

* Update ci/edmtool.py

* Get things working on wxPython again (#950)

Addresses these warnigns/exceptions:
- TypeError: BitmapFromImage() got an unexpected keyword argument 'depth'
- AttributeError: 'PaintDC' object has no attribute 'BeginDrawing'
- wxPyDeprecationWarning: Call to deprecated item EmptyImage. Use :class:`Image` instead.
    image = wx.EmptyImage(*sz)
- wxPyDeprecationWarning: Call to deprecated item BitmapFromImage. Use :class:`wx.Bitmap` instead
    bmp = wx.BitmapFromImage(image, depth=-1)

See https://forums.wxwidgets.org/viewtopic.php?t=39930 why the Begin/EndDrawing calls can simply be removed.

Related issues: #798 and #531

* Add SWIG to pyproject.toml build dependencies (#954)

* Experiment with installing SWIG from PyPI

* Update the EDM-based workflow

* Remove restriction on SWIG version

* Add Cython back as a development dependency; remove verify_swig_install

* Remove generated C++ file. (#958)

* Fix Kiva Quartz backend string encoding (#966)

* Add regression test for Enable #964.

* Properly decode strings in Kiva Quartz font code.

* Properly guard against running Quartz tests on non-Mac systems.

* Ensure Wx Quartz test terminates.

* Make test success externally visible.

* Fix tests, use UTF-8.

* Add a github workflow that publishes to sdists to PyPI on release (#967)

* Add a github workflow that publishes to sdists to PyPI on release.

* Use build to build the sdist.

* Take into account all font features when drawing SVG text. (#980)

* Fix Quartz font rendering (#978)

* Use font family in quartz when no font name given.

* Render quartz text with fill color rather than stroke color.

* Fix `SCRIPT` font family in Kiva (#975)

* Add a test for #971

This should fail CI.

* Fix bug and clean-up style.

* Correct first point and orientation of Kiva QPainter arcs (#970)

* Correct first point and orientation of Kiva QPainter arcs.

This fixes #962 but not #960.

* Update kiva/qpainter.py

* Render font families better in QPainter backend (#973)

* Fall back to kiva.fonttools if Qt can't come up with a font name.

* Add a comment about setFamilies()

* Fix WEIGHT_EXTRAHEAVY on Qt6 (#990)

Some changes to tests to make sure eveything is tested correctly.

* Fix the rendering of polygons in basecore2d-based backends (#987)

* Fix the rendering of polygons in basecore2d-based backends

This:

- consistently uses Nx2 numpy arrays to store path points
- doesn't create a new subpath after a LINES function

A driveby fix gives a default implementation for show_text_at_point().

* Clean-up comments.

* Fix some unused imports.

* Some of the unused imports are in fact used.

* Improve the situation of line_state_equal a bit.

* Ensure all subpath arguments are numpy arrays.

* Ensure all backends implement `arc_to` and `quad_curve_to` (#988)

* Ensure all backends implement arc_to and quad_curve_to.

* Fix 'infomration' typo in comments in multiple files.

* Fixes suggested from PR review.

Co-authored-by: Poruri Sai Rahul <rporuri@enthought.com>
Co-authored-by: Brecht Machiels <brecht@mos6581.org>
Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
  • Loading branch information
4 people authored Aug 12, 2022
1 parent e197657 commit 719af59
Show file tree
Hide file tree
Showing 24 changed files with 341 additions and 25,745 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/bleeding-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ jobs:
run: sudo apt-get install libglu1-mesa-dev
- name: Install build dependencies
run: |
sudo apt-get install swig
python -m pip install -U pip setuptools wheel
python -m pip install numpy
python -m pip install Cython
python -m pip install -U pip wheel
- name: Install prebuilt wxPython
run: python -m pip install -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 wxPython
if: matrix.toolkit == 'wx'
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/publish-on-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish release to PyPI

on:
workflow_dispatch:
release:
types: [published]

jobs:
build-and-upload:
runs-on: ubuntu-latest

steps:
- name: Check out the release commit
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install Python packages needed for build and upload
run: |
python -m pip install build twine
- name: Build sdist
run: |
python -m build --sdist
- name: Publish to PyPI

env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

run: |
python -m twine check --strict dist/*
python -m twine upload dist/*
5 changes: 3 additions & 2 deletions ci/edmtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@
"pyparsing",
"pypdf2",
"reportlab",
"swig",
"traits",
"traitsui",
"wheel",
},
'3.8': {
"apptools",
Expand All @@ -120,9 +120,9 @@
"pyface",
"pygments",
"pyparsing",
"swig",
"traits",
"traitsui",
"wheel",
}
}

Expand Down Expand Up @@ -293,6 +293,7 @@ def docs(runtime, toolkit, environment):
])
commands = [
"edm install -y -e {environment} " + packages,
"edm run -e {environment} -- python -m pip install sphinx-copybutton",
]
click.echo(
"Installing documentation tools in '{environment}'".format(
Expand Down
7 changes: 7 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"sphinx.ext.napoleon",
# Link to code in sphinx generated API docs
"sphinx.ext.viewcode",
"sphinx_copybutton",
# Include trait definition comments in autogenerated API docs
"traits.util.trait_documenter",
]
Expand Down Expand Up @@ -98,6 +99,12 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# Options for Sphinx copybutton extension
# ---------------------------------------

# Matches prompts - "$ ", ">>>" and "..."
copybutton_prompt_text = r">>> |\.\.\. |\$ "
copybutton_prompt_is_regexp = True

# Options for HTML output
# -----------------------
Expand Down
2 changes: 2 additions & 0 deletions enable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
]

__extras_require__ = {
# Dependencies for documentation
"docs": ["enthought-sphinx-theme", "sphinx", "sphinx-copybutton"],
# Dependencies for running enable/kiva's examples
"examples": ["chaco", "mayavi", "scipy", "kiwisolver", "pyglet"],
# Dependencies for GL backend support
Expand Down
Loading

0 comments on commit 719af59

Please sign in to comment.