Skip to content
Merged
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
38 changes: 38 additions & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build wheels

on:
# Make it possible to manually trigger the workflow
workflow_dispatch:

jobs:
build-wheels:
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']

runs-on: ${{ matrix.os }}
steps:
- name: Check out the release commit
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
if: runner.os == 'Linux'

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Build wheels
uses: pypa/cibuildwheel@v2.12.1

- name: Archive build
uses: actions/upload-artifact@v3
with:
name: enable_wheels
path: wheelhouse
# don't need these kept for long
retention-days: 7
43 changes: 39 additions & 4 deletions .github/workflows/publish-on-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,52 @@ on:
types: [published]

jobs:
build-and-upload:
build-wheels:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:

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

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
if: runner.os == 'Linux'

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Build wheels
uses: pypa/cibuildwheel@v2.12.1

- name: Check and upload wheels
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install twine
python -m twine check --strict wheelhouse/*.whl
python -m twine upload wheelhouse/*.whl

build-sdist:
runs-on: ubuntu-latest

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

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any reason why the sdist should be created with the latest possible version of Python? I would assume an older version was better (and Cython source would be compiled by the user of the sdist)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No particular reason other than the assumption that most recent python would automatically get the most current packaging infrastructure. Cython shouldn't be an issue because I don't think we ship the generated .cpp files in the sdist any more.

Copy link
Copy Markdown
Contributor Author

@corranwebster corranwebster Apr 21, 2023

Choose a reason for hiding this comment

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

Looks like I was wrong about that:

recursive-include kiva/agg *.py *.i *.cpp *.h *.c

Probably should remove that - the isolated builds should install Cython correctly from the info in the sdist if needed when building.

Edit: Nope, that's all in the agg subdirectory.

And I also spot a stray gl reference in the manifest as well.


- name: Install Python packages needed for build and upload
run: |
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[build-system]
requires = ["cython", "oldest-supported-numpy", "setuptools", "swig", "wheel"]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
skip = 'pp* *-musllinux* cp36-*'

[tool.cibuildwheel.linux]
archs = ['auto', 'aarch64']
before-all = "yum install -y mesa-libGL-devel"
132 changes: 70 additions & 62 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,45 +380,46 @@ def macos_extensions():
if sys.platform == 'darwin':
ext_modules += macos_extensions()

setup(name='enable',
version=__version__,
author='Enthought, Inc',
author_email='info@enthought.com',
maintainer='ETS Developers',
maintainer_email='enthought-dev@enthought.com',
url='https://github.com/enthought/enable/',
# Note that this URL is only valid for tagged releases.
download_url=('https://github.com/enthought/enable/archive/'
'{0}.tar.gz'.format(__version__)),
license='BSD',
classifiers=[c.strip() for c in """\
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Operating System :: MacOS
Operating System :: Microsoft :: Windows
Operating System :: OS Independent
Operating System :: POSIX
Operating System :: Unix
Programming Language :: C
Programming Language :: Python
Topic :: Scientific/Engineering
Topic :: Software Development
Topic :: Software Development :: Libraries
""".splitlines() if len(c.strip()) > 0],
platforms=['Windows', 'Linux', 'macOS', 'Unix', 'Solaris'],
description='low-level drawing and interaction',
long_description=long_description,
long_description_content_type="text/x-rst",
install_requires=__requires__,
extras_require=__extras_require__,
cmdclass={
'build': PatchedBuild,
'install': PatchedInstall,
'build_ext': build_ext,
},
entry_points={
setup(
name='enable',
version=__version__,
author='Enthought, Inc',
author_email='info@enthought.com',
maintainer='ETS Developers',
maintainer_email='enthought-dev@enthought.com',
url='https://github.com/enthought/enable/',
# Note that this URL is only valid for tagged releases.
download_url=('https://github.com/enthought/enable/archive/'
'{0}.tar.gz'.format(__version__)),
license='BSD',
classifiers=[c.strip() for c in """\
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Operating System :: MacOS
Operating System :: Microsoft :: Windows
Operating System :: OS Independent
Operating System :: POSIX
Operating System :: Unix
Programming Language :: C
Programming Language :: Python
Topic :: Scientific/Engineering
Topic :: Software Development
Topic :: Software Development :: Libraries
""".splitlines() if len(c.strip()) > 0],
platforms=['Windows', 'Linux', 'macOS', 'Unix', 'Solaris'],
description='low-level drawing and interaction',
long_description=long_description,
long_description_content_type="text/x-rst",
install_requires=__requires__,
extras_require=__extras_require__,
cmdclass={
'build': PatchedBuild,
'install': PatchedInstall,
'build_ext': build_ext,
},
entry_points={
'enable.toolkits': [
'null = enable.null.toolkit:toolkit',
'qt = enable.qt4.toolkit:toolkit',
Expand All @@ -429,26 +430,33 @@ def macos_extensions():
'enable_examples = enable.examples._etsdemo_info:info',
'kiva_examples = kiva.examples._etsdemo_info:info',
]
},
ext_modules=ext_modules,
packages=find_packages(exclude=['ci', 'docs']),
package_data={
'': ['*.zip', '*.svg', 'images/*'],
'enable': ['tests/primitives/data/PngSuite/*.png'],
'enable.examples': ['demo/*',
'demo/*/*',
'demo/*/*/*',
'demo/*/*/*/*',
'demo/*/*/*/*/*'],
'enable.savage.trait_defs.ui.wx': ['data/*.svg'],
'kiva': ['tests/agg/doubleprom_soho_full.jpg',
'fonttools/data/*.ttf',
'fonttools/tests/data/*.afm',
'fonttools/tests/data/*.ttc',
'fonttools/tests/data/*.ttf',
'fonttools/tests/data/*.txt'],
'kiva.examples': ['kiva/*',
'kiva/*/*'],
},
zip_safe=False,
)
},
ext_modules=ext_modules,
packages=find_packages(exclude=['ci', 'docs']),
package_data={
'': ['*.zip', '*.svg', 'images/*'],
'enable': ['tests/primitives/data/PngSuite/*.png'],
'enable.examples': [
'demo/*',
'demo/*/*',
'demo/*/*/*',
'demo/*/*/*/*',
'demo/*/*/*/*/*',
],
'enable.savage.trait_defs.ui.wx': ['data/*.svg'],
'kiva': [
'tests/agg/doubleprom_soho_full.jpg',
'fonttools/data/*.ttf',
'fonttools/tests/data/*.afm',
'fonttools/tests/data/*.ttc',
'fonttools/tests/data/*.ttf',
'fonttools/tests/data/*.txt',
],
'kiva.examples': [
'kiva/*',
'kiva/*/*',
],
},
zip_safe=False,
python_requires=">=3.7",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the only change here apart from formatting.

)