diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml new file mode 100644 index 00000000..74f77367 --- /dev/null +++ b/.github/workflows/build-wheels.yml @@ -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 diff --git a/.github/workflows/publish-on-pypi.yml b/.github/workflows/publish-on-pypi.yml index 72ca43a8..dce289f0 100644 --- a/.github/workflows/publish-on-pypi.yml +++ b/.github/workflows/publish-on-pypi.yml @@ -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' - name: Install Python packages needed for build and upload run: | diff --git a/pyproject.toml b/pyproject.toml index 54d49e45..8ab5b300 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/setup.py b/setup.py index d1c2efef..65424e34 100644 --- a/setup.py +++ b/setup.py @@ -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', @@ -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", + )