Skip to content

Commit

Permalink
Kick the wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion committed Jan 3, 2024
1 parent 84c66fa commit 60eee41
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 67 deletions.
100 changes: 42 additions & 58 deletions .github/workflows/release-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,30 @@ name: release-deploy
on:
release:
types: [ published ]
push:
branches: [ main ]
pull_request:

jobs:
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.11'
python-version: '3.10'

- name: Build sdist
run: |
python -m pip install .
python setup.py sdist
python -m pip install -U pip
python -m pip install poetry
poetry build -f sdist
- name: Store artifacts
uses: actions/upload-artifact@v3
Expand All @@ -38,9 +42,6 @@ jobs:
matrix:
include:
# Windows 32 bit
- os: windows-latest
python: 37
platform_id: win32
- os: windows-latest
python: 38
platform_id: win32
Expand All @@ -58,9 +59,6 @@ jobs:
platform_id: win32

# Windows 64 bit
- os: windows-latest
python: 37
platform_id: win_amd64
- os: windows-latest
python: 38
platform_id: win_amd64
Expand All @@ -78,10 +76,6 @@ jobs:
platform_id: win_amd64

# Linux 64 bit manylinux2014
- os: ubuntu-latest
python: 37
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
- os: ubuntu-latest
python: 38
platform_id: manylinux_x86_64
Expand All @@ -102,15 +96,8 @@ jobs:
python: 312
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
- os: ubuntu-latest
python: 311
platform_id: manylinux_x86_64
manylinux_image: manylinux2014

# Linux aarch64
- os: ubuntu-latest
python: 37
platform_id: manylinux_aarch64
- os: ubuntu-latest
python: 38
platform_id: manylinux_aarch64
Expand All @@ -123,11 +110,11 @@ jobs:
- os: ubuntu-latest
python: 311
platform_id: manylinux_aarch64
- os: ubuntu-latest
python: 312
platform_id: manylinux_aarch64

# MacOS x86_64
- os: macos-latest
python: 37
platform_id: macosx_x86_64
- os: macos-latest
python: 38
platform_id: macosx_x86_64
Expand All @@ -142,9 +129,6 @@ jobs:
- os: macos-latest
python: 312
platform_id: macosx_x86_64
- os: macos-latest
python: 311
platform_id: macosx_x86_64

# MacOS arm64
- os: macos-latest
Expand All @@ -164,7 +148,7 @@ jobs:
platform_id: macosx_arm64

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -182,7 +166,7 @@ jobs:
- name: Install cibuildwheel
run: |
python -m pip install -U pip
python -m pip install cibuildwheel==2.16.2
python -m pip install cibuildwheel>=2.16
- name: Build wheels
env:
Expand Down Expand Up @@ -232,8 +216,8 @@ jobs:
python -m pip install pytest pydicom pylibjpeg
python -m pip uninstall -y pylibjpeg-openjpeg
python -m pip install git+https://github.com/pydicom/pylibjpeg-data
python -m pip install -U --find-links dist/ pylibjpeg-openjpeg
python -c "import pytest; pytest.main(['--pyargs', 'openjpeg.tests'])"
python -m pip install -U --pre --find-links dist/ pylibjpeg-openjpeg
python -m pytest --pyargs openjpeg.tests
deactivate
- name: Install from package tarball and test
Expand All @@ -244,36 +228,36 @@ jobs:
python -m pip install pytest pydicom pylibjpeg
python -m pip uninstall -y pylibjpeg-openjpeg
python -m pip install git+https://github.com/pydicom/pylibjpeg-data
python -m pip install -U dist/pylibjpeg-openjpeg-*.tar.gz
python -c "import pytest; pytest.main(['--pyargs', 'openjpeg.tests'])"
python -m pip install -U dist/pylibjpeg*openjpeg-*.tar.gz
python -m pytest --pyargs openjpeg.tests
deactivate
# The pypi upload fails with non-linux containers, so grab the uploaded
# artifacts and run using those
# See: https://github.com/pypa/gh-action-pypi-publish/discussions/15
deploy:
name: Upload wheels to PyPI
needs: [ test-package ]
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Download the wheels
uses: actions/download-artifact@v3
with:
name: wheels
path: dist/

#- name: Publish package to Test PyPi
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_PASSWORD }}
# repository_url: https://test.pypi.org/legacy/

- name: Publish package to PyPi
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
# deploy:
# name: Upload wheels to PyPI
# needs: [ test-package ]
# runs-on: ubuntu-latest
# timeout-minutes: 10
#
# steps:
# - name: Download the wheels
# uses: actions/download-artifact@v3
# with:
# name: wheels
# path: dist/
#
# #- name: Publish package to Test PyPi
# # uses: pypa/gh-action-pypi-publish@master
# # with:
# # user: __token__
# # password: ${{ secrets.TEST_PYPI_PASSWORD }}
# # repository_url: https://test.pypi.org/legacy/
#
# - name: Publish package to PyPi
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.PYPI_PASSWORD }}
3 changes: 1 addition & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
INTERFACE_SRC = PACKAGE_DIR / "src" / "interface"


def build(setup_kwargs: Any) -> None:
def build(setup_kwargs: Any) -> Any:
from setuptools import Extension
from setuptools.dist import Distribution
import Cython.Compiler.Options
Expand All @@ -29,7 +29,6 @@ def build(setup_kwargs: Any) -> None:
os.fspath(OPENJPEG_SRC),
os.fspath(INTERFACE_SRC),
numpy.get_include(),
# distutils.sysconfig.get_python_inc(),
],
extra_compile_args=[],
extra_link_args=[],
Expand Down
2 changes: 1 addition & 1 deletion openjpeg/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from importlib.metadata import version

__version__: str = version("openjpeg")
__version__: str = version("pylibjpeg-openjpeg")
14 changes: 8 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ classifiers=[
"Topic :: Software Development :: Libraries",
]
description = """\
A Python framework for decoding JPEG and decoding/encoding DICOM\
RLE data, with a focus on supporting pydicom\
"A Python wrapper for openjpeg, with a focus on use as a plugin for "\
"for pylibjpeg"\
"""
homepage = "https://github.com/pydicom/pylibjpeg-openjpeg"
include = [
Expand All @@ -44,12 +44,14 @@ include = [
"openjpeg/src/openjpeg/*.md",
"openjpeg/src/openjpeg/LICENSE",
"build_tools/*",
{path = "*.so", format= "wheel"},
]
keywords = ["dicom pydicom python imaging jpg jpeg jpg-ls jpeg-ls jpeg2k jpeg2000 rle"]
keywords = ["dicom pydicom python imaging jpg jpeg jpeg2k jpeg2000 pylibjpeg openjpeg"]
license = "MIT"
maintainers = ["scaramallion <[email protected]>"]
name = "openjpeg"
name = "pylibjpeg-openjpeg"
packages = [
{include = "openjpeg"}
]
readme = "README.md"
version = "2.0.0.dev0"

Expand Down Expand Up @@ -85,7 +87,7 @@ omit = [
[tool.mypy]
python_version = "3.8"
files = "openjpeg"
exclude = ["openjpeg/tests", "openjpeg/tools/tests"]
exclude = ["openjpeg/tests"]
show_error_codes = true
warn_redundant_casts = true
warn_unused_ignores = true
Expand Down

0 comments on commit 60eee41

Please sign in to comment.