From b455e6ba4ce13493b316b930f749d6e26ce1d97e Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Thu, 19 Nov 2026 22:49:04 +0100 Subject: [PATCH] workflows: migrate cibuildwheel builds to reusable workflow --- .github/workflows/_build-cibuildwheel.yml | 29 +- .../workflows/build-accelerator-toolbox.yml | 73 ++- .github/workflows/build-accesscontrol.yml | 1 - .github/workflows/build-acquisition.yml | 1 - .github/workflows/build-acsylla.yml | 3 +- .github/workflows/build-ada-url.yml | 1 - .../workflows/build-adbc-driver-manager.yml | 3 +- .github/workflows/build-aggdraw.yml | 2 +- .github/workflows/build-aimrocks.yml | 145 +++--- .github/workflows/build-aioesphomeapi.yml | 5 +- .github/workflows/build-aiofastnet.yml | 2 +- .github/workflows/build-aiokafka.yml | 1 - .github/workflows/build-aioquic.yml | 80 ++-- .github/workflows/build-ale-py.yml | 182 ++++---- .github/workflows/build-amazon-ion.yml | 102 ++-- .github/workflows/build-anastruct.yml | 84 ++-- .github/workflows/build-annotatedyaml.yml | 5 +- .github/workflows/build-annoy.yml | 4 +- .../workflows/build-ansys-mapdl-reader.yml | 51 +- .github/workflows/build-apache-flink.yml | 1 - .github/workflows/build-apache-sedona.yml | 86 ++-- .github/workflows/build-aplr.yml | 69 +-- .github/workflows/build-arch.yml | 66 ++- .github/workflows/build-arm-pyart.yml | 75 ++- .github/workflows/build-arraykit.yml | 84 ++-- .github/workflows/build-arrow-odbc.yml | 271 +++++------ .github/workflows/build-asammdf.yml | 1 - .github/workflows/build-assimp-py.yml | 51 +- .github/workflows/build-astc-encoder-py.yml | 1 - .github/workflows/build-astropy-healpix.yml | 121 +++-- .github/workflows/build-astropy.yml | 71 ++- .github/workflows/build-asyncdb.yml | 65 +-- .github/workflows/build-asynch.yml | 59 ++- .github/workflows/build-asyncmy.yml | 100 ++-- .github/workflows/build-asyncmy2.yml | 91 ++-- .github/workflows/build-asyncpg.yml | 1 - .github/workflows/build-atheris.yml | 4 +- .github/workflows/build-audiostretchy.yml | 52 +-- .github/workflows/build-autobahn.yml | 4 +- .github/workflows/build-awscrt.yml | 138 +++--- .github/workflows/build-awslambdaric.yml | 80 ++-- .github/workflows/build-base2048.yml | 88 ++-- .github/workflows/build-basedpl.yml | 5 +- .github/workflows/build-basemap.yml | 86 ++-- .../build-betterproto-rust-codec.yml | 118 ++--- .github/workflows/build-biopython.yml | 81 ++-- .github/workflows/build-biotraj.yml | 4 +- .github/workflows/build-biscuit-python.yml | 4 +- .github/workflows/build-bitarray-hardbyte.yml | 68 +-- .github/workflows/build-bitarray.yml | 46 +- .github/workflows/build-bleak-esphome.yml | 5 +- .github/workflows/build-blis.yml | 69 ++- .github/workflows/build-blosc.yml | 84 ++-- .github/workflows/build-blosc2.yml | 90 ++-- .../workflows/build-bluetooth-data-tools.yml | 7 +- .github/workflows/build-blurhash-python.yml | 4 +- .github/workflows/build-bottleneck.yml | 83 ++-- .github/workflows/build-btrees.yml | 1 - .github/workflows/build-burner-redis.yml | 113 +++-- .github/workflows/build-bx-python.yml | 67 +-- .github/workflows/build-cached-ipaddress.yml | 4 +- .github/workflows/build-capstone.yml | 56 +-- .github/workflows/build-capstone6pwndbg.yml | 99 ++-- .github/workflows/build-cartopy.yml | 94 ++-- .github/workflows/build-cbitstruct.yml | 1 - .github/workflows/build-cbor2.yml | 2 +- .github/workflows/build-cdshealpix.yml | 4 +- .github/workflows/build-certbot-dns-multi.yml | 262 +++++------ .github/workflows/build-cf-units.yml | 114 +++-- .github/workflows/build-cffsubr.yml | 6 +- .github/workflows/build-cftime.yml | 4 +- .github/workflows/build-chalk-viztracer.yml | 1 - .github/workflows/build-chalkpy-rs.yml | 376 +++++++-------- .github/workflows/build-chia-rs.yml | 67 +-- .github/workflows/build-chiabip158.yml | 48 +- .github/workflows/build-chialisp.yml | 60 ++- .github/workflows/build-chiapos.yml | 76 +-- .github/workflows/build-chiavdf.yml | 112 +++-- .github/workflows/build-chompjs.yml | 60 ++- .github/workflows/build-chroma-hnswlib.yml | 5 +- .github/workflows/build-chromadb.yml | 189 ++++---- .github/workflows/build-circt.yml | 146 +++--- .github/workflows/build-citiespy.yml | 95 ++-- .github/workflows/build-ckzg.yml | 1 - .github/workflows/build-clang-format.yml | 4 +- .github/workflows/build-clevercsv.yml | 1 - .../build-clickhouse-connect-core.yml | 137 +++--- .../workflows/build-clickhouse-connect.yml | 141 +++--- .github/workflows/build-clickhouse-driver.yml | 65 ++- .github/workflows/build-clingo.yml | 66 ++- .github/workflows/build-clp-ffi-py.yml | 79 ++-- .github/workflows/build-clvm-rs.yml | 92 ++-- .github/workflows/build-clvm-tools-rs.yml | 79 ++-- .github/workflows/build-cmeel-assimp.yml | 57 +-- .github/workflows/build-cmeel-boost.yml | 61 ++- .github/workflows/build-cmeel-cddlib.yml | 103 ++-- .github/workflows/build-cmeel-clp.yml | 83 ++-- .github/workflows/build-cmeel-coinutils.yml | 71 ++- .../workflows/build-cmeel-console-bridge.yml | 61 ++- .github/workflows/build-cmeel-cppad.yml | 67 ++- .github/workflows/build-cmeel-fmt.yml | 55 ++- .github/workflows/build-cmeel-gklib.yml | 117 ++--- .github/workflows/build-cmeel-glpk.yml | 133 +++--- .github/workflows/build-cmeel-gmp.yml | 59 ++- .github/workflows/build-cmeel-lapack.yml | 101 ++-- .github/workflows/build-cmeel-libomp.yml | 87 ++-- .github/workflows/build-cmeel-m4.yml | 101 ++-- .github/workflows/build-cmeel-metis.yml | 225 ++++----- .github/workflows/build-cmeel-octomap.yml | 59 ++- .github/workflows/build-cmeel-qhull.yml | 65 ++- .github/workflows/build-cmeel-qpoases.yml | 56 ++- .github/workflows/build-cmeel-spirv-tools.yml | 152 +++--- .github/workflows/build-cmeel-tinyxml.yml | 2 +- .github/workflows/build-cmeel-tinyxml2.yml | 2 +- .github/workflows/build-cmeel-urdfdom.yml | 57 +-- .github/workflows/build-cmeel-yaml-cpp.yml | 61 ++- .github/workflows/build-cmeel-zlib.yml | 55 ++- .../workflows/build-cmsis-pack-manager.yml | 73 ++- .github/workflows/build-coacd.yml | 107 +++-- .github/workflows/build-color-operations.yml | 55 ++- .github/workflows/build-compreffor.yml | 48 +- .../build-connected-components-3d.yml | 102 ++-- .github/workflows/build-contourpy.yml | 2 +- .github/workflows/build-convertbng.yml | 4 +- .github/workflows/build-convertertools.yml | 2 +- .github/workflows/build-coolprop.yml | 92 ++-- .github/workflows/build-coreforecast.yml | 91 ++-- .github/workflows/build-cppcheck.yml | 106 ++--- .github/workflows/build-cramjam.yml | 68 ++- .github/workflows/build-crc32c.yml | 48 +- .github/workflows/build-crick.yml | 101 ++-- .github/workflows/build-cronexpr.yml | 4 +- .github/workflows/build-crosshair-tool.yml | 5 +- .github/workflows/build-cumm.yml | 2 +- .../workflows/build-curated-tokenizers.yml | 54 +-- .github/workflows/build-cutadapt.yml | 4 +- .github/workflows/build-cvxopt.yml | 76 ++- .github/workflows/build-cvxpy-base.yml | 96 ++-- .github/workflows/build-cvxpy.yml | 72 ++- .github/workflows/build-cyksuid.yml | 2 +- .github/workflows/build-cylp.yml | 78 ++-- .github/workflows/build-cymem.yml | 82 ++-- .github/workflows/build-cysignals.yml | 81 ++-- .github/workflows/build-cysystemd.yml | 259 ++++++----- .github/workflows/build-cyvcf2.yml | 112 +++-- .github/workflows/build-datasketches.yml | 83 ++-- .github/workflows/build-davey.yml | 75 +-- .github/workflows/build-dbt-extractor.yml | 89 ++-- .github/workflows/build-dclab.yml | 67 ++- .github/workflows/build-ddtrace.yml | 116 ++--- .github/workflows/build-debugpy.yml | 4 +- .github/workflows/build-deepsearch-glm.yml | 118 ++--- ...uild-delta-kernel-rust-sharing-wrapper.yml | 113 ++--- .../workflows/build-dependency-injector.yml | 125 ++--- .github/workflows/build-diffq-fixed.yml | 4 +- .github/workflows/build-diffq.yml | 4 +- .github/workflows/build-djlint.yml | 4 +- .github/workflows/build-dlib-bin.yml | 133 +++--- .github/workflows/build-dm-tree.yml | 71 ++- .github/workflows/build-dnaio.yml | 2 +- .github/workflows/build-docling-parse.yml | 107 ++--- .github/workflows/build-dracopy.yml | 76 ++- .github/workflows/build-drjit.yml | 81 ++-- .github/workflows/build-dtw-python.yml | 53 ++- .github/workflows/build-duckdb.yml | 83 ++-- .github/workflows/build-dukpy.yml | 58 ++- .../workflows/build-dwave-optimization.yml | 4 +- .github/workflows/build-dwave-samplers.yml | 10 +- .github/workflows/build-dynet38.yml | 80 ++-- .github/workflows/build-eclipse-sumo.yml | 137 +++--- .github/workflows/build-ecos.yml | 4 +- .github/workflows/build-edt.yml | 86 ++-- .github/workflows/build-efel.yml | 4 +- .github/workflows/build-eigenpy.yml | 89 ++-- .github/workflows/build-emcache.yml | 1 - .github/workflows/build-emval.yml | 86 ++-- .github/workflows/build-epaper-dithering.yml | 76 +-- .github/workflows/build-essentia.yml | 226 ++++----- .github/workflows/build-etcpak.yml | 86 ++-- .github/workflows/build-ethos-u-vela.yml | 91 ++-- .github/workflows/build-eventio.yml | 62 ++- .github/workflows/build-evtx.yml | 80 ++-- .github/workflows/build-executorch.yml | 316 ++++++------- .../workflows/build-exp-gateway-native.yml | 220 +++++---- .github/workflows/build-ezdxf.yml | 4 +- .github/workflows/build-faiss-cpu.yml | 68 +-- .github/workflows/build-fast-histogram.yml | 77 ++- .../workflows/build-fast-simplification.yml | 54 +-- .github/workflows/build-fastavro.yml | 95 ++-- .github/workflows/build-fastcluster.yml | 4 +- .github/workflows/build-fastecdsa.yml | 77 ++- .github/workflows/build-faster-coco-eval.yml | 4 +- .github/workflows/build-faster-eth-abi.yml | 1 - .github/workflows/build-fastnumbers.yml | 61 ++- .github/workflows/build-fastokens.yml | 121 +++-- .github/workflows/build-fastparquet.yml | 102 ++-- .github/workflows/build-fastremap.yml | 92 ++-- .github/workflows/build-fasttext-numpy2.yml | 1 - .github/workflows/build-fastwarc.yml | 124 +++-- .github/workflows/build-fatfs-ng.yml | 71 ++- .github/workflows/build-faust-cchardet.yml | 72 +-- .github/workflows/build-faust-streaming.yml | 73 ++- .github/workflows/build-fenics-basix.yml | 77 +-- .github/workflows/build-fill-voids.yml | 98 ++-- .github/workflows/build-filprofiler.yml | 2 +- .github/workflows/build-finufft.yml | 97 ++-- .github/workflows/build-flpc.yml | 102 ++-- .github/workflows/build-fnv-hash-fast.yml | 2 +- .github/workflows/build-fpylll.yml | 89 ++-- .github/workflows/build-freetype-py.yml | 117 +++-- .github/workflows/build-freud-analysis.yml | 156 +++---- .github/workflows/build-fuzzyset2.yml | 1 - .github/workflows/build-gdstk.yml | 95 ++-- .github/workflows/build-gemmi.yml | 83 ++-- .github/workflows/build-gensim.yml | 4 +- .github/workflows/build-gersemi.yml | 4 +- .github/workflows/build-gevent.yml | 114 ++--- .github/workflows/build-geventhttpclient.yml | 110 ++--- .github/workflows/build-glcontext.yml | 106 ++--- .github/workflows/build-glum.yml | 56 ++- .github/workflows/build-gmpy2.yml | 98 ++-- .github/workflows/build-google-re2.yml | 105 ++--- .github/workflows/build-gpy.yml | 69 ++- .github/workflows/build-gsd.yml | 52 +-- .github/workflows/build-gseapy.yml | 66 ++- .github/workflows/build-gstools-cython.yml | 55 ++- .github/workflows/build-gsw.yml | 65 ++- .github/workflows/build-guardpycfn.yml | 290 ++++++------ .github/workflows/build-h5py.yml | 167 ++++--- .github/workflows/build-habluetooth.yml | 7 +- .github/workflows/build-harmonypy.yml | 79 ++-- .github/workflows/build-hdbscan.yml | 4 +- .github/workflows/build-hdf5plugin.yml | 113 ++--- .github/workflows/build-hdrhistogram.yml | 83 ++-- .github/workflows/build-healpy.yml | 96 ++-- .github/workflows/build-hidapi.yml | 190 ++++---- .../workflows/build-hierarchicalforecast.yml | 86 ++-- .github/workflows/build-highspy.yml | 81 ++-- .github/workflows/build-hiredis.yml | 82 ++-- .github/workflows/build-histomicstk.yml | 44 +- .github/workflows/build-hnswlib.yml | 5 +- .github/workflows/build-hunter.yml | 67 ++- .github/workflows/build-hypothesis.yml | 4 +- .github/workflows/build-icsneopy.yml | 101 ++-- .github/workflows/build-icu4py.yml | 101 ++-- .github/workflows/build-igraph.yml | 137 +++--- .github/workflows/build-ijson.yml | 50 +- .github/workflows/build-img2table.yml | 56 ++- .github/workflows/build-imgui-bundle.yml | 12 +- .github/workflows/build-immutables.yml | 2 +- .github/workflows/build-implicit.yml | 97 ++-- .github/workflows/build-indexed-bzip2.yml | 85 ++-- .github/workflows/build-indexed-zstd.yml | 2 +- .github/workflows/build-infomap.yml | 69 +-- .github/workflows/build-intbitset.yml | 70 +-- .../workflows/build-iree-base-compiler.yml | 124 ++--- .github/workflows/build-isal.yml | 2 +- .github/workflows/build-jellyfish.yml | 71 ++- .github/workflows/build-jenkspy.yml | 54 ++- .github/workflows/build-jina.yml | 97 ++-- .github/workflows/build-joulescope.yml | 63 ++- .github/workflows/build-jpype1.yml | 87 ++-- .github/workflows/build-jxlpy.yml | 144 +++--- .github/workflows/build-kasa-crypt.yml | 2 +- .github/workflows/build-keeper-mlkem.yml | 167 ++++--- .../workflows/build-keeper-pam-webrtc-rs.yml | 158 ++++--- .github/workflows/build-keystone-engine.yml | 156 ++++--- .github/workflows/build-kiss-icp.yml | 171 +++---- .github/workflows/build-kiwipiepy.yml | 93 ++-- .github/workflows/build-klayout.yml | 67 +-- .github/workflows/build-lameenc.yml | 102 ++-- .github/workflows/build-lap.yml | 54 +-- .github/workflows/build-lapx.yml | 76 ++- .github/workflows/build-lark-cython.yml | 51 +- .github/workflows/build-lazy-object-proxy.yml | 58 ++- .github/workflows/build-lcm.yml | 1 - .github/workflows/build-leidenalg.yml | 98 ++-- .github/workflows/build-lhafile.yml | 102 ++-- .github/workflows/build-libcoal.yml | 62 ++- .github/workflows/build-libcst.yml | 5 +- .github/workflows/build-libdatachannel-py.yml | 54 ++- .github/workflows/build-libigl.yml | 138 +++--- .github/workflows/build-libpinocchio.yml | 57 +-- .github/workflows/build-libtorrent.yml | 96 ++-- .github/workflows/build-libuuu.yml | 215 ++++----- .github/workflows/build-libvalkey.yml | 76 +-- .github/workflows/build-liftover.yml | 70 +-- .github/workflows/build-lightsim2grid.yml | 1 - .github/workflows/build-ligo-skymap.yml | 148 +++--- .github/workflows/build-lilcom.yml | 1 - .github/workflows/build-line-profiler.yml | 1 - .github/workflows/build-linearmodels.yml | 62 ++- .github/workflows/build-livekit-blingfire.yml | 73 ++- .github/workflows/build-lmdb.yml | 1 - .../build-lmnr-claude-code-proxy.yml | 332 ++++++------- .github/workflows/build-loudness.yml | 5 +- .github/workflows/build-lru-dict.yml | 43 +- .github/workflows/build-lzallright.yml | 93 ++-- .github/workflows/build-mahotas.yml | 90 ++-- .github/workflows/build-manifold3d.yml | 68 +-- .github/workflows/build-mapbox-earcut.yml | 1 - .github/workflows/build-mappy.yml | 158 ++++--- .github/workflows/build-marisa-trie.yml | 71 +-- .github/workflows/build-materialyoucolor.yml | 82 ++-- .github/workflows/build-matrix-synapse.yml | 75 ++- .github/workflows/build-mdanalysis.yml | 96 ++-- .github/workflows/build-mdtraj.yml | 119 +++-- .github/workflows/build-memory-allocator.yml | 71 +-- .github/workflows/build-memray.yml | 237 +++++----- .github/workflows/build-miniaudio.yml | 1 - .github/workflows/build-mink.yml | 4 +- .github/workflows/build-mitsuba.yml | 90 ++-- .github/workflows/build-mmcif.yml | 82 ++-- .github/workflows/build-mocpy.yml | 4 +- .github/workflows/build-moderngl.yml | 65 +-- .github/workflows/build-molbloom.yml | 1 - .../build-monotonic-alignment-search.yml | 2 +- .github/workflows/build-moocore.yml | 4 +- .github/workflows/build-mpi4py.yml | 136 +++--- .github/workflows/build-mplcairo.yml | 93 ++-- .github/workflows/build-mrml.yml | 86 ++-- .github/workflows/build-multimark.yml | 1 - .github/workflows/build-mwparserfromhell.yml | 4 +- .github/workflows/build-mypy.yml | 2 +- .../build-mysql-connector-python.yml | 115 +++-- .github/workflows/build-mysql-mimic.yml | 1 - .github/workflows/build-nagisa.yml | 4 +- .github/workflows/build-navconfig.yml | 4 +- .github/workflows/build-navigator-api.yml | 53 +-- .github/workflows/build-navigator-auth.yml | 49 +- .github/workflows/build-ncls.yml | 2 +- .github/workflows/build-ncompress.yml | 69 +-- .github/workflows/build-netcdf4.yml | 260 +++++------ .github/workflows/build-netifaces-plus.yml | 62 +-- .github/workflows/build-netifaces.yml | 62 +-- .github/workflows/build-newrelic.yml | 2 +- .github/workflows/build-ngt.yml | 122 +++-- .github/workflows/build-nlopt.yml | 4 +- .github/workflows/build-nmslib.yml | 68 ++- .github/workflows/build-numexpr.yml | 2 - .github/workflows/build-numpy-financial.yml | 78 ++-- .github/workflows/build-numpy-minmax.yml | 4 +- .github/workflows/build-numpy-quaternion.yml | 60 ++- .github/workflows/build-numpy-rms.yml | 64 ++- .github/workflows/build-nvtx.yml | 1 - .github/workflows/build-obspy.yml | 65 ++- .github/workflows/build-oneagent-sdk.yml | 95 ++-- .github/workflows/build-onnxoptimizer.yml | 9 +- .../build-onnxruntime-extensions.yml | 119 +++-- .github/workflows/build-opencc.yml | 2 +- .github/workflows/build-openskill.yml | 51 +- .../workflows/build-opentype-sanitizer.yml | 2 +- .github/workflows/build-oracledb.yml | 70 ++- .github/workflows/build-orange3.yml | 4 +- .github/workflows/build-ormsgpack.yml | 74 ++- .github/workflows/build-oxapy.yml | 4 +- .github/workflows/build-oxbow.yml | 89 ++-- .github/workflows/build-packingsolver.yml | 168 +++---- .github/workflows/build-pcapy-ng.yml | 221 ++++----- .github/workflows/build-pedalboard.yml | 238 +++++----- .github/workflows/build-persistence.yml | 1 - .github/workflows/build-persistent.yml | 1 - .github/workflows/build-pglast.yml | 66 +-- .github/workflows/build-pgparse.yml | 101 ++-- .github/workflows/build-pgserver.yml | 88 ++-- .github/workflows/build-phik.yml | 1 - .github/workflows/build-phono3py.yml | 93 ++-- .github/workflows/build-phonopy.yml | 89 ++-- .github/workflows/build-photutils.yml | 57 ++- .github/workflows/build-pi-heif.yml | 105 +++-- .github/workflows/build-picows.yml | 2 +- .../workflows/build-pillow-avif-plugin.yml | 125 +++-- .github/workflows/build-pillow-heif.yml | 71 ++- .github/workflows/build-pillow-jxl-plugin.yml | 121 +++-- .github/workflows/build-piper-tts.yml | 113 ++--- .github/workflows/build-piqp.yml | 60 +-- .../workflows/build-pixeltable-pgserver.yml | 123 +++-- .github/workflows/build-planegcs.yml | 66 +-- .github/workflows/build-playa-pdf.yml | 4 +- .github/workflows/build-plotext.yml | 58 ++- .github/workflows/build-plyvel.yml | 107 ++--- .github/workflows/build-pmdarima.yml | 5 +- .github/workflows/build-pocketsphinx.yml | 77 +-- .github/workflows/build-point-cloud-utils.yml | 158 +++---- .github/workflows/build-polars-ols.yml | 116 +++-- .github/workflows/build-polyscope.yml | 129 ++--- .github/workflows/build-portablemc.yml | 135 +++--- .github/workflows/build-pot.yml | 105 +++-- .github/workflows/build-power-grid-model.yml | 109 ++--- .github/workflows/build-preshed.yml | 69 ++- .github/workflows/build-prody.yml | 80 ++-- .github/workflows/build-proxsuite.yml | 85 ++-- .github/workflows/build-psd-tools.yml | 5 +- .github/workflows/build-psygnal.yml | 5 +- .github/workflows/build-pulsar-client.yml | 245 +++++----- .github/workflows/build-pupil-apriltags.yml | 1 - .github/workflows/build-py-radix.yml | 2 +- .github/workflows/build-pya2ldb.yml | 4 +- .github/workflows/build-pybammsolvers.yml | 118 ++--- .github/workflows/build-pybcj.yml | 1 - .github/workflows/build-pybedtools.yml | 1 - .github/workflows/build-pyboy.yml | 4 +- .github/workflows/build-pybullet.yml | 81 ++-- .github/workflows/build-pycapnp.yml | 90 ++-- .github/workflows/build-pycares.yml | 84 ++-- .github/workflows/build-pycauset.yml | 99 ++-- .github/workflows/build-pyclipper.yml | 1 - .github/workflows/build-pyclothoids.yml | 82 ++-- .github/workflows/build-pycocotools.yml | 148 +++--- .github/workflows/build-pycryptosat.yml | 64 ++- .github/workflows/build-pycurl.yml | 228 ++++----- .github/workflows/build-pydemumble.yml | 4 +- .github/workflows/build-pydivsufsort.yml | 90 ++-- .github/workflows/build-pye57.yml | 71 +-- .github/workflows/build-pyedflib.yml | 66 ++- .github/workflows/build-pyerfa.yml | 77 ++- .github/workflows/build-pyfastx.yml | 83 ++-- .github/workflows/build-pyfftw.yml | 91 ++-- .github/workflows/build-pyfqmr.yml | 57 ++- .github/workflows/build-pygame-ce.yml | 296 ++++++------ .github/workflows/build-pygame.yml | 245 +++++----- .github/workflows/build-pygeohash.yml | 1 - .github/workflows/build-pygraphviz.yml | 339 ++++++-------- .github/workflows/build-pygrib.yml | 157 +++---- .github/workflows/build-pyhdf.yml | 79 ++-- .github/workflows/build-pyheck.yml | 86 ++-- .github/workflows/build-pyheif.yml | 164 ++++--- .github/workflows/build-pyiceberg.yml | 60 +-- .github/workflows/build-pyicu-binary.yml | 115 ++--- .github/workflows/build-pyinstrument.yml | 1 - .github/workflows/build-pyjls.yml | 2 +- .github/workflows/build-pyjpegls.yml | 80 ++-- .github/workflows/build-pyjpt.yml | 7 +- .github/workflows/build-pykdtree.yml | 84 ++-- .github/workflows/build-pykrige.yml | 5 +- .github/workflows/build-pylhasa.yml | 46 +- .github/workflows/build-pylibjpeg-libjpeg.yml | 88 ++-- .../workflows/build-pylibjpeg-openjpeg.yml | 85 ++-- .github/workflows/build-pylibjpeg-rle.yml | 66 ++- .github/workflows/build-pylibmc.yml | 151 +++--- .github/workflows/build-pylibsrtp.yml | 97 ++-- .github/workflows/build-pylife.yml | 79 ++-- .github/workflows/build-pymatgen-core.yml | 89 ++-- .github/workflows/build-pymaxflow.yml | 97 ++-- .github/workflows/build-pymcubes.yml | 84 ++-- .github/workflows/build-pymediainfo.yml | 163 +++---- .github/workflows/build-pymeshfix.yml | 55 ++- .github/workflows/build-pymetis.yml | 81 ++-- .github/workflows/build-pymgclient.yml | 102 ++-- .github/workflows/build-pymongo.yml | 2 +- .github/workflows/build-pymongoarrow.yml | 112 ++--- .github/workflows/build-pymoo.yml | 4 +- .github/workflows/build-pymp3.yml | 90 ++-- .github/workflows/build-pymupdf-layout.yml | 63 ++- .github/workflows/build-pymupdf.yml | 8 +- .github/workflows/build-pymupdfb.yml | 78 ++-- .github/workflows/build-pyo.yml | 147 +++--- .github/workflows/build-pyodbc.yml | 75 ++- .github/workflows/build-pyodps.yml | 89 ++-- .github/workflows/build-pyopencl.yml | 59 ++- .../workflows/build-pyopengl-accelerate.yml | 89 ++-- .github/workflows/build-pyopenxlsx.yml | 97 ++-- .github/workflows/build-pyorthomosaic.yml | 50 +- .github/workflows/build-pypolyline.yml | 81 ++-- .github/workflows/build-pyppmd.yml | 1 - .github/workflows/build-pyproj.yml | 97 ++-- .github/workflows/build-pypulseqpp.yml | 72 +-- .github/workflows/build-pyqir.yml | 140 +++--- .github/workflows/build-pyqrack-cpu.yml | 84 ++-- .github/workflows/build-pyre2.yml | 124 +++-- .github/workflows/build-pyreadr.yml | 106 +++-- .github/workflows/build-pyreadstat.yml | 86 ++-- .github/workflows/build-pyrealsense2.yml | 249 +++++----- .github/workflows/build-pyresample.yml | 78 ++-- .github/workflows/build-pyrnnoise.yml | 147 +++--- .github/workflows/build-pyroaring.yml | 86 ++-- .github/workflows/build-pyroomacoustics.yml | 85 ++-- .github/workflows/build-pyroscope-io.yml | 439 +++++++++--------- .github/workflows/build-pyrosm.yml | 4 +- .github/workflows/build-pyrsistent.yml | 74 +-- .github/workflows/build-pyrush.yml | 7 +- .github/workflows/build-pysam.yml | 86 ++-- .github/workflows/build-pyscipopt.yml | 316 ++++++------- .github/workflows/build-pysjef.yml | 98 ++-- .github/workflows/build-pyslang.yml | 86 ++-- .github/workflows/build-pystack.yml | 180 +++---- .github/workflows/build-pyswisseph.yml | 137 +++--- .github/workflows/build-pytest-mergify.yml | 159 +++---- .github/workflows/build-pytetwild.yml | 142 +++--- .../build-python-active-directory.yml | 212 +++++---- .github/workflows/build-python-bidi.yml | 65 ++- .github/workflows/build-python-crfsuite.yml | 50 +- .github/workflows/build-python-flint.yml | 85 ++-- .github/workflows/build-python-geohash.yml | 64 ++- .github/workflows/build-python-kadmin-rs.yml | 6 +- .github/workflows/build-python-pkcs11.yml | 5 +- .github/workflows/build-python-stretch.yml | 99 ++-- .github/workflows/build-pytomlpp.yml | 74 +-- .../workflows/build-pytorch-tokenizers.yml | 93 ++-- .github/workflows/build-pytype.yml | 88 ++-- .github/workflows/build-pyvirtualcam.yml | 96 ++-- .../workflows/build-pyvista-validation.yml | 57 +-- .github/workflows/build-pyvrl.yml | 126 +++-- .github/workflows/build-pywavelets.yml | 55 ++- .github/workflows/build-pywhispercpp.yml | 81 ++-- .github/workflows/build-qiskit-aer.yml | 144 +++--- .github/workflows/build-qiskit-terra.yml | 6 +- .github/workflows/build-qiskit.yml | 76 ++- .github/workflows/build-qoi.yml | 78 ++-- .github/workflows/build-quadprog.yml | 4 +- .github/workflows/build-quantile-forest.yml | 52 +-- .github/workflows/build-questdb.yml | 89 ++-- .github/workflows/build-quickjs-ng.yml | 88 ++-- .github/workflows/build-quicksectx.yml | 2 +- .github/workflows/build-qutip.yml | 4 +- .github/workflows/build-rapidgzip.yml | 79 ++-- .github/workflows/build-rapids-logger.yml | 51 +- .github/workflows/build-rapidyaml.yml | 2 +- .github/workflows/build-rebound.yml | 4 +- .github/workflows/build-rectangle-packer.yml | 52 +-- .github/workflows/build-redislite.yml | 97 ++-- .github/workflows/build-regions.yml | 57 ++- .github/workflows/build-regopy.yml | 69 ++- .github/workflows/build-reproject.yml | 75 ++- .github/workflows/build-rfc3161-client.yml | 78 ++-- .github/workflows/build-rhino3dm.yml | 111 ++--- .github/workflows/build-riskcal.yml | 2 +- .github/workflows/build-riskfolio-lib.yml | 134 +++--- .github/workflows/build-rjieba.yml | 98 ++-- .github/workflows/build-rl-accel.yml | 57 ++- .github/workflows/build-rnet.yml | 5 +- .github/workflows/build-roaringbitmap.yml | 2 +- .../build-roboticstoolbox-python.yml | 176 ++++--- .github/workflows/build-robust-laplacian.yml | 127 +++-- .github/workflows/build-rtree.yml | 87 ++-- .github/workflows/build-ruckig.yml | 52 +-- .github/workflows/build-ruptures.yml | 5 +- .github/workflows/build-rustworkx.yml | 85 ++-- .../build-s3torchconnectorclient.yml | 163 +++---- .github/workflows/build-samplerate.yml | 74 ++- .github/workflows/build-scikit-allel.yml | 81 ++-- .github/workflows/build-scikit-bio.yml | 82 ++-- .../workflows/build-scikit-learn-extra.yml | 74 +-- .github/workflows/build-scikit-surprise.yml | 56 ++- .github/workflows/build-scikit-survival.yml | 92 ++-- .github/workflows/build-scipp.yml | 128 +++-- .github/workflows/build-scout-apm.yml | 1 - .github/workflows/build-scrypt.yml | 61 ++- .github/workflows/build-scs.yml | 84 ++-- .github/workflows/build-segyio.yml | 60 +-- .github/workflows/build-sgp4.yml | 2 +- .github/workflows/build-simplejpeg.yml | 77 +-- .github/workflows/build-simplejson.yml | 53 ++- .github/workflows/build-simplepyble.yml | 228 ++++----- .github/workflows/build-simplification.yml | 125 ++--- .github/workflows/build-simsimd.yml | 47 +- .github/workflows/build-singlestoredb.yml | 5 +- .github/workflows/build-skia-pathops.yml | 103 ++-- .../build-sleipnirgroup-jormungandr.yml | 139 +++--- .github/workflows/build-slh-dsa.yml | 55 ++- .github/workflows/build-slixmpp.yml | 101 ++-- .github/workflows/build-slycot.yml | 59 +-- .github/workflows/build-small-gicp.yml | 68 +-- .github/workflows/build-smoldot-light.yml | 89 ++-- .../build-snowflake-connector-python.yml | 185 ++++---- .github/workflows/build-soxr.yml | 1 - .github/workflows/build-spacy-pkuseg.yml | 108 ++--- .../workflows/build-spacy-transformers.yml | 100 ++-- .github/workflows/build-sparsediffpy.yml | 87 ++-- .github/workflows/build-spatial-access.yml | 92 ++-- .github/workflows/build-spatialgeometry.yml | 74 +-- .github/workflows/build-spconv.yml | 2 +- .github/workflows/build-spglib.yml | 1 - .github/workflows/build-spiceypy.yml | 99 ++-- .github/workflows/build-spookyhash.yml | 2 +- .../workflows/build-squirrel-lang-sq305.yml | 52 +-- .github/workflows/build-srsly.yml | 102 ++-- .github/workflows/build-ssh-python.yml | 197 ++++---- .github/workflows/build-ssh2-python.yml | 110 ++--- .github/workflows/build-sslpsk-pmd3.yml | 114 ++++- .github/workflows/build-statsforecast.yml | 111 +++-- .github/workflows/build-statsmodels.yml | 105 ++--- .../workflows/build-streaming-form-data.yml | 2 +- .github/workflows/build-symusic.yml | 123 ++--- .../workflows/build-systemrdl-compiler.yml | 2 +- .github/workflows/build-ta-lib.yml | 143 +++--- .github/workflows/build-tables.yml | 179 +++---- .github/workflows/build-tabmat.yml | 4 +- .github/workflows/build-temporalio.yml | 6 +- .github/workflows/build-tesserocr.yml | 269 ++++++----- .github/workflows/build-tetgen.yml | 54 +-- .github/workflows/build-text2num.yml | 63 ++- .github/workflows/build-texterrors.yml | 1 - .github/workflows/build-textual-speedups.yml | 296 ++++++------ .github/workflows/build-texture2ddecoder.yml | 2 +- .github/workflows/build-tfparse.yml | 2 +- .github/workflows/build-thinc.yml | 175 +++---- .github/workflows/build-thrift.yml | 85 ++-- .github/workflows/build-thriftpy2.yml | 92 ++-- .github/workflows/build-timezonefinder.yml | 5 +- .github/workflows/build-tippecanoe.yml | 91 ++-- .github/workflows/build-tl2cgen.yml | 137 +++--- .github/workflows/build-tokie.yml | 93 ++-- .github/workflows/build-toktok-rs.yml | 4 +- .github/workflows/build-toons.yml | 78 ++-- .github/workflows/build-toppra.yml | 85 ++-- .github/workflows/build-torchcodec.yml | 248 +++++----- .github/workflows/build-torchrl.yml | 4 +- .github/workflows/build-torchtext.yml | 150 +++--- .github/workflows/build-torchvision.yml | 4 +- .github/workflows/build-tosa-tools.yml | 173 +++---- .github/workflows/build-transformations.yml | 5 +- .github/workflows/build-treelite.yml | 76 +-- .github/workflows/build-trollimage.yml | 65 ++- .github/workflows/build-type-enforced.yml | 2 +- .github/workflows/build-uamqp.yml | 123 +++-- .github/workflows/build-ujson.yml | 1 - .github/workflows/build-ukkonen.yml | 1 - .github/workflows/build-ulid-transform.yml | 2 +- .github/workflows/build-unicorn.yml | 79 ++-- .github/workflows/build-vispy.yml | 4 +- .github/workflows/build-vllm-router.yml | 98 ++-- .github/workflows/build-vmprof.yml | 113 +++-- .github/workflows/build-wandb.yml | 88 ++-- .github/workflows/build-webp.yml | 84 ++-- .github/workflows/build-whylogs-sketching.yml | 82 ++-- .github/workflows/build-wntr.yml | 199 ++++---- .github/workflows/build-wordcloud.yml | 5 +- .github/workflows/build-xatlas.yml | 72 +-- .github/workflows/build-xattr.yml | 1 - .github/workflows/build-xgboost-cpu.yml | 98 ++-- .github/workflows/build-xrootd.yml | 231 ++++----- .github/workflows/build-xtcocotools.yml | 87 ++-- .github/workflows/build-yappi.yml | 1 - .github/workflows/build-yara-python.yml | 92 ++-- .github/workflows/build-zeroconf.yml | 2 +- .github/workflows/build-zipcodes.yml | 76 ++- .github/workflows/build-zipline-reloaded.yml | 6 +- .github/workflows/build-zodbpickle.yml | 1 - .github/workflows/build-zope-container.yml | 1 - .github/workflows/build-zope-index.yml | 1 - .github/workflows/build-zope-proxy.yml | 1 - .github/workflows/build-zope-security.yml | 1 - .github/workflows/build-zopfli.yml | 2 +- .github/workflows/build-zttp.yml | 80 ++-- .github/workflows/build-zuvloop.yml | 78 ++-- .github/workflows/pr-checks.yml | 5 +- 647 files changed, 23709 insertions(+), 24379 deletions(-) diff --git a/.github/workflows/_build-cibuildwheel.yml b/.github/workflows/_build-cibuildwheel.yml index ccbf3ad5d005..d8f9882d3284 100644 --- a/.github/workflows/_build-cibuildwheel.yml +++ b/.github/workflows/_build-cibuildwheel.yml @@ -41,6 +41,16 @@ on: required: false default: 1 type: number + pre-build: + description: Shell commands to run after checkout and before cibuildwheel. + required: false + default: '' + type: string + post-build: + description: Shell commands to run after cibuildwheel and before artifact upload. + required: false + default: '' + type: string cibw-package-dir: description: Package directory passed to the cibuildwheel action. required: false @@ -130,11 +140,6 @@ on: required: false default: '' type: string - cibw-environment: - description: CIBW_ENVIRONMENT value. - required: false - default: '' - type: string cibw-environment-linux: description: CIBW_ENVIRONMENT_LINUX value. required: false @@ -246,6 +251,12 @@ jobs: fetch-depth: ${{ inputs['checkout-fetch-depth'] }} persist-credentials: false + - name: Prepare for cibuildwheel + if: inputs['pre-build'] != '' + env: + COMMAND: ${{ inputs['pre-build'] }} + run: bash --noprofile --norc -euo pipefail -c "$COMMAND" + - name: Configure cibuildwheel env: CIBW_ARCHS: ${{ inputs['cibw-archs'] }} @@ -262,7 +273,7 @@ jobs: CIBW_CONFIG_SETTINGS: ${{ inputs['cibw-config-settings'] }} CIBW_CONTAINER_ENGINE: ${{ inputs['cibw-container-engine'] }} CIBW_DEPENDENCY_VERSIONS: ${{ inputs['cibw-dependency-versions'] }} - CIBW_ENVIRONMENT: ${{ inputs['cibw-environment'] }} + CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple CIBW_ENVIRONMENT_LINUX: ${{ inputs['cibw-environment-linux'] }} CIBW_ENVIRONMENT_PASS_LINUX: ${{ inputs['cibw-environment-pass-linux'] }} CIBW_MANYLINUX_RISCV64_IMAGE: ${{ inputs['cibw-manylinux-riscv64-image'] }} @@ -340,6 +351,12 @@ jobs: config-file: ${{ inputs['cibw-config-file'] }} extras: ${{ inputs['cibw-extras'] }} + - name: Finish cibuildwheel build + if: inputs['post-build'] != '' + env: + COMMAND: ${{ inputs['post-build'] }} + run: bash --noprofile --norc -euo pipefail -c "$COMMAND" + - name: Upload wheels uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: diff --git a/.github/workflows/build-accelerator-toolbox.yml b/.github/workflows/build-accelerator-toolbox.yml index cd18c2e36dc0..4bbe91adaeb0 100644 --- a/.github/workflows/build-accelerator-toolbox.yml +++ b/.github/workflows/build-accelerator-toolbox.yml @@ -50,46 +50,50 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build accelerator-toolbox ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "accelerator-toolbox" + version: "${{ matrix.version }}" + repository: "atcollab/at" + ref: "pyat-${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a build-time requirement (pyproject.toml build-system.requires); + # scipy/h5py are runtime deps pulled in when cibuildwheel installs the + # wheel for the test step. Only our registry has any of these for + # riscv64; only-binary keeps a newer PyPI release from winning the + # resolution and then compiling from sdist (h5py would need libhdf5-dev). + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,h5py" + cibw-test-sources: "pyat/test" + cibw-test-requires: "pytest" + # test_long_arrays_in_m_file reads machine_data/kickmap_w150_20mm.txt, which + # pyproject.toml's package-data glob (*.m, *.mat only) never ships in any + # installed wheel -- reproduced against a local x86_64 build, unrelated to riscv64. + cibw-test-command: "python -m pytest pyat/test -k \"not test_long_arrays_in_m_file\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ACCELERATOR_TOOLBOX_VERSION: ${{ matrix.version }} - steps: - - name: Checkout accelerator-toolbox pyat-${{ env.ACCELERATOR_TOOLBOX_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: atcollab/at - ref: pyat-${{ env.ACCELERATOR_TOOLBOX_VERSION }} - fetch-depth: 0 # setuptools_scm derives the version from `git describe --tags` - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build-time requirement (pyproject.toml build-system.requires); - # scipy/h5py are runtime deps pulled in when cibuildwheel installs the - # wheel for the test step. Only our registry has any of these for - # riscv64; only-binary keeps a newer PyPI release from winning the - # resolution and then compiling from sdist (h5py would need libhdf5-dev). - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,h5py - CIBW_TEST_SOURCES: pyat/test - CIBW_TEST_REQUIRES: pytest - # test_long_arrays_in_m_file reads machine_data/kickmap_w150_20mm.txt, which - # pyproject.toml's package-data glob (*.m, *.mat only) never ships in any - # installed wheel -- reproduced against a local x86_64 build, unrelated to riscv64. - CIBW_TEST_COMMAND: python -m pytest pyat/test -k "not test_long_arrays_in_m_file" + name: accelerator-toolbox-${{ env.ACCELERATOR_TOOLBOX_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -104,16 +108,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: accelerator-toolbox-${{ env.ACCELERATOR_TOOLBOX_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish accelerator-toolbox ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-accesscontrol.yml b/.github/workflows/build-accesscontrol.yml index fe2914e5eb94..3f74d60b02ac 100644 --- a/.github/workflows/build-accesscontrol.yml +++ b/.github/workflows/build-accesscontrol.yml @@ -59,7 +59,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # The compiled test-time dependencies (zope.interface, ExtensionClass, # BTrees, persistent, ...) have no riscv64 wheel on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test # RestrictedPython 9.0 (2026-11-04) removed `sorted`/`bytes`/`tuple`/`zip` # from safe_builtins (zopefoundation/RestrictedPython#335); AccessControl diff --git a/.github/workflows/build-acquisition.yml b/.github/workflows/build-acquisition.yml index 4ed5e3e97d11..dddf676ecb1f 100644 --- a/.github/workflows/build-acquisition.yml +++ b/.github/workflows/build-acquisition.yml @@ -59,7 +59,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # ExtensionClass and zope.interface, Acquisition's two deps, have no # riscv64 wheel on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test cibw-test-environment: ZOPE_INTERFACE_STRICT_IRO=1 # Upstream's two test steps: with and without the C extension. diff --git a/.github/workflows/build-acsylla.yml b/.github/workflows/build-acsylla.yml index fb6ef20b2f1a..4546eb1bce53 100644 --- a/.github/workflows/build-acsylla.yml +++ b/.github/workflows/build-acsylla.yml @@ -88,10 +88,9 @@ jobs: openssl_version=$(openssl version | awk '{print $2}') curl -fsSL -o LICENSE.openssl "https://raw.githubusercontent.com/openssl/openssl/openssl-${openssl_version}/LICENSE.txt" fi - cibw-environment: >- + cibw-environment-linux: > LIBUV_ROOT_DIR=/usr/local UV_LIBRARY_PATH=/usr/local/lib - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-before-build: make cythonize # Upstream tests against the cassandra:latest image, which has no riscv64 build; # run the same Cassandra release on Temurin 17 (the image's JRE) in the container. diff --git a/.github/workflows/build-ada-url.yml b/.github/workflows/build-ada-url.yml index 4e1bb8010f4f..6fdca5b0ed20 100644 --- a/.github/workflows/build-ada-url.yml +++ b/.github/workflows/build-ada-url.yml @@ -58,7 +58,6 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # cffi is a build requirement and has no riscv64 wheel on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-sources: tests cibw-test-command: python -m unittest discover -s tests -v timeout-minutes: 90 diff --git a/.github/workflows/build-adbc-driver-manager.yml b/.github/workflows/build-adbc-driver-manager.yml index 9bb53eabde54..96789da43e90 100644 --- a/.github/workflows/build-adbc-driver-manager.yml +++ b/.github/workflows/build-adbc-driver-manager.yml @@ -64,7 +64,6 @@ jobs: cibw-package-dir: python/adbc_driver_manager cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # pandas/pyarrow riscv64 wheels only exist on our own registry. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # The [dbapi] test install pulls pandas; PyPI's newest pandas has no # riscv64 wheel and its sdist fails to build (meson/xsimd), so install it # wheel-only, with the registry visible, and let pip back off to a release @@ -81,7 +80,7 @@ jobs: # since the Arrow C++ library isn't installed in this test env) - wheel-only # lets pip back off to a published riscv64 build. The registry does have a # cp314t pyarrow wheel, unlike pandas, so that leg can go wheel-only for it. - cibw-test-environment: ${{ matrix.python == 'cp314t' && 'PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_CONSTRAINT=/tmp/pandas-constraint.txt PIP_ONLY_BINARY=pyarrow' || 'PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=pandas,pyarrow' }} + cibw-test-environment: "${{ matrix.python == 'cp314t' && ' PIP_CONSTRAINT=/tmp/pandas-constraint.txt PIP_ONLY_BINARY=pyarrow' || ' PIP_ONLY_BINARY=pandas,pyarrow' }}" cibw-test-extras: dbapi cibw-test-requires: ${{ matrix.python == 'cp314t' && 'pytest>=9 pandas<3.1' || 'pytest>=9' }} cibw-test-sources: python/adbc_driver_manager/tests python/adbc_driver_manager/pyproject.toml diff --git a/.github/workflows/build-aggdraw.yml b/.github/workflows/build-aggdraw.yml index de92a794175c..3e7fb3f7f675 100644 --- a/.github/workflows/build-aggdraw.yml +++ b/.github/workflows/build-aggdraw.yml @@ -67,7 +67,7 @@ jobs: # Pillow (a test/runtime dep) ships no riscv64 wheel on public PyPI; ours is # what the test env installs. PIP_ONLY_BINARY keeps pip from falling back to # building it from source. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=Pillow + cibw-environment-linux: "PIP_ONLY_BINARY=Pillow" timeout-minutes: 90 publish: diff --git a/.github/workflows/build-aimrocks.yml b/.github/workflows/build-aimrocks.yml index 16f538257f8e..5dfc8d7ba075 100644 --- a/.github/workflows/build-aimrocks.yml +++ b/.github/workflows/build-aimrocks.yml @@ -57,96 +57,71 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build aimrocks ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "aimrocks" + version: "${{ matrix.version }}" + repository: "aimhubio/aimrocks" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "AIM_DEP_DIR=/opt/deps ZLIB_VERSION=1.2.11 BZIP2_VERSION=1.0.8 LZ4_VERSION=1.9.3 ZSTD_VERSION=1.1.3 SNAPPY_VERSION=1.1.8 ROCKSDB_VERSION=6.29.fb" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Reproduces upstream's docker/build-{zlib,bzip2,lz4,zstd,snappy,rocksdb}.sh: + # each dep installs into /opt/deps with its default (mostly-static) `make + # install`/cmake, then the `rm -f *.so*` before the rocksdb build (matching + # upstream's own `rm -rf lib/lib*.so*` in build-rocksdb.sh) forces rocksdb to + # link every codec in statically, so the only shared object produced is + # librocksdb.so itself. PORTABLE=1 (upstream's own flag, used unconditionally + # there) disables -march=native and every x86 SSE4.2/PCLMUL/AVX2 probe in + # rocksdb's build_detect_platform; util/crc32c.cc's hardware paths are gated on + # HAVE_SSE42/HAVE_ARM64_CRC/HAVE_POWER8, none of which get defined here, so it + # falls back to the portable table-based CRC32C upstream already ships + # non-x86 wheels (aarch64) with. DISABLE_WARNING_AS_ERROR=1 is rocksdb's own + # Makefile knob (gated by `ifndef DISABLE_WARNING_AS_ERROR`) for a compiler + # newer than 6.29.fb's code anticipated: manylinux_2_39_riscv64's GCC 14.3.1 + # flags `return std::move(io_s);` in db/db_impl/db_impl.cc as + # -Werror=redundant-move, which upstream's own (older) build image never hit. + # `-include cstdint` is for the same GCC 14: libstdc++ (since 13) no longer pulls + # in transitively, which table/block_based/data_block_hash_index.h + # relies on for uint8_t/uint16_t/uint32_t. + # PPC_LIBC_IS_GNU=0 is rocksdb's own Makefile switch for leaving out the optional + # range-lock manager (RANGE_TREE_SOURCES): its toku_time.h has no riscv64 timer and + # hits `#error No timer implementation for this platform`. aimrocks never binds + # TransactionDB or NewRangeLockManager. + # snappy's -DCMAKE_INSTALL_LIBDIR=lib pins its GNUInstallDirs libdir: on this + # manylinux_2_39_riscv64 (RHEL-family) image, GNUInstallDirs otherwise defaults a + # 64-bit install to lib64, so `cmake --install` puts libsnappy.a in + # /opt/deps/lib64 while zlib/bzip2/lz4/zstd's plain Makefiles install into + # /opt/deps/lib. rocksdb's link step only sets LIBRARY_PATH=/opt/deps/lib, so the + # linker can't find it: `/usr/bin/ld: cannot find -lsnappy`. + cibw-before-all-linux: > + mkdir -p /opt/deps/lib /opt/deps/include && curl -sSLf "https://www.zlib.net/fossils/zlib-${ZLIB_VERSION}.tar.gz" | tar -xz -C /tmp && (cd /tmp/zlib-${ZLIB_VERSION} && ./configure && make CFLAGS=-fPIC CXXFLAGS=-fPIC && make install prefix=/opt/deps) && curl -sSLf "https://sourceware.org/pub/bzip2/bzip2-${BZIP2_VERSION}.tar.gz" | tar -xz -C /tmp && (cd /tmp/bzip2-${BZIP2_VERSION} && make CFLAGS=-fPIC CXXFLAGS=-fPIC && make install PREFIX=/opt/deps) && curl -sSLf "https://github.com/lz4/lz4/archive/v${LZ4_VERSION}.tar.gz" | tar -xz -C /tmp && (cd /tmp/lz4-${LZ4_VERSION} && make CFLAGS=-fPIC CXXFLAGS=-fPIC && make PREFIX=/opt/deps install) && curl -sSLf "https://github.com/facebook/zstd/archive/v${ZSTD_VERSION}.tar.gz" | tar -xz -C /tmp && (cd /tmp/zstd-${ZSTD_VERSION} && make CFLAGS=-fPIC CXXFLAGS=-fPIC && make PREFIX=/opt/deps install) && curl -sSLf "https://github.com/google/snappy/archive/${SNAPPY_VERSION}.tar.gz" | tar -xz -C /tmp && cmake -S /tmp/snappy-${SNAPPY_VERSION} -B /tmp/snappy-${SNAPPY_VERSION}/build -DCMAKE_INSTALL_PREFIX=/opt/deps -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 && cmake --build /tmp/snappy-${SNAPPY_VERSION}/build --parallel --target install && rm -f /opt/deps/lib/lib*.so* && curl -sSLf "https://github.com/facebook/rocksdb/archive/${ROCKSDB_VERSION}.tar.gz" | tar -xz -C /tmp && LIBRARY_PATH=/opt/deps/lib PORTABLE=1 make -C /tmp/rocksdb-${ROCKSDB_VERSION} shared_lib PLATFORM_SHARED_VERSIONED=false EXTRA_CXXFLAGS="-fPIC -I/opt/deps/include -include cstdint" EXTRA_CFLAGS=-fPIC USE_RTTI=0 DEBUG_LEVEL=0 DISABLE_WARNING_AS_ERROR=1 PPC_LIBC_IS_GNU=0 -j4 && strip --strip-debug /tmp/rocksdb-${ROCKSDB_VERSION}/librocksdb.so && cp /tmp/rocksdb-${ROCKSDB_VERSION}/librocksdb.so /opt/deps/lib/ && PORTABLE=1 make -C /tmp/rocksdb-${ROCKSDB_VERSION} PREFIX=/opt/deps DEBUG_LEVEL=0 install-headers && cp /tmp/zlib-${ZLIB_VERSION}/README {project}/LICENSE.zlib && cp /tmp/bzip2-${BZIP2_VERSION}/LICENSE {project}/LICENSE.bzip2 && cp /tmp/lz4-${LZ4_VERSION}/lib/LICENSE {project}/LICENSE.lz4 && cp /tmp/zstd-${ZSTD_VERSION}/LICENSE {project}/LICENSE.zstd && cp /tmp/snappy-${SNAPPY_VERSION}/COPYING {project}/LICENSE.snappy && cp /tmp/rocksdb-${ROCKSDB_VERSION}/LICENSE.Apache {project}/LICENSE.rocksdb + cibw-repair-wheel-command: "auditwheel repair --strip -w {dest_dir} {wheel}" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: AIMROCKS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout aimrocks ${{ env.AIMROCKS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: aimhubio/aimrocks - ref: v${{ env.AIMROCKS_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_PASS_LINUX: >- - ZLIB_VERSION BZIP2_VERSION LZ4_VERSION ZSTD_VERSION SNAPPY_VERSION - ROCKSDB_VERSION - # Reproduces upstream's docker/build-{zlib,bzip2,lz4,zstd,snappy,rocksdb}.sh: - # each dep installs into /opt/deps with its default (mostly-static) `make - # install`/cmake, then the `rm -f *.so*` before the rocksdb build (matching - # upstream's own `rm -rf lib/lib*.so*` in build-rocksdb.sh) forces rocksdb to - # link every codec in statically, so the only shared object produced is - # librocksdb.so itself. PORTABLE=1 (upstream's own flag, used unconditionally - # there) disables -march=native and every x86 SSE4.2/PCLMUL/AVX2 probe in - # rocksdb's build_detect_platform; util/crc32c.cc's hardware paths are gated on - # HAVE_SSE42/HAVE_ARM64_CRC/HAVE_POWER8, none of which get defined here, so it - # falls back to the portable table-based CRC32C upstream already ships - # non-x86 wheels (aarch64) with. DISABLE_WARNING_AS_ERROR=1 is rocksdb's own - # Makefile knob (gated by `ifndef DISABLE_WARNING_AS_ERROR`) for a compiler - # newer than 6.29.fb's code anticipated: manylinux_2_39_riscv64's GCC 14.3.1 - # flags `return std::move(io_s);` in db/db_impl/db_impl.cc as - # -Werror=redundant-move, which upstream's own (older) build image never hit. - # `-include cstdint` is for the same GCC 14: libstdc++ (since 13) no longer pulls - # in transitively, which table/block_based/data_block_hash_index.h - # relies on for uint8_t/uint16_t/uint32_t. - # PPC_LIBC_IS_GNU=0 is rocksdb's own Makefile switch for leaving out the optional - # range-lock manager (RANGE_TREE_SOURCES): its toku_time.h has no riscv64 timer and - # hits `#error No timer implementation for this platform`. aimrocks never binds - # TransactionDB or NewRangeLockManager. - # snappy's -DCMAKE_INSTALL_LIBDIR=lib pins its GNUInstallDirs libdir: on this - # manylinux_2_39_riscv64 (RHEL-family) image, GNUInstallDirs otherwise defaults a - # 64-bit install to lib64, so `cmake --install` puts libsnappy.a in - # /opt/deps/lib64 while zlib/bzip2/lz4/zstd's plain Makefiles install into - # /opt/deps/lib. rocksdb's link step only sets LIBRARY_PATH=/opt/deps/lib, so the - # linker can't find it: `/usr/bin/ld: cannot find -lsnappy`. - CIBW_BEFORE_ALL_LINUX: >- - mkdir -p /opt/deps/lib /opt/deps/include && - curl -sSLf "https://www.zlib.net/fossils/zlib-${ZLIB_VERSION}.tar.gz" | tar -xz -C /tmp && - (cd /tmp/zlib-${ZLIB_VERSION} && ./configure && make CFLAGS=-fPIC CXXFLAGS=-fPIC && make install prefix=/opt/deps) && - curl -sSLf "https://sourceware.org/pub/bzip2/bzip2-${BZIP2_VERSION}.tar.gz" | tar -xz -C /tmp && - (cd /tmp/bzip2-${BZIP2_VERSION} && make CFLAGS=-fPIC CXXFLAGS=-fPIC && make install PREFIX=/opt/deps) && - curl -sSLf "https://github.com/lz4/lz4/archive/v${LZ4_VERSION}.tar.gz" | tar -xz -C /tmp && - (cd /tmp/lz4-${LZ4_VERSION} && make CFLAGS=-fPIC CXXFLAGS=-fPIC && make PREFIX=/opt/deps install) && - curl -sSLf "https://github.com/facebook/zstd/archive/v${ZSTD_VERSION}.tar.gz" | tar -xz -C /tmp && - (cd /tmp/zstd-${ZSTD_VERSION} && make CFLAGS=-fPIC CXXFLAGS=-fPIC && make PREFIX=/opt/deps install) && - curl -sSLf "https://github.com/google/snappy/archive/${SNAPPY_VERSION}.tar.gz" | tar -xz -C /tmp && - cmake -S /tmp/snappy-${SNAPPY_VERSION} -B /tmp/snappy-${SNAPPY_VERSION}/build - -DCMAKE_INSTALL_PREFIX=/opt/deps -DCMAKE_INSTALL_LIBDIR=lib - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 && - cmake --build /tmp/snappy-${SNAPPY_VERSION}/build --parallel --target install && - rm -f /opt/deps/lib/lib*.so* && - curl -sSLf "https://github.com/facebook/rocksdb/archive/${ROCKSDB_VERSION}.tar.gz" | tar -xz -C /tmp && - LIBRARY_PATH=/opt/deps/lib PORTABLE=1 make -C /tmp/rocksdb-${ROCKSDB_VERSION} - shared_lib PLATFORM_SHARED_VERSIONED=false EXTRA_CXXFLAGS="-fPIC -I/opt/deps/include -include cstdint" - EXTRA_CFLAGS=-fPIC USE_RTTI=0 DEBUG_LEVEL=0 DISABLE_WARNING_AS_ERROR=1 PPC_LIBC_IS_GNU=0 -j4 && - strip --strip-debug /tmp/rocksdb-${ROCKSDB_VERSION}/librocksdb.so && - cp /tmp/rocksdb-${ROCKSDB_VERSION}/librocksdb.so /opt/deps/lib/ && - PORTABLE=1 make -C /tmp/rocksdb-${ROCKSDB_VERSION} PREFIX=/opt/deps DEBUG_LEVEL=0 install-headers && - cp /tmp/zlib-${ZLIB_VERSION}/README {project}/LICENSE.zlib && - cp /tmp/bzip2-${BZIP2_VERSION}/LICENSE {project}/LICENSE.bzip2 && - cp /tmp/lz4-${LZ4_VERSION}/lib/LICENSE {project}/LICENSE.lz4 && - cp /tmp/zstd-${ZSTD_VERSION}/LICENSE {project}/LICENSE.zstd && - cp /tmp/snappy-${SNAPPY_VERSION}/COPYING {project}/LICENSE.snappy && - cp /tmp/rocksdb-${ROCKSDB_VERSION}/LICENSE.Apache {project}/LICENSE.rocksdb - CIBW_ENVIRONMENT: AIM_DEP_DIR=/opt/deps - CIBW_REPAIR_WHEEL_COMMAND: auditwheel repair --strip -w {dest_dir} {wheel} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: pytest tests + name: aimrocks-${{ env.AIMROCKS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and licences made it into the wheel run: | @@ -161,15 +136,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: aimrocks-${{ env.AIMROCKS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish aimrocks ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-aioesphomeapi.yml b/.github/workflows/build-aioesphomeapi.yml index 4e268a850431..03c0fb422e4c 100644 --- a/.github/workflows/build-aioesphomeapi.yml +++ b/.github/workflows/build-aioesphomeapi.yml @@ -65,10 +65,7 @@ jobs: # Upstream passes REQUIRE_CYTHON as a plain step env var, which never # reaches the Linux build container. only-binary keeps pip off the # sdists of the compiled dependencies, whose riscv64 wheels are ours. - cibw-environment: >- - REQUIRE_CYTHON=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=cffi,cryptography,protobuf,zeroconf + cibw-environment-linux: "REQUIRE_CYTHON=1 PIP_ONLY_BINARY=cffi,cryptography,protobuf,zeroconf" cibw-test-sources: tests pyproject.toml cibw-test-requires: 'pytest>=9.1.1,<10 pytest-asyncio==1.4.0' # setup.py's build_ext swallows every compile error, so the extensions diff --git a/.github/workflows/build-aiofastnet.yml b/.github/workflows/build-aiofastnet.yml index 7054fce08ef3..5ea9f4f6e825 100644 --- a/.github/workflows/build-aiofastnet.yml +++ b/.github/workflows/build-aiofastnet.yml @@ -62,7 +62,7 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 - cibw-environment-linux: CFLAGS="$CFLAGS -O2 -g0 -DNDEBUG" PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "CFLAGS=\"$CFLAGS -O2 -g0 -DNDEBUG\"" # No musllinux riscv64 uvloop wheel exists; the suite only adds it as an extra loop when importable. cibw-test-requires: >- aiohttp async_timeout pytest pytest-aiohttp pytest-asyncio pytest-xdist diff --git a/.github/workflows/build-aiokafka.yml b/.github/workflows/build-aiokafka.yml index 73cc82ed2388..477185426ff1 100644 --- a/.github/workflows/build-aiokafka.yml +++ b/.github/workflows/build-aiokafka.yml @@ -64,7 +64,6 @@ jobs: cibw-before-build-linux: >- if [ -f requirements-cython.txt ]; then pip install -r requirements-cython.txt; fi && yum install -y zlib-devel - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # The repo-root aiokafka/ would otherwise shadow the installed wheel's # compiled extension; stage only the suite and its pytest config. cibw-test-sources: tests pyproject.toml diff --git a/.github/workflows/build-aioquic.yml b/.github/workflows/build-aioquic.yml index 8164547607ec..6577accfc901 100644 --- a/.github/workflows/build-aioquic.yml +++ b/.github/workflows/build-aioquic.yml @@ -54,48 +54,48 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build aioquic ${{ matrix.version }} cp310-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "aioquic" + version: "${{ matrix.version }}" + repository: "aiortc/aioquic" + ref: "${{ matrix.version }}" + artifact-tag: "cp310-abi3-manylinux_riscv64" + timeout-minutes: 90 + # cp310 first: setup.py forces the cp310-abi3 tag regardless of the + # build interpreter (gotcha 96); the later entries build nothing, + # they only re-test the one wheel. + cibw-build: "cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # cryptography has no riscv64 wheel on public PyPI; PIP_ONLY_BINARY + # stops pip from picking a newer PyPI-only sdist release (which + # fails: its Rust backend has no riscv64 rustup target) over the + # older riscv64 wheel our registry carries. pylsqpack (also no + # public riscv64 wheel) builds from sdist in seconds either way. + cibw-test-environment: "AIOQUIC_SKIP_TESTS=ipv6,loss PIP_ONLY_BINARY=cryptography" + # cryptography 50.0.0 dropped SHA1-for-RSA-signing support, which + # breaks test_tls.py's legacy-algorithm test regardless of arch; + # cap it at the last release the suite was written against + # (gotcha 97's shape). + cibw-test-requires: "cryptography<50" + cibw-test-command: "python -m unittest discover -t {project} -s {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: AIOQUIC_VERSION: ${{ matrix.version }} - steps: - - name: Checkout aioquic ${{ env.AIOQUIC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: aiortc/aioquic - ref: ${{ env.AIOQUIC_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - # cp310 first: setup.py forces the cp310-abi3 tag regardless of the - # build interpreter (gotcha 96); the later entries build nothing, - # they only re-test the one wheel. - CIBW_BUILD: >- - cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cryptography has no riscv64 wheel on public PyPI; PIP_ONLY_BINARY - # stops pip from picking a newer PyPI-only sdist release (which - # fails: its Rust backend has no riscv64 rustup target) over the - # older riscv64 wheel our registry carries. pylsqpack (also no - # public riscv64 wheel) builds from sdist in seconds either way. - CIBW_TEST_ENVIRONMENT: >- - AIOQUIC_SKIP_TESTS=ipv6,loss - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=cryptography - # cryptography 50.0.0 dropped SHA1-for-RSA-signing support, which - # breaks test_tls.py's legacy-algorithm test regardless of arch; - # cap it at the last release the suite was written against - # (gotcha 97's shape). - CIBW_TEST_REQUIRES: cryptography<50 - CIBW_TEST_COMMAND: python -m unittest discover -t {project} -s {project}/tests + name: aioquic-${{ env.AIOQUIC_VERSION }}-cp310-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and the licence run: | @@ -111,15 +111,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: aioquic-${{ env.AIOQUIC_VERSION }}-cp310-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish aioquic ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ale-py.yml b/.github/workflows/build-ale-py.yml index 28f918dc3510..0b9ce3f1c757 100644 --- a/.github/workflows/build-ale-py.yml +++ b/.github/workflows/build-ale-py.yml @@ -49,97 +49,109 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build ale-py ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ale-py" + version: "${{ matrix.version }}" + repository: "Farama-Foundation/Arcade-Learning-Environment" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/ale-py/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + ./scripts/download_unpack_roms.sh + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's manylinux--vcpkg image has no riscv64 build; this builds the + # same vcpkg.json dependencies (SDL2 2.30.11 shared, OpenCV 4.10.0 static) from + # their release tarballs, with zlib from the image. + cibw-before-all: |- + set -e + dnf install -y -q ninja-build zlib-devel \ + libX11-devel libXext-devel libXcursor-devel libXi-devel libXrandr-devel \ + libXinerama-devel libXxf86vm-devel libxkbcommon-devel \ + wayland-devel wayland-protocols-devel alsa-lib-devel + mkdir -p /tmp/ale-deps && cd /tmp/ale-deps + + curl -fsSL --retry 5 -o SDL2.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.30.11/SDL2-2.30.11.tar.gz + tar xzf SDL2.tar.gz + cmake -S SDL2-2.30.11 -B sdl2-build -G Ninja -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib \ + -DSDL_SHARED=ON -DSDL_STATIC=OFF -DSDL_TEST=OFF \ + -DSDL_DBUS=OFF -DSDL_IBUS=OFF -DSDL_LIBSAMPLERATE=OFF -DSDL_VULKAN=OFF + cmake --build sdl2-build && cmake --install sdl2-build + cp SDL2-2.30.11/LICENSE.txt {project}/LICENSE.SDL2.txt + + curl -fsSL --retry 5 -o opencv.tar.gz https://github.com/opencv/opencv/archive/refs/tags/4.10.0.tar.gz + tar xzf opencv.tar.gz + cmake -S opencv-4.10.0 -B opencv-build -G Ninja -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=OFF -DBUILD_LIST=core,imgproc \ + -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_opencv_apps=OFF \ + -DBUILD_JAVA=OFF -DBUILD_opencv_python3=OFF \ + -DWITH_ITT=OFF -DWITH_IPP=OFF -DWITH_OPENCL=OFF -DWITH_LAPACK=OFF -DWITH_EIGEN=OFF \ + -DWITH_TIFF=OFF -DWITH_JPEG=OFF -DWITH_PNG=OFF -DWITH_WEBP=OFF \ + -DWITH_OPENJPEG=OFF -DWITH_JASPER=OFF -DWITH_OPENEXR=OFF -DWITH_GTK=OFF -DWITH_FFMPEG=OFF \ + -DWITH_PROTOBUF=OFF -DWITH_QUIRC=OFF -DWITH_ADE=OFF -DWITH_GDCM=OFF \ + -DWITH_GSTREAMER=OFF -DWITH_V4L=OFF -DWITH_1394=OFF -DWITH_GPHOTO2=OFF \ + -DWITH_OPENVX=OFF -DWITH_VA=OFF -DWITH_VA_INTEL=OFF -DWITH_GDAL=OFF \ + -DWITH_OPENGL=OFF -DWITH_QT=OFF -DWITH_TBB=OFF -DWITH_VTK=OFF -DWITH_IMGCODEC_HDR=OFF \ + -DWITH_IMGCODEC_SUNRASTER=OFF -DWITH_IMGCODEC_PXM=OFF -DWITH_IMGCODEC_PFM=OFF + cmake --build opencv-build && cmake --install opencv-build + cp opencv-4.10.0/LICENSE {project}/LICENSE.opencv.txt + # jax is a build requirement only for the XLA vector interface, which needs + # jaxlib's FFI headers; jaxlib has no riscv64 build, so that interface is off + # and pip's no-isolation mode skips resolving jax (gotcha 76). + # nanobind is capped at the 2.x series ale-py 0.12.1 was released with. + cibw-build-frontend: "pip; args: --no-build-isolation" + cibw-before-build: |- + python -m pip install "scikit-build-core>=0.10" "nanobind>=2.5.0,<3" + python -c "import importlib.metadata as m, shutil; shutil.copy(next(f.locate() for f in m.files('nanobind') if f.name == 'LICENSE'), '{project}/LICENSE.nanobind')" + cibw-environment-linux: "SKBUILD_CMAKE_ARGS=\"-DSDL_SUPPORT=ON;-DSDL_DYNLOAD=ON;-DBUILD_CPP_LIB=OFF;-DBUILD_PYTHON_LIB=ON;-DBUILD_VECTOR_LIB=ON;-DBUILD_VECTOR_XLA_LIB=OFF\" PIP_ONLY_BINARY=numpy,opencv-python" + # Upstream's `test` extra minus jax and chex (jaxlib again); the XLA test + # module importorskips them. + cibw-test-requires: "pytest>=7.0 gymnasium>=1.1.0 opencv-python>=3.0" + cibw-test-sources: "tests pyproject.toml" + cibw-test-command: "python -m pytest" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ALE_PY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout ale-py ${{ env.ALE_PY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Farama-Foundation/Arcade-Learning-Environment - ref: v${{ env.ALE_PY_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Patch ale-py source - run: git apply python-wheels/patches/ale-py/${{ env.ALE_PY_VERSION }}/00*.patch - - - name: Download and unpack ROMs - run: ./scripts/download_unpack_roms.sh - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's manylinux--vcpkg image has no riscv64 build; this builds the - # same vcpkg.json dependencies (SDL2 2.30.11 shared, OpenCV 4.10.0 static) from - # their release tarballs, with zlib from the image. - CIBW_BEFORE_ALL: | - set -e - dnf install -y -q ninja-build zlib-devel \ - libX11-devel libXext-devel libXcursor-devel libXi-devel libXrandr-devel \ - libXinerama-devel libXxf86vm-devel libxkbcommon-devel \ - wayland-devel wayland-protocols-devel alsa-lib-devel - mkdir -p /tmp/ale-deps && cd /tmp/ale-deps - - curl -fsSL --retry 5 -o SDL2.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.30.11/SDL2-2.30.11.tar.gz - tar xzf SDL2.tar.gz - cmake -S SDL2-2.30.11 -B sdl2-build -G Ninja -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib \ - -DSDL_SHARED=ON -DSDL_STATIC=OFF -DSDL_TEST=OFF \ - -DSDL_DBUS=OFF -DSDL_IBUS=OFF -DSDL_LIBSAMPLERATE=OFF -DSDL_VULKAN=OFF - cmake --build sdl2-build && cmake --install sdl2-build - cp SDL2-2.30.11/LICENSE.txt {project}/LICENSE.SDL2.txt - - curl -fsSL --retry 5 -o opencv.tar.gz https://github.com/opencv/opencv/archive/refs/tags/4.10.0.tar.gz - tar xzf opencv.tar.gz - cmake -S opencv-4.10.0 -B opencv-build -G Ninja -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib \ - -DBUILD_SHARED_LIBS=OFF -DBUILD_LIST=core,imgproc \ - -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_opencv_apps=OFF \ - -DBUILD_JAVA=OFF -DBUILD_opencv_python3=OFF \ - -DWITH_ITT=OFF -DWITH_IPP=OFF -DWITH_OPENCL=OFF -DWITH_LAPACK=OFF -DWITH_EIGEN=OFF \ - -DWITH_TIFF=OFF -DWITH_JPEG=OFF -DWITH_PNG=OFF -DWITH_WEBP=OFF \ - -DWITH_OPENJPEG=OFF -DWITH_JASPER=OFF -DWITH_OPENEXR=OFF -DWITH_GTK=OFF -DWITH_FFMPEG=OFF \ - -DWITH_PROTOBUF=OFF -DWITH_QUIRC=OFF -DWITH_ADE=OFF -DWITH_GDCM=OFF \ - -DWITH_GSTREAMER=OFF -DWITH_V4L=OFF -DWITH_1394=OFF -DWITH_GPHOTO2=OFF \ - -DWITH_OPENVX=OFF -DWITH_VA=OFF -DWITH_VA_INTEL=OFF -DWITH_GDAL=OFF \ - -DWITH_OPENGL=OFF -DWITH_QT=OFF -DWITH_TBB=OFF -DWITH_VTK=OFF -DWITH_IMGCODEC_HDR=OFF \ - -DWITH_IMGCODEC_SUNRASTER=OFF -DWITH_IMGCODEC_PXM=OFF -DWITH_IMGCODEC_PFM=OFF - cmake --build opencv-build && cmake --install opencv-build - cp opencv-4.10.0/LICENSE {project}/LICENSE.opencv.txt - # jax is a build requirement only for the XLA vector interface, which needs - # jaxlib's FFI headers; jaxlib has no riscv64 build, so that interface is off - # and pip's no-isolation mode skips resolving jax (gotcha 76). - # nanobind is capped at the 2.x series ale-py 0.12.1 was released with. - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_BEFORE_BUILD: | - python -m pip install "scikit-build-core>=0.10" "nanobind>=2.5.0,<3" - python -c "import importlib.metadata as m, shutil; shutil.copy(next(f.locate() for f in m.files('nanobind') if f.name == 'LICENSE'), '{project}/LICENSE.nanobind')" - CIBW_ENVIRONMENT: >- - SKBUILD_CMAKE_ARGS="-DSDL_SUPPORT=ON;-DSDL_DYNLOAD=ON;-DBUILD_CPP_LIB=OFF;-DBUILD_PYTHON_LIB=ON;-DBUILD_VECTOR_LIB=ON;-DBUILD_VECTOR_XLA_LIB=OFF" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,opencv-python - # Upstream's `test` extra minus jax and chex (jaxlib again); the XLA test - # module importorskips them. - CIBW_TEST_REQUIRES: pytest>=7.0 gymnasium>=1.1.0 opencv-python>=3.0 - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_COMMAND: python -m pytest + name: ale-py-${{ env.ALE_PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the bundled licences made it into the wheel run: | @@ -154,15 +166,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ale-py-${{ env.ALE_PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish ale-py ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-amazon-ion.yml b/.github/workflows/build-amazon-ion.yml index 0844e3c210fb..b1da02201a40 100644 --- a/.github/workflows/build-amazon-ion.yml +++ b/.github/workflows/build-amazon-ion.yml @@ -51,59 +51,67 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build amazon-ion ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "amazon-ion" + version: "${{ matrix.version }}" + repository: "amazon-ion/ion-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + pre-build: |- + git -C src/ion-c fetch --tags --unshallow + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/amazon-ion/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # jsonconversion pulls in numpy, which has no riscv64 wheel on PyPI. + cibw-test-extras: "test" + # test_vectors.py resolves its data as /vectors/iontestdata. + cibw-test-sources: "tests vectors pyproject.toml" + # The suite silently falls back to the pure-Python reader when the + # extension is missing, and the licence files come from our patch, so + # assert both before running upstream's own command. + cibw-test-command: "python -c \"from amazon.ion.simpleion import c_ext; assert c_ext, 'C extension not loaded'\" && python -c \"import importlib.metadata as m; f = sorted(str(p).split('licenses/', 1)[1] for p in m.files('amazon-ion') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'NOTICE', 'src/ion-c/LICENSE', 'src/ion-c/NOTICE', 'src/ion-c/decNumber/ICU-license.html'], f\" && py.test --ignore tests/test_benchmark_cli.py --ignore tests/test_benchmark_spec.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: AMAZON_ION_VERSION: ${{ matrix.version }} - steps: - - name: Checkout amazon-ion v${{ env.AMAZON_ION_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: amazon-ion/ion-python - ref: v${{ env.AMAZON_ION_VERSION }} - submodules: true - persist-credentials: false - - # ion-c derives its version via `git describe --match "v*"`; submodule - # checkouts fetch no tags, which leaves the version macros empty and breaks - # the ion_version.c compile. - - name: Fetch ion-c tags - run: git -C src/ion-c fetch --tags --unshallow - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch amazon-ion source - run: git apply python-wheels/patches/amazon-ion/${{ env.AMAZON_ION_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # jsonconversion pulls in numpy, which has no riscv64 wheel on PyPI. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_EXTRAS: test - # test_vectors.py resolves its data as /vectors/iontestdata. - CIBW_TEST_SOURCES: tests vectors pyproject.toml - # The suite silently falls back to the pure-Python reader when the - # extension is missing, and the licence files come from our patch, so - # assert both before running upstream's own command. - CIBW_TEST_COMMAND: >- - python -c "from amazon.ion.simpleion import c_ext; assert c_ext, 'C extension not loaded'" && - python -c "import importlib.metadata as m; f = sorted(str(p).split('licenses/', 1)[1] for p in m.files('amazon-ion') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'NOTICE', 'src/ion-c/LICENSE', 'src/ion-c/NOTICE', 'src/ion-c/decNumber/ICU-license.html'], f" && - py.test --ignore tests/test_benchmark_cli.py --ignore tests/test_benchmark_spec.py + name: amazon-ion-${{ env.AMAZON_ION_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -115,15 +123,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: amazon-ion-${{ env.AMAZON_ION_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish amazon-ion ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-anastruct.yml b/.github/workflows/build-anastruct.yml index 319b22d1496f..9d759b6eed70 100644 --- a/.github/workflows/build-anastruct.yml +++ b/.github/workflows/build-anastruct.yml @@ -48,52 +48,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build anastruct ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "anastruct" + version: "${{ matrix.version }}" + repository: "ritchie46/anaStruct" + ref: "release-v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy (build-time + runtime) and scipy (runtime; scipy>=1.10.0 is a hard + # dependency) both need OpenBLAS/gfortran to build from sdist, which the + # manylinux_riscv64 image doesn't carry, so both are pinned to binary -- + # only our registry has them for riscv64. matplotlib (test-only) is pinned + # for the same reason: no public-PyPI riscv64 wheel, and it is slow to + # build from source. pillow (a matplotlib runtime dep, also test-only) is + # pinned too: unpinned, pip resolves PyPI's newest pillow -- which has no + # riscv64 wheel anywhere -- ahead of our registry's, and its sdist build + # fails outright (RequiredDependencyException: jpeg; the manylinux image + # carries no libjpeg headers). Cython (the other build-time requirement) is + # left unrestricted: our registry only carries riscv64 Cython wheels for + # cp312+, and letting pip fall back to Cython's own (portable, + # non-arch-specific) sdist for cp310/cp311 builds cleanly, as it already + # does for crick. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,matplotlib,pillow MPLBACKEND=Agg" + cibw-test-sources: "tests examples" + cibw-test-requires: "pytest pytest-describe matplotlib numpy" + cibw-test-command: "python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ANASTRUCT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout anaStruct release-v${{ env.ANASTRUCT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ritchie46/anaStruct - ref: release-v${{ env.ANASTRUCT_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy (build-time + runtime) and scipy (runtime; scipy>=1.10.0 is a hard - # dependency) both need OpenBLAS/gfortran to build from sdist, which the - # manylinux_riscv64 image doesn't carry, so both are pinned to binary -- - # only our registry has them for riscv64. matplotlib (test-only) is pinned - # for the same reason: no public-PyPI riscv64 wheel, and it is slow to - # build from source. pillow (a matplotlib runtime dep, also test-only) is - # pinned too: unpinned, pip resolves PyPI's newest pillow -- which has no - # riscv64 wheel anywhere -- ahead of our registry's, and its sdist build - # fails outright (RequiredDependencyException: jpeg; the manylinux image - # carries no libjpeg headers). Cython (the other build-time requirement) is - # left unrestricted: our registry only carries riscv64 Cython wheels for - # cp312+, and letting pip fall back to Cython's own (portable, - # non-arch-specific) sdist for cp310/cp311 builds cleanly, as it already - # does for crick. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,matplotlib,pillow - MPLBACKEND=Agg - CIBW_TEST_SOURCES: tests examples - CIBW_TEST_REQUIRES: pytest pytest-describe matplotlib numpy - CIBW_TEST_COMMAND: python -m pytest tests + name: anastruct-${{ env.ANASTRUCT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -106,16 +109,9 @@ jobs: assert licences == {"LICENSE.txt"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: anastruct-${{ env.ANASTRUCT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish anastruct ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-annotatedyaml.yml b/.github/workflows/build-annotatedyaml.yml index 91bebda66460..b2548d3ce159 100644 --- a/.github/workflows/build-annotatedyaml.yml +++ b/.github/workflows/build-annotatedyaml.yml @@ -60,10 +60,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 # Upstream's job-level REQUIRE_CYTHON never reaches the Linux build container. - cibw-environment: >- - REQUIRE_CYTHON=1 - PYYAML_FORCE_LIBYAML=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "REQUIRE_CYTHON=1 PYYAML_FORCE_LIBYAML=1" # musllinux builds PyYAML from sdist; without libyaml it silently lacks CSafeLoader (gotcha 577). cibw-before-test: ${{ matrix.platform == 'musllinux' && 'apk add --no-cache yaml-dev' || '' }} cibw-test-sources: tests diff --git a/.github/workflows/build-annoy.yml b/.github/workflows/build-annoy.yml index 14bbb94caf28..7065940d697f 100644 --- a/.github/workflows/build-annoy.yml +++ b/.github/workflows/build-annoy.yml @@ -57,9 +57,7 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" cibw-test-requires: numpy pytest # The checkout's own annoy/ (pure-Python wrapper, no compiled # .annoylib) would shadow the installed wheel if staged (gotcha 25); diff --git a/.github/workflows/build-ansys-mapdl-reader.yml b/.github/workflows/build-ansys-mapdl-reader.yml index b772a49046f3..a8208d039219 100644 --- a/.github/workflows/build-ansys-mapdl-reader.yml +++ b/.github/workflows/build-ansys-mapdl-reader.yml @@ -50,34 +50,41 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build ansys-mapdl-reader ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ansys-mapdl-reader" + version: "${{ matrix.version }}" + repository: "pyansys/pymapdl-reader" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,vtk,scipy,matplotlib,pillow,contourpy,kiwisolver" + # ansys-mapdl-core only feeds the suite's skip_no_ansys guard, which needs a local MAPDL install. + cibw-test-requires: "matplotlib pytest scipy" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ANSYS_MAPDL_READER_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pymapdl-reader v${{ env.ANSYS_MAPDL_READER_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pyansys/pymapdl-reader - ref: v${{ env.ANSYS_MAPDL_READER_VERSION }} - persist-credentials: false - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy,vtk,scipy,matplotlib,pillow,contourpy,kiwisolver - # ansys-mapdl-core only feeds the suite's skip_no_ansys guard, which needs a local MAPDL install. - CIBW_TEST_REQUIRES: matplotlib pytest scipy + name: ansys-mapdl-reader-${{ env.ANSYS_MAPDL_READER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extensions and license made it into the wheel run: | @@ -93,15 +100,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ansys-mapdl-reader-${{ env.ANSYS_MAPDL_READER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish ansys-mapdl-reader ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-apache-flink.yml b/.github/workflows/build-apache-flink.yml index 7500df3d6b91..f38d1a42da12 100644 --- a/.github/workflows/build-apache-flink.yml +++ b/.github/workflows/build-apache-flink.yml @@ -63,7 +63,6 @@ jobs: # apache-beam/pyarrow/grpcio/pemja, each pinned to the exact # version inside flink's declared windows, are riscv64-only on our # own registry. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # The cimport'd apache_beam.runners.worker.operations.Operation (and # the other Beam cdef classes beam_operations_fast/beam_coder_impl_fast/ # beam_stream_fast cimport) is a Cython size-checked type import: it diff --git a/.github/workflows/build-apache-sedona.yml b/.github/workflows/build-apache-sedona.yml index 4f6caa35cece..b4d2be14c44b 100644 --- a/.github/workflows/build-apache-sedona.yml +++ b/.github/workflows/build-apache-sedona.yml @@ -49,6 +49,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build apache-sedona ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "apache-sedona" + version: "${{ matrix.version }}" + repository: "apache/sedona" + ref: "sedona-${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-package-dir: "python" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # shapely (installed as a dependency of the built wheel) only has a + # riscv64 wheel on our own registry, not on public PyPI. + # sedona.spark.utils (which the test below imports through) hard-requires + # pyspark to import at all, even though the base wheel doesn't declare it - + # only the "spark" extra does. pyspark itself ships no wheel on any arch + # (sdist only), but is pure Python + bundled jars, so it builds trivially. + # Importing sedona.spark also reaches sedona.spark.sql.functions, which + # imports pandas directly (undeclared anywhere in sedona's own metadata). + cibw-test-extras: "spark" + cibw-test-requires: "pytest pandas" + # pandas has no cp314t wheel on our registry yet, and it's needed + # transitively to even import the test module; skip testing that leg + # (the wheel itself still builds). + cibw-test-skip: "cp314t-*" + # geomserde_speedup's own suite: exercises (de)serialization through the + # compiled extension without needing a JVM/Spark session, unlike the rest + # of the test tree (see .github/workflows/python-extension.yml upstream). + cibw-test-sources: "python/tests/utils/test_geomserde_speedup.py" + cibw-test-command: "python -m pytest python/tests/utils/test_geomserde_speedup.py -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv # pyspark (a test-only dependency, pulled in via the "spark" extra) ships no # wheel anywhere and is a ~400MB sdist; give the download/install room. @@ -57,46 +95,14 @@ jobs: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SEDONA_VERSION: ${{ matrix.version }} - steps: - - name: Checkout apache/sedona sedona-${{ env.SEDONA_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: apache/sedona - ref: sedona-${{ env.SEDONA_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: python - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # shapely (installed as a dependency of the built wheel) only has a - # riscv64 wheel on our own registry, not on public PyPI. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # sedona.spark.utils (which the test below imports through) hard-requires - # pyspark to import at all, even though the base wheel doesn't declare it - - # only the "spark" extra does. pyspark itself ships no wheel on any arch - # (sdist only), but is pure Python + bundled jars, so it builds trivially. - # Importing sedona.spark also reaches sedona.spark.sql.functions, which - # imports pandas directly (undeclared anywhere in sedona's own metadata). - CIBW_TEST_EXTRAS: spark - CIBW_TEST_REQUIRES: pytest pandas - # pandas has no cp314t wheel on our registry yet, and it's needed - # transitively to even import the test module; skip testing that leg - # (the wheel itself still builds). - CIBW_TEST_SKIP: cp314t-* - # geomserde_speedup's own suite: exercises (de)serialization through the - # compiled extension without needing a JVM/Spark session, unlike the rest - # of the test tree (see .github/workflows/python-extension.yml upstream). - CIBW_TEST_SOURCES: python/tests/utils/test_geomserde_speedup.py - CIBW_TEST_COMMAND: python -m pytest python/tests/utils/test_geomserde_speedup.py -v + name: apache-sedona-${{ env.SEDONA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the compiled extension made it into the wheel run: | @@ -109,15 +115,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: apache-sedona-${{ env.SEDONA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish apache-sedona ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-aplr.yml b/.github/workflows/build-aplr.yml index 3494554162cd..0d99d5047baa 100644 --- a/.github/workflows/build-aplr.yml +++ b/.github/workflows/build-aplr.yml @@ -48,42 +48,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build aplr ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: # aplr imports pandas at module level; pypi.riseproject.dev has no cp314t pandas yet. include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "aplr" + version: "${{ matrix.version }}" + repository: "ottenbreit-data-science/aplr" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + cp dependencies/eigen-3.4.0/COPYING.MPL2 COPYING.eigen + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,pandas,scipy,scikit-learn" + cibw-test-skip: "${{ case(endsWith(matrix.python, 't'), '*', '') }}" + # Upstream's `pip install scikit-learn || true` would silently skip the sklearn tests. + cibw-test-requires: "pytest scikit-learn" + cibw-test-sources: "tests" + cibw-test-command: "c++ -std=c++17 -O2 -pthread {project}/cpp/tests.cpp -o /tmp/aplr_cpp_tests && /tmp/aplr_cpp_tests && pytest {project}/tests/tests.py {project}/tests/test_sklearn_compatibility.py -q" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + # aplr imports pandas at module level; pypi.riseproject.dev has no cp314t pandas yet. + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: APLR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout aplr ${{ env.APLR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ottenbreit-data-science/aplr - ref: ${{ env.APLR_VERSION }} - persist-credentials: false - - # The vendored header-only Eigen is compiled into aplr_cpp, but upstream's wheel ships only its own LICENSE. - - name: Stage Eigen's licence - run: cp dependencies/eigen-3.4.0/COPYING.MPL2 COPYING.eigen - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pandas,scipy,scikit-learn - CIBW_TEST_SKIP: ${{ case(endsWith(matrix.python, 't'), '*', '') }} - # Upstream's `pip install scikit-learn || true` would silently skip the sklearn tests. - CIBW_TEST_REQUIRES: pytest scikit-learn - CIBW_TEST_SOURCES: "tests" - CIBW_TEST_COMMAND: c++ -std=c++17 -O2 -pthread {project}/cpp/tests.cpp -o /tmp/aplr_cpp_tests && /tmp/aplr_cpp_tests && pytest {project}/tests/tests.py {project}/tests/test_sklearn_compatibility.py -q + name: aplr-${{ env.APLR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -98,15 +107,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: aplr-${{ env.APLR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish aplr ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-arch.yml b/.github/workflows/build-arch.yml index 2d3eab855f07..996a6bd720cd 100644 --- a/.github/workflows/build-arch.yml +++ b/.github/workflows/build-arch.yml @@ -48,42 +48,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build arch ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "arch" + version: "${{ matrix.version }}" + repository: "bashtage/arch" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy/scipy/pandas/statsmodels are build- and/or run-time requirements; + # only our registry has them for riscv64, and only-binary keeps a newer + # PyPI release from winning resolution and compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,pandas,statsmodels" + # arch v8.0.0 pins pytest<9 itself: its own addopts="--strict" trips + # pytest 9's stricter default on a duplicate fixture ID arch never fixed. + cibw-test-requires: "pytest<9 pytest-xdist pytest-cov matplotlib numpy scipy pandas seaborn" + cibw-test-command: "python -c \"import arch; arch.test(['--skip-slow','-n','auto'])\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ARCH_VERSION: ${{ matrix.version }} - steps: - - name: Checkout arch v${{ env.ARCH_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: bashtage/arch - ref: v${{ env.ARCH_VERSION }} - fetch-depth: 0 # setuptools_scm derives the version from git tag history - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy/scipy/pandas/statsmodels are build- and/or run-time requirements; - # only our registry has them for riscv64, and only-binary keeps a newer - # PyPI release from winning resolution and compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas,statsmodels - # arch v8.0.0 pins pytest<9 itself: its own addopts="--strict" trips - # pytest 9's stricter default on a duplicate fixture ID arch never fixed. - CIBW_TEST_REQUIRES: pytest<9 pytest-xdist pytest-cov matplotlib numpy scipy pandas seaborn - CIBW_TEST_COMMAND: python -c "import arch; arch.test(['--skip-slow','-n','auto'])" + name: arch-${{ env.ARCH_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -96,16 +101,9 @@ jobs: assert licences == {"LICENSE.md"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: arch-${{ env.ARCH_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish arch ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-arm-pyart.yml b/.github/workflows/build-arm-pyart.yml index 41c4a3bdc95a..fe72a7f8c130 100644 --- a/.github/workflows/build-arm-pyart.yml +++ b/.github/workflows/build-arm-pyart.yml @@ -49,47 +49,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build arm-pyart ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "arm-pyart" + version: "${{ matrix.version }}" + repository: "ARM-DOE/pyart" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Repeats upstream's own PIP_ONLY_BINARY=:all: (pyproject.toml's + # [tool.cibuildwheel] table, which CIBW_ENVIRONMENT would otherwise drop) + # and adds our registry for numpy/cython (build) and cartopy/netcdf4/scipy/ + # matplotlib/pandas/cftime (runtime/test) - PyPI ships none of these for + # riscv64. Everything else the test install needs (xarray, fsspec, + # mda-xdrlib, open-radar-data, pint, pooch, s3fs, xradar) is a pure-Python + # py3-none-any wheel on PyPI already. + cibw-environment-linux: "PIP_ONLY_BINARY=:all:" + # test_grid_xradar asserts a float32 gridded minimum at the default rtol=1e-7; + # riscv64 gives -1.320179 vs -1.3201784 (rel. diff 6.2e-7, a few float32 ULP), + # an arch float-rounding difference (gotcha 304). -k, not --deselect (gotcha 14). + cibw-test-command: "pytest --mpl {project}/tests -k \"not test_grid_xradar\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ARM_PYART_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyart v${{ env.ARM_PYART_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ARM-DOE/pyart - ref: v${{ env.ARM_PYART_VERSION }} - fetch-depth: 0 # setuptools_scm derives the version from the tag history - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Repeats upstream's own PIP_ONLY_BINARY=:all: (pyproject.toml's - # [tool.cibuildwheel] table, which CIBW_ENVIRONMENT would otherwise drop) - # and adds our registry for numpy/cython (build) and cartopy/netcdf4/scipy/ - # matplotlib/pandas/cftime (runtime/test) - PyPI ships none of these for - # riscv64. Everything else the test install needs (xarray, fsspec, - # mda-xdrlib, open-radar-data, pint, pooch, s3fs, xradar) is a pure-Python - # py3-none-any wheel on PyPI already. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=:all: - # test_grid_xradar asserts a float32 gridded minimum at the default rtol=1e-7; - # riscv64 gives -1.320179 vs -1.3201784 (rel. diff 6.2e-7, a few float32 ULP), - # an arch float-rounding difference (gotcha 304). -k, not --deselect (gotcha 14). - CIBW_TEST_COMMAND: >- - pytest --mpl {project}/tests -k "not test_grid_xradar" + name: arm-pyart-${{ env.ARM_PYART_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -107,16 +111,9 @@ jobs: assert licences == {"LICENSE.txt"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: arm-pyart-${{ env.ARM_PYART_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish arm-pyart ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-arraykit.yml b/.github/workflows/build-arraykit.yml index 446036f0c35e..29a2a980110a 100644 --- a/.github/workflows/build-arraykit.yml +++ b/.github/workflows/build-arraykit.yml @@ -49,52 +49,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build arraykit ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "arraykit" + version: "${{ matrix.version }}" + repository: "static-frame/arraykit" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a build and runtime requirement, and only our registry has + # it for riscv64; only-binary keeps a newer PyPI sdist-only release + # from winning the resolution and trying to build from source. + # setup.py locates numpy's headers via site.getsitepackages(), which + # a PEP 517 build-isolation overlay is invisible to, so numpy has to + # be preinstalled with isolation disabled. + # PIP_ONLY_BINARY also covers hypothesis: our registry has 6.165.10 with a + # cp314t riscv64 wheel, but PyPI's newer 6.168.0 (no riscv64 wheel for + # cp314t) otherwise wins version resolution and falls back to its sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,hypothesis" + cibw-before-build: "pip install setuptools wheel \"numpy>=2.2\"" + cibw-build-frontend: "pip; args: --no-build-isolation" + cibw-test-requires: "pytest hypothesis" + # The property tests trip Hypothesis' too_slow health check and the + # per-example deadline on the shared riscv64 runners, a different test + # each run; the failures are timing, not wrong results. + cibw-before-test: "printf 'from hypothesis import HealthCheck, settings\\nsettings.register_profile(\"ci\", suppress_health_check=list(HealthCheck), deadline=None)\\nsettings.load_profile(\"ci\")\\n' > {project}/test/conftest.py" + cibw-test-command: "pytest {project}/test --durations=0" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ARRAYKIT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout arraykit v${{ env.ARRAYKIT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: static-frame/arraykit - ref: v${{ env.ARRAYKIT_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build and runtime requirement, and only our registry has - # it for riscv64; only-binary keeps a newer PyPI sdist-only release - # from winning the resolution and trying to build from source. - # setup.py locates numpy's headers via site.getsitepackages(), which - # a PEP 517 build-isolation overlay is invisible to, so numpy has to - # be preinstalled with isolation disabled. - # PIP_ONLY_BINARY also covers hypothesis: our registry has 6.165.10 with a - # cp314t riscv64 wheel, but PyPI's newer 6.168.0 (no riscv64 wheel for - # cp314t) otherwise wins version resolution and falls back to its sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,hypothesis - CIBW_BEFORE_BUILD: pip install setuptools wheel "numpy>=2.2" - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_TEST_REQUIRES: pytest hypothesis - # The property tests trip Hypothesis' too_slow health check and the - # per-example deadline on the shared riscv64 runners, a different test - # each run; the failures are timing, not wrong results. - CIBW_BEFORE_TEST: >- - printf 'from hypothesis import HealthCheck, settings\nsettings.register_profile("ci", suppress_health_check=list(HealthCheck), deadline=None)\nsettings.load_profile("ci")\n' > {project}/test/conftest.py - CIBW_TEST_COMMAND: pytest {project}/test --durations=0 + name: arraykit-${{ env.ARRAYKIT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -107,16 +110,9 @@ jobs: assert licences == {"LICENSE.txt"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: arraykit-${{ env.ARRAYKIT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish arraykit ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-arrow-odbc.yml b/.github/workflows/build-arrow-odbc.yml index 55d906fd2dfa..cf5a5adebf3f 100644 --- a/.github/workflows/build-arrow-odbc.yml +++ b/.github/workflows/build-arrow-odbc.yml @@ -47,151 +47,144 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build arrow-odbc ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "arrow-odbc" + version: "${{ matrix.version }}" + repository: "pacman82/arrow-odbc-py" + ref: "v${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 180 + pre-build: |- + cat > tests/test_riscv64_smoke.py <<'EOF' + import pyarrow as pa + import pytest + from arrow_odbc import ( + Error, + from_table_to_db, + insert_into_table, + log_to_stderr, + read_arrow_batches_from_odbc, + ) + + POSTGRES = "DRIVER=PostgreSQL;SERVER=127.0.0.1;PORT=5432;UID=postgres;DATABASE=test" + + log_to_stderr() + + + def run_statement(statement): + # read_arrow_batches_from_odbc also executes statements that + # produce no result set (upstream's own test_no_result_set + # relies on the same behavior for an INSERT); draining the + # reader runs DDL/DML like CREATE, DROP and INSERT. + reader = read_arrow_batches_from_odbc( + query=statement, batch_size=1, connection_string=POSTGRES + ) + list(reader) + + + def test_select_literal(): + reader = read_arrow_batches_from_odbc( + query="SELECT 1 AS a", connection_string=POSTGRES + ) + batches = list(reader) + assert len(batches) == 1 + assert batches[0].column("a").to_pylist() == [1] + + + def test_should_report_error_on_invalid_connection_string(): + # The driver manager reports this error identically regardless + # of which driver would have been selected, so this is portable + # from upstream's own + # test_should_report_error_on_invalid_connection_string_reading. + with pytest.raises(Error, match="Data source name not found"): + read_arrow_batches_from_odbc( + query="SELECT * FROM Table", batch_size=100, connection_string="foo" + ) + + + def test_from_table_to_db_and_read_back_roundtrip(): + table = "RiscvRoundtrip" + run_statement(f"DROP TABLE IF EXISTS {table}") + run_statement(f"CREATE TABLE {table} (a INTEGER, b TEXT)") + + source = pa.table({"a": [1, 2, 3], "b": ["x", "y", "z"]}) + from_table_to_db(source=source, target=table, connection_string=POSTGRES, chunk_size=2) + + reader = read_arrow_batches_from_odbc( + query=f"SELECT a, b FROM {table} ORDER BY a", connection_string=POSTGRES + ) + result = pa.Table.from_batches(list(reader)) + assert result.column("a").to_pylist() == [1, 2, 3] + assert result.column("b").to_pylist() == ["x", "y", "z"] + + + def test_insert_into_table_with_record_batch_reader(): + table = "RiscvInsertIntoTable" + run_statement(f"DROP TABLE IF EXISTS {table}") + run_statement(f"CREATE TABLE {table} (a INTEGER)") + + source = pa.table({"a": [10, 20, 30]}) + batch_reader = pa.RecordBatchReader.from_batches(source.schema, source.to_batches()) + insert_into_table( + reader=batch_reader, chunk_size=1000, table=table, connection_string=POSTGRES + ) + + reader = read_arrow_batches_from_odbc( + query=f"SELECT a FROM {table} ORDER BY a", connection_string=POSTGRES + ) + result = pa.Table.from_batches(list(reader)) + assert result.column("a").to_pylist() == [10, 20, 30] + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # maturin's cffi bindings reach the Rust cdylib through cffi's ABI + # mode, so the wheel is py3-none: one build serves every + # interpreter, and the further identifiers only re-run the test + # command against it. + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 cp314t-manylinux_riscv64" + # unixODBC-devel is the link-time half of the same unixODBC that + # build-pyodbc.yml installs; postgresql-server/-odbc back the + # smoke tests above and are started once here so the running + # server survives the later, build-skipped test-only legs. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && dnf -y install unixODBC-devel postgresql-server postgresql-odbc && install -d -o postgres -g postgres /run/postgresql /var/lib/pgsql/data && su postgres -c \"/usr/bin/initdb -A trust -D /var/lib/pgsql/data\" && su postgres -c \"/usr/bin/pg_ctl -D /var/lib/pgsql/data -l /tmp/pg.log -o '-c listen_addresses=127.0.0.1' -w start\" && su postgres -c \"/usr/bin/createdb test\"" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-repair-wheel-command-linux: "auditwheel repair --exclude \"libodbc.so.*\" --wheel-dir {dest_dir} {wheel}" + cibw-test-requires: "pytest" + # arrow-odbc only asks for `pyarrow>=8.0.0`, so without this pip + # takes PyPI's newest pyarrow sdist (which has no riscv64 wheel and + # can't find an Arrow C++ install to build against) over the latest + # riscv64 wheel on pypi.riseproject.dev. + cibw-test-environment: "PIP_ONLY_BINARY=pyarrow" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest -v tests/test_riscv64_smoke.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: ARROW_ODBC_VERSION: ${{ matrix.version }} - steps: - - name: Checkout arrow-odbc-py v${{ env.ARROW_ODBC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pacman82/arrow-odbc-py - ref: v${{ env.ARROW_ODBC_VERSION }} - persist-credentials: false - - - name: Stage the riscv64 smoke tests - # Upstream's own tests/test_arrow_odbc.py is hardwired to a Microsoft - # SQL Server service; neither the mssql/server docker image nor the - # ODBC Driver for SQL Server publish a riscv64 build. PostgreSQL and - # its ODBC driver both package for riscv64 (same as build-pyodbc.yml - # relies on), so this exercises the same public surface against a - # PostgreSQL server started inside the build container. - run: | - cat > tests/test_riscv64_smoke.py <<'EOF' - import pyarrow as pa - import pytest - from arrow_odbc import ( - Error, - from_table_to_db, - insert_into_table, - log_to_stderr, - read_arrow_batches_from_odbc, - ) - - POSTGRES = "DRIVER=PostgreSQL;SERVER=127.0.0.1;PORT=5432;UID=postgres;DATABASE=test" - - log_to_stderr() - - - def run_statement(statement): - # read_arrow_batches_from_odbc also executes statements that - # produce no result set (upstream's own test_no_result_set - # relies on the same behavior for an INSERT); draining the - # reader runs DDL/DML like CREATE, DROP and INSERT. - reader = read_arrow_batches_from_odbc( - query=statement, batch_size=1, connection_string=POSTGRES - ) - list(reader) - - - def test_select_literal(): - reader = read_arrow_batches_from_odbc( - query="SELECT 1 AS a", connection_string=POSTGRES - ) - batches = list(reader) - assert len(batches) == 1 - assert batches[0].column("a").to_pylist() == [1] - - - def test_should_report_error_on_invalid_connection_string(): - # The driver manager reports this error identically regardless - # of which driver would have been selected, so this is portable - # from upstream's own - # test_should_report_error_on_invalid_connection_string_reading. - with pytest.raises(Error, match="Data source name not found"): - read_arrow_batches_from_odbc( - query="SELECT * FROM Table", batch_size=100, connection_string="foo" - ) - - - def test_from_table_to_db_and_read_back_roundtrip(): - table = "RiscvRoundtrip" - run_statement(f"DROP TABLE IF EXISTS {table}") - run_statement(f"CREATE TABLE {table} (a INTEGER, b TEXT)") - - source = pa.table({"a": [1, 2, 3], "b": ["x", "y", "z"]}) - from_table_to_db(source=source, target=table, connection_string=POSTGRES, chunk_size=2) - - reader = read_arrow_batches_from_odbc( - query=f"SELECT a, b FROM {table} ORDER BY a", connection_string=POSTGRES - ) - result = pa.Table.from_batches(list(reader)) - assert result.column("a").to_pylist() == [1, 2, 3] - assert result.column("b").to_pylist() == ["x", "y", "z"] - - - def test_insert_into_table_with_record_batch_reader(): - table = "RiscvInsertIntoTable" - run_statement(f"DROP TABLE IF EXISTS {table}") - run_statement(f"CREATE TABLE {table} (a INTEGER)") - - source = pa.table({"a": [10, 20, 30]}) - batch_reader = pa.RecordBatchReader.from_batches(source.schema, source.to_batches()) - insert_into_table( - reader=batch_reader, chunk_size=1000, table=table, connection_string=POSTGRES - ) - - reader = read_arrow_batches_from_odbc( - query=f"SELECT a FROM {table} ORDER BY a", connection_string=POSTGRES - ) - result = pa.Table.from_batches(list(reader)) - assert result.column("a").to_pylist() == [10, 20, 30] - EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - # maturin's cffi bindings reach the Rust cdylib through cffi's ABI - # mode, so the wheel is py3-none: one build serves every - # interpreter, and the further identifiers only re-run the test - # command against it. - CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 cp314t-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # unixODBC-devel is the link-time half of the same unixODBC that - # build-pyodbc.yml installs; postgresql-server/-odbc back the - # smoke tests above and are started once here so the running - # server survives the later, build-skipped test-only legs. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && - dnf -y install unixODBC-devel postgresql-server postgresql-odbc && - install -d -o postgres -g postgres /run/postgresql /var/lib/pgsql/data && - su postgres -c "/usr/bin/initdb -A trust -D /var/lib/pgsql/data" && - su postgres -c "/usr/bin/pg_ctl -D /var/lib/pgsql/data -l /tmp/pg.log -o '-c listen_addresses=127.0.0.1' -w start" && - su postgres -c "/usr/bin/createdb test" - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- - auditwheel repair - --exclude "libodbc.so.*" - --wheel-dir {dest_dir} - {wheel} - CIBW_TEST_REQUIRES: pytest - # arrow-odbc only asks for `pyarrow>=8.0.0`, so without this pip - # takes PyPI's newest pyarrow sdist (which has no riscv64 wheel and - # can't find an Arrow C++ install to build against) over the latest - # riscv64 wheel on pypi.riseproject.dev. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=pyarrow - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest -v tests/test_riscv64_smoke.py + name: arrow-odbc-${{ env.ARROW_ODBC_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries the Rust cdylib and its licence run: | @@ -204,15 +197,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: arrow-odbc-${{ env.ARROW_ODBC_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish arrow-odbc ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-asammdf.yml b/.github/workflows/build-asammdf.yml index 15639603d143..7882b0ebf756 100644 --- a/.github/workflows/build-asammdf.yml +++ b/.github/workflows/build-asammdf.yml @@ -63,7 +63,6 @@ jobs: # lets cibuildwheel compile once and reuse+test that wheel on each # (find_compatible_wheel); cp314t/cp315 are skipped upstream too. cibw-build: "cp312-* cp313-* cp314-*" - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-environment: "PIP_ONLY_BINARY=:all:" # Mirrors upstream's own wheels.yml, which excludes the Qt-based GUI # suite (PySide6 has no riscv64 wheel anywhere). diff --git a/.github/workflows/build-assimp-py.yml b/.github/workflows/build-assimp-py.yml index 2ab11089109b..0262564fd3a4 100644 --- a/.github/workflows/build-assimp-py.yml +++ b/.github/workflows/build-assimp-py.yml @@ -50,34 +50,41 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build assimp-py ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "assimp-py" + version: "${{ matrix.version }}" + repository: "ranjian0/assimp_py" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-test-requires: "pytest" + cibw-test-command: "pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ASSIMP_PY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout assimp_py v${{ env.ASSIMP_PY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ranjian0/assimp_py - ref: v${{ env.ASSIMP_PY_VERSION }} - persist-credentials: false - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest {project}/tests + name: assimp-py-${{ env.ASSIMP_PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -91,15 +98,9 @@ jobs: assert not [n for n in names if n.endswith(".c")], names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: assimp-py-${{ env.ASSIMP_PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish assimp-py ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-astc-encoder-py.yml b/.github/workflows/build-astc-encoder-py.yml index 247be9845663..0f91621758fd 100644 --- a/.github/workflows/build-astc-encoder-py.yml +++ b/.github/workflows/build-astc-encoder-py.yml @@ -102,7 +102,6 @@ jobs: cp313-${{ matrix.libc }}_riscv64 cp314-${{ matrix.libc }}_riscv64 cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: ${{ matrix.test_extras }} cibw-test-command: ${{ matrix.test_command }} timeout-minutes: 90 diff --git a/.github/workflows/build-astropy-healpix.yml b/.github/workflows/build-astropy-healpix.yml index bc7838315bcd..ec15acdda102 100644 --- a/.github/workflows/build-astropy-healpix.yml +++ b/.github/workflows/build-astropy-healpix.yml @@ -52,6 +52,73 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build astropy-healpix ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # setup.cfg pins `[bdist_wheel] py_limited_api = cp310`, overridden here to + # our cp312 floor via EXTENSION_HELPERS_PY_LIMITED_API; built on cp312, the + # oldest interpreter the tag then claims, and re-tested on the newer ones. + - tag: cp312-abi3 + wheel_tag: cp312-abi3 + build: >- + cp312-manylinux_riscv64 cp313-manylinux_riscv64 + cp314-manylinux_riscv64 + limited_api: cp312 + test_skip: '' + timeout: 90 + # pyproject.toml itself blanks EXTENSION_HELPERS_PY_LIMITED_API for cp3??t + # builds, since free-threaded interpreters don't support the limited API. + # Its test extras hard-require astropy, which publishes no cp314t wheel on + # any index anywhere (checked pypi.org and pypi.riseproject.dev) -- so the + # wheel is built and shipped like upstream's, but untested (gotcha 149). + - tag: cp314t + wheel_tag: cp314-cp314t + build: cp314t-manylinux_riscv64 + limited_api: '' + test_skip: '*' + timeout: 45 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "astropy-healpix" + version: "${{ matrix.version }}" + repository: "astropy/astropy-healpix" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: "${{ matrix.timeout }}" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/astropy-healpix/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.build }}" + cibw-test-skip: "${{ matrix.test_skip }}" + # numpy is a build and a runtime requirement, and only our registry has + # it for riscv64; only-binary keeps a newer PyPI release from winning the + # resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy EXTENSION_HELPERS_PY_LIMITED_API=${{ matrix.limited_api }} SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ASTROPY_HEALPIX=${{ matrix.version }}" + cibw-test-extras: "test" + cibw-test-command: "pytest --pyargs astropy_healpix" + # astropy (a hard runtime+test dependency) and hypothesis (a test + # dependency) both only have riscv64 wheels on our registry, at specific + # versions; only-binary stops pip resolving a newer PyPI release with no + # riscv64 wheel anywhere and building it from sdist (gotcha 210 -- for + # hypothesis that sdist build needs a Rust toolchain rustup won't target). + cibw-test-environment: "PIP_ONLY_BINARY=astropy,hypothesis" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: ${{ matrix.timeout }} strategy: @@ -81,51 +148,14 @@ jobs: limited_api: '' test_skip: '*' timeout: 45 - env: ASTROPY_HEALPIX_VERSION: ${{ matrix.version }} - steps: - - name: Checkout astropy-healpix v${{ env.ASTROPY_HEALPIX_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: astropy/astropy-healpix - ref: v${{ env.ASTROPY_HEALPIX_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch astropy-healpix source - run: git apply python-wheels/patches/astropy-healpix/${{ env.ASTROPY_HEALPIX_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_SKIP: ${{ matrix.test_skip }} - # numpy is a build and a runtime requirement, and only our registry has - # it for riscv64; only-binary keeps a newer PyPI release from winning the - # resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - EXTENSION_HELPERS_PY_LIMITED_API=${{ matrix.limited_api }} - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ASTROPY_HEALPIX=${{ env.ASTROPY_HEALPIX_VERSION }} - CIBW_TEST_EXTRAS: test - CIBW_TEST_COMMAND: pytest --pyargs astropy_healpix - # astropy (a hard runtime+test dependency) and hypothesis (a test - # dependency) both only have riscv64 wheels on our registry, at specific - # versions; only-binary stops pip resolving a newer PyPI release with no - # riscv64 wheel anywhere and building it from sdist (gotcha 210 -- for - # hypothesis that sdist build needs a Rust toolchain rustup won't target). - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=astropy,hypothesis + name: astropy-healpix-${{ env.ASTROPY_HEALPIX_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -141,16 +171,9 @@ jobs: assert licences == {"LICENSE.md"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: astropy-healpix-${{ env.ASTROPY_HEALPIX_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish astropy-healpix ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-astropy.yml b/.github/workflows/build-astropy.yml index 3d174035a54a..afabbcb3cee3 100644 --- a/.github/workflows/build-astropy.yml +++ b/.github/workflows/build-astropy.yml @@ -57,45 +57,41 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build astropy ${{ matrix.version }} cp311-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "astropy" + version: "${{ matrix.version }}" + repository: "astropy/astropy" + ref: "v${{ matrix.version }}" + artifact-tag: "cp311-abi3-manylinux_riscv64" + timeout-minutes: 720 + # One abi3 wheel, built on cp311 -- the oldest interpreter its tag + # claims -- and re-tested on the newer ones via find_compatible_wheel. + cibw-build: "cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # numpy is a build and a runtime requirement, and only our registry has + # it for riscv64; only-binary keeps a newer PyPI release from winning the + # resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ASTROPY=${{ matrix.version }}" + cibw-test-extras: "test" + cibw-test-command: "pytest -Wdefault --astropy-header -m \"not hypothesis\" -k \"not test_data_out_of_range and not test_set_locale and not TestQuantityTyping\" --strict-markers --pyargs astropy" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 720 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: ASTROPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout astropy v${{ env.ASTROPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: astropy/astropy - ref: v${{ env.ASTROPY_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # One abi3 wheel, built on cp311 -- the oldest interpreter its tag - # claims -- and re-tested on the newer ones via find_compatible_wheel. - CIBW_BUILD: >- - cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - # pyproject.toml asks for ["auto", "aarch64"], which needs emulation here. - CIBW_ARCHS: riscv64 - # numpy is a build and a runtime requirement, and only our registry has - # it for riscv64; only-binary keeps a newer PyPI release from winning the - # resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ASTROPY=${{ env.ASTROPY_VERSION }} - CIBW_TEST_EXTRAS: test - CIBW_TEST_COMMAND: >- - pytest -Wdefault --astropy-header -m "not hypothesis" - -k "not test_data_out_of_range and not test_set_locale and not TestQuantityTyping" - --strict-markers --pyargs astropy + name: astropy-${{ env.ASTROPY_VERSION }}-cp311-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -112,16 +108,9 @@ jobs: "licenses/WCSLIB_LICENSE.rst"} <= licences, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: astropy-${{ env.ASTROPY_VERSION }}-cp311-abi3-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish astropy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-asyncdb.yml b/.github/workflows/build-asyncdb.yml index 9deffd4773e3..694b0990d7c9 100644 --- a/.github/workflows/build-asyncdb.yml +++ b/.github/workflows/build-asyncdb.yml @@ -46,36 +46,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build asyncdb ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "asyncdb" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + export ASYNCDB_VERSION='${{ matrix.version }}' + set -euo pipefail + shopt -s dotglob + rm -rf ./* + git init -q . + git remote add origin https://github.com/phenobarbital/asyncdb + git fetch -q --depth=1 origin "$ASYNCDB_VERSION" + git checkout -q FETCH_HEAD + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-output-dir: "dist" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ASYNCDB_VERSION: ${{ matrix.version }} - steps: - # Upstream's tree carries a gitlink with no corresponding .gitmodules entry - # (libraries/python-driver), which makes actions/checkout's own - # persist-credentials cleanup (`git submodule foreach`) fail with "No url - # found for submodule path"; plain git sidesteps that internal routine. - - name: Checkout asyncdb ${{ env.ASYNCDB_VERSION }} - run: | - set -euo pipefail - shopt -s dotglob - rm -rf ./* - git init -q . - git remote add origin https://github.com/phenobarbital/asyncdb - git fetch -q --depth=1 origin "$ASYNCDB_VERSION" - git checkout -q FETCH_HEAD - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: dist - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + name: asyncdb-${{ env.ASYNCDB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: dist - name: Verify wheel tags and compiled Cython extension env: @@ -104,15 +121,9 @@ jobs: assert found_cpython_tags == {os.environ["EXPECTED_CPYTHON_TAG"]}, found_cpython_tags EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: asyncdb-${{ env.ASYNCDB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: dist/*.whl - if-no-files-found: error - publish: name: Publish asyncdb ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-asynch.yml b/.github/workflows/build-asynch.yml index f0a3bcbdd446..a797b67eaea0 100644 --- a/.github/workflows/build-asynch.yml +++ b/.github/workflows/build-asynch.yml @@ -49,38 +49,43 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build asynch ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "asynch" + version: "${{ matrix.version }}" + repository: "long2ice/asynch" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Every other test in the suite needs a live ClickHouse server, which + # publishes no riscv64 image (asynch's own CI gets one via a `services:` + # container, unavailable here); this file just checks the Cython + # extensions loaded, so it's the only one that runs unmodified. + cibw-test-sources: "tests/test_compiled.py" + cibw-test-requires: "pytest" + cibw-test-command: "python -m pytest -v tests/test_compiled.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: ASYNCH_VERSION: ${{ matrix.version }} - steps: - - name: Checkout asynch v${{ env.ASYNCH_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: long2ice/asynch - ref: v${{ env.ASYNCH_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Every other test in the suite needs a live ClickHouse server, which - # publishes no riscv64 image (asynch's own CI gets one via a `services:` - # container, unavailable here); this file just checks the Cython - # extensions loaded, so it's the only one that runs unmodified. - CIBW_TEST_SOURCES: tests/test_compiled.py - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: python -m pytest -v tests/test_compiled.py + name: asynch-${{ env.ASYNCH_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the Cython extensions made it into the wheel run: | @@ -98,15 +103,9 @@ jobs: print(whl, 'ok') EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: asynch-${{ env.ASYNCH_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish asynch ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-asyncmy.yml b/.github/workflows/build-asyncmy.yml index 0201dd031195..3a452576c996 100644 --- a/.github/workflows/build-asyncmy.yml +++ b/.github/workflows/build-asyncmy.yml @@ -50,59 +50,65 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build asyncmy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "asyncmy" + version: "${{ matrix.version }}" + repository: "long2ice/asyncmy" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + export ASYNCMY_VERSION='${{ matrix.version }}' + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + patches="$PWD/python-wheels/patches/asyncmy/${ASYNCMY_VERSION}" + if [ -d "$patches" ]; then + git apply -v "$patches"/*.patch + fi + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Every other test needs a live MySQL/MariaDB server, which publishes no + # riscv64 image (upstream's own CI gets one via a `services:` container, + # unavailable here); these files exercise the compiled protocol/converters + # extensions without one. test_timedelta_binding_round_trip (added to + # test_converters.py in 0.2.17) takes the `connection` fixture and so also + # needs a live server, so it is deselected. + cibw-test-sources: "tests/test_converters.py tests/test_dbapi.py tests/test_errors.py tests/test_free_threading.py tests/test_gtid.py" + cibw-test-requires: "pytest" + cibw-test-command: "python -m pytest -v tests/test_converters.py tests/test_dbapi.py tests/test_errors.py tests/test_free_threading.py tests/test_gtid.py --deselect tests/test_converters.py::test_timedelta_binding_round_trip" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ASYNCMY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout asyncmy v${{ env.ASYNCMY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: long2ice/asyncmy - ref: v${{ env.ASYNCMY_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # Only some versions need patching, so a missing directory is not an error. - - name: Apply patches - run: | - patches="$PWD/python-wheels/patches/asyncmy/${ASYNCMY_VERSION}" - if [ -d "$patches" ]; then - git apply -v "$patches"/*.patch - fi - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Every other test needs a live MySQL/MariaDB server, which publishes no - # riscv64 image (upstream's own CI gets one via a `services:` container, - # unavailable here); these files exercise the compiled protocol/converters - # extensions without one. test_timedelta_binding_round_trip (added to - # test_converters.py in 0.2.17) takes the `connection` fixture and so also - # needs a live server, so it is deselected. - CIBW_TEST_SOURCES: >- - tests/test_converters.py tests/test_dbapi.py tests/test_errors.py - tests/test_free_threading.py tests/test_gtid.py - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: >- - python -m pytest -v tests/test_converters.py tests/test_dbapi.py - tests/test_errors.py tests/test_free_threading.py tests/test_gtid.py - --deselect tests/test_converters.py::test_timedelta_binding_round_trip + name: asyncmy-${{ env.ASYNCMY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the Cython extensions made it into the wheel run: | @@ -120,15 +126,9 @@ jobs: print(whl, 'ok') EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: asyncmy-${{ env.ASYNCMY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish asyncmy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-asyncmy2.yml b/.github/workflows/build-asyncmy2.yml index 4ad7ac06070a..6f25d69734c6 100644 --- a/.github/workflows/build-asyncmy2.yml +++ b/.github/workflows/build-asyncmy2.yml @@ -50,53 +50,62 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build asyncmy2 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "asyncmy2" + version: "${{ matrix.version }}" + repository: "vpmedia/asyncmy2" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + patches="$PWD/python-wheels/patches/asyncmy2/${{ matrix.version }}" + if [ -d "$patches" ]; then + git apply -v "$patches"/*.patch + fi + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Every other test needs a live MySQL/MariaDB server, which publishes no + # riscv64 image (upstream's own CI gets one via a `services:` container, + # unavailable here); these files exercise the compiled protocol/converters + # extensions without one. + cibw-test-sources: "tests/test_auth.py tests/test_converters.py tests/test_optionfile.py" + cibw-test-requires: "pytest" + cibw-test-command: "python -m pytest -v tests/test_auth.py tests/test_converters.py tests/test_optionfile.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ASYNCMY2_VERSION: ${{ matrix.version }} - steps: - - name: Checkout asyncmy2 v${{ env.ASYNCMY2_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: vpmedia/asyncmy2 - ref: v${{ env.ASYNCMY2_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: | - patches="$PWD/python-wheels/patches/asyncmy2/${{ env.ASYNCMY2_VERSION }}" - if [ -d "$patches" ]; then - git apply -v "$patches"/*.patch - fi - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Every other test needs a live MySQL/MariaDB server, which publishes no - # riscv64 image (upstream's own CI gets one via a `services:` container, - # unavailable here); these files exercise the compiled protocol/converters - # extensions without one. - CIBW_TEST_SOURCES: tests/test_auth.py tests/test_converters.py tests/test_optionfile.py - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: >- - python -m pytest -v tests/test_auth.py tests/test_converters.py - tests/test_optionfile.py + name: asyncmy2-${{ env.ASYNCMY2_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the Cython extensions made it into the wheel run: | @@ -114,15 +123,9 @@ jobs: print(whl, 'ok') EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: asyncmy2-${{ env.ASYNCMY2_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish asyncmy2 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-asyncpg.yml b/.github/workflows/build-asyncpg.yml index 4165b71eb6c7..fd51dec7b81f 100644 --- a/.github/workflows/build-asyncpg.yml +++ b/.github/workflows/build-asyncpg.yml @@ -70,7 +70,6 @@ jobs: cibw-before-build: pip install "setuptools<82" "Cython>=3.2.1,<4.0.0" wheel cibw-build-frontend: "build; args: --no-isolation" # uvloop, in upstream's inherited `test` group, has no riscv64 wheel on PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ timeout-minutes: 180 publish: diff --git a/.github/workflows/build-atheris.yml b/.github/workflows/build-atheris.yml index 37f72547abfe..faaca360cb59 100644 --- a/.github/workflows/build-atheris.yml +++ b/.github/workflows/build-atheris.yml @@ -64,9 +64,7 @@ jobs: # Upstream builds libFuzzer from an LLVM 16 snapshot that predates riscv64 # libFuzzer (added in LLVM 17); Rocky 10's compiler-rt ships it prebuilt. cibw-before-all: dnf install -y compiler-rt - cibw-environment: >- - LIBFUZZER_LIB=/usr/lib/clang/21/lib/riscv64-redhat-linux-gnu/libclang_rt.fuzzer_no_main.a - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "LIBFUZZER_LIB=/usr/lib/clang/21/lib/riscv64-redhat-linux-gnu/libclang_rt.fuzzer_no_main.a" cibw-before-build: pip install setuptools pybind11 cibw-build-frontend: "pip; args: --no-build-isolation" cibw-test-requires: PyInstaller diff --git a/.github/workflows/build-audiostretchy.yml b/.github/workflows/build-audiostretchy.yml index d9ab6a84137e..c1bc3954e4fd 100644 --- a/.github/workflows/build-audiostretchy.yml +++ b/.github/workflows/build-audiostretchy.yml @@ -52,43 +52,41 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build audiostretchy ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "audiostretchy" + version: "${{ matrix.version }}" + repository: "twardoch/audiostretchy" + ref: "v${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + # hatch_build.py tags the ctypes-loaded _stretch.so py3-none, so one build serves every interpreter. + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION=${{ matrix.version }}" + # PyPI's newest numpy can be ahead of the registry's riscv64 wheel (gotcha 354). + cibw-test-environment: "PIP_PREFER_BINARY=1" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: AUDIOSTRETCHY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout audiostretchy v${{ env.AUDIOSTRETCHY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: twardoch/audiostretchy - ref: v${{ env.AUDIOSTRETCHY_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # hatch_build.py tags the ctypes-loaded _stretch.so py3-none, so one build serves every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - SETUPTOOLS_SCM_PRETEND_VERSION=${{ env.AUDIOSTRETCHY_VERSION }} - # PyPI's newest numpy can be ahead of the registry's riscv64 wheel (gotcha 354). - CIBW_TEST_ENVIRONMENT: PIP_PREFER_BINARY=1 + name: audiostretchy-${{ env.AUDIOSTRETCHY_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the compiled library made it into the wheel run: | unzip -l wheelhouse/*.whl | grep 'audiostretchy/c_interface/lib/_stretch.so$' - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: audiostretchy-${{ env.AUDIOSTRETCHY_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - test_wheel: name: Test audiostretchy ${{ matrix.version }} ${{ matrix.python }} needs: [setup, build_wheels] @@ -148,7 +146,7 @@ jobs: publish: name: Publish audiostretchy ${{ matrix.version }} - needs: [setup, build_wheels, test_wheel] + needs: [setup, build_wheels, test_wheel, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-autobahn.yml b/.github/workflows/build-autobahn.yml index 08ea9c0225b8..12dc39cbfdbe 100644 --- a/.github/workflows/build-autobahn.yml +++ b/.github/workflows/build-autobahn.yml @@ -65,9 +65,7 @@ jobs: # riscv64 wheel on public PyPI; AUTOBAHN_USE_NVX=1 makes hatch_build.py # fail the build (instead of silently degrading to a pure-Python # wheel) if the CFFI compile doesn't succeed. - cibw-environment: >- - AUTOBAHN_USE_NVX=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "AUTOBAHN_USE_NVX=1" # pynacl and argon2-cffi-bindings (encryption/scram extras) are # compiled deps that also need the riseproject.dev index above. cibw-test-requires: pytest pytest-asyncio diff --git a/.github/workflows/build-awscrt.yml b/.github/workflows/build-awscrt.yml index 2d4f326c0af1..fcd82fc08001 100644 --- a/.github/workflows/build-awscrt.yml +++ b/.github/workflows/build-awscrt.yml @@ -50,8 +50,6 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build awscrt ${{ matrix.version }} ${{ matrix.wheel_tag }}-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 740 strategy: fail-fast: false matrix: @@ -74,61 +72,91 @@ jobs: - wheel_tag: cp314-cp314t builds: cp314t-manylinux_riscv64 - env: - AWSCRT_VERSION: ${{ matrix.version }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "awscrt" + version: "${{ matrix.version }}" + repository: "awslabs/aws-crt-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.wheel_tag }}-manylinux_riscv64" + timeout-minutes: 740 + checkout-submodules: "recursive" + pre-build: |- + export AWSCRT_VERSION='${{ matrix.version }}' + python3 continuous-delivery/update-version.py + grep -q "__version__ = '${AWSCRT_VERSION}'" awscrt/__init__.py - steps: - - name: Checkout awscrt v${{ env.AWSCRT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: awslabs/aws-crt-python - ref: v${{ env.AWSCRT_VERSION }} - submodules: recursive - persist-credentials: false + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - # First step of upstream's release script: awscrt/__init__.py carries a - # 1.0.0.dev0 placeholder in git, and every wheel is named from it. - - name: Stamp awscrt.__version__ from the tag - run: | - python3 continuous-delivery/update-version.py - grep -q "__version__ = '${AWSCRT_VERSION}'" awscrt/__init__.py + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + patches="$PWD/python-wheels/patches/awscrt/${AWSCRT_VERSION}" + if [ -d "$patches" ]; then + git apply -v "$patches"/*.patch + fi - # Only some versions need patching, so a missing directory is not an error. - - name: Apply patches - run: | - patches="$PWD/python-wheels/patches/awscrt/${AWSCRT_VERSION}" - if [ -d "$patches" ]; then - git apply -v "$patches"/*.patch - fi + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.builds }}" + # cibuildwheel's default abi3audit run rejects any abi3 wheel exporting a + # Py-prefixed symbol it doesn't know; awscrt's source/module.h declares 17 + # such helpers, so upstream's own released wheels fail it too. + cibw-audit-command: '' + # Upstream's builder runs the whole suite; these are the two test deps from + # its `dev` extra (the rest of that extra is docs and packaging tooling). + cibw-test-requires: "websockets>=13.1 h2==4.1.0" + # The h2 mock-server tests load test/../crt/aws-c-http/tests/{mock_server,resources}, + # which test-sources keeps at the same relative path. Staging test/ alone also + # keeps the checkout's awscrt/ package from shadowing the wheel. + cibw-test-sources: "test crt/aws-c-http/tests/mock_server crt/aws-c-http/tests/resources" + cibw-test-environment: "AWS_TEST_LOCALHOST=1" + cibw-test-command: "python -m unittest discover --verbose" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 740 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # setup.py picks the tag from the interpreter it runs on, so the matrix is + # over build interpreters and wheel_tag is what comes out. Upstream's release + # script builds the same set (plus cp39/cp310, which predate our floor). + # Each abi3 wheel is built on the oldest interpreter its tag claims and only + # re-tested on the next one, so cp311 is here despite our cp312 floor: awscrt + # defines PY_SSIZE_T_CLEAN and parses "s#"/"z#" throughout. + # wheel_tag is a real matrix dimension (not include-only) so it fans out + # against every pending version instead of collapsing to one combination + # per include entry (CLAUDE.md gotcha 402). + wheel_tag: [cp311-abi3, cp313-abi3, cp314-cp314t] + include: + - wheel_tag: cp311-abi3 + builds: cp311-manylinux_riscv64 cp312-manylinux_riscv64 + - wheel_tag: cp313-abi3 + builds: cp313-manylinux_riscv64 cp314-manylinux_riscv64 + - wheel_tag: cp314-cp314t + builds: cp314t-manylinux_riscv64 + env: + AWSCRT_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.builds }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # cibuildwheel's default abi3audit run rejects any abi3 wheel exporting a - # Py-prefixed symbol it doesn't know; awscrt's source/module.h declares 17 - # such helpers, so upstream's own released wheels fail it too. - CIBW_AUDIT_COMMAND: '' - # Upstream's builder runs the whole suite; these are the two test deps from - # its `dev` extra (the rest of that extra is docs and packaging tooling). - CIBW_TEST_REQUIRES: websockets>=13.1 h2==4.1.0 - # The h2 mock-server tests load test/../crt/aws-c-http/tests/{mock_server,resources}, - # which test-sources keeps at the same relative path. Staging test/ alone also - # keeps the checkout's awscrt/ package from shadowing the wheel. - CIBW_TEST_SOURCES: test crt/aws-c-http/tests/mock_server crt/aws-c-http/tests/resources - CIBW_TEST_ENVIRONMENT: AWS_TEST_LOCALHOST=1 - CIBW_TEST_COMMAND: python -m unittest discover --verbose + name: awscrt-${{ env.AWSCRT_VERSION }}-${{ matrix.wheel_tag }}-manylinux_riscv64 + path: wheelhouse - name: Check wheel contains the compiled extension run: | @@ -138,15 +166,9 @@ jobs: unzip -l "$whl" | grep '\.so$' done - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: awscrt-${{ env.AWSCRT_VERSION }}-${{ matrix.wheel_tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish awscrt ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-awslambdaric.yml b/.github/workflows/build-awslambdaric.yml index 47dbd3647537..bb3696d3a65b 100644 --- a/.github/workflows/build-awslambdaric.yml +++ b/.github/workflows/build-awslambdaric.yml @@ -47,47 +47,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build awslambdaric ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "awslambdaric" + version: "${{ matrix.version }}" + repository: "aws/aws-lambda-python-runtime-interface-client" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/awslambdaric/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pytest parameterized" + # tests/ is a package, so pytest's rootdir insertion would otherwise + # shadow the installed wheel with the checkout's own awslambdaric/ + # source directory (gotcha 25) - stage just the tests into an empty + # cwd and reference them relative to it. + cibw-test-sources: "tests" + cibw-test-command: "pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: AWSLAMBDARIC_VERSION: ${{ matrix.version }} - steps: - - name: Checkout awslambdaric v${{ env.AWSLAMBDARIC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: aws/aws-lambda-python-runtime-interface-client - ref: ${{ env.AWSLAMBDARIC_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch awslambdaric source - run: git apply python-wheels/patches/awslambdaric/${{ env.AWSLAMBDARIC_VERSION }}/00*.patch - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pytest parameterized - # tests/ is a package, so pytest's rootdir insertion would otherwise - # shadow the installed wheel with the checkout's own awslambdaric/ - # source directory (gotcha 25) - stage just the tests into an empty - # cwd and reference them relative to it. - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: pytest -v tests + name: awslambdaric-${{ env.AWSLAMBDARIC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension run: | @@ -99,15 +109,9 @@ jobs: assert any(n.startswith("runtime_client.") for n in sos), sos EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: awslambdaric-${{ env.AWSLAMBDARIC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish awslambdaric ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-base2048.yml b/.github/workflows/build-base2048.yml index fafb87a6f505..875929c9edae 100644 --- a/.github/workflows/build-base2048.yml +++ b/.github/workflows/build-base2048.yml @@ -53,52 +53,52 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build base2048 ${{ matrix.version }} cp37-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "base2048" + version: "${{ matrix.version }}" + repository: "ionite34/base2048" + ref: "v${{ matrix.version }}" + artifact-tag: "cp37-abi3-manylinux_riscv64" + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + # pyo3's abi3-py37 feature is on unconditionally (Cargo.toml), so + # one abi3 wheel serves every interpreter in our matrix; pyo3 + # 0.17.1 predates PEP 703 entirely, so there is no free-threaded + # (cp314t) job. + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # base2048 ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # pyproject.toml pins maturin>=0.13,<0.14 (2022), which has no + # riscv64 wheel on PyPI and fails to build from sdist (its own + # bootstrap needs setuptools, which Python 3.12+ no longer seeds + # into a fresh build-isolation venv). A current maturin builds + # this tree unmodified, so install one and skip isolation to + # bypass the pin. + cibw-before-build: "pip install maturin" + cibw-build-frontend: "pip; args: --no-build-isolation" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import base2048; assert base2048.base2048.__file__.endswith('.abi3.so'), base2048.base2048.__file__\" && python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: BASE2048_VERSION: ${{ matrix.version }} - steps: - - name: Checkout base2048 v${{ env.BASE2048_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ionite34/base2048 - ref: v${{ env.BASE2048_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - # pyo3's abi3-py37 feature is on unconditionally (Cargo.toml), so - # one abi3 wheel serves every interpreter in our matrix; pyo3 - # 0.17.1 predates PEP 703 entirely, so there is no free-threaded - # (cp314t) job. - CIBW_BUILD: >- - cp312-manylinux_riscv64 cp313-manylinux_riscv64 - cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # base2048 ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - # pyproject.toml pins maturin>=0.13,<0.14 (2022), which has no - # riscv64 wheel on PyPI and fails to build from sdist (its own - # bootstrap needs setuptools, which Python 3.12+ no longer seeds - # into a fresh build-isolation venv). A current maturin builds - # this tree unmodified, so install one and skip isolation to - # bypass the pin. - CIBW_BEFORE_BUILD: pip install maturin - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import base2048; assert base2048.base2048.__file__.endswith('.abi3.so'), base2048.base2048.__file__" && - python -m pytest -v tests + name: base2048-${{ env.BASE2048_VERSION }}-cp37-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the licence made it into the wheel run: | @@ -110,15 +110,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: base2048-${{ env.BASE2048_VERSION }}-cp37-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish base2048 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-basedpl.yml b/.github/workflows/build-basedpl.yml index a5767faf0891..3b8c2f4b6598 100644 --- a/.github/workflows/build-basedpl.yml +++ b/.github/workflows/build-basedpl.yml @@ -73,10 +73,7 @@ jobs: cargo update --manifest-path {project}/Cargo.toml -p rustymath-buffer --precise 0.1.53 && cargo update --manifest-path {project}/Cargo.toml -p rustymath --precise 0.1.53 # numpy (a test requirement) has a riscv64 wheel only on our registry. - cibw-environment-linux: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" PIP_ONLY_BINARY=numpy" # tests/conftest.py imports fastws.cargo.timing_lock, which fastws-cli 0.0.33 # removed; 0.0.32 was the latest release when v0.1.82 was tagged. cibw-test-requires: pytest numpy fastws-cli==0.0.32 diff --git a/.github/workflows/build-basemap.yml b/.github/workflows/build-basemap.yml index 09d1c338df3a..d5fed953f525 100644 --- a/.github/workflows/build-basemap.yml +++ b/.github/workflows/build-basemap.yml @@ -50,55 +50,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build basemap ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "basemap" + version: "${{ matrix.version }}" + repository: "matplotlib/basemap" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all: "python {project}/.github/workflows/run_before_all.py" + # build-backend is setuptools.build_meta (pyproject.toml); with + # --no-build-isolation pip never creates an isolated env to pull it, so it + # must be preinstalled here, same as cython/numpy (CLAUDE.md gotcha 23's + # preinstall shape) -- otherwise: BackendUnavailable: Cannot import + # 'setuptools.build_meta'. + cibw-before-build: "pip install cython setuptools wheel \"numpy>=2.0,<2.4\"" + cibw-build-frontend: "pip; args: --no-build-isolation" + # GEOS 3.6.5's cmake_minimum_required is below the image's CMake 4 floor, and + # run_before_all.py's cmake call takes no extra flags (gotcha 257). + cibw-environment-linux: "CMAKE_POLICY_VERSION_MINIMUM=3.5 GEOS_VERSION=3.6.5 GEOS_DIR=/project/extern GEOS_NJOBS=4 LD_LIBRARY_PATH=/project/extern/lib PIP_PREFER_BINARY=1 PYTHONUNBUFFERED=1" + cibw-test-extras: "test" + # basemap_data_hires (~90MB) is only needed for the "h"/"f" resolutions, which + # no test in test/ exercises; skip it to save download time on every job. + cibw-before-test: "pip install basemap_data" + cibw-test-environment: "PIP_ONLY_BINARY=matplotlib,pyproj" + cibw-test-command: "python -m pytest {project}/test" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: BASEMAP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout basemap v${{ env.BASEMAP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: matplotlib/basemap - ref: v${{ env.BASEMAP_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL: python {project}/.github/workflows/run_before_all.py - # build-backend is setuptools.build_meta (pyproject.toml); with - # --no-build-isolation pip never creates an isolated env to pull it, so it - # must be preinstalled here, same as cython/numpy (CLAUDE.md gotcha 23's - # preinstall shape) -- otherwise: BackendUnavailable: Cannot import - # 'setuptools.build_meta'. - CIBW_BEFORE_BUILD: pip install cython setuptools wheel "numpy>=2.0,<2.4" - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - # GEOS 3.6.5's cmake_minimum_required is below the image's CMake 4 floor, and - # run_before_all.py's cmake call takes no extra flags (gotcha 257). - CIBW_ENVIRONMENT: >- - CMAKE_POLICY_VERSION_MINIMUM=3.5 - GEOS_VERSION=${{ env.GEOS_VERSION }} - GEOS_DIR=/project/extern - GEOS_NJOBS=4 - LD_LIBRARY_PATH=/project/extern/lib - PIP_PREFER_BINARY=1 - PYTHONUNBUFFERED=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_EXTRAS: test - # basemap_data_hires (~90MB) is only needed for the "h"/"f" resolutions, which - # no test in test/ exercises; skip it to save download time on every job. - CIBW_BEFORE_TEST: pip install basemap_data - CIBW_TEST_ENVIRONMENT: 'PIP_ONLY_BINARY=matplotlib,pyproj' - CIBW_TEST_COMMAND: python -m pytest {project}/test + name: basemap-${{ env.BASEMAP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the GEOS licence and the compiled extension made it into the wheel run: | @@ -111,15 +111,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: basemap-${{ env.BASEMAP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish basemap ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-betterproto-rust-codec.yml b/.github/workflows/build-betterproto-rust-codec.yml index 933e78699b61..dd2c65ea35c1 100644 --- a/.github/workflows/build-betterproto-rust-codec.yml +++ b/.github/workflows/build-betterproto-rust-codec.yml @@ -49,6 +49,64 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build betterproto-rust-codec ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # pyo3's abi3-py37 feature is on unconditionally (Cargo.toml), so + # one abi3 wheel serves every interpreter in our matrix; there is + # no free-threaded (cp314t) leg -- pyo3 0.21.0 predates PEP 703. + - tag: cp312-abi3 + # Built on cp312 -- the oldest interpreter in our matrix -- and + # re-tested on the newer ones via find_compatible_wheel. + build: >- + cp312-manylinux_riscv64 cp313-manylinux_riscv64 + cp314-manylinux_riscv64 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "betterproto-rust-codec" + version: "${{ matrix.version }}" + repository: "124C41p/betterproto-rust-codec" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + # musllinux is dropped: upstream itself never builds a musllinux + # wheel for any architecture (plain `manylinux: auto`). + cibw-build: "${{ matrix.build }}" + # Ships no [tool.cibuildwheel], so the Rust toolchain its maturin + # backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # No test suite upstream; exercise the compiled codec the way + # betterproto itself does (betterproto.Message.parse/__bytes__ is + # monkey-patched onto these two functions when this package is + # importable), round-tripping a hand-written message. + cibw-test-requires: "betterproto==2.0.0b7" + cibw-test-command: |- + python3 - <<'PYEOF' + from dataclasses import dataclass + import betterproto + import betterproto_rust_codec + + @dataclass + class Greeting(betterproto.Message): + name: str = betterproto.string_field(1) + message: str = betterproto.string_field(2) + + g = Greeting(name="riscv64", message="hello") + data = betterproto_rust_codec.serialize(g) + g2 = Greeting() + betterproto_rust_codec.deserialize(g2, data) + assert g2 == g, (g2, g) + assert bytes(g) == data, "betterproto's own monkey-patch disagrees with the codec" + assert betterproto_rust_codec.betterproto_rust_codec.__file__.endswith(".so"), \ + betterproto_rust_codec.betterproto_rust_codec.__file__ + print("betterproto-rust-codec OK") + PYEOF + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: @@ -65,58 +123,14 @@ jobs: build: >- cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - env: BETTERPROTO_RUST_CODEC_VERSION: ${{ matrix.version }} - steps: - - name: Checkout betterproto-rust-codec v${{ env.BETTERPROTO_RUST_CODEC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: 124C41p/betterproto-rust-codec - ref: v${{ env.BETTERPROTO_RUST_CODEC_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # musllinux is dropped: upstream itself never builds a musllinux - # wheel for any architecture (plain `manylinux: auto`). - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Ships no [tool.cibuildwheel], so the Rust toolchain its maturin - # backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - # No test suite upstream; exercise the compiled codec the way - # betterproto itself does (betterproto.Message.parse/__bytes__ is - # monkey-patched onto these two functions when this package is - # importable), round-tripping a hand-written message. - CIBW_TEST_REQUIRES: betterproto==2.0.0b7 - CIBW_TEST_COMMAND: | - python3 - <<'PYEOF' - from dataclasses import dataclass - import betterproto - import betterproto_rust_codec - - @dataclass - class Greeting(betterproto.Message): - name: str = betterproto.string_field(1) - message: str = betterproto.string_field(2) - - g = Greeting(name="riscv64", message="hello") - data = betterproto_rust_codec.serialize(g) - g2 = Greeting() - betterproto_rust_codec.deserialize(g2, data) - assert g2 == g, (g2, g) - assert bytes(g) == data, "betterproto's own monkey-patch disagrees with the codec" - assert betterproto_rust_codec.betterproto_rust_codec.__file__.endswith(".so"), \ - betterproto_rust_codec.betterproto_rust_codec.__file__ - print("betterproto-rust-codec OK") - PYEOF + name: betterproto-rust-codec-${{ env.BETTERPROTO_RUST_CODEC_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check the extension and licence made it into the wheel run: | @@ -129,15 +143,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: betterproto-rust-codec-${{ env.BETTERPROTO_RUST_CODEC_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish betterproto-rust-codec ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-biopython.yml b/.github/workflows/build-biopython.yml index 1f959d591d4d..e7bcb11fa4ab 100644 --- a/.github/workflows/build-biopython.yml +++ b/.github/workflows/build-biopython.yml @@ -49,48 +49,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build biopython ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "biopython" + version: "${{ matrix.version }}" + repository: "biopython/biopython" + ref: '' + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + echo "BIOPYTHON_TAG=biopython-${BIOPYTHON_VERSION//./}" >> "$GITHUB_ENV" + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + git fetch -q --no-tags origin "${BIOPYTHON_TAG}" + git checkout -q --detach FETCH_HEAD + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # run_tests.py enumerates doctest modules by walking `Tests/..` and some + # tests open data through `../Bio` and `../Doc`, so reproduce upstream's + # checkout layout around Tests/. Nothing here shadows the wheel: every + # command runs from Tests/, which is what lands on sys.path[0]. + cibw-test-sources: "Tests Bio BioSQL Doc" + # Upstream's macOS/Windows test jobs install only numpy; setuptools is + # imported by run_tests.py itself. + cibw-test-requires: "numpy setuptools" + cibw-test-command: "cd Tests && python -c \"import importlib; [importlib.import_module(m) for m in ('Bio.Align._aligncore', 'Bio.Align._alignmentcounts', 'Bio.Align._codonaligner', 'Bio.Align._pairwisealigner', 'Bio.Align.substitution_matrices._arraycore', 'Bio.cpairwise2', 'Bio.Nexus.cnexus', 'Bio.motifs._pwm', 'Bio.Cluster._cluster', 'Bio.PDB.ccealign', 'Bio.PDB.kdtrees', 'Bio.PDB._bcif_helper', 'Bio.SeqIO._twoBitIO')]\" && python run_tests.py --offline" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: BIOPYTHON_VERSION: ${{ matrix.version }} - steps: - # Upstream tags releases as `biopython-`. - - name: Resolve upstream tag - run: echo "BIOPYTHON_TAG=biopython-${BIOPYTHON_VERSION//./}" >> "$GITHUB_ENV" - - - name: Checkout biopython ${{ env.BIOPYTHON_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: biopython/biopython - ref: ${{ env.BIOPYTHON_TAG }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # run_tests.py enumerates doctest modules by walking `Tests/..` and some - # tests open data through `../Bio` and `../Doc`, so reproduce upstream's - # checkout layout around Tests/. Nothing here shadows the wheel: every - # command runs from Tests/, which is what lands on sys.path[0]. - CIBW_TEST_SOURCES: Tests Bio BioSQL Doc - # Upstream's macOS/Windows test jobs install only numpy; setuptools is - # imported by run_tests.py itself. - CIBW_TEST_REQUIRES: numpy setuptools - CIBW_TEST_COMMAND: >- - cd Tests && - python -c "import importlib; [importlib.import_module(m) for m in ('Bio.Align._aligncore', 'Bio.Align._alignmentcounts', 'Bio.Align._codonaligner', 'Bio.Align._pairwisealigner', 'Bio.Align.substitution_matrices._arraycore', 'Bio.cpairwise2', 'Bio.Nexus.cnexus', 'Bio.motifs._pwm', 'Bio.Cluster._cluster', 'Bio.PDB.ccealign', 'Bio.PDB.kdtrees', 'Bio.PDB._bcif_helper', 'Bio.SeqIO._twoBitIO')]" && - python run_tests.py --offline + name: biopython-${{ env.BIOPYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extensions made it into the wheel run: | @@ -102,15 +111,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: biopython-${{ env.BIOPYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish biopython ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-biotraj.yml b/.github/workflows/build-biotraj.yml index df612220b282..4d633cf704c0 100644 --- a/.github/workflows/build-biotraj.yml +++ b/.github/workflows/build-biotraj.yml @@ -63,9 +63,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # numpy/scipy: pypi.riseproject.dev trails PyPI's newest patch release for # some interpreters, which would otherwise resolve to a sdist build. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy" cibw-test-requires: ${{ case(matrix.python == 'cp310', 'pytest psutil', matrix.python == 'cp311', 'pytest psutil', matrix.python == 'cp312', 'pytest psutil netcdf4>=1.7.1', matrix.python == 'cp313', 'pytest psutil netcdf4>=1.7.1', '') }} cibw-test-command: pytest {project} timeout-minutes: 60 diff --git a/.github/workflows/build-biscuit-python.yml b/.github/workflows/build-biscuit-python.yml index c1dd4e308a2e..3067e25ab3fe 100644 --- a/.github/workflows/build-biscuit-python.yml +++ b/.github/workflows/build-biscuit-python.yml @@ -60,9 +60,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-before-all-linux: >- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - cibw-environment-linux: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" cibw-test-requires: pytest sphinx cibw-test-sources: biscuit_test.py docs cibw-test-command: >- diff --git a/.github/workflows/build-bitarray-hardbyte.yml b/.github/workflows/build-bitarray-hardbyte.yml index 30b42e0aa84e..052c1da89caf 100644 --- a/.github/workflows/build-bitarray-hardbyte.yml +++ b/.github/workflows/build-bitarray-hardbyte.yml @@ -60,41 +60,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build bitarray-hardbyte ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "bitarray-hardbyte" + version: "${{ matrix.version }}" + repository: "ilanschnell/bitarray" + ref: "50b62ede70b9ef5f553e1463bb912d2bc45a174d" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/bitarray-hardbyte/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-command: "python -c \"import bitarray; assert bitarray.test().wasSuccessful()\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: BITARRAY_HARDBYTE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout bitarray-hardbyte ${{ env.BITARRAY_HARDBYTE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ilanschnell/bitarray - ref: ${{ env.BITARRAY_HARDBYTE_REF }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch bitarray-hardbyte source - run: git apply python-wheels/patches/bitarray-hardbyte/${{ env.BITARRAY_HARDBYTE_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_COMMAND: python -c "import bitarray; assert bitarray.test().wasSuccessful()" + name: bitarray-hardbyte-${{ env.BITARRAY_HARDBYTE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extensions and LICENSE made it into the wheel run: | @@ -109,15 +119,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: bitarray-hardbyte-${{ env.BITARRAY_HARDBYTE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish bitarray-hardbyte ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-bitarray.yml b/.github/workflows/build-bitarray.yml index 85f6ec20c5c1..e47b85875334 100644 --- a/.github/workflows/build-bitarray.yml +++ b/.github/workflows/build-bitarray.yml @@ -49,31 +49,37 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build bitarray ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "bitarray" + version: "${{ matrix.version }}" + repository: "ilanschnell/bitarray" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-command: "python -c \"import bitarray; assert bitarray.test().wasSuccessful()\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: BITARRAY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout bitarray ${{ env.BITARRAY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ilanschnell/bitarray - ref: ${{ env.BITARRAY_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_COMMAND: python -c "import bitarray; assert bitarray.test().wasSuccessful()" + name: bitarray-${{ env.BITARRAY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extensions made it into the wheel run: | @@ -86,15 +92,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: bitarray-${{ env.BITARRAY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish bitarray ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-bleak-esphome.yml b/.github/workflows/build-bleak-esphome.yml index f1f021bd971c..7fd6268ec8ee 100644 --- a/.github/workflows/build-bleak-esphome.yml +++ b/.github/workflows/build-bleak-esphome.yml @@ -60,10 +60,7 @@ jobs: # cryptography, a hard runtime dependency, has no musllinux riscv64 wheel. cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # REQUIRE_CYTHON must reach the build container; only-binary keeps pip on our compiled deps. - cibw-environment: >- - REQUIRE_CYTHON=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=aioesphomeapi,bluetooth-data-tools,cffi,cryptography,habluetooth,lru-dict,zeroconf + cibw-environment-linux: "REQUIRE_CYTHON=1 PIP_ONLY_BINARY=aioesphomeapi,bluetooth-data-tools,cffi,cryptography,habluetooth,lru-dict,zeroconf" # Upstream's pytest ini is coverage-only and its pythonpath would shadow the wheel with src/. cibw-test-sources: tests # The dev group's zeroconf<0.151.0 pin has no riscv64 wheel; aioesphomeapi pulls zeroconf in. diff --git a/.github/workflows/build-blis.yml b/.github/workflows/build-blis.yml index 0a891e6d3f38..bd630f65985b 100644 --- a/.github/workflows/build-blis.yml +++ b/.github/workflows/build-blis.yml @@ -48,45 +48,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build blis ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "blis" + version: "${{ matrix.version }}" + repository: "explosion/cython-blis" + ref: "release-v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py's get_arch_name() already picks the portable `generic` BLIS + # config for any Linux machine that is not x86_64/aarch64/ppc64le. + # Upstream tests in a separate workflow (tests.yml), which installs the + # wheel, deletes the source tree and runs the suite. Up to 1.3.3 the suite + # shipped inside the wheel (`pytest --pyargs blis`); from 1.3.4 it lives in + # a top-level tests/ that [tool.cibuildwheel] test-sources copies next to + # the installed wheel, so run pytest on it (pyproject's testpaths and + # filterwarnings = error apply) and keep the old form for older versions. + cibw-test-requires: "pytest hypothesis>=4.0.0,<7.0.0" + cibw-test-command: "if [ -n \"$(ls -A tests 2>/dev/null)\" ]; then python -m pytest; else python -m pytest --pyargs blis -Werror; fi" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: BLIS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cython-blis ${{ env.BLIS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: explosion/cython-blis - ref: release-v${{ env.BLIS_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py's get_arch_name() already picks the portable `generic` BLIS - # config for any Linux machine that is not x86_64/aarch64/ppc64le. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream tests in a separate workflow (tests.yml), which installs the - # wheel, deletes the source tree and runs the suite. Up to 1.3.3 the suite - # shipped inside the wheel (`pytest --pyargs blis`); from 1.3.4 it lives in - # a top-level tests/ that [tool.cibuildwheel] test-sources copies next to - # the installed wheel, so run pytest on it (pyproject's testpaths and - # filterwarnings = error apply) and keep the old form for older versions. - CIBW_TEST_REQUIRES: pytest hypothesis>=4.0.0,<7.0.0 - CIBW_TEST_COMMAND: >- - if [ -n "$(ls -A tests 2>/dev/null)" ]; then - python -m pytest; - else python -m pytest --pyargs blis -Werror; fi + name: blis-${{ env.BLIS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the compiled extensions made it into the wheel run: | @@ -99,15 +102,9 @@ jobs: print(whl, sorted(got)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: blis-${{ env.BLIS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish blis ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-blosc.yml b/.github/workflows/build-blosc.yml index 37462b89c99b..82895864e54d 100644 --- a/.github/workflows/build-blosc.yml +++ b/.github/workflows/build-blosc.yml @@ -51,49 +51,59 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build blosc ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "blosc" + version: "${{ matrix.version }}" + repository: "blosc/python-blosc" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 45 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/blosc/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # C-Blosc's own CMakeLists.txt gates SSE2/AVX2 on a recognized x86 + # CMAKE_SYSTEM_PROCESSOR and warns-not-fails otherwise, so riscv64 + # falls straight back to its portable shuffle-generic.c path -- no + # patch needed for the SIMD codec gating itself. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "numpy" + cibw-test-command: "python -m blosc.test" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 45 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: BLOSC_VERSION: ${{ matrix.version }} - steps: - - name: Checkout python-blosc v${{ env.BLOSC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: blosc/python-blosc - ref: v${{ env.BLOSC_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch python-blosc source - run: git apply python-wheels/patches/blosc/${{ env.BLOSC_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # C-Blosc's own CMakeLists.txt gates SSE2/AVX2 on a recognized x86 - # CMAKE_SYSTEM_PROCESSOR and warns-not-fails otherwise, so riscv64 - # falls straight back to its portable shuffle-generic.c path -- no - # patch needed for the SIMD codec gating itself. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: numpy - CIBW_TEST_COMMAND: python -m blosc.test + name: blosc-${{ env.BLOSC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -117,15 +127,9 @@ jobs: }, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: blosc-${{ env.BLOSC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish blosc ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-blosc2.yml b/.github/workflows/build-blosc2.yml index 8d136b3faace..a1736a48e7c9 100644 --- a/.github/workflows/build-blosc2.yml +++ b/.github/workflows/build-blosc2.yml @@ -49,6 +49,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build blosc2 ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # scikit-build-core builds a single cp311-abi3 wheel (pyproject.toml's + # wheel.py-api) covering CPython 3.11+; built on cp311, the oldest + # interpreter the tag claims, and re-tested on the newer ones. Only + # cp314t is built free-threaded: numpy has no riscv64 wheel yet for + # cp315/cp315t anywhere (our registry or public PyPI), which upstream's + # own cp315t leg would otherwise need building from source. + - tag: cp311-abi3 + build: >- + cp311-manylinux_riscv64 cp312-manylinux_riscv64 + cp313-manylinux_riscv64 cp314-manylinux_riscv64 + timeout: 360 + - tag: cp314t + build: cp314t-manylinux_riscv64 + timeout: 120 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "blosc2" + version: "${{ matrix.version }}" + repository: "Blosc/python-blosc2" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: "${{ matrix.timeout }}" + cibw-build: "${{ matrix.build }}" + # numpy/ndindex/numexpr have riscv64 wheels only on our registry; + # msgpack, pydantic, httpx, rich and threadpoolctl already have them + # (or a pure py3-none-any wheel) on public PyPI. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + # Mirrors the subset upstream's own CI runs against both the sdist + # build and the built abi3 wheel (cibuildwheels.yml's sdist-test and + # test_abi3_matrix steps). + cibw-test-command: "python -m pytest {project}/tests/test_open.py {project}/tests/test_vlmeta.py {project}/tests/ndarray/test_evaluate.py" + # The extensions declare no Py_mod_gil slot, so cp314t re-enables the + # GIL on import and pytest.ini's `filterwarnings = error` (picked up + # from {project}) turns that into a collection error (gotcha 127). + cibw-test-environment: "PYTHON_GIL=1" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: ${{ matrix.timeout }} strategy: @@ -70,41 +117,14 @@ jobs: - tag: cp314t build: cp314t-manylinux_riscv64 timeout: 120 - env: BLOSC2_VERSION: ${{ matrix.version }} - steps: - - name: Checkout python-blosc2 v${{ env.BLOSC2_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Blosc/python-blosc2 - ref: v${{ env.BLOSC2_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy/ndindex/numexpr have riscv64 wheels only on our registry; - # msgpack, pydantic, httpx, rich and threadpoolctl already have them - # (or a pure py3-none-any wheel) on public PyPI. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - # Mirrors the subset upstream's own CI runs against both the sdist - # build and the built abi3 wheel (cibuildwheels.yml's sdist-test and - # test_abi3_matrix steps). - CIBW_TEST_COMMAND: >- - python -m pytest {project}/tests/test_open.py {project}/tests/test_vlmeta.py - {project}/tests/ndarray/test_evaluate.py - # The extensions declare no Py_mod_gil slot, so cp314t re-enables the - # GIL on import and pytest.ini's `filterwarnings = error` (picked up - # from {project}) turns that into a collection error (gotcha 127). - CIBW_TEST_ENVIRONMENT: PYTHON_GIL=1 + name: blosc2-${{ env.BLOSC2_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents if: ${{ matrix.tag == 'cp311-abi3' }} @@ -124,15 +144,9 @@ jobs: "miniexpr/THIRD_PARTY_NOTICES.md"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: blosc2-${{ env.BLOSC2_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish blosc2 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-bluetooth-data-tools.yml b/.github/workflows/build-bluetooth-data-tools.yml index 77860fbf05d7..8c15c1379edf 100644 --- a/.github/workflows/build-bluetooth-data-tools.yml +++ b/.github/workflows/build-bluetooth-data-tools.yml @@ -68,12 +68,7 @@ jobs: # to a pure-Python wheel under a riscv64 tag. # only-binary keeps pip off PyPI's newest cryptography, which has no # riscv64 wheel, so it resolves from the registry. - cibw-environment: >- - REQUIRE_CYTHON=1 - PIP_CONSTRAINT=/cython-constraint.txt - PIP_BUILD_CONSTRAINT=/cython-constraint.txt - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=cryptography + cibw-environment-linux: "REQUIRE_CYTHON=1 PIP_CONSTRAINT=/cython-constraint.txt PIP_BUILD_CONSTRAINT=/cython-constraint.txt PIP_ONLY_BINARY=cryptography" cibw-test-sources: tests cibw-test-requires: 'pytest>=9.0,<10 pytest-codspeed>=5.0.3,<6.0.0' cibw-test-command: >- diff --git a/.github/workflows/build-blurhash-python.yml b/.github/workflows/build-blurhash-python.yml index 3c158dacc991..bc66dfbe97f2 100644 --- a/.github/workflows/build-blurhash-python.yml +++ b/.github/workflows/build-blurhash-python.yml @@ -63,9 +63,7 @@ jobs: # build against them directly instead. cibw-build-frontend: "pip; args: --no-build-isolation" cibw-before-build: pip install cffi setuptools setuptools-scm wheel - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BLURHASH_PYTHON=${{ matrix.version }} + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BLURHASH_PYTHON=${{ matrix.version }}" cibw-test-extras: testing # test_invalid_image opens README.md as a non-image file; tests/ # loads its fixture PNGs by relative path, matching upstream's own diff --git a/.github/workflows/build-bottleneck.yml b/.github/workflows/build-bottleneck.yml index d495d222537d..b96ff4de3583 100644 --- a/.github/workflows/build-bottleneck.yml +++ b/.github/workflows/build-bottleneck.yml @@ -48,50 +48,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build bottleneck ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "bottleneck" + version: "${{ matrix.version }}" + repository: "pydata/bottleneck" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-fetch-depth: 0 + pre-build: |- + cp LICENSES/NUMPY_LICENSE LICENSE.numpy + cp LICENSES/SCIPY_LICENSE LICENSE.scipy + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is both a build and a runtime requirement, and only our registry + # has it for riscv64; only-binary keeps a newer PyPI release from winning + # the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest" + # pyproject.toml carries the pytest config upstream runs with. + cibw-test-sources: "pyproject.toml" + cibw-test-command: "python -m pytest --pyargs bottleneck" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: BOTTLENECK_VERSION: ${{ matrix.version }} - steps: - - name: Checkout bottleneck v${{ env.BOTTLENECK_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pydata/bottleneck - ref: v${{ env.BOTTLENECK_VERSION }} - fetch-depth: 0 # versioneer derives the version from `git describe` - persist-credentials: false - - # The wheel compiles code taken from NumPy and ships a SciPy-derived module, - # but only bottleneck's own LICENSE reaches it; the root is where setuptools - # looks for licence files. - - name: Stage licences of incorporated projects - run: | - cp LICENSES/NUMPY_LICENSE LICENSE.numpy - cp LICENSES/SCIPY_LICENSE LICENSE.scipy - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is both a build and a runtime requirement, and only our registry - # has it for riscv64; only-binary keeps a newer PyPI release from winning - # the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest - # pyproject.toml carries the pytest config upstream runs with. - CIBW_TEST_SOURCES: pyproject.toml - CIBW_TEST_COMMAND: python -m pytest --pyargs bottleneck + name: bottleneck-${{ env.BOTTLENECK_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -104,16 +110,9 @@ jobs: assert {"LICENSE", "LICENSE.numpy", "LICENSE.scipy"} <= licences, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: bottleneck-${{ env.BOTTLENECK_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish bottleneck ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-btrees.yml b/.github/workflows/build-btrees.yml index 6296e04aacca..4d0fabf69210 100644 --- a/.github/workflows/build-btrees.yml +++ b/.github/workflows/build-btrees.yml @@ -59,7 +59,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # persistent and zope.interface, needed to build and to import the # extension, have no riscv64 wheel on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test cibw-test-environment: ZOPE_INTERFACE_STRICT_IRO=1 # Upstream's two test steps (with and without the C extensions). diff --git a/.github/workflows/build-burner-redis.yml b/.github/workflows/build-burner-redis.yml index b99130ab3db2..ccb6894dbe1d 100644 --- a/.github/workflows/build-burner-redis.yml +++ b/.github/workflows/build-burner-redis.yml @@ -54,64 +54,65 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build burner-redis ${{ matrix.version }} cp310-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "burner-redis" + version: "${{ matrix.version }}" + repository: "prefectlabs/burner-redis" + ref: "v${{ matrix.version }}" + artifact-tag: "cp310-abi3-manylinux_riscv64" + timeout-minutes: 240 + pre-build: |- + cp THIRDPARTY.yml NOTICE.THIRDPARTY.yml + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # Cargo.toml pins pyo3 to `abi3-py310`, so maturin tags every build + # `cp310-abi3` whatever interpreter runs it. Selecting the five + # interpreters therefore compiles the Rust ONCE (on cp310, the oldest the + # tag claims) and then find_compatible_wheel reuses that wheel for + # cp311-cp314 while still running the test phase on each. cp314t is + # excluded: pyo3's abi3 mode cannot target free-threaded CPython, which is + # also why upstream publishes no cp3??t wheel. + cibw-build: "cp310-* cp311-* cp312-* cp313-* cp314-*" + # Upstream also ships musllinux wheels, but rustup.rs publishes no + # riscv64gc-unknown-linux-musl *host* toolchain (only rust-std, a cross + # target), so the musl container has no cargo to build with. + cibw-skip: "*-musllinux_*" + # burner-redis ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. The crate is + # edition 2024 with no nightly features, so stable satisfies it. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # Upstream's `.[dev]` extra, minus maturin (cibuildwheel drives the build). + cibw-test-requires: "pytest pytest-asyncio redis" + # pyproject.toml carries [tool.pytest.ini_options] (asyncio_mode = auto, + # the `integration` marker and the `-m 'not integration'` default) that the + # suite cannot run without. Staging only these two paths leaves the + # importable `python/burner_redis` out of the test cwd, so `import + # burner_redis` can only resolve to the installed wheel. + cibw-test-sources: "tests pyproject.toml" + cibw-test-command: "python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: BURNER_REDIS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout burner-redis v${{ env.BURNER_REDIS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: prefectlabs/burner-redis - ref: v${{ env.BURNER_REDIS_VERSION }} - persist-credentials: false - - # The wheel statically links vendored Lua 5.4 and 60+ MIT/Apache-2.0 crates - # whose notices upstream only ships in the sdist. maturin's default - # licence-file globs (LICEN[CS]E*, COPYING*, NOTICE*, AUTHORS*) are rooted at - # the pyproject directory, so copying the inventory to a NOTICE* name is - # enough to land it in dist-info/licenses/ with no packaging change. - - name: Ship the third-party licence inventory in the wheel - run: cp THIRDPARTY.yml NOTICE.THIRDPARTY.yml - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ARCHS: riscv64 - # Cargo.toml pins pyo3 to `abi3-py310`, so maturin tags every build - # `cp310-abi3` whatever interpreter runs it. Selecting the five - # interpreters therefore compiles the Rust ONCE (on cp310, the oldest the - # tag claims) and then find_compatible_wheel reuses that wheel for - # cp311-cp314 while still running the test phase on each. cp314t is - # excluded: pyo3's abi3 mode cannot target free-threaded CPython, which is - # also why upstream publishes no cp3??t wheel. - CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*" - # Upstream also ships musllinux wheels, but rustup.rs publishes no - # riscv64gc-unknown-linux-musl *host* toolchain (only rust-std, a cross - # target), so the musl container has no cargo to build with. - CIBW_SKIP: "*-musllinux_*" - # burner-redis ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. The crate is - # edition 2024 with no nightly features, so stable satisfies it. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream's `.[dev]` extra, minus maturin (cibuildwheel drives the build). - CIBW_TEST_REQUIRES: pytest pytest-asyncio redis - # pyproject.toml carries [tool.pytest.ini_options] (asyncio_mode = auto, - # the `integration` marker and the `-m 'not integration'` default) that the - # suite cannot run without. Staging only these two paths leaves the - # importable `python/burner_redis` out of the test cwd, so `import - # burner_redis` can only resolve to the installed wheel. - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_COMMAND: python -m pytest tests + name: burner-redis-${{ env.BURNER_REDIS_VERSION }}-cp310-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension module and licences made it into the wheel run: | @@ -128,15 +129,9 @@ jobs: print('OK:', sys.argv[1], sos, lic) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: burner-redis-${{ env.BURNER_REDIS_VERSION }}-cp310-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish burner-redis ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-bx-python.yml b/.github/workflows/build-bx-python.yml index fe7337bad453..be14501912ea 100644 --- a/.github/workflows/build-bx-python.yml +++ b/.github/workflows/build-bx-python.yml @@ -49,6 +49,40 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build bx-python ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: + - "cp310" + - "cp311" + - "cp312" + - "cp313" + - "cp314" + - "cp314t" + exclude: + # 0.16.0 raised requires-python to >=3.11 (0.15.x is still >=3.10), so + # cibuildwheel selects no cp310 build. Add each newer version here as it is + # declared. + - version: "0.16.0" + python: cp310 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "bx-python" + version: "${{ matrix.version }}" + repository: "bxlab/bx-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + # numpy has riscv64 wheels only on our registry; cython (a build + # requirement) has none anywhere and must compile from sdist, so + # only-binary is scoped to numpy alone (gotcha 12). + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: @@ -68,31 +102,14 @@ jobs: # declared. - version: "0.16.0" python: cp310 - env: BX_PYTHON_VERSION: ${{ matrix.version }} - steps: - - name: Checkout bx-python v${{ env.BX_PYTHON_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: bxlab/bx-python - ref: v${{ env.BX_PYTHON_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy has riscv64 wheels only on our registry; cython (a build - # requirement) has none anywhere and must compile from sdist, so - # only-binary is scoped to numpy alone (gotcha 12). - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + name: bx-python-${{ env.BX_PYTHON_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Check the C extensions made it into the wheel run: | @@ -104,15 +121,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: bx-python-${{ env.BX_PYTHON_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish bx-python ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cached-ipaddress.yml b/.github/workflows/build-cached-ipaddress.yml index eafca1ab8eb3..80d2b3ad34a5 100644 --- a/.github/workflows/build-cached-ipaddress.yml +++ b/.github/workflows/build-cached-ipaddress.yml @@ -63,9 +63,7 @@ jobs: # Upstream passes REQUIRE_CYTHON as a plain job env var, which never # reaches the Linux build container; build_ext.py otherwise falls # back to a pure-Python wheel under a riscv64 tag. - cibw-environment: >- - REQUIRE_CYTHON=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "REQUIRE_CYTHON=1" cibw-test-sources: tests cibw-test-requires: 'pytest>=7,<9' cibw-test-command: >- diff --git a/.github/workflows/build-capstone.yml b/.github/workflows/build-capstone.yml index e577c872f003..eef048a90836 100644 --- a/.github/workflows/build-capstone.yml +++ b/.github/workflows/build-capstone.yml @@ -50,6 +50,30 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build capstone ${{ matrix.version }} py3-none-${{ matrix.libc }}_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + libc: [manylinux, musllinux] + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "capstone" + version: "${{ matrix.version }}" + repository: "capstone-engine/capstone" + ref: "${{ matrix.version }}" + artifact-tag: "py3-none-${{ matrix.libc }}_riscv64" + cibw-package-dir: "bindings/python" + # setup.py ships no ext_modules (the C library is loaded via ctypes), so + # setuptools tags the wheel py3-none and one build serves every interpreter. + cibw-build: "cp312-${{ matrix.libc }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-test-sources: "bindings/python/tests" + cibw-test-command: "python bindings/python/tests/test_all.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: @@ -57,30 +81,14 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} libc: [manylinux, musllinux] - env: CAPSTONE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout capstone ${{ env.CAPSTONE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: capstone-engine/capstone - ref: ${{ env.CAPSTONE_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: bindings/python - output-dir: wheelhouse/ - # setup.py ships no ext_modules (the C library is loaded via ctypes), so - # setuptools tags the wheel py3-none and one build serves every interpreter. - only: cp312-${{ matrix.libc }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_TEST_SOURCES: bindings/python/tests - CIBW_TEST_COMMAND: python bindings/python/tests/test_all.py + name: capstone-${{ env.CAPSTONE_VERSION }}-py3-none-${{ matrix.libc }}_riscv64 + path: wheelhouse - name: Check the wheel carries libcapstone run: | @@ -93,15 +101,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: capstone-${{ env.CAPSTONE_VERSION }}-py3-none-${{ matrix.libc }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish capstone ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-capstone6pwndbg.yml b/.github/workflows/build-capstone6pwndbg.yml index 5684f24963e6..b79bcc64fac0 100644 --- a/.github/workflows/build-capstone6pwndbg.yml +++ b/.github/workflows/build-capstone6pwndbg.yml @@ -53,6 +53,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build capstone6pwndbg ${{ matrix.version }} ${{ matrix.PYTHON.TAG }}-${{ matrix.libc }}_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + libc: [manylinux, musllinux] + # setup.py forces has_ext_modules + py_limited_api=cp38 unless built + # under Py_GIL_DISABLED (no limited API there yet), matching upstream's + # own two wheel shapes per platform: one cp38-abi3 wheel (built here + # with RISE's own cp312 floor) plus one free-threaded cp314-cp314t + # wheel. + PYTHON: + - { BUILD: cp312, TAG: cp38-abi3 } + - { BUILD: cp314t, TAG: cp314-cp314t } + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "capstone6pwndbg" + version: "${{ matrix.version }}" + repository: "pwndbg/capstone6pwndbg" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.PYTHON.TAG }}-${{ matrix.libc }}_riscv64" + checkout-submodules: "recursive" + pre-build: |- + cd capstone && git apply ../python-rename.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "capstone/bindings/python" + cibw-build: "${{ matrix.PYTHON.BUILD }}-${{ matrix.libc }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # setup.py shells out to `cmake` directly; it's not a declared build dep. + cibw-before-build: "pip install cmake" + # Upstream's own bindings/python/tests does 'from capstone import *', + # the pre-rename module name, and test_compatibility_layer.py imports + # pre-v6 compat shims python-rename.patch deletes outright - neither + # runs unmodified against the renamed capstone6pwndbg module, so this + # smoke-tests the installed module directly, reusing upstream's own + # known-good x86/riscv64 test vectors (tests/test_lite.py, + # tests/test_riscv_reg_access.py). + cibw-test-command: "python3 -c \"import capstone6pwndbg as cs, capstone6pwndbg.riscv as csr; m = cs.Cs(cs.CS_ARCH_X86, cs.CS_MODE_64); i = list(m.disasm(b'\\x55\\x48\\x8b\\x05\\xb8\\x13\\x00\\x00', 0x1000)); assert len(i) == 2 and i[0].mnemonic == 'push', i; m = cs.Cs(cs.CS_ARCH_RISCV, cs.CS_MODE_RISCV64); m.detail = True; i = list(m.disasm(b'\\x13\\x85\\xa5\\x00', 0)); assert len(i) == 1 and i[0].mnemonic == 'addi', i; r, w = i[0].regs_access(); assert csr.RISCV_REG_X11 in r and csr.RISCV_REG_X10 in w, (r, w); print('capstone6pwndbg smoke test ok')\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: @@ -68,51 +114,14 @@ jobs: PYTHON: - { BUILD: cp312, TAG: cp38-abi3 } - { BUILD: cp314t, TAG: cp314-cp314t } - env: CAPSTONE6PWNDBG_VERSION: ${{ matrix.version }} - steps: - - name: Checkout capstone6pwndbg v${{ env.CAPSTONE6PWNDBG_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pwndbg/capstone6pwndbg - ref: v${{ env.CAPSTONE6PWNDBG_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Apply python-rename.patch to the capstone submodule - run: cd capstone && git apply ../python-rename.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: capstone/bindings/python - output-dir: wheelhouse/ - only: ${{ matrix.PYTHON.BUILD }}-${{ matrix.libc }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # setup.py shells out to `cmake` directly; it's not a declared build dep. - CIBW_BEFORE_BUILD: pip install cmake - # Upstream's own bindings/python/tests does 'from capstone import *', - # the pre-rename module name, and test_compatibility_layer.py imports - # pre-v6 compat shims python-rename.patch deletes outright - neither - # runs unmodified against the renamed capstone6pwndbg module, so this - # smoke-tests the installed module directly, reusing upstream's own - # known-good x86/riscv64 test vectors (tests/test_lite.py, - # tests/test_riscv_reg_access.py). - CIBW_TEST_COMMAND: >- - python3 -c "import capstone6pwndbg as cs, capstone6pwndbg.riscv as csr; - m = cs.Cs(cs.CS_ARCH_X86, cs.CS_MODE_64); - i = list(m.disasm(b'\x55\x48\x8b\x05\xb8\x13\x00\x00', 0x1000)); - assert len(i) == 2 and i[0].mnemonic == 'push', i; - m = cs.Cs(cs.CS_ARCH_RISCV, cs.CS_MODE_RISCV64); - m.detail = True; - i = list(m.disasm(b'\x13\x85\xa5\x00', 0)); - assert len(i) == 1 and i[0].mnemonic == 'addi', i; - r, w = i[0].regs_access(); - assert csr.RISCV_REG_X11 in r and csr.RISCV_REG_X10 in w, (r, w); - print('capstone6pwndbg smoke test ok')" + name: capstone6pwndbg-${{ env.CAPSTONE6PWNDBG_VERSION }}-${{ matrix.PYTHON.TAG }}-${{ matrix.libc }}_riscv64 + path: wheelhouse - name: Check the wheel carries libcapstone run: | @@ -125,15 +134,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: capstone6pwndbg-${{ env.CAPSTONE6PWNDBG_VERSION }}-${{ matrix.PYTHON.TAG }}-${{ matrix.libc }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish capstone6pwndbg ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cartopy.yml b/.github/workflows/build-cartopy.yml index bcb2fdc277c4..240e0996c8e1 100644 --- a/.github/workflows/build-cartopy.yml +++ b/.github/workflows/build-cartopy.yml @@ -49,58 +49,60 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cartopy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cartopy" + version: "${{ matrix.version }}" + repository: "SciTools/cartopy" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a build dependency; matplotlib/shapely/pyproj are runtime + # dependencies and scipy a test-only one, all pulled in for the test install. + # Only our registry has riscv64 wheels for them, and PIP_ONLY_BINARY keeps a + # newer PyPI release from winning the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,matplotlib,shapely,pyproj,scipy" + # Building from a checkout (no PKG-INFO) makes setup.py cythonize trace.pyx + # fresh, unlike a PyPI sdist build which ships a pre-cythonized trace.cpp and + # skips this entirely. Cython 3.3.0 (unbounded in pyproject.toml's + # build-system requires) regressed its own generated std::list-to-Python-list + # conversion for trace.pyx's C++ iteration, so build isolation must not be + # allowed to pick it. + cibw-build-frontend: "pip; args: --no-build-isolation" + cibw-before-build: "pip install \"cython<3.3\" numpy setuptools setuptools_scm wheel" + cibw-test-requires: "pytest pytest-mpl pytest-xdist scipy" + # Mirrors upstream's own hermetic job (ci-testing.yml's "No Network Tests" + # step: `pytest ... -m "not natural_earth and not network"`), which also + # runs without --mpl; image-comparison baselines are font-rendering + # sensitive and not something upstream itself trusts cross-platform. Tests + # are excluded from the wheel (packages.find excludes cartopy.tests), so + # copy them out of the checkout first, as pyproj's workflow does. + cibw-test-command: "python -c \"import cartopy; import cartopy.crs as ccrs; import shapely.geometry as sgeom; r = ccrs.Robinson().project_geometry(sgeom.LineString([(-10, 10), (10, 50)]), ccrs.PlateCarree()); assert not r.is_empty; print('cartopy.trace OK')\" && cp -r {package}/lib/cartopy/tests cartopy_tests && python -m pytest cartopy_tests -rfEsX -n 4 -m \"not natural_earth and not network\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CARTOPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cartopy v${{ env.CARTOPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: SciTools/cartopy - ref: v${{ env.CARTOPY_VERSION }} - fetch-depth: 0 # setuptools_scm derives the version from the tag history - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build dependency; matplotlib/shapely/pyproj are runtime - # dependencies and scipy a test-only one, all pulled in for the test install. - # Only our registry has riscv64 wheels for them, and PIP_ONLY_BINARY keeps a - # newer PyPI release from winning the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,matplotlib,shapely,pyproj,scipy - # Building from a checkout (no PKG-INFO) makes setup.py cythonize trace.pyx - # fresh, unlike a PyPI sdist build which ships a pre-cythonized trace.cpp and - # skips this entirely. Cython 3.3.0 (unbounded in pyproject.toml's - # build-system requires) regressed its own generated std::list-to-Python-list - # conversion for trace.pyx's C++ iteration, so build isolation must not be - # allowed to pick it. - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_BEFORE_BUILD: pip install "cython<3.3" numpy setuptools setuptools_scm wheel - CIBW_TEST_REQUIRES: pytest pytest-mpl pytest-xdist scipy - # Mirrors upstream's own hermetic job (ci-testing.yml's "No Network Tests" - # step: `pytest ... -m "not natural_earth and not network"`), which also - # runs without --mpl; image-comparison baselines are font-rendering - # sensitive and not something upstream itself trusts cross-platform. Tests - # are excluded from the wheel (packages.find excludes cartopy.tests), so - # copy them out of the checkout first, as pyproj's workflow does. - CIBW_TEST_COMMAND: >- - python -c "import cartopy; import cartopy.crs as ccrs; import shapely.geometry as sgeom; r = ccrs.Robinson().project_geometry(sgeom.LineString([(-10, 10), (10, 50)]), ccrs.PlateCarree()); assert not r.is_empty; print('cartopy.trace OK')" && - cp -r {package}/lib/cartopy/tests cartopy_tests && - python -m pytest cartopy_tests -rfEsX -n 4 -m "not natural_earth and not network" + name: cartopy-${{ env.CARTOPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the licence and the compiled extension run: | @@ -112,15 +114,9 @@ jobs: assert any(n.startswith("cartopy/trace.") and n.endswith(".so") for n in names), names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cartopy-${{ env.CARTOPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cartopy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cbitstruct.yml b/.github/workflows/build-cbitstruct.yml index 4856dbc18c23..741196a3e2e1 100644 --- a/.github/workflows/build-cbitstruct.yml +++ b/.github/workflows/build-cbitstruct.yml @@ -58,7 +58,6 @@ jobs: ref: ${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ timeout-minutes: 60 publish: diff --git a/.github/workflows/build-cbor2.yml b/.github/workflows/build-cbor2.yml index 29b6f6deae1b..c74bad0fccd3 100644 --- a/.github/workflows/build-cbor2.yml +++ b/.github/workflows/build-cbor2.yml @@ -59,7 +59,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-before-all-linux: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y # setuptools_scm can't derive the version from this tag-less checkout. - cibw-environment: >- + cibw-environment-linux: >- PATH=$HOME/.cargo/bin:$PATH SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CBOR2=${{ matrix.version }} cibw-test-groups: test diff --git a/.github/workflows/build-cdshealpix.yml b/.github/workflows/build-cdshealpix.yml index 35299aa30e25..57fc1b47830e 100644 --- a/.github/workflows/build-cdshealpix.yml +++ b/.github/workflows/build-cdshealpix.yml @@ -61,9 +61,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-before-all-linux: >- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - cibw-environment-linux: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" # MPLBACKEND stands in for upstream's root conftest.py, which only selects Agg. cibw-test-environment: >- PIP_ONLY_BINARY=:all: diff --git a/.github/workflows/build-certbot-dns-multi.yml b/.github/workflows/build-certbot-dns-multi.yml index c8e52ee3aaa5..e0d60ba695ac 100644 --- a/.github/workflows/build-certbot-dns-multi.yml +++ b/.github/workflows/build-certbot-dns-multi.yml @@ -51,140 +51,146 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build certbot-dns-multi ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "certbot-dns-multi" + version: "${{ matrix.version }}" + repository: "alexzorin/certbot-dns-multi" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + cat > tests/test_certbot_dns_multi.py <<'PYTEST' + """Smoke tests for the riscv64 certbot-dns-multi wheel. + + Upstream ships no Python test suite, so these drive the compiled Go + bridge end to end over its JSON protocol. lego's `exec` provider in RAW + mode needs no network and no credentials: it shells out to a script with + the challenge arguments, which proves the Python -> cgo -> Go runtime -> + lego path and back. + """ + + import json + + import pytest + + import lego_bridge + + + def cmd(**kwargs): + return json.loads(lego_bridge.cmd(json.dumps(kwargs))) + + + @pytest.fixture + def hook(tmp_path): + log = tmp_path / "hook.log" + script = tmp_path / "hook.sh" + script.write_text(f'#!/bin/sh\nprintf "%s\\n" "$*" >> "{log}"\n') + script.chmod(0o755) + return script, log + + + def test_extension_module_is_compiled(): + assert lego_bridge.__file__.endswith(".so"), lego_bridge.__file__ + + + def test_unknown_action(): + response = cmd(action="frobnicate") + assert response["success"] is False + assert "frobnicate" in response["error"] + + + def test_unknown_provider(): + response = cmd(action="configure", provider="does-not-exist", credentials={}) + assert response["success"] is False + assert "does-not-exist" in response["error"] + + + def test_missing_provider_credentials(): + response = cmd(action="configure", provider="cloudflare", credentials={}) + assert response["success"] is False + assert "cloudflare" in response["error"] + + + def test_exec_provider_round_trip(hook): + script, log = hook + assert cmd( + action="configure", + provider="exec", + credentials={"EXEC_PATH": str(script), "EXEC_MODE": "RAW"}, + ) == {"success": True} + assert cmd( + action="perform", + domain="example.com", + token="a-token", + key_authorization="a-token.key-auth", + ) == {"success": True} + assert cmd( + action="cleanup", + domain="example.com", + token="a-token", + key_authorization="a-token.key-auth", + ) == {"success": True} + assert log.read_text().splitlines() == [ + "present -- example.com a-token a-token.key-auth", + "cleanup -- example.com a-token a-token.key-auth", + ] + + + def test_certbot_plugin_entry_point(): + from importlib.metadata import entry_points + + from certbot.plugins import dns_common + + (plugin,) = [ + entry_point + for entry_point in entry_points(group="certbot.plugins") + if entry_point.name == "dns-multi" + ] + authenticator = plugin.load() + assert issubclass(authenticator, dns_common.DNSAuthenticator) + PYTEST + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Same Go tarball as upstream's .github/build-wheel.sh, for our GOARCH. + cibw-before-all-linux: "curl -sSfL https://go.dev/dl/go1.26.0.linux-riscv64.tar.gz | tar -zx -C /usr/local/" + # setuptools-scm reads the tag from the checkout, which cibuildwheel does + # not copy into the container. + cibw-environment-linux: "PATH=\"/usr/local/go/bin:$PATH\" SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CERTBOT_DNS_MULTI=${{ matrix.version }}" + # Without it pip prefers PyPI's cryptography releases, which have no + # riscv64 wheels, and source-builds them in the container. + cibw-test-environment: "PIP_ONLY_BINARY=cryptography" + cibw-test-requires: "pytest certbot" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CERTBOT_DNS_MULTI_VERSION: ${{ matrix.version }} - steps: - - name: Checkout certbot-dns-multi ${{ env.CERTBOT_DNS_MULTI_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: alexzorin/certbot-dns-multi - ref: ${{ env.CERTBOT_DNS_MULTI_VERSION }} - persist-credentials: false - - - name: Stage smoke tests - run: | - cat > tests/test_certbot_dns_multi.py <<'PYTEST' - """Smoke tests for the riscv64 certbot-dns-multi wheel. - - Upstream ships no Python test suite, so these drive the compiled Go - bridge end to end over its JSON protocol. lego's `exec` provider in RAW - mode needs no network and no credentials: it shells out to a script with - the challenge arguments, which proves the Python -> cgo -> Go runtime -> - lego path and back. - """ - - import json - - import pytest - - import lego_bridge - - - def cmd(**kwargs): - return json.loads(lego_bridge.cmd(json.dumps(kwargs))) - - - @pytest.fixture - def hook(tmp_path): - log = tmp_path / "hook.log" - script = tmp_path / "hook.sh" - script.write_text(f'#!/bin/sh\nprintf "%s\\n" "$*" >> "{log}"\n') - script.chmod(0o755) - return script, log - - - def test_extension_module_is_compiled(): - assert lego_bridge.__file__.endswith(".so"), lego_bridge.__file__ - - - def test_unknown_action(): - response = cmd(action="frobnicate") - assert response["success"] is False - assert "frobnicate" in response["error"] - - - def test_unknown_provider(): - response = cmd(action="configure", provider="does-not-exist", credentials={}) - assert response["success"] is False - assert "does-not-exist" in response["error"] - - - def test_missing_provider_credentials(): - response = cmd(action="configure", provider="cloudflare", credentials={}) - assert response["success"] is False - assert "cloudflare" in response["error"] - - - def test_exec_provider_round_trip(hook): - script, log = hook - assert cmd( - action="configure", - provider="exec", - credentials={"EXEC_PATH": str(script), "EXEC_MODE": "RAW"}, - ) == {"success": True} - assert cmd( - action="perform", - domain="example.com", - token="a-token", - key_authorization="a-token.key-auth", - ) == {"success": True} - assert cmd( - action="cleanup", - domain="example.com", - token="a-token", - key_authorization="a-token.key-auth", - ) == {"success": True} - assert log.read_text().splitlines() == [ - "present -- example.com a-token a-token.key-auth", - "cleanup -- example.com a-token a-token.key-auth", - ] - - - def test_certbot_plugin_entry_point(): - from importlib.metadata import entry_points - - from certbot.plugins import dns_common - - (plugin,) = [ - entry_point - for entry_point in entry_points(group="certbot.plugins") - if entry_point.name == "dns-multi" - ] - authenticator = plugin.load() - assert issubclass(authenticator, dns_common.DNSAuthenticator) - PYTEST - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Same Go tarball as upstream's .github/build-wheel.sh, for our GOARCH. - CIBW_BEFORE_ALL_LINUX: >- - curl -sSfL https://go.dev/dl/go${{ env.GO_VERSION }}.linux-riscv64.tar.gz - | tar -zx -C /usr/local/ - # setuptools-scm reads the tag from the checkout, which cibuildwheel does - # not copy into the container. - CIBW_ENVIRONMENT_LINUX: >- - PATH="/usr/local/go/bin:$PATH" - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CERTBOT_DNS_MULTI=${{ env.CERTBOT_DNS_MULTI_VERSION }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Without it pip prefers PyPI's cryptography releases, which have no - # riscv64 wheels, and source-builds them in the container. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=cryptography - CIBW_TEST_REQUIRES: pytest certbot - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest -v tests + name: certbot-dns-multi-${{ env.CERTBOT_DNS_MULTI_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extension run: | @@ -196,15 +202,9 @@ jobs: print("extension:", sos[0]) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: certbot-dns-multi-${{ env.CERTBOT_DNS_MULTI_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish certbot-dns-multi ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cf-units.yml b/.github/workflows/build-cf-units.yml index 9b26f9b31470..991f2a3855e3 100644 --- a/.github/workflows/build-cf-units.yml +++ b/.github/workflows/build-cf-units.yml @@ -52,68 +52,70 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cf-units ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cf-units" + version: "${{ matrix.version }}" + repository: "SciTools/cf-units" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-fetch-depth: 0 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/cf-units/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # udunits2-devel is EPEL-only (gotcha 51: no EPEL on riscv64), so + # UDUNITS-2 is built from source instead, the same workaround + # build-pygame.yml uses for portmidi. The tag archive has no generated + # scanner.c/parser.c/.info, hence flex, bison and texinfo (CRB). + cibw-before-all-linux: |- + set -eux + dnf install -y expat-devel flex bison texinfo + curl -fsSL --retry 5 https://github.com/Unidata/UDUNITS-2/archive/refs/tags/v2.2.28.tar.gz -o udunits2.tar.gz + tar xzf udunits2.tar.gz + cmake -S UDUNITS-2-2.2.28 -B udunits2-build -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release + cmake --build udunits2-build -j"$(nproc)" + cmake --install udunits2-build + echo /usr/local/lib > /etc/ld.so.conf.d/udunits2.conf + ldconfig + cp UDUNITS-2-2.2.28/COPYRIGHT LICENSE.udunits2 + cibw-environment-linux: "CF_UNITS_LIMITED_API=1 UDUNITS2_INCDIR=/usr/local/include UDUNITS2_LIBDIR=/usr/local/lib UDUNITS2_XML_PATH=/usr/local/share/udunits/udunits2.xml SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CF_UNITS=${{ matrix.version }} PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest tomli" + cibw-test-command: "python -c \"import cf_units; print(f'cf-units v{cf_units.__version__}')\" && python -m pytest --pyargs cf_units" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CF_UNITS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cf-units v${{ env.CF_UNITS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: SciTools/cf-units - ref: v${{ env.CF_UNITS_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch cf-units source - run: git apply python-wheels/patches/cf-units/${{ env.CF_UNITS_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # udunits2-devel is EPEL-only (gotcha 51: no EPEL on riscv64), so - # UDUNITS-2 is built from source instead, the same workaround - # build-pygame.yml uses for portmidi. The tag archive has no generated - # scanner.c/parser.c/.info, hence flex, bison and texinfo (CRB). - CIBW_BEFORE_ALL_LINUX: | - set -eux - dnf install -y expat-devel flex bison texinfo - curl -fsSL --retry 5 https://github.com/Unidata/UDUNITS-2/archive/refs/tags/v${{ env.UDUNITS2_VERSION }}.tar.gz -o udunits2.tar.gz - tar xzf udunits2.tar.gz - cmake -S UDUNITS-2-${{ env.UDUNITS2_VERSION }} -B udunits2-build -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release - cmake --build udunits2-build -j"$(nproc)" - cmake --install udunits2-build - echo /usr/local/lib > /etc/ld.so.conf.d/udunits2.conf - ldconfig - cp UDUNITS-2-${{ env.UDUNITS2_VERSION }}/COPYRIGHT LICENSE.udunits2 - CIBW_ENVIRONMENT_LINUX: >- - CF_UNITS_LIMITED_API=1 - UDUNITS2_INCDIR=/usr/local/include - UDUNITS2_LIBDIR=/usr/local/lib - UDUNITS2_XML_PATH=/usr/local/share/udunits/udunits2.xml - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CF_UNITS=${{ env.CF_UNITS_VERSION }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest tomli - CIBW_TEST_COMMAND: >- - python -c "import cf_units; print(f'cf-units v{cf_units.__version__}')" && - python -m pytest --pyargs cf_units + name: cf-units-${{ env.CF_UNITS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extension and its licence run: | @@ -127,15 +129,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cf-units-${{ env.CF_UNITS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cf-units ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cffsubr.yml b/.github/workflows/build-cffsubr.yml index 283f2b7ad8b1..cd4240c79a6d 100644 --- a/.github/workflows/build-cffsubr.yml +++ b/.github/workflows/build-cffsubr.yml @@ -70,11 +70,7 @@ jobs: # One py3-none wheel is built on cp312 and reused (and tested) on the others. cibw-build: "cp312-* cp313-* cp314-*" cibw-skip: "*-musllinux*" - cibw-environment: >- - FORCE_BUILD_LIBXML2=ON - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_CONSTRAINT=/setuptools-constraint.txt - PIP_BUILD_CONSTRAINT=/setuptools-constraint.txt + cibw-environment-linux: "FORCE_BUILD_LIBXML2=ON PIP_CONSTRAINT=/setuptools-constraint.txt PIP_BUILD_CONSTRAINT=/setuptools-constraint.txt" cibw-test-requires: "pytest" cibw-test-command: >- pytest {project}/tests && diff --git a/.github/workflows/build-cftime.yml b/.github/workflows/build-cftime.yml index c7f2b510db4f..c7b9be0e13b7 100644 --- a/.github/workflows/build-cftime.yml +++ b/.github/workflows/build-cftime.yml @@ -58,9 +58,7 @@ jobs: ref: v${{ matrix.version }}rel artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" cibw-test-requires: pytest cibw-test-command: >- python -c "import cftime; print(f'cftime v{cftime.__version__}')" && diff --git a/.github/workflows/build-chalk-viztracer.yml b/.github/workflows/build-chalk-viztracer.yml index 1cf86993243f..31176ed36660 100644 --- a/.github/workflows/build-chalk-viztracer.yml +++ b/.github/workflows/build-chalk-viztracer.yml @@ -74,7 +74,6 @@ jobs: # collecting via an absolute {project}/tests path breaks that match and # fails test_include_files/test_exclude_files regardless of platform. cibw-test-command: pytest tests --ignore=tests/test_torch.py --ignore=tests/test_remote.py -k "not test_use_external_processor" - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ timeout-minutes: 90 publish: diff --git a/.github/workflows/build-chalkpy-rs.yml b/.github/workflows/build-chalkpy-rs.yml index a6025e36236f..e052523d28ed 100644 --- a/.github/workflows/build-chalkpy-rs.yml +++ b/.github/workflows/build-chalkpy-rs.yml @@ -52,190 +52,210 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build chalkpy-rs ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "chalkpy-rs" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 300 + pre-build: |- + export CHALKPY_RS_VERSION='${{ matrix.version }}' + url="$(curl -sSfL "https://pypi.org/pypi/chalkpy-rs/${CHALKPY_RS_VERSION}/json" \ + | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" + curl -sSfL -o sdist.tar.gz "$url" + # Extracted rather than passed to cibuildwheel as a tarball: for a + # tarball package-dir cibuildwheel chdirs into its own extraction temp + # dir, and CIBW_TEST_SOURCES resolves against that cwd, so the staged + # tests below would be invisible. + tar xzf sdist.tar.gz + test -f "chalkpy_rs-${CHALKPY_RS_VERSION}/pyproject.toml" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + mkdir -p tests + cat > tests/test_chalk_rs.py <<'PYTEST' + """Smoke tests for the riscv64 chalkpy-rs wheel. + + Upstream ships no Python test suite, so these exercise the compiled PyO3 + extension end to end: the duration/ISO-8601 helpers, the naming helpers and + the ruff-backed Python AST indexer that is the bulk of the extension. + """ + + import datetime + import textwrap + + import pytest + + import chalk_rs + + FEATURES_SOURCE = textwrap.dedent( + ''' + from chalk.features import features, feature + from chalk import online + + + @features + class User: + id: str + email: str = feature(description="primary email", owner="team@example.com", tags=["pii"]) + age: int + + + @online + def get_age(uid: User.id) -> User.age: + return 42 + ''' + ).lstrip() + + + @pytest.fixture + def project(tmp_path): + path = tmp_path / "features.py" + path.write_text(FEATURES_SOURCE) + return str(tmp_path), [str(path)] + + + def test_extension_module_is_compiled(): + assert chalk_rs.__file__.endswith(".so"), chalk_rs.__file__ + + + def test_parse_duration(): + assert chalk_rs.parse_duration_ms("1h") == 3_600_000 + assert chalk_rs.parse_duration_ms("1h30m") == 5_400_000 + assert chalk_rs.parse_duration_s("1d") == 86_400 + with pytest.raises(ValueError): + chalk_rs.parse_duration_s("not a duration") + + + def test_seconds_to_duration_string(): + assert chalk_rs.seconds_to_duration_string(3661.0) == "1h1m1s" + assert chalk_rs.seconds_to_duration_string(90.0) == "1m30s" + + + def test_parse_iso_date_time(): + assert chalk_rs.parse_iso_date("2026-09-21") == datetime.date(2026, 9, 21) + assert chalk_rs.parse_iso_time("13:45:06") == datetime.time(13, 45, 6) + assert chalk_rs.parse_datetime("2026-09-21T13:45:06") == datetime.datetime(2026, 9, 21, 13, 45, 6) + aware = chalk_rs.parse_datetime("2026-09-21T13:45:06+00:00") + assert aware.utcoffset() == datetime.timedelta(0) + with pytest.raises(ValueError): + chalk_rs.parse_iso_date("not a date") + + + def test_iso_duration_round_trip(): + delta = datetime.timedelta(days=1, hours=2, minutes=3, seconds=4) + assert chalk_rs.parse_iso_duration("P1DT2H3M4S") == delta + assert chalk_rs.duration_isoformat(delta) == "P1DT2H3M4S" + with pytest.raises(TypeError): + chalk_rs.duration_isoformat(123) + + + def test_timezone_from_name(): + assert chalk_rs.timezone_from_name("UTC") is not None + assert chalk_rs.timezone_from_name("Not/AZone") is None + assert datetime.datetime( + 2026, 9, 21, tzinfo=chalk_rs.timezone_from_name("UTC") + ).utcoffset() == datetime.timedelta(0) + + + def test_naming_helpers(): + assert chalk_rs.to_snake_case("FooBarBaz") == "foo_bar_baz" + assert chalk_rs.to_snake_case("HTTPResponse") == "http_response" + assert chalk_rs.build_namespaced_name("user", "email") == "user::email" + assert chalk_rs.build_namespaced_name(None, "email") == "email" + + + def test_file_system_and_parser_cache(project): + root, files = project + filesystem = chalk_rs.StdAstFileSystem(files) + assert filesystem.all_files() == files + assert filesystem.read_to_string(files[0]) == FEATURES_SOURCE + + cache = chalk_rs.AstFileParserCache(files, root) + path, source, imports = cache.get_parsed_file(files[0]) + assert path == files[0] + assert source == FEATURES_SOURCE + assert imports["chalk.features"]["feature"] == ["feature"] + assert imports["chalk"]["online"] == ["online"] + + + def test_feature_class_ast(project): + root, files = project + index = chalk_rs.AstProjectIndex(files, root) + index.nonblocking_start_index() + + feature_class = index.feature_class_ast_in_file(files[0], "User") + assert feature_class is not None + assert feature_class.class_name == "User" + assert feature_class.namespace == "user" + assert feature_class.module == "features" + assert sorted(feature_class.fields) == ["age", "email", "id"] + + email = feature_class.fields["email"] + assert email.field_name == "email" + assert sorted(email.kwarg_names) == ["description", "owner", "tags"] + line, start, end_line, end = email.field_name_location + assert line == end_line + assert FEATURES_SOURCE.splitlines()[line][start:end] == "email" + + + def test_resolver_ast(project): + root, files = project + index = chalk_rs.AstProjectIndex(files, root) + resolver = index.resolver_ast_in_file(files[0], "get_age") + assert resolver is not None + assert resolver.resolver_name == "get_age" + assert resolver.module == "features" + assert resolver.args_in_order == ["uid"] + assert resolver.return_annotation is not None + assert resolver.missing_return_annotation is None + assert index.resolver_ast_in_file(files[0], "does_not_exist") is None + PYTEST + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "chalkpy_rs-${{ matrix.version }}" + # musllinux is dropped: rustup.rs ships no riscv64 musl host toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # No [tool.cibuildwheel] table upstream, so the Rust toolchain + # setuptools-rust needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 300 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CHALKPY_RS_VERSION: ${{ matrix.version }} - steps: - - name: Fetch chalkpy-rs ${{ env.CHALKPY_RS_VERSION }} sdist - run: | - url="$(curl -sSfL "https://pypi.org/pypi/chalkpy-rs/${CHALKPY_RS_VERSION}/json" \ - | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" - curl -sSfL -o sdist.tar.gz "$url" - # Extracted rather than passed to cibuildwheel as a tarball: for a - # tarball package-dir cibuildwheel chdirs into its own extraction temp - # dir, and CIBW_TEST_SOURCES resolves against that cwd, so the staged - # tests below would be invisible. - tar xzf sdist.tar.gz - test -f "chalkpy_rs-${CHALKPY_RS_VERSION}/pyproject.toml" - - - name: Stage smoke tests - run: | - mkdir -p tests - cat > tests/test_chalk_rs.py <<'PYTEST' - """Smoke tests for the riscv64 chalkpy-rs wheel. - - Upstream ships no Python test suite, so these exercise the compiled PyO3 - extension end to end: the duration/ISO-8601 helpers, the naming helpers and - the ruff-backed Python AST indexer that is the bulk of the extension. - """ - - import datetime - import textwrap - - import pytest - - import chalk_rs - - FEATURES_SOURCE = textwrap.dedent( - ''' - from chalk.features import features, feature - from chalk import online - - - @features - class User: - id: str - email: str = feature(description="primary email", owner="team@example.com", tags=["pii"]) - age: int - - - @online - def get_age(uid: User.id) -> User.age: - return 42 - ''' - ).lstrip() - - - @pytest.fixture - def project(tmp_path): - path = tmp_path / "features.py" - path.write_text(FEATURES_SOURCE) - return str(tmp_path), [str(path)] - - - def test_extension_module_is_compiled(): - assert chalk_rs.__file__.endswith(".so"), chalk_rs.__file__ - - - def test_parse_duration(): - assert chalk_rs.parse_duration_ms("1h") == 3_600_000 - assert chalk_rs.parse_duration_ms("1h30m") == 5_400_000 - assert chalk_rs.parse_duration_s("1d") == 86_400 - with pytest.raises(ValueError): - chalk_rs.parse_duration_s("not a duration") - - - def test_seconds_to_duration_string(): - assert chalk_rs.seconds_to_duration_string(3661.0) == "1h1m1s" - assert chalk_rs.seconds_to_duration_string(90.0) == "1m30s" - - - def test_parse_iso_date_time(): - assert chalk_rs.parse_iso_date("2026-09-21") == datetime.date(2026, 9, 21) - assert chalk_rs.parse_iso_time("13:45:06") == datetime.time(13, 45, 6) - assert chalk_rs.parse_datetime("2026-09-21T13:45:06") == datetime.datetime(2026, 9, 21, 13, 45, 6) - aware = chalk_rs.parse_datetime("2026-09-21T13:45:06+00:00") - assert aware.utcoffset() == datetime.timedelta(0) - with pytest.raises(ValueError): - chalk_rs.parse_iso_date("not a date") - - - def test_iso_duration_round_trip(): - delta = datetime.timedelta(days=1, hours=2, minutes=3, seconds=4) - assert chalk_rs.parse_iso_duration("P1DT2H3M4S") == delta - assert chalk_rs.duration_isoformat(delta) == "P1DT2H3M4S" - with pytest.raises(TypeError): - chalk_rs.duration_isoformat(123) - - - def test_timezone_from_name(): - assert chalk_rs.timezone_from_name("UTC") is not None - assert chalk_rs.timezone_from_name("Not/AZone") is None - assert datetime.datetime( - 2026, 9, 21, tzinfo=chalk_rs.timezone_from_name("UTC") - ).utcoffset() == datetime.timedelta(0) - - - def test_naming_helpers(): - assert chalk_rs.to_snake_case("FooBarBaz") == "foo_bar_baz" - assert chalk_rs.to_snake_case("HTTPResponse") == "http_response" - assert chalk_rs.build_namespaced_name("user", "email") == "user::email" - assert chalk_rs.build_namespaced_name(None, "email") == "email" - - - def test_file_system_and_parser_cache(project): - root, files = project - filesystem = chalk_rs.StdAstFileSystem(files) - assert filesystem.all_files() == files - assert filesystem.read_to_string(files[0]) == FEATURES_SOURCE - - cache = chalk_rs.AstFileParserCache(files, root) - path, source, imports = cache.get_parsed_file(files[0]) - assert path == files[0] - assert source == FEATURES_SOURCE - assert imports["chalk.features"]["feature"] == ["feature"] - assert imports["chalk"]["online"] == ["online"] - - - def test_feature_class_ast(project): - root, files = project - index = chalk_rs.AstProjectIndex(files, root) - index.nonblocking_start_index() - - feature_class = index.feature_class_ast_in_file(files[0], "User") - assert feature_class is not None - assert feature_class.class_name == "User" - assert feature_class.namespace == "user" - assert feature_class.module == "features" - assert sorted(feature_class.fields) == ["age", "email", "id"] - - email = feature_class.fields["email"] - assert email.field_name == "email" - assert sorted(email.kwarg_names) == ["description", "owner", "tags"] - line, start, end_line, end = email.field_name_location - assert line == end_line - assert FEATURES_SOURCE.splitlines()[line][start:end] == "email" - - - def test_resolver_ast(project): - root, files = project - index = chalk_rs.AstProjectIndex(files, root) - resolver = index.resolver_ast_in_file(files[0], "get_age") - assert resolver is not None - assert resolver.resolver_name == "get_age" - assert resolver.module == "features" - assert resolver.args_in_order == ["uid"] - assert resolver.return_annotation is not None - assert resolver.missing_return_annotation is None - assert index.resolver_ast_in_file(files[0], "does_not_exist") is None - PYTEST - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - package-dir: chalkpy_rs-${{ env.CHALKPY_RS_VERSION }} - # musllinux is dropped: rustup.rs ships no riscv64 musl host toolchain. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # No [tool.cibuildwheel] table upstream, so the Rust toolchain - # setuptools-rust needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest -v tests + name: chalkpy-rs-${{ env.CHALKPY_RS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extension run: | @@ -247,15 +267,9 @@ jobs: print("extension:", sos[0]) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: chalkpy-rs-${{ env.CHALKPY_RS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish chalkpy-rs ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-chia-rs.yml b/.github/workflows/build-chia-rs.yml index 67060a976595..c6f2c77313d9 100644 --- a/.github/workflows/build-chia-rs.yml +++ b/.github/workflows/build-chia-rs.yml @@ -48,39 +48,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build chia-rs ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "chia-rs" + version: "${{ matrix.version }}" + repository: "Chia-Network/chia_rs" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + cp LICENSE wheel/LICENSE + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "wheel" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "colorama pytest pytest-xdist clvm" + cibw-test-sources: "pytest.ini tests test-bundles ff-tests generator-tests" + cibw-test-command: "pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CHIA_RS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout chia_rs ${{ env.CHIA_RS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Chia-Network/chia_rs - ref: ${{ env.CHIA_RS_VERSION }} - persist-credentials: false - - # maturin only picks up licence files beside wheel/pyproject.toml, so upstream's wheels carry none. - - run: cp LICENSE wheel/LICENSE - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: wheel - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_REQUIRES: colorama pytest pytest-xdist clvm - CIBW_TEST_SOURCES: pytest.ini tests test-bundles ff-tests generator-tests - CIBW_TEST_COMMAND: pytest tests + name: chia-rs-${{ env.CHIA_RS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -93,16 +105,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: chia-rs-${{ env.CHIA_RS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish chia-rs ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-chiabip158.yml b/.github/workflows/build-chiabip158.yml index 5ebedef438ee..49445638b79c 100644 --- a/.github/workflows/build-chiabip158.yml +++ b/.github/workflows/build-chiabip158.yml @@ -48,32 +48,39 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build chiabip158 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "chiabip158" + version: "${{ matrix.version }}" + repository: "Chia-Network/chiabip158" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pytest" + cibw-test-command: "pytest -v {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CHIABIP158_VERSION: ${{ matrix.version }} - steps: - - name: Checkout chiabip158 ${{ env.CHIABIP158_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Chia-Network/chiabip158 - ref: ${{ env.CHIABIP158_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest -v {project}/tests + name: chiabip158-${{ env.CHIABIP158_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -86,16 +93,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: chiabip158-${{ env.CHIABIP158_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish chiabip158 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-chialisp.yml b/.github/workflows/build-chialisp.yml index c26588b910a9..ee89308e509a 100644 --- a/.github/workflows/build-chialisp.yml +++ b/.github/workflows/build-chialisp.yml @@ -55,36 +55,40 @@ jobs: version: ${{ fromJSON(needs.setup.outputs.versions) }} platform: [manylinux, musllinux] name: Build chialisp ${{ matrix.version }} cp310-abi3-${{ matrix.platform }}_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "chialisp" + version: "${{ matrix.version }}" + repository: "Chia-Network/chialisp" + ref: "${{ matrix.version }}" + artifact-tag: "cp310-abi3-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + cibw-build: "cp312-${{ matrix.platform }}_riscv64 cp313-${{ matrix.platform }}_riscv64 cp314-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + # rust-toolchain.toml pins 1.97.1, which has no riscv64 musl host toolchain. + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" RUSTUP_TOOLCHAIN=stable" + cibw-test-sources: "resources/tests" + cibw-test-command: "python resources/tests/test_clvm_step.py && python resources/tests/test_compile_from_string.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + platform: [manylinux, musllinux] env: CHIALISP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout chialisp ${{ env.CHIALISP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Chia-Network/chialisp - ref: ${{ env.CHIALISP_VERSION }} - persist-credentials: false - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_BUILD: cp312-${{ matrix.platform }}_riscv64 cp313-${{ matrix.platform }}_riscv64 cp314-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - # rust-toolchain.toml pins 1.97.1, which has no riscv64 musl host toolchain. - CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin" RUSTUP_TOOLCHAIN=stable' - CIBW_TEST_SOURCES: resources/tests - CIBW_TEST_COMMAND: >- - python resources/tests/test_clvm_step.py && - python resources/tests/test_compile_from_string.py + name: chialisp-${{ env.CHIALISP_VERSION }}-cp310-abi3-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -97,15 +101,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: chialisp-${{ env.CHIALISP_VERSION }}-cp310-abi3-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish chialisp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-chiapos.yml b/.github/workflows/build-chiapos.yml index df2d3c56a6f7..c1918c80e771 100644 --- a/.github/workflows/build-chiapos.yml +++ b/.github/workflows/build-chiapos.yml @@ -48,44 +48,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build chiapos ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "chiapos" + version: "${{ matrix.version }}" + repository: "Chia-Network/chiapos" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + set -euo pipefail + tag() { sed -n "/GIT_REPOSITORY .*\/$1\.git/{n;s/.*GIT_TAG *//p}" CMakeLists.txt; } + curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/$(tag pybind11)/LICENSE" -o LICENSE.pybind11 + curl -fsSL --retry 5 "https://raw.githubusercontent.com/BLAKE3-team/BLAKE3/$(tag BLAKE3)/LICENSE" -o LICENSE.blake3 + cp lib/FiniteStateEntropy/LICENSE LICENSE.finite-state-entropy + sed -n '/The MIT License/,/THE SOFTWARE\./p' lib/include/picosha2.hpp > LICENSE.picosha2 + test -s LICENSE.picosha2 + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Bladebit's prebuilt green_reaper harvester has no riscv64 build; upstream's own riscv64 job builds without it. + cibw-before-all: '' + cibw-environment-linux: "CP_USE_GREEN_REAPER=0" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CHIAPOS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout chiapos ${{ env.CHIAPOS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Chia-Network/chiapos - ref: ${{ env.CHIAPOS_VERSION }} - persist-credentials: false - - # pybind11, BLAKE3, FiniteStateEntropy and picosha2 are compiled into the extension; upstream ships none of their notices. - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - tag() { sed -n "/GIT_REPOSITORY .*\/$1\.git/{n;s/.*GIT_TAG *//p}" CMakeLists.txt; } - curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/$(tag pybind11)/LICENSE" -o LICENSE.pybind11 - curl -fsSL --retry 5 "https://raw.githubusercontent.com/BLAKE3-team/BLAKE3/$(tag BLAKE3)/LICENSE" -o LICENSE.blake3 - cp lib/FiniteStateEntropy/LICENSE LICENSE.finite-state-entropy - sed -n '/The MIT License/,/THE SOFTWARE\./p' lib/include/picosha2.hpp > LICENSE.picosha2 - test -s LICENSE.picosha2 - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Bladebit's prebuilt green_reaper harvester has no riscv64 build; upstream's own riscv64 job builds without it. - CIBW_BEFORE_ALL: '' - CIBW_ENVIRONMENT: CP_USE_GREEN_REAPER=0 + name: chiapos-${{ env.CHIAPOS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -101,16 +112,9 @@ jobs: "LICENSE.picosha2", "LICENSE.pybind11"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: chiapos-${{ env.CHIAPOS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish chiapos ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-chiavdf.yml b/.github/workflows/build-chiavdf.yml index 2fbb083dd6d9..a7870fe2cade 100644 --- a/.github/workflows/build-chiavdf.yml +++ b/.github/workflows/build-chiavdf.yml @@ -48,66 +48,69 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build chiavdf ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "chiavdf" + version: "${{ matrix.version }}" + repository: "Chia-Network/chiavdf" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + export CHIAVDF_VERSION='${{ matrix.version }}' + case "${CHIAVDF_VERSION}" in + 1.0.*|1.1.*) + echo "GMP_VERSION=6.2.1" >> "$GITHUB_ENV" + echo "GMP_SHA256=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2" >> "$GITHUB_ENV" ;; + *) + echo "GMP_VERSION=6.3.0" >> "$GITHUB_ENV" + echo "GMP_SHA256=a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898" >> "$GITHUB_ENV" ;; + esac + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + set -euo pipefail + curl -fsSL --retry 5 "https://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.xz" -o "gmp-${GMP_VERSION}.tar.xz" + echo "${GMP_SHA256} gmp-${GMP_VERSION}.tar.xz" | sha256sum -c - + tar xJf "gmp-${GMP_VERSION}.tar.xz" --to-stdout "gmp-${GMP_VERSION}/COPYING.LESSERv3" "gmp-${GMP_VERSION}/COPYINGv3" > LICENSE.gmp + pybind11=$(sed -n '/GIT_REPOSITORY .*\/pybind11\.git/{n;s/.*GIT_TAG *//p}' src/CMakeLists.txt) + curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/${pybind11}/LICENSE" -o LICENSE.pybind11 + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-environment-linux: "GMP_VERSION=${{ (startsWith(matrix.version, '1.0.') || startsWith(matrix.version, '1.1.')) && '6.2.1' || '6.3.0' }}" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # manylinux has no EPEL on riscv64 and Rocky 10 has no lzip, so GMP comes from the .tar.xz fetched above. + cibw-before-all: "yum -y install boost-devel && tar xJf gmp-$GMP_VERSION.tar.xz && cd gmp-$GMP_VERSION && if [ -d ../src/lib/gmp-patch-$GMP_VERSION ]; then cp ../src/lib/gmp-patch-$GMP_VERSION/longlong.h ../src/lib/gmp-patch-$GMP_VERSION/compat.c . && cp ../src/lib/gmp-patch-$GMP_VERSION/mpz/inp_raw.c mpz/; else patch -p1 < ../src/lib/gmp-$GMP_VERSION.diff; fi && ./configure --enable-fat --enable-cxx && make && make install && cd .. && rm -rf gmp-$GMP_VERSION && cmake --version && uname -a" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CHIAVDF_VERSION: ${{ matrix.version }} - steps: - - name: Checkout chiavdf ${{ env.CHIAVDF_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Chia-Network/chiavdf - ref: ${{ env.CHIAVDF_VERSION }} - persist-credentials: false - - # Up to 1.1.14 upstream bundled GMP 6.2.1 with replacement files (gmp-patch-6.2.1/); - # from 1.2.0 it bundles GMP 6.3.0 with a diff (gmp-6.3.0.diff). - - name: Select the GMP version - run: | - case "${CHIAVDF_VERSION}" in - 1.0.*|1.1.*) - echo "GMP_VERSION=6.2.1" >> "$GITHUB_ENV" - echo "GMP_SHA256=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2" >> "$GITHUB_ENV" ;; - *) - echo "GMP_VERSION=6.3.0" >> "$GITHUB_ENV" - echo "GMP_SHA256=a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898" >> "$GITHUB_ENV" ;; - esac - - # GMP and pybind11 are linked into the wheel; upstream ships neither notice. - - name: Fetch GMP and stage the bundled dependencies' licences - run: | - set -euo pipefail - curl -fsSL --retry 5 "https://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.xz" -o "gmp-${GMP_VERSION}.tar.xz" - echo "${GMP_SHA256} gmp-${GMP_VERSION}.tar.xz" | sha256sum -c - - tar xJf "gmp-${GMP_VERSION}.tar.xz" --to-stdout "gmp-${GMP_VERSION}/COPYING.LESSERv3" "gmp-${GMP_VERSION}/COPYINGv3" > LICENSE.gmp - pybind11=$(sed -n '/GIT_REPOSITORY .*\/pybind11\.git/{n;s/.*GIT_TAG *//p}' src/CMakeLists.txt) - curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/${pybind11}/LICENSE" -o LICENSE.pybind11 - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # manylinux has no EPEL on riscv64 and Rocky 10 has no lzip, so GMP comes from the .tar.xz fetched above. - CIBW_BEFORE_ALL: >- - yum -y install boost-devel - && tar xJf gmp-${{ env.GMP_VERSION }}.tar.xz - && cd gmp-${{ env.GMP_VERSION }} - && if [ -d ../src/lib/gmp-patch-${{ env.GMP_VERSION }} ]; then - cp ../src/lib/gmp-patch-${{ env.GMP_VERSION }}/longlong.h ../src/lib/gmp-patch-${{ env.GMP_VERSION }}/compat.c . && - cp ../src/lib/gmp-patch-${{ env.GMP_VERSION }}/mpz/inp_raw.c mpz/; - else patch -p1 < ../src/lib/gmp-${{ env.GMP_VERSION }}.diff; fi - && ./configure --enable-fat --enable-cxx - && make && make install && cd .. && rm -rf gmp-${{ env.GMP_VERSION }} - && cmake --version - && uname -a + name: chiavdf-${{ env.CHIAVDF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -126,13 +129,6 @@ jobs: assert licences == {"LICENSE", "LICENSE.gmp", "LICENSE.pybind11"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: chiavdf-${{ env.CHIAVDF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -198,7 +194,7 @@ jobs: publish: name: Publish chiavdf ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-chompjs.yml b/.github/workflows/build-chompjs.yml index dd9832cacf49..244f2235b92e 100644 --- a/.github/workflows/build-chompjs.yml +++ b/.github/workflows/build-chompjs.yml @@ -54,40 +54,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build chompjs ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "chompjs" + version: "${{ matrix.version }}" + repository: "Nykakin/chompjs" + ref: "5e6ecf05644efce78524d1dd05b077da5cab25aa" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-test-requires: "${{ case(matrix.python == 'cp312' && matrix.platform == 'manylinux', 'orjson', matrix.python == 'cp313' && matrix.platform == 'manylinux', 'orjson', matrix.python == 'cp314' && matrix.platform == 'manylinux', 'orjson', '') }}" + # pypi.riseproject.dev only carries orjson for cp312/cp313/cp314 + # manylinux today; the doctest below imports orjson as a custom + # `loader`, so it only runs where a riscv64 wheel exists rather + # than forcing a from-source PyO3 build on the rest of the matrix. + cibw-test-command: "python -m unittest discover {package} && ${{ case(matrix.python == 'cp312' && matrix.platform == 'manylinux', 'orjson', matrix.python == 'cp313' && matrix.platform == 'manylinux', 'orjson', matrix.python == 'cp314' && matrix.platform == 'manylinux', 'orjson', '') == 'orjson' && 'python -m doctest {package}/chompjs/chompjs.py --verbose' || 'true' }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CHOMPJS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout chompjs ${{ env.CHOMPJS_REF }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Nykakin/chompjs - ref: ${{ env.CHOMPJS_REF }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: ${{ case(matrix.python == 'cp312' && matrix.platform == 'manylinux', 'orjson', matrix.python == 'cp313' && matrix.platform == 'manylinux', 'orjson', matrix.python == 'cp314' && matrix.platform == 'manylinux', 'orjson', '') }} - # pypi.riseproject.dev only carries orjson for cp312/cp313/cp314 - # manylinux today; the doctest below imports orjson as a custom - # `loader`, so it only runs where a riscv64 wheel exists rather - # than forcing a from-source PyO3 build on the rest of the matrix. - CIBW_TEST_COMMAND: >- - python -m unittest discover {package} && - ${{ case(matrix.python == 'cp312' && matrix.platform == 'manylinux', 'orjson', matrix.python == 'cp313' && matrix.platform == 'manylinux', 'orjson', matrix.python == 'cp314' && matrix.platform == 'manylinux', 'orjson', '') == 'orjson' && 'python -m doctest {package}/chompjs/chompjs.py --verbose' || 'true' }} + name: chompjs-${{ env.CHOMPJS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extension made it into the wheel run: | @@ -99,15 +103,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: chompjs-${{ env.CHOMPJS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish chompjs ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-chroma-hnswlib.yml b/.github/workflows/build-chroma-hnswlib.yml index 66f0869dd6e5..5fde3b6a85ec 100644 --- a/.github/workflows/build-chroma-hnswlib.yml +++ b/.github/workflows/build-chroma-hnswlib.yml @@ -62,10 +62,7 @@ jobs: # publishes, to keep the binary portable across unknown host CPUs. # numpy is a build and a runtime requirement, and only our registry # has it for riscv64. - cibw-environment: >- - HNSWLIB_NO_NATIVE=true - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "HNSWLIB_NO_NATIVE=true PIP_ONLY_BINARY=numpy" # The compiled extension is a top-level `hnswlib` module, and the # checkout's own `hnswlib/` directory (the C++ headers) would shadow # it as a namespace package if staged (gotcha 25); stage only the diff --git a/.github/workflows/build-chromadb.yml b/.github/workflows/build-chromadb.yml index bcf97e55f0a1..58cccd5bdd07 100644 --- a/.github/workflows/build-chromadb.yml +++ b/.github/workflows/build-chromadb.yml @@ -53,110 +53,95 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build chromadb ${{ matrix.version }} cp39-abi3-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 1440 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "chromadb" + version: "${{ matrix.version }}" + repository: "chroma-core/chroma" + ref: "${{ matrix.version }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 1440 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - env: - CHROMADB_VERSION: ${{ matrix.version }} + set -euo pipefail + git apply -v python-wheels/patches/chromadb/${{ matrix.version }}/*.patch - steps: - - name: Checkout chromadb ${{ env.CHROMADB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: chroma-core/chroma - ref: ${{ env.CHROMADB_VERSION }} - persist-credentials: false + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + set -euo pipefail + sed -i 's/^dynamic = \["version"\]$/version = "${{ matrix.version }}"/' pyproject.toml + grep -q '^version = "${{ matrix.version }}"$' pyproject.toml - - name: Apply patches - run: | - set -euo pipefail - git apply -v python-wheels/patches/chromadb/${{ env.CHROMADB_VERSION }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # pyo3 is pinned to `abi3-py39` workspace-wide, so every interpreter + # yields the same cp39-abi3 wheel: cibuildwheel compiles once and reuses + # it for cp313/cp314 while still running the test suite on each. + cibw-build: "cp312-* cp313-* cp314-*" + # rustup.rs ships no riscv64 musl toolchain. + cibw-skip: "*-musllinux_*" + # protoc builds the chroma-types gRPC stubs; it lives in Rocky's CRB repo. + cibw-before-all-linux: "dnf -y --enablerepo=crb install protobuf-compiler protobuf-devel && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + # PROTOC_INCLUDE points prost-build at the well-known .proto files, which + # the distro packages install outside protoc's own search path. + # `[tool.maturin] strip = true` discards the debug info upstream's + # `[profile.release] debug = 2` produces, so it only costs build time here. + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" PROTOC_INCLUDE=/usr/include CARGO_PROFILE_RELEASE_DEBUG=0" + # Upstream's requirements_dev.txt minus the lint/codegen tooling the + # rust-bindings suite never loads, plus pytest-xdist/pytest-rerunfailures + # for the retry below. + cibw-test-requires: "pytest pytest-asyncio psutil pandas hypothesis[numpy]==6.112.2 fastapi uvicorn[standard] snowballstemmer opentelemetry-instrumentation-fastapi chroma-hnswlib==0.7.6 pytest-xdist pytest-rerunfailures" + # `schemas/` is resolved relative to the source tree by + # chromadb/utils/embedding_functions/schemas/schema_utils.py, and + # pyproject.toml carries the pytest config (asyncio_mode, pythonpath). + cibw-test-sources: "chromadb schemas pyproject.toml" + # PyPI's newest grpcio/pandas have no riscv64 wheel, so without + # PIP_ONLY_BINARY pip picks them over the registry's and compiles both + # in-container. chroma-hnswlib has no riscv64 wheel either and its own + # release workflow sets HNSWLIB_NO_NATIVE, so the sdist build matches. + cibw-test-environment: "CHROMA_RUST_BINDINGS_TEST_ONLY=1 RUST_BACKTRACE=1 PIP_ONLY_BINARY=grpcio,numpy,pandas HNSWLIB_NO_NATIVE=true" + # The compiled extension lives in its own top-level package, so the + # staged `chromadb/` source tree cannot shadow it - assert it is the + # installed .so before running upstream's glob. `-x` is dropped so one + # riscv64 cycle reports every failure. + # test_multithreaded.py's ThreadPoolExecutor stress tests hit a rare + # (~1 in 3 runs here) SIGABRT inside chromadb_rust_bindings under real + # riscv64 parallelism - didn't reproduce in 40 loops on native aarch64, + # so it reads as riscv64's weaker memory ordering exposing an upstream + # race rather than anything in this workflow. `-n 1 --reruns 3` makes + # pytest-xdist restart the worker and retry the one crashed test + # instead of failing the whole (~1h) run. + cibw-test-command: "python -c \"import chromadb; from chromadb_rust_bindings import chromadb_rust_bindings as ext; assert ext.__file__.endswith('.so'), ext.__file__; print(ext.__file__)\" && python -m pytest chromadb/test --ignore-glob 'chromadb/test/property/*' --ignore-glob 'chromadb/test/stress/*' --ignore-glob 'chromadb/test/distributed/*' --ignore chromadb/test/test_multithreaded.py -v --color=yes --durations 10 && python -m pytest chromadb/test/test_multithreaded.py -v --color=yes -n 1 --reruns 3" - # The tag leaves the version dynamic (setuptools_scm), but the build backend - # is maturin, which would fall back to the crate version (0.1.0). Upstream's - # release workflow rewrites pyproject.toml the same way before building. - - name: Pin the package version - run: | - set -euo pipefail - sed -i 's/^dynamic = \["version"\]$/version = "${{ env.CHROMADB_VERSION }}"/' pyproject.toml - grep -q '^version = "${{ env.CHROMADB_VERSION }}"$' pyproject.toml - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 1440 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + env: + CHROMADB_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ARCHS: riscv64 - # pyo3 is pinned to `abi3-py39` workspace-wide, so every interpreter - # yields the same cp39-abi3 wheel: cibuildwheel compiles once and reuses - # it for cp313/cp314 while still running the test suite on each. - CIBW_BUILD: "cp312-* cp313-* cp314-*" - # rustup.rs ships no riscv64 musl toolchain. - CIBW_SKIP: "*-musllinux_*" - # protoc builds the chroma-types gRPC stubs; it lives in Rocky's CRB repo. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y --enablerepo=crb install protobuf-compiler protobuf-devel && - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - # PROTOC_INCLUDE points prost-build at the well-known .proto files, which - # the distro packages install outside protoc's own search path. - # `[tool.maturin] strip = true` discards the debug info upstream's - # `[profile.release] debug = 2` produces, so it only costs build time here. - CIBW_ENVIRONMENT: >- - PATH="$PATH:$HOME/.cargo/bin" - PROTOC_INCLUDE=/usr/include - CARGO_PROFILE_RELEASE_DEBUG=0 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream's requirements_dev.txt minus the lint/codegen tooling the - # rust-bindings suite never loads, plus pytest-xdist/pytest-rerunfailures - # for the retry below. - CIBW_TEST_REQUIRES: >- - pytest pytest-asyncio psutil pandas hypothesis[numpy]==6.112.2 - fastapi uvicorn[standard] snowballstemmer - opentelemetry-instrumentation-fastapi chroma-hnswlib==0.7.6 - pytest-xdist pytest-rerunfailures - # `schemas/` is resolved relative to the source tree by - # chromadb/utils/embedding_functions/schemas/schema_utils.py, and - # pyproject.toml carries the pytest config (asyncio_mode, pythonpath). - CIBW_TEST_SOURCES: chromadb schemas pyproject.toml - # PyPI's newest grpcio/pandas have no riscv64 wheel, so without - # PIP_ONLY_BINARY pip picks them over the registry's and compiles both - # in-container. chroma-hnswlib has no riscv64 wheel either and its own - # release workflow sets HNSWLIB_NO_NATIVE, so the sdist build matches. - CIBW_TEST_ENVIRONMENT: >- - CHROMA_RUST_BINDINGS_TEST_ONLY=1 RUST_BACKTRACE=1 - PIP_ONLY_BINARY=grpcio,numpy,pandas - HNSWLIB_NO_NATIVE=true - # The compiled extension lives in its own top-level package, so the - # staged `chromadb/` source tree cannot shadow it - assert it is the - # installed .so before running upstream's glob. `-x` is dropped so one - # riscv64 cycle reports every failure. - # test_multithreaded.py's ThreadPoolExecutor stress tests hit a rare - # (~1 in 3 runs here) SIGABRT inside chromadb_rust_bindings under real - # riscv64 parallelism - didn't reproduce in 40 loops on native aarch64, - # so it reads as riscv64's weaker memory ordering exposing an upstream - # race rather than anything in this workflow. `-n 1 --reruns 3` makes - # pytest-xdist restart the worker and retry the one crashed test - # instead of failing the whole (~1h) run. - CIBW_TEST_COMMAND: >- - python -c "import chromadb; - from chromadb_rust_bindings import chromadb_rust_bindings as ext; - assert ext.__file__.endswith('.so'), ext.__file__; - print(ext.__file__)" - && python -m pytest chromadb/test - --ignore-glob 'chromadb/test/property/*' - --ignore-glob 'chromadb/test/stress/*' - --ignore-glob 'chromadb/test/distributed/*' - --ignore chromadb/test/test_multithreaded.py - -v --color=yes --durations 10 - && python -m pytest chromadb/test/test_multithreaded.py - -v --color=yes -n 1 --reruns 3 + name: chromadb-${{ env.CHROMADB_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension run: | @@ -169,15 +154,9 @@ jobs: print(sys.argv[1], "->", sos) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: chromadb-${{ env.CHROMADB_VERSION }}-cp39-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish chromadb ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-circt.yml b/.github/workflows/build-circt.yml index 79b6931cd57d..78e01b3f104e 100644 --- a/.github/workflows/build-circt.yml +++ b/.github/workflows/build-circt.yml @@ -48,78 +48,92 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build circt ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "circt" + version: "${{ matrix.version }}" + repository: "llvm/circt" + ref: "firtool-${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 1440 + checkout-submodules: "true" + checkout-fetch-depth: 2 + pre-build: |- + git fetch --force --unshallow --tags --no-recurse-submodules + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + set -euo pipefail + nanobind_version="$(sed -n 's/.*"nanobind==\([^"]*\)".*/\1/p' lib/Bindings/Python/pyproject.toml)" + git clone --depth 1 --branch "v${nanobind_version}" --recurse-submodules --shallow-submodules \ + https://github.com/wjakob/nanobind.git "${RUNNER_TEMP}/nanobind" + cp LICENSE lib/Bindings/Python/LICENSE + cp llvm/llvm/LICENSE.TXT lib/Bindings/Python/LICENSE.llvm + cp "${RUNNER_TEMP}/nanobind/LICENSE" lib/Bindings/Python/LICENSE.nanobind + cp "${RUNNER_TEMP}/nanobind/ext/robin_map/LICENSE" lib/Bindings/Python/LICENSE.robin-map + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cat > integration_test/Bindings/Python/lit.cfg.py <<'EOF' + import os + import sys + + import lit.formats + + config.name = "CIRCT Python bindings" + config.test_format = lit.formats.ShTest() + config.suffixes = [".py"] + config.excludes = ["lit.cfg.py"] + config.test_source_root = os.path.dirname(__file__) + config.test_exec_root = "/tmp/circt-lit" + config.available_features.add("bindings_python") + config.substitutions.append(("%PYTHON%", f'"{sys.executable}"')) + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "lib/Bindings/Python" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build-frontend: "build" + # Default ninja -j and ld.bfd exhaust the runner's 15GB (it went silent 7h in); setup.py switches to lld when present. + cibw-before-all: "dnf -y install lld" + cibw-environment-linux: "CMAKE_BUILD_PARALLEL_LEVEL=3" + cibw-before-test: "dnf -y install llvm" + cibw-test-command: "python {project}/llvm/llvm/utils/lit/lit.py -v {project}/integration_test/Bindings/Python" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 1440 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CIRCT_VERSION: ${{ matrix.version }} - steps: - - name: Get CIRCT - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: llvm/circt - ref: firtool-${{ env.CIRCT_VERSION }} - fetch-depth: 2 - submodules: "true" - persist-credentials: false - - - name: Unshallow CIRCT - run: | - git fetch --force --unshallow --tags --no-recurse-submodules - - # The wheel bundles LLVM/MLIR, nanobind and robin-map; upstream's wheel ships no licence text. - - name: Stage licences - run: | - set -euo pipefail - nanobind_version="$(sed -n 's/.*"nanobind==\([^"]*\)".*/\1/p' lib/Bindings/Python/pyproject.toml)" - git clone --depth 1 --branch "v${nanobind_version}" --recurse-submodules --shallow-submodules \ - https://github.com/wjakob/nanobind.git "${RUNNER_TEMP}/nanobind" - cp LICENSE lib/Bindings/Python/LICENSE - cp llvm/llvm/LICENSE.TXT lib/Bindings/Python/LICENSE.llvm - cp "${RUNNER_TEMP}/nanobind/LICENSE" lib/Bindings/Python/LICENSE.nanobind - cp "${RUNNER_TEMP}/nanobind/ext/robin_map/LICENSE" lib/Bindings/Python/LICENSE.robin-map - - # Upstream runs integration_test/Bindings/Python through the build tree's lit.site.cfg; - # this config runs the same tests against the installed wheel instead. - - name: Write lit config for the Python bindings tests - run: | - cat > integration_test/Bindings/Python/lit.cfg.py <<'EOF' - import os - import sys - - import lit.formats - - config.name = "CIRCT Python bindings" - config.test_format = lit.formats.ShTest() - config.suffixes = [".py"] - config.excludes = ["lit.cfg.py"] - config.test_source_root = os.path.dirname(__file__) - config.test_exec_root = "/tmp/circt-lit" - config.available_features.add("bindings_python") - config.substitutions.append(("%PYTHON%", f'"{sys.executable}"')) - EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: lib/Bindings/Python - output-dir: wheelhouse - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BUILD_FRONTEND: build - # Default ninja -j and ld.bfd exhaust the runner's 15GB (it went silent 7h in); setup.py switches to lld when present. - CIBW_BEFORE_ALL: dnf -y install lld - CIBW_ENVIRONMENT: >- - CMAKE_BUILD_PARALLEL_LEVEL=3 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_BEFORE_TEST: dnf -y install llvm - CIBW_TEST_COMMAND: python {project}/llvm/llvm/utils/lit/lit.py -v {project}/integration_test/Bindings/Python + name: circt-${{ env.CIRCT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel licences run: | @@ -132,15 +146,9 @@ jobs: assert licences == {"LICENSE", "LICENSE.llvm", "LICENSE.nanobind", "LICENSE.robin-map"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: circt-${{ env.CIRCT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish circt ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-citiespy.yml b/.github/workflows/build-citiespy.yml index 0fbfbea1e1a1..67bb193c80ed 100644 --- a/.github/workflows/build-citiespy.yml +++ b/.github/workflows/build-citiespy.yml @@ -49,6 +49,54 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build citiespy ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # pyo3's abi3-py310 feature gives one wheel for every GIL-ful + # interpreter; free-threaded builds disable abi3 and get their own. + - tag: cp310-abi3 + # Built on cp310 -- the oldest interpreter the abi3 tag claims -- + # and re-tested on the newer ones via find_compatible_wheel. + build: >- + cp310-manylinux_riscv64 cp311-manylinux_riscv64 + cp312-manylinux_riscv64 cp313-manylinux_riscv64 + cp314-manylinux_riscv64 + - tag: cp314t + build: cp314t-manylinux_riscv64 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "citiespy" + version: "${{ matrix.version }}" + repository: "ringsaturn/go-cities.json" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: 180 + pre-build: |- + cp LICENSE citiespy/ + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "citiespy" + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.build }}" + # citiespy ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "citiespy/tests" + # citiespy/__init__.py is a maturin-generated shim, so the extension + # has to be probed by its own name. + cibw-test-command: "python -c \"from citiespy import citiespy as ext; assert ext.__file__.endswith('.so'), ext.__file__\" && python -m pytest -v citiespy/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: @@ -67,45 +115,14 @@ jobs: cp314-manylinux_riscv64 - tag: cp314t build: cp314t-manylinux_riscv64 - env: CITIESPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout citiespy ${{ env.CITIESPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ringsaturn/go-cities.json - ref: v${{ env.CITIESPY_VERSION }} - persist-credentials: false - - # maturin globs licence files next to pyproject.toml, which here is the - # citiespy/ subdirectory -- so upstream's wheels carry none at all. - - name: Stage the licence beside citiespy's pyproject.toml - run: cp LICENSE citiespy/ - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: citiespy - output-dir: wheelhouse/ - env: - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # citiespy ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: citiespy/tests - # citiespy/__init__.py is a maturin-generated shim, so the extension - # has to be probed by its own name. - CIBW_TEST_COMMAND: >- - python -c "from citiespy import citiespy as ext; - assert ext.__file__.endswith('.so'), ext.__file__" && - python -m pytest -v citiespy/tests + name: citiespy-${{ env.CITIESPY_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and the licence run: | @@ -118,15 +135,9 @@ jobs: print("\n".join(n for n in names if n.endswith(".so") or "licenses/" in n)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: citiespy-${{ env.CITIESPY_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish citiespy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ckzg.yml b/.github/workflows/build-ckzg.yml index 52998bef711e..20c8b3b54424 100644 --- a/.github/workflows/build-ckzg.yml +++ b/.github/workflows/build-ckzg.yml @@ -67,7 +67,6 @@ jobs: yum install -y clang && make -C src blst fi cibw-test-requires: PyYAML - cibw-test-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-command: >- python -c "import ckzg; assert ckzg.__file__.endswith('.so'), ckzg.__file__" && cd {package}/bindings/python && diff --git a/.github/workflows/build-clang-format.yml b/.github/workflows/build-clang-format.yml index db31b6acbb6f..675e43e6289c 100644 --- a/.github/workflows/build-clang-format.yml +++ b/.github/workflows/build-clang-format.yml @@ -60,9 +60,7 @@ jobs: cibw-build: cp312-manylinux_riscv64 # Repeats pyproject.toml's own `environment` table: CIBW_ENVIRONMENT replaces # rather than merges with it (gotcha 107). - cibw-environment: >- - CMAKE_GENERATOR=Ninja - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "CMAKE_GENERATOR=Ninja" timeout-minutes: 1440 publish: diff --git a/.github/workflows/build-clevercsv.yml b/.github/workflows/build-clevercsv.yml index ffe99b4cddb0..d73c7f522364 100644 --- a/.github/workflows/build-clevercsv.yml +++ b/.github/workflows/build-clevercsv.yml @@ -57,7 +57,6 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # pandas/wilderness cover the hard imports in tests/test_unit # (test_wrappers.py, test_console.py); faust-cchardet is skipped - # it has no riscv64 wheel, and test_encoding.py already skips diff --git a/.github/workflows/build-clickhouse-connect-core.yml b/.github/workflows/build-clickhouse-connect-core.yml index c87c4a53781a..69bc21d259eb 100644 --- a/.github/workflows/build-clickhouse-connect-core.yml +++ b/.github/workflows/build-clickhouse-connect-core.yml @@ -51,78 +51,83 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build clickhouse-connect-core ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "clickhouse-connect-core" + version: "${{ matrix.version }}" + repository: "ClickHouse/clickhouse-connect" + ref: '' + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + case "${{ matrix.version }}" in + 0.2.3) echo "CLICKHOUSE_CONNECT_TAG=v1.11.0" >> "$GITHUB_ENV" ;; + *) echo "::error::no clickhouse-connect tag known for clickhouse-connect-core ${{ matrix.version }}"; exit 1 ;; + esac + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + git fetch -q --no-tags origin "${CLICKHOUSE_CONNECT_TAG}" + git checkout -q --detach FETCH_HEAD + cibw-package-dir: "rust/ch-core-py" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # rust/ch-core-py ships no [tool.cibuildwheel], so the Rust toolchain + # its maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # binding_ci.yml's own "Build binding and run unit tests" job installs + # the clickhouse_connect driver (`pip install -e . --no-deps`) before + # this exact pytest invocation: several tests (JSON/Variant/Geometry + # fallback paths) import it lazily and fail with ModuleNotFoundError + # otherwise. clickhouse-connect is deliberately NOT in PIP_ONLY_BINARY + # below (gotcha 354's inverse): our own registry only carries a + # riscv64 wheel for every interpreter at the old 1.7.2 release, which + # predates the Geometry/Variant types these tests exercise, and + # carries no musllinux riscv64 wheel at all (build-clickhouse-connect.yml + # only builds manylinux). Leaving it unpinned lets pip fall back to + # PyPI's sdist for the current release on every leg that needs it + # (clickhouse-connect's C extensions are optional - setup.py marks + # them `optional=True` - so the sdist build never fails even without + # a working compiler). Its own runtime deps lz4 and backports.zstd + # (both `python_version < "3.14"` only) stay only-binary where a + # riscv64 wheel exists: backports.zstd has one on both libcs, but + # lz4 has manylinux riscv64 wheels only (neither our registry nor + # PyPI carries a musllinux riscv64 one). Forcing lz4 to binary on + # musllinux cp312/cp313 left pip no candidate and sent it + # backtracking through every clickhouse-connect sdist until the + # 60-minute job timeout, so musllinux lets lz4 build from its sdist + # (it vendors liblz4, needing only the image's C compiler). + cibw-test-requires: "pytest pytest-xdist clickhouse-connect" + cibw-test-environment: "${{ matrix.platform == 'manylinux' && 'PIP_ONLY_BINARY=lz4,backports.zstd' || 'PIP_ONLY_BINARY=backports.zstd' }}" + cibw-test-sources: "rust/ch-core-py/tests" + cibw-test-command: "python -m pytest rust/ch-core-py/tests -n 4" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CLICKHOUSE_CONNECT_CORE_VERSION: ${{ matrix.version }} - steps: - # clickhouse-connect-core is published from ClickHouse/clickhouse-connect's - # rust/ch-core-py/ subdirectory and versioned independently of that repo's - # own tags (CHANGELOG.md: "Its versions are independent of both - # clickhouse-connect and the bundled ch-core-rs crate"), so the mapping to - # a checkout ref is a small explicit table, not a derivation. - - name: Resolve the clickhouse-connect tag for core ${{ env.CLICKHOUSE_CONNECT_CORE_VERSION }} - run: | - case "${{ env.CLICKHOUSE_CONNECT_CORE_VERSION }}" in - 0.2.3) echo "CLICKHOUSE_CONNECT_TAG=v1.11.0" >> "$GITHUB_ENV" ;; - *) echo "::error::no clickhouse-connect tag known for clickhouse-connect-core ${{ env.CLICKHOUSE_CONNECT_CORE_VERSION }}"; exit 1 ;; - esac - - - name: Checkout clickhouse-connect ${{ env.CLICKHOUSE_CONNECT_TAG }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ClickHouse/clickhouse-connect - ref: ${{ env.CLICKHOUSE_CONNECT_TAG }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: rust/ch-core-py - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # rust/ch-core-py ships no [tool.cibuildwheel], so the Rust toolchain - # its maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # binding_ci.yml's own "Build binding and run unit tests" job installs - # the clickhouse_connect driver (`pip install -e . --no-deps`) before - # this exact pytest invocation: several tests (JSON/Variant/Geometry - # fallback paths) import it lazily and fail with ModuleNotFoundError - # otherwise. clickhouse-connect is deliberately NOT in PIP_ONLY_BINARY - # below (gotcha 354's inverse): our own registry only carries a - # riscv64 wheel for every interpreter at the old 1.7.2 release, which - # predates the Geometry/Variant types these tests exercise, and - # carries no musllinux riscv64 wheel at all (build-clickhouse-connect.yml - # only builds manylinux). Leaving it unpinned lets pip fall back to - # PyPI's sdist for the current release on every leg that needs it - # (clickhouse-connect's C extensions are optional - setup.py marks - # them `optional=True` - so the sdist build never fails even without - # a working compiler). Its own runtime deps lz4 and backports.zstd - # (both `python_version < "3.14"` only) stay only-binary where a - # riscv64 wheel exists: backports.zstd has one on both libcs, but - # lz4 has manylinux riscv64 wheels only (neither our registry nor - # PyPI carries a musllinux riscv64 one). Forcing lz4 to binary on - # musllinux cp312/cp313 left pip no candidate and sent it - # backtracking through every clickhouse-connect sdist until the - # 60-minute job timeout, so musllinux lets lz4 build from its sdist - # (it vendors liblz4, needing only the image's C compiler). - CIBW_TEST_REQUIRES: pytest pytest-xdist clickhouse-connect - CIBW_TEST_ENVIRONMENT: ${{ matrix.platform == 'manylinux' && 'PIP_ONLY_BINARY=lz4,backports.zstd' || 'PIP_ONLY_BINARY=backports.zstd' }} - CIBW_TEST_SOURCES: rust/ch-core-py/tests - CIBW_TEST_COMMAND: python -m pytest rust/ch-core-py/tests -n 4 + name: clickhouse-connect-core-${{ env.CLICKHOUSE_CONNECT_CORE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the compiled codec made it into the wheel run: | @@ -138,15 +143,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: clickhouse-connect-core-${{ env.CLICKHOUSE_CONNECT_CORE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish clickhouse-connect-core ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-clickhouse-connect.yml b/.github/workflows/build-clickhouse-connect.yml index 683a277386c1..fdad8d7151d0 100644 --- a/.github/workflows/build-clickhouse-connect.yml +++ b/.github/workflows/build-clickhouse-connect.yml @@ -51,6 +51,78 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build clickhouse-connect ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # Per-interpreter (not abi3), matching upstream's own wheel matrix. + # `test_requires` varies because 3.14 has zstd in the stdlib, and the + # registry ships no free-threaded pandas wheel - so on cp314t the two + # modules that import pandas at module scope are skipped, along with the + # one test that reads pandas' version through the as_pandas converter. + include: + - python: "cp312" + test_requires: "backports.zstd pandas<3.0.4" + pytest_ignore: "" + - python: "cp313" + test_requires: "backports.zstd pandas<3.0.4" + pytest_ignore: "" + - python: "cp314" + test_requires: "pandas<3.0.4" + pytest_ignore: "" + - python: "cp314t" + test_requires: "" + pytest_ignore: >- + --ignore tests/unit_tests/test_driver/test_params.py + --ignore tests/unit_tests/test_driver/test_temporal.py + --deselect tests/unit_tests/test_driver/test_rustnumpy.py::test_time_converter_uses_native_timedelta_dtype + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "clickhouse-connect" + version: "${{ matrix.version }}" + repository: "ClickHouse/clickhouse-connect" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + timeout-minutes: 180 + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + # Upstream builds the wheels without testing them and tests an in-place + # build instead; stage only the suite (plus `examples`, which + # test_async_alembic.py reads via `Path(__file__).parents[3]`) so the + # repo-root `clickhouse_connect/` can't shadow the installed extension + # modules. + cibw-test-sources: "tests examples" + cibw-test-requires: "pytest pytest-asyncio pytest-mock numpy pyarrow sqlalchemy alembic aiohttp ${{ matrix.test_requires }}" + # Keeps a dep whose riscv64 wheel we don't have from silently source-building. + cibw-test-environment: "PIP_ONLY_BINARY=numpy,pyarrow,pandas,sqlalchemy,aiohttp,lz4,backports.zstd" + # tests/unit_tests/test_driver/test_c_parity.py imports driverc directly, so a + # wheel that fell back to pure Python fails here. TestQuery's fixture opens a + # real connection to a ClickHouse server, which has no riscv64 image. + # + # 1.9.0 added an async SQLAlchemy dialect (cc_sqlalchemy/asyncio.py) gated on + # greenlet, which pypi.riseproject.dev doesn't carry and which SQLAlchemy's own + # `greenlet>=1; platform_machine == ...` marker never installs on riscv64 (that + # list is aarch64/ppc64le/x86_64/amd64/win32 only) - so greenlet is genuinely + # absent here, same as upstream's own optional-dependency gating intends. Per + # CLAUDE.md gotcha 212, running the suite (not grepping) found one file that + # fails to collect and two more tests, in otherwise-passing files, that import + # the dialect lazily inside the test body: + # test_async_dialect.py: ImportError at collection (--ignore, whole file). + # test_async_alembic.py::test_async_alembic_offline_context_compiles_without_client + # and test_async_dialect_version.py::test_async_dialect_sqlalchemy_version_guard: + # both `patch(...)`/`importlib.import_module(...)` the dialect module at call + # time (--deselect, keeping the rest of each file). + # SQLAlchemy 2.1 dropped greenlet from its default deps entirely (only the + # `asyncio` extra pulls it in) and now raises ImportError on a bare + # `import sqlalchemy.ext.asyncio` without it, so + # test_async_alembic.py::test_checked_in_async_alembic_environment_carries_clickhouse_hooks, + # which `patch(...)`es sqlalchemy.ext.asyncio.async_engine_from_config, fails + # too (AttributeError: 'sqlalchemy.ext' has no attribute 'asyncio') - --deselect. + cibw-test-command: "python -m pytest tests/unit_tests -k \"not TestQuery\" --ignore tests/unit_tests/test_sqlalchemy/test_async_dialect.py --deselect tests/unit_tests/test_sqlalchemy/test_async_alembic.py::test_async_alembic_offline_context_compiles_without_client --deselect tests/unit_tests/test_sqlalchemy/test_async_alembic.py::test_checked_in_async_alembic_environment_carries_clickhouse_hooks --deselect tests/unit_tests/test_sqlalchemy/test_async_dialect_version.py::test_async_dialect_sqlalchemy_version_guard ${{ matrix.pytest_ignore }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: @@ -59,7 +131,7 @@ jobs: version: ${{ fromJSON(needs.setup.outputs.versions) }} # Per-interpreter (not abi3), matching upstream's own wheel matrix. # `test_requires` varies because 3.14 has zstd in the stdlib, and the - # registry ships no free-threaded pandas wheel — so on cp314t the two + # registry ships no free-threaded pandas wheel -- so on cp314t the two # modules that import pandas at module scope are skipped, along with the # one test that reads pandas' version through the as_pandas converter. include: @@ -78,65 +150,14 @@ jobs: --ignore tests/unit_tests/test_driver/test_params.py --ignore tests/unit_tests/test_driver/test_temporal.py --deselect tests/unit_tests/test_driver/test_rustnumpy.py::test_time_converter_uses_native_timedelta_dtype - env: CLICKHOUSE_CONNECT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout clickhouse-connect v${{ env.CLICKHOUSE_CONNECT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ClickHouse/clickhouse-connect - ref: v${{ env.CLICKHOUSE_CONNECT_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream builds the wheels without testing them and tests an in-place - # build instead; stage only the suite (plus `examples`, which - # test_async_alembic.py reads via `Path(__file__).parents[3]`) so the - # repo-root `clickhouse_connect/` can't shadow the installed extension - # modules. - CIBW_TEST_SOURCES: tests examples - CIBW_TEST_REQUIRES: pytest pytest-asyncio pytest-mock numpy pyarrow sqlalchemy alembic aiohttp ${{ matrix.test_requires }} - # Keeps a dep whose riscv64 wheel we don't have from silently source-building. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,pyarrow,pandas,sqlalchemy,aiohttp,lz4,backports.zstd - # tests/unit_tests/test_driver/test_c_parity.py imports driverc directly, so a - # wheel that fell back to pure Python fails here. TestQuery's fixture opens a - # real connection to a ClickHouse server, which has no riscv64 image. - # - # 1.9.0 added an async SQLAlchemy dialect (cc_sqlalchemy/asyncio.py) gated on - # greenlet, which pypi.riseproject.dev doesn't carry and which SQLAlchemy's own - # `greenlet>=1; platform_machine == ...` marker never installs on riscv64 (that - # list is aarch64/ppc64le/x86_64/amd64/win32 only) — so greenlet is genuinely - # absent here, same as upstream's own optional-dependency gating intends. Per - # CLAUDE.md gotcha 212, running the suite (not grepping) found one file that - # fails to collect and two more tests, in otherwise-passing files, that import - # the dialect lazily inside the test body: - # test_async_dialect.py: ImportError at collection (--ignore, whole file). - # test_async_alembic.py::test_async_alembic_offline_context_compiles_without_client - # and test_async_dialect_version.py::test_async_dialect_sqlalchemy_version_guard: - # both `patch(...)`/`importlib.import_module(...)` the dialect module at call - # time (--deselect, keeping the rest of each file). - # SQLAlchemy 2.1 dropped greenlet from its default deps entirely (only the - # `asyncio` extra pulls it in) and now raises ImportError on a bare - # `import sqlalchemy.ext.asyncio` without it, so - # test_async_alembic.py::test_checked_in_async_alembic_environment_carries_clickhouse_hooks, - # which `patch(...)`es sqlalchemy.ext.asyncio.async_engine_from_config, fails - # too (AttributeError: 'sqlalchemy.ext' has no attribute 'asyncio') — --deselect. - CIBW_TEST_COMMAND: >- - python -m pytest tests/unit_tests -k "not TestQuery" - --ignore tests/unit_tests/test_sqlalchemy/test_async_dialect.py - --deselect tests/unit_tests/test_sqlalchemy/test_async_alembic.py::test_async_alembic_offline_context_compiles_without_client - --deselect tests/unit_tests/test_sqlalchemy/test_async_alembic.py::test_checked_in_async_alembic_environment_carries_clickhouse_hooks - --deselect tests/unit_tests/test_sqlalchemy/test_async_dialect_version.py::test_async_dialect_sqlalchemy_version_guard - ${{ matrix.pytest_ignore }} + name: clickhouse-connect-${{ env.CLICKHOUSE_CONNECT_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Check the Cython extensions made it into the wheel run: | @@ -153,15 +174,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: clickhouse-connect-${{ env.CLICKHOUSE_CONNECT_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish clickhouse-connect ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-clickhouse-driver.yml b/.github/workflows/build-clickhouse-driver.yml index 8d14ae833b7b..93fddee6e0c0 100644 --- a/.github/workflows/build-clickhouse-driver.yml +++ b/.github/workflows/build-clickhouse-driver.yml @@ -49,44 +49,43 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build clickhouse-driver ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "clickhouse-driver" + version: "${{ matrix.version }}" + repository: "mymarilyn/clickhouse-driver" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-build: "pip install cython" + cibw-test-sources: "tests" + cibw-test-requires: "pytest" + # Upstream's wheel jobs run no tests; the suite needs a live ClickHouse + # server, which publishes no riscv64 image. These modules are the ones that + # run without one, and they cover all four compiled extensions. + cibw-test-command: "python -m pytest -v tests/test_errors.py tests/test_buffered_reader.py tests/test_varint.py tests/test_util.py tests/columns/test_dynamic_shared_value.py tests/columns/test_unknown.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: CLICKHOUSE_DRIVER_VERSION: ${{ matrix.version }} - steps: - - name: Checkout clickhouse-driver ${{ env.CLICKHOUSE_DRIVER_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: mymarilyn/clickhouse-driver - ref: ${{ env.CLICKHOUSE_DRIVER_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_BUILD: pip install cython - CIBW_TEST_SOURCES: tests - CIBW_TEST_REQUIRES: pytest - # Upstream's wheel jobs run no tests; the suite needs a live ClickHouse - # server, which publishes no riscv64 image. These modules are the ones that - # run without one, and they cover all four compiled extensions. - CIBW_TEST_COMMAND: >- - python -m pytest -v - tests/test_errors.py - tests/test_buffered_reader.py - tests/test_varint.py - tests/test_util.py - tests/columns/test_dynamic_shared_value.py - tests/columns/test_unknown.py + name: clickhouse-driver-${{ env.CLICKHOUSE_DRIVER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the compiled extensions made it into the wheel run: | @@ -106,15 +105,9 @@ jobs: print(whl, 'ok') EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: clickhouse-driver-${{ env.CLICKHOUSE_DRIVER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish clickhouse-driver ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-clingo.yml b/.github/workflows/build-clingo.yml index 22e309b0ccfd..dba10c0506a0 100644 --- a/.github/workflows/build-clingo.yml +++ b/.github/workflows/build-clingo.yml @@ -48,43 +48,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build clingo ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "clingo" + version: "${{ matrix.version }}" + repository: "potassco/clingo" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "recursive" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # cffi, a runtime dependency of the built extension, has no riscv64 + # wheel on public PyPI. + # The wheel does not ship libpyclingo/clingo/tests (CMake installs + # only *.py/*.typed); stage it and copy it next to the installed + # package so its relative imports resolve, then run it exactly as + # CMake's own `test_pyclingo` target does (gotcha 513). + cibw-test-sources: "libpyclingo/clingo/tests" + cibw-test-command: "python -c \"import clingo, os, shutil; d = os.path.dirname(clingo.__file__); shutil.copytree('libpyclingo/clingo/tests', os.path.join(d, 'tests'))\" && python -m unittest discover -s \"$(python -c 'import clingo, os; print(os.path.dirname(clingo.__file__))')/tests\" -t \"$(python -c 'import clingo, os; print(os.path.dirname(os.path.dirname(clingo.__file__)))')\" -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CLINGO_VERSION: ${{ matrix.version }} - steps: - - name: Checkout clingo v${{ env.CLINGO_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: potassco/clingo - ref: v${{ env.CLINGO_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cffi, a runtime dependency of the built extension, has no riscv64 - # wheel on public PyPI. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # The wheel does not ship libpyclingo/clingo/tests (CMake installs - # only *.py/*.typed); stage it and copy it next to the installed - # package so its relative imports resolve, then run it exactly as - # CMake's own `test_pyclingo` target does (gotcha 513). - CIBW_TEST_SOURCES: libpyclingo/clingo/tests - CIBW_TEST_COMMAND: >- - python -c "import clingo, os, shutil; d = os.path.dirname(clingo.__file__); shutil.copytree('libpyclingo/clingo/tests', os.path.join(d, 'tests'))" && - python -m unittest discover -s "$(python -c 'import clingo, os; print(os.path.dirname(clingo.__file__))')/tests" -t "$(python -c 'import clingo, os; print(os.path.dirname(os.path.dirname(clingo.__file__)))')" -v + name: clingo-${{ env.CLINGO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extension run: | @@ -97,15 +101,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: clingo-${{ env.CLINGO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish clingo ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-clp-ffi-py.yml b/.github/workflows/build-clp-ffi-py.yml index 3c5cae9d90e8..f53250a921c6 100644 --- a/.github/workflows/build-clp-ffi-py.yml +++ b/.github/workflows/build-clp-ffi-py.yml @@ -49,49 +49,54 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build clp-ffi-py ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "clp-ffi-py" + version: "${{ matrix.version }}" + repository: "y-scope/clp-ffi-py" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "recursive" + pre-build: |- + cp src/clp/LICENSE LICENSE.clp-core + cp src/GSL/LICENSE LICENSE.GSL + cp src/msgpack/LICENSE_1_0.txt LICENSE.msgpack + test -s LICENSE.clp-core + test -s LICENSE.GSL + test -s LICENSE.msgpack + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "smart_open==6.4.0" + cibw-test-command: "python -m unittest discover --failfast --verbose --start-directory={package}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CLP_FFI_PY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout clp-ffi-py v${{ env.CLP_FFI_PY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: y-scope/clp-ffi-py - ref: v${{ env.CLP_FFI_PY_VERSION }} - submodules: recursive - persist-credentials: false - - # CLP core (src/clp, Apache-2.0), GSL (src/GSL, MIT) and msgpack-c - # (src/msgpack, BSL-1.0) are compiled/pulled in as submodules but the - # real PyPI wheel ships only clp-ffi-py's own LICENSE; stage their - # notices too for scikit-build-core's default license-files glob. - - name: Stage the vendored dependencies' licences - run: | - cp src/clp/LICENSE LICENSE.clp-core - cp src/GSL/LICENSE LICENSE.GSL - cp src/msgpack/LICENSE_1_0.txt LICENSE.msgpack - test -s LICENSE.clp-core - test -s LICENSE.GSL - test -s LICENSE.msgpack - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: smart_open==6.4.0 - CIBW_TEST_COMMAND: >- - python -m unittest discover --failfast --verbose --start-directory={package}/tests + name: clp-ffi-py-${{ env.CLP_FFI_PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -106,15 +111,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: clp-ffi-py-${{ env.CLP_FFI_PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish clp-ffi-py ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-clvm-rs.yml b/.github/workflows/build-clvm-rs.yml index fd7f78567394..20e7eadd1ee2 100644 --- a/.github/workflows/build-clvm-rs.yml +++ b/.github/workflows/build-clvm-rs.yml @@ -50,51 +50,64 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build clvm-rs ${{ matrix.version }} cp310-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "clvm-rs" + version: "${{ matrix.version }}" + repository: "Chia-Network/clvm_rs" + ref: "${{ matrix.version }}" + artifact-tag: "cp310-abi3-manylinux_riscv64" + timeout-minutes: 360 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/clvm-rs/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cp LICENSE wheel/LICENSE + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "wheel" + cibw-build: "cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "wheel/python/tests" + cibw-test-command: "cd wheel/python && pytest --import-mode append tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CLVM_RS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout clvm_rs ${{ env.CLVM_RS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Chia-Network/clvm_rs - ref: ${{ env.CLVM_RS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch clvm_rs source - run: git apply python-wheels/patches/clvm-rs/${{ env.CLVM_RS_VERSION }}/*.patch - - # wheel/Cargo.toml's license-file is relative to wheel/, and upstream's wheels carry no LICENSE at all. - - run: cp LICENSE wheel/LICENSE - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: wheel - output-dir: wheelhouse/ - env: - CIBW_BUILD: >- - cp310-manylinux_riscv64 cp311-manylinux_riscv64 - cp312-manylinux_riscv64 cp313-manylinux_riscv64 - cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: wheel/python/tests - CIBW_TEST_COMMAND: cd wheel/python && pytest --import-mode append tests + name: clvm-rs-${{ env.CLVM_RS_VERSION }}-cp310-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -107,16 +120,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: clvm-rs-${{ env.CLVM_RS_VERSION }}-cp310-abi3-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish clvm-rs ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-clvm-tools-rs.yml b/.github/workflows/build-clvm-tools-rs.yml index 61b0f45b66b9..4f35a4c4b4b8 100644 --- a/.github/workflows/build-clvm-tools-rs.yml +++ b/.github/workflows/build-clvm-tools-rs.yml @@ -53,46 +53,49 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build clvm-tools-rs ${{ matrix.version }} cp39-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "clvm-tools-rs" + version: "${{ matrix.version }}" + repository: "Chia-Network/clvm_tools_rs" + ref: "${{ matrix.version }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 360 + # pyo3 is built with the `abi3-py39` feature (Cargo.toml), so maturin + # emits a single cp39-abi3 wheel matching the one Linux wheel upstream + # publishes per arch. cibuildwheel compiles once for cp312 and reuses + # that wheel for cp313/cp314 while still running the test phase on + # each. musllinux is excluded because rustup.rs ships no riscv64 musl + # toolchain, and cp314t is excluded because upstream ships no + # free-threaded wheel (abi3 has no free-threaded ABI). + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # clvm_tools_rs ships no [tool.cibuildwheel], so install the Rust + # toolchain its maturin backend needs in-container and put it on PATH. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # Two of upstream's own self-contained resources/tests scripts (no + # external clvm/clvm_rs/clvm_tools checkouts needed): plain compiler + # and step-execution smoke tests exercised against the built wheel. + cibw-test-sources: "resources/tests" + cibw-test-command: "python resources/tests/test_clvm_step.py && python resources/tests/test_compile_from_string.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: CLVM_TOOLS_RS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout clvm_tools_rs ${{ env.CLVM_TOOLS_RS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Chia-Network/clvm_tools_rs - ref: ${{ env.CLVM_TOOLS_RS_VERSION }} - persist-credentials: false - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # pyo3 is built with the `abi3-py39` feature (Cargo.toml), so maturin - # emits a single cp39-abi3 wheel matching the one Linux wheel upstream - # publishes per arch. cibuildwheel compiles once for cp312 and reuses - # that wheel for cp313/cp314 while still running the test phase on - # each. musllinux is excluded because rustup.rs ships no riscv64 musl - # toolchain, and cp314t is excluded because upstream ships no - # free-threaded wheel (abi3 has no free-threaded ABI). - CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # clvm_tools_rs ships no [tool.cibuildwheel], so install the Rust - # toolchain its maturin backend needs in-container and put it on PATH. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' - # Two of upstream's own self-contained resources/tests scripts (no - # external clvm/clvm_rs/clvm_tools checkouts needed): plain compiler - # and step-execution smoke tests exercised against the built wheel. - CIBW_TEST_SOURCES: resources/tests - CIBW_TEST_COMMAND: >- - python resources/tests/test_clvm_step.py && - python resources/tests/test_compile_from_string.py + name: clvm-tools-rs-${{ env.CLVM_TOOLS_RS_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -105,15 +108,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: clvm-tools-rs-${{ env.CLVM_TOOLS_RS_VERSION }}-cp39-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish clvm-tools-rs ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-assimp.yml b/.github/workflows/build-cmeel-assimp.yml index a70e5964005e..42b177a0e2f6 100644 --- a/.github/workflows/build-cmeel-assimp.yml +++ b/.github/workflows/build-cmeel-assimp.yml @@ -48,37 +48,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-assimp ${{ matrix.version }} manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-assimp" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-assimp" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 360 + checkout-submodules: "true" + # has-sitelib = false: the wheel holds no Python extension, so one + # py3-none wheel covers every interpreter. + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_ASSIMP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cmeel-assimp v${{ env.CMEEL_ASSIMP_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/cmeel-assimp - ref: v${{ env.CMEEL_ASSIMP_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-assimp-${{ env.CMEEL_ASSIMP_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -122,15 +129,9 @@ jobs: "$prefix/bin/assimp" info tetra.ply | tee info.log grep -Eq '^Faces: +4$' info.log - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-assimp-${{ env.CMEEL_ASSIMP_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-assimp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-boost.yml b/.github/workflows/build-cmeel-boost.yml index 7e1c0279e4ec..2038211fe304 100644 --- a/.github/workflows/build-cmeel-boost.yml +++ b/.github/workflows/build-cmeel-boost.yml @@ -48,40 +48,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-boost ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-boost" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-boost" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 480 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy has no riscv64 wheel on public PyPI; needed both at build time + # (build-system.requires) and at install time. + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # Boost's shared libs already carry a hardcoded $ORIGIN RPATH + # (CMakeLists.txt's hardcode-dll-paths=true); repair would only + # re-tag them, so skip it as upstream's own release.yml does. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 480 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CMEEL_BOOST_VERSION: ${{ matrix.version }} - steps: - # cmeel-boost's own release tags carry a trailing packaging-revision - # suffix (.c0) that isn't part of the wheel's own version. - - name: Checkout cmeel-boost v${{ env.CMEEL_BOOST_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cmake-wheel/cmeel-boost - ref: v${{ env.CMEEL_BOOST_VERSION }}.c0 - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy has no riscv64 wheel on public PyPI; needed both at build time - # (build-system.requires) and at install time. - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Boost's shared libs already carry a hardcoded $ORIGIN RPATH - # (CMakeLists.txt's hardcode-dll-paths=true); repair would only - # re-tag them, so skip it as upstream's own release.yml does. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-boost-${{ env.CMEEL_BOOST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -94,15 +99,9 @@ jobs: assert any("libboost_numpy" in n for n in libs), libs EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-boost-${{ env.CMEEL_BOOST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-boost ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-cddlib.yml b/.github/workflows/build-cmeel-cddlib.yml index b835d8e491c8..05d3f3ce330a 100644 --- a/.github/workflows/build-cmeel-cddlib.yml +++ b/.github/workflows/build-cmeel-cddlib.yml @@ -48,59 +48,68 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-cddlib ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-cddlib" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-cddlib" + ref: "v${{ matrix.version }}.c2" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + pre-build: |- + # The real published wheel (cmeel_cddlib-0.94.13-2-py3-none-manylinux_2_28_x86_64.whl, + # confirmed via unzip -l) ships no LICENSE/COPYING file at all - the same gap + # already found and fixed for cmeel-m4/cmeel-glpk, present in the upstream + # cmake-wheel/cmeel-cddlib wrapper itself on every platform, not riscv64-specific. + # cddlib's own release tarball (cddlib-0.94m.tar.gz, the ORIGINAL_VERSION this + # tag's CMakeLists.txt pins, confirmed by reading it at this exact tag rather + # than the "cmeel" dev branch's newer 0.94n) ships COPYING at its top level + # (confirmed: tar -tzf cddlib-0.94m.tar.gz). This wrapper's + # ExternalProject_Add(cddlib ...) uses BUILD_IN_SOURCE ON with no explicit + # SOURCE_DIR, so CMake's own documented default applies (confirmed against the + # real ExternalProject.cmake module source and its extractfile.cmake.in + # single-top-level-directory-rename logic, not guessed): SOURCE_DIR = + # /cddlib-prefix/src/cddlib, so COPYING lands there + # once the build step runs, before the top-level install() rules execute. Add + # a second install(FILES ...) rule beside the wrapper's existing "dummy + # README.md" one, pointing at that path. + sed -i '/^install(FILES README.md DESTINATION share\/cmeel-\${NAME}\/)$/a install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}-prefix/src/${NAME}/COPYING" DESTINATION share/cmeel-${NAME}/)' CMakeLists.txt + grep -n COPYING CMakeLists.txt + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # cddlib is a leaf dependency (requires_dist: cmeel only), no cross-package + # library linking here to repair; cmeel installs into a shared prefix. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_CDDLIB_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-cddlib v${{ env.CMEEL_CDDLIB_VERSION }}.c2 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/cmeel-cddlib - ref: v${{ env.CMEEL_CDDLIB_VERSION }}.c2 - submodules: true - persist-credentials: false - - - name: Install upstream's COPYING into the wheel - run: | - # The real published wheel (cmeel_cddlib-0.94.13-2-py3-none-manylinux_2_28_x86_64.whl, - # confirmed via unzip -l) ships no LICENSE/COPYING file at all - the same gap - # already found and fixed for cmeel-m4/cmeel-glpk, present in the upstream - # cmake-wheel/cmeel-cddlib wrapper itself on every platform, not riscv64-specific. - # cddlib's own release tarball (cddlib-0.94m.tar.gz, the ORIGINAL_VERSION this - # tag's CMakeLists.txt pins, confirmed by reading it at this exact tag rather - # than the "cmeel" dev branch's newer 0.94n) ships COPYING at its top level - # (confirmed: tar -tzf cddlib-0.94m.tar.gz). This wrapper's - # ExternalProject_Add(cddlib ...) uses BUILD_IN_SOURCE ON with no explicit - # SOURCE_DIR, so CMake's own documented default applies (confirmed against the - # real ExternalProject.cmake module source and its extractfile.cmake.in - # single-top-level-directory-rename logic, not guessed): SOURCE_DIR = - # /cddlib-prefix/src/cddlib, so COPYING lands there - # once the build step runs, before the top-level install() rules execute. Add - # a second install(FILES ...) rule beside the wrapper's existing "dummy - # README.md" one, pointing at that path. - sed -i '/^install(FILES README.md DESTINATION share\/cmeel-\${NAME}\/)$/a install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}-prefix/src/${NAME}/COPYING" DESTINATION share/cmeel-${NAME}/)' CMakeLists.txt - grep -n COPYING CMakeLists.txt - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG - # cddlib is a leaf dependency (requires_dist: cmeel only), no cross-package - # library linking here to repair; cmeel installs into a shared prefix. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-cddlib-${{ env.CMEEL_CDDLIB_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -130,15 +139,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-cddlib-${{ env.CMEEL_CDDLIB_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-cddlib ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-clp.yml b/.github/workflows/build-cmeel-clp.yml index 2f674f191ef8..963975af92ae 100644 --- a/.github/workflows/build-cmeel-clp.yml +++ b/.github/workflows/build-cmeel-clp.yml @@ -48,52 +48,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-clp ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-clp" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-clp" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + cibw-build: "cp312-manylinux_riscv64" + # pyproject.toml's build-system.requires pulls in cmeel-coinutils + # with no version pin; without PIP_EXTRA_INDEX_URL, pip's + # build-isolation install only sees the default PyPI index (where + # cmeel-coinutils has no riscv64 wheel), so it would fall back to + # building cmeel-coinutils from its sdist instead of installing our + # already-published riscv64 wheel. Unlike cmeel-metis's own + # bolted-on target_link_libraries patch for GKlib, this wrapper's + # CMakeLists.txt resolves CoinUtils the standard way (pkg_check_modules, + # confirmed against the real cmake-wheel/cmeel-clp source) and bakes + # -Wl,-rpath,'$ORIGIN/../lib' itself, so once CoinUtils installs + # from a wheel at build time, the RPATH it finds is already correct + # for the shared cmeel.prefix/lib layout at runtime. + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets + # itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_CLP_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-clp v${{ env.CMEEL_CLP_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/cmeel-clp - ref: v${{ env.CMEEL_CLP_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # pyproject.toml's build-system.requires pulls in cmeel-coinutils - # with no version pin; without PIP_EXTRA_INDEX_URL, pip's - # build-isolation install only sees the default PyPI index (where - # cmeel-coinutils has no riscv64 wheel), so it would fall back to - # building cmeel-coinutils from its sdist instead of installing our - # already-published riscv64 wheel. Unlike cmeel-metis's own - # bolted-on target_link_libraries patch for GKlib, this wrapper's - # CMakeLists.txt resolves CoinUtils the standard way (pkg_check_modules, - # confirmed against the real cmake-wheel/cmeel-clp source) and bakes - # -Wl,-rpath,'$ORIGIN/../lib' itself, so once CoinUtils installs - # from a wheel at build time, the RPATH it finds is already correct - # for the shared cmeel.prefix/lib layout at runtime. - CIBW_ENVIRONMENT: >- - CMEEL_LOG_LEVEL=DEBUG - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets - # itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-clp-${{ env.CMEEL_CLP_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -128,15 +131,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-clp-${{ env.CMEEL_CLP_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-clp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-coinutils.yml b/.github/workflows/build-cmeel-coinutils.yml index 4e6ff1fca2f7..c684a860b259 100644 --- a/.github/workflows/build-cmeel-coinutils.yml +++ b/.github/workflows/build-cmeel-coinutils.yml @@ -48,45 +48,50 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-coinutils ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-coinutils" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-coinutils" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # CoinUtils' own autotools build (./configure && make && make check + # && make install, see CMakeLists.txt's ExternalProject_Add) carries + # a modern (2024-01-01) config.guess/config.sub that already + # recognizes riscv64, and its configure.ac/Makefile.am carry no + # -march=native or other x86-specific flag (confirmed against the + # real coin-or/CoinUtils releases/2.11.13 source) -- unlike + # cmeel-gklib, no patch or environment workaround is needed here. + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets + # itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_COINUTILS_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-coinutils v${{ env.CMEEL_COINUTILS_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cmake-wheel/cmeel-coinutils - ref: v${{ env.CMEEL_COINUTILS_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG - # CoinUtils' own autotools build (./configure && make && make check - # && make install, see CMakeLists.txt's ExternalProject_Add) carries - # a modern (2024-01-01) config.guess/config.sub that already - # recognizes riscv64, and its configure.ac/Makefile.am carry no - # -march=native or other x86-specific flag (confirmed against the - # real coin-or/CoinUtils releases/2.11.13 source) -- unlike - # cmeel-gklib, no patch or environment workaround is needed here. - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets - # itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-coinutils-${{ env.CMEEL_COINUTILS_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -115,15 +120,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-coinutils-${{ env.CMEEL_COINUTILS_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-coinutils ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-console-bridge.yml b/.github/workflows/build-cmeel-console-bridge.yml index 30d0b4ed0e67..542578924fef 100644 --- a/.github/workflows/build-cmeel-console-bridge.yml +++ b/.github/workflows/build-cmeel-console-bridge.yml @@ -48,40 +48,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-console-bridge ${{ matrix.version }} manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-console-bridge" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-console-bridge" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + cibw-build: "cp312-manylinux_riscv64" + # console_bridge declares cmake_minimum_required(VERSION 3.0.2) and cmeel[build] + # resolves CMake >= 4, which refuses it; the cmeel backend owns the configure + # line, so the floor goes in the environment (gotcha 257). + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG CMAKE_POLICY_VERSION_MINIMUM=3.5" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_CONSOLE_BRIDGE_VERSION: ${{ matrix.version }} - steps: - # The wheel holds no Python extension ([tool.cmeel] has-sitelib = false), so one - # py3-none-manylinux_riscv64 wheel covers every interpreter. - - name: Checkout cmeel-console-bridge v${{ env.CMEEL_CONSOLE_BRIDGE_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cmake-wheel/cmeel-console-bridge - ref: v${{ env.CMEEL_CONSOLE_BRIDGE_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # console_bridge declares cmake_minimum_required(VERSION 3.0.2) and cmeel[build] - # resolves CMake >= 4, which refuses it; the cmeel backend owns the configure - # line, so the floor goes in the environment (gotcha 257). - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG CMAKE_POLICY_VERSION_MINIMUM=3.5 - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-console-bridge-${{ env.CMEEL_CONSOLE_BRIDGE_VERSION }}-py3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -109,15 +114,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-console-bridge-${{ env.CMEEL_CONSOLE_BRIDGE_VERSION }}-py3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-console-bridge ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-cppad.yml b/.github/workflows/build-cmeel-cppad.yml index e144746766d0..6977976c191a 100644 --- a/.github/workflows/build-cmeel-cppad.yml +++ b/.github/workflows/build-cmeel-cppad.yml @@ -48,43 +48,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-cppad ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-cppad" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-cppad" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + cibw-build: "cp312-manylinux_riscv64" + # CppAD's own CMakeLists.txt declares cmake_minimum_required(VERSION + # 3.5), exactly at the floor CMake >= 4 still accepts, and carries no + # -march=native/-mavx/-msse or other x86-specific flags anywhere in + # its CMake tree (confirmed against the real coin-or/CppAD source at + # the pinned submodule commit) - unlike cmeel-gklib, no workaround + # needed here. + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_CPPAD_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-cppad v${{ env.CMEEL_CPPAD_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cmake-wheel/cmeel-cppad - ref: v${{ env.CMEEL_CPPAD_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # CppAD's own CMakeLists.txt declares cmake_minimum_required(VERSION - # 3.5), exactly at the floor CMake >= 4 still accepts, and carries no - # -march=native/-mavx/-msse or other x86-specific flags anywhere in - # its CMake tree (confirmed against the real coin-or/CppAD source at - # the pinned submodule commit) - unlike cmeel-gklib, no workaround - # needed here. - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-cppad-${{ env.CMEEL_CPPAD_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -115,15 +120,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-cppad-${{ env.CMEEL_CPPAD_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-cppad ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-fmt.yml b/.github/workflows/build-cmeel-fmt.yml index b50b84380bd1..7eda1316f15c 100644 --- a/.github/workflows/build-cmeel-fmt.yml +++ b/.github/workflows/build-cmeel-fmt.yml @@ -48,37 +48,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-fmt ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-fmt" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-fmt" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_FMT_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-fmt v${{ env.CMEEL_FMT_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cmake-wheel/cmeel-fmt - ref: v${{ env.CMEEL_FMT_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-fmt-${{ env.CMEEL_FMT_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -106,15 +111,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-fmt-${{ env.CMEEL_FMT_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-fmt ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-gklib.yml b/.github/workflows/build-cmeel-gklib.yml index a24bd99c28f1..3998f6eb0d66 100644 --- a/.github/workflows/build-cmeel-gklib.yml +++ b/.github/workflows/build-cmeel-gklib.yml @@ -48,66 +48,75 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-gklib ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-gklib" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-GKlib" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + pre-build: |- + # GKlib's own CMakeLists.txt keys NO_X86 off CMAKE_SYSTEM_PROCESSOR + # (anything not x86/amd64 gets NO_X86=ON), but that flag only gates + # one optional helper app (apps/gkuniq.c), not the library itself. + # The library's own -march=native (GKlibSystem.cmake, gated only by + # a PPC-specific regex, unrelated to NO_X86) breaks every C file on + # riscv64: this toolchain's GCC errors on native-CPU detection + # ("ISA string must begin with rv32 or rv64") instead of producing + # one. GKlib itself is fetched fresh by this wrapper's own + # ExternalProject_Add (not vendored here), so the fix is a + # PATCH_COMMAND, confirmed line-for-line against the real + # GKlibSystem.cmake at the pinned commit (8bd6bad750b2) before + # writing this sed: scope -march=native to real x86 the same way + # the PPC branch is already scoped, instead of leaving it as the + # unconditional "everything else" fallback. + cat > gklib-riscv64-no-march-native.sh <<'SCRIPT' + #!/bin/sh + set -e + sed -i '/CMAKE_SYSTEM_PROCESSOR MATCHES "power|ppc|powerpc|ppc64|powerpc64" OR (APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64"))/{n;n;s/^else()$/elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")/}' GKlibSystem.cmake + SCRIPT + chmod +x gklib-riscv64-no-march-native.sh + sed -i '/DOWNLOAD_EXTRACT_TIMESTAMP OFF/a\ PATCH_COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/gklib-riscv64-no-march-native.sh' CMakeLists.txt + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-manylinux_riscv64" + # GKlib's own CMakeLists.txt declares cmake_minimum_required(VERSION 2.8) + # with no , and cmeel[build] resolves CMake >= 4, which refuses + # anything below 3.5 outright ("Compatibility with CMake < 3.5 has been + # removed"); the cmeel backend owns the configure line, so the floor goes + # in the environment, same as cmeel-yaml-cpp's build (gotcha 257). + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG CMAKE_POLICY_VERSION_MINIMUM=3.5" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_GKLIB_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-gklib v${{ env.CMEEL_GKLIB_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/cmeel-GKlib - ref: v${{ env.CMEEL_GKLIB_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Patch GKlib's -march=native for riscv64 - run: | - # GKlib's own CMakeLists.txt keys NO_X86 off CMAKE_SYSTEM_PROCESSOR - # (anything not x86/amd64 gets NO_X86=ON), but that flag only gates - # one optional helper app (apps/gkuniq.c), not the library itself. - # The library's own -march=native (GKlibSystem.cmake, gated only by - # a PPC-specific regex, unrelated to NO_X86) breaks every C file on - # riscv64: this toolchain's GCC errors on native-CPU detection - # ("ISA string must begin with rv32 or rv64") instead of producing - # one. GKlib itself is fetched fresh by this wrapper's own - # ExternalProject_Add (not vendored here), so the fix is a - # PATCH_COMMAND, confirmed line-for-line against the real - # GKlibSystem.cmake at the pinned commit (8bd6bad750b2) before - # writing this sed: scope -march=native to real x86 the same way - # the PPC branch is already scoped, instead of leaving it as the - # unconditional "everything else" fallback. - cat > gklib-riscv64-no-march-native.sh <<'SCRIPT' - #!/bin/sh - set -e - sed -i '/CMAKE_SYSTEM_PROCESSOR MATCHES "power|ppc|powerpc|ppc64|powerpc64" OR (APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64"))/{n;n;s/^else()$/elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")/}' GKlibSystem.cmake - SCRIPT - chmod +x gklib-riscv64-no-march-native.sh - sed -i '/DOWNLOAD_EXTRACT_TIMESTAMP OFF/a\ PATCH_COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/gklib-riscv64-no-march-native.sh' CMakeLists.txt - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # GKlib's own CMakeLists.txt declares cmake_minimum_required(VERSION 2.8) - # with no , and cmeel[build] resolves CMake >= 4, which refuses - # anything below 3.5 outright ("Compatibility with CMake < 3.5 has been - # removed"); the cmeel backend owns the configure line, so the floor goes - # in the environment, same as cmeel-yaml-cpp's build (gotcha 257). - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG CMAKE_POLICY_VERSION_MINIMUM=3.5 - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-gklib-${{ env.CMEEL_GKLIB_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -136,15 +145,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-gklib-${{ env.CMEEL_GKLIB_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-gklib ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-glpk.yml b/.github/workflows/build-cmeel-glpk.yml index ea56daa8c241..6fa6d694d85d 100644 --- a/.github/workflows/build-cmeel-glpk.yml +++ b/.github/workflows/build-cmeel-glpk.yml @@ -48,72 +48,85 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-glpk ${{ matrix.version }} py3-none-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: - CMEEL_GLPK_VERSION: ${{ matrix.version }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-glpk" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-glpk" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + pre-build: |- + # The real published wheel (cmeel_glpk-5.0-0-py3-none-manylinux_2_28_x86_64.whl, + # confirmed via unzip -l) ships no LICENSE/COPYING file at all - a gap against + # patching-and-licensing.md's "wheel carries the LICENSE file(s) from the + # upstream source" rule, present in the upstream cmake-wheel/cmeel-glpk + # wrapper itself on every platform, not riscv64-specific (same finding as + # cmeel-m4's identical gap). GNU GLPK's own release tarball ships COPYING at + # its top level (confirmed: tar -tzf glpk-5.0.tar.gz). This wrapper's + # ExternalProject_Add(glpk ...) uses BUILD_IN_SOURCE ON with no explicit + # SOURCE_DIR, so CMake's own documented default applies (confirmed against the + # real ExternalProject.cmake module source and its extractfile.cmake.in + # single-top-level-directory-rename logic, not guessed): SOURCE_DIR = + # /glpk-prefix/src/glpk, so COPYING lands there once + # the build step runs, before the top-level install() rules execute. Add a + # second install(FILES ...) rule beside the wrapper's existing "dummy + # README.md" one, pointing at that path. + sed -i '/^install(FILES README.md DESTINATION share\/cmeel-\${NAME}\/)$/a install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}-prefix/src/${NAME}/COPYING" DESTINATION share/cmeel-${NAME}/)' CMakeLists.txt + grep -n COPYING CMakeLists.txt - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-glpk v${{ env.CMEEL_GLPK_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/cmeel-glpk - ref: v${{ env.CMEEL_GLPK_VERSION }}.c0 - submodules: true - persist-credentials: false + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Install upstream's COPYING into the wheel - run: | - # The real published wheel (cmeel_glpk-5.0-0-py3-none-manylinux_2_28_x86_64.whl, - # confirmed via unzip -l) ships no LICENSE/COPYING file at all - a gap against - # patching-and-licensing.md's "wheel carries the LICENSE file(s) from the - # upstream source" rule, present in the upstream cmake-wheel/cmeel-glpk - # wrapper itself on every platform, not riscv64-specific (same finding as - # cmeel-m4's identical gap). GNU GLPK's own release tarball ships COPYING at - # its top level (confirmed: tar -tzf glpk-5.0.tar.gz). This wrapper's - # ExternalProject_Add(glpk ...) uses BUILD_IN_SOURCE ON with no explicit - # SOURCE_DIR, so CMake's own documented default applies (confirmed against the - # real ExternalProject.cmake module source and its extractfile.cmake.in - # single-top-level-directory-rename logic, not guessed): SOURCE_DIR = - # /glpk-prefix/src/glpk, so COPYING lands there once - # the build step runs, before the top-level install() rules execute. Add a - # second install(FILES ...) rule beside the wrapper's existing "dummy - # README.md" one, pointing at that path. - sed -i '/^install(FILES README.md DESTINATION share\/cmeel-\${NAME}\/)$/a install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}-prefix/src/${NAME}/COPYING" DESTINATION share/cmeel-${NAME}/)' CMakeLists.txt - grep -n COPYING CMakeLists.txt + # Real cp312 build log (job 131256088489): GLPK 5.0's own bundled + # config.guess predates riscv64 recognition entirely (CLAUDE.md gotcha 138, + # same root cause already fixed for msprime's GSL dependency) - + # "./config.guess: unable to guess system type" / "configure: error: cannot + # guess build type; you must specify one", dated 2012-09-25 in the real log + # output. ExternalProject_Add(glpk ...) has no PATCH_COMMAND of its own, so + # add one that copies the manylinux image's own current automake config.guess/ + # config.sub into the extracted source tree before configure runs - same + # fix shape build-msprime.yml already uses for GSL 2.8's identical gap. + sed -i '/^ BUILD_IN_SOURCE ON$/a\ PATCH_COMMAND bash -c "cp /usr/share/automake-*/config.guess /usr/share/automake-*/config.sub ."' CMakeLists.txt + grep -n -A1 BUILD_IN_SOURCE CMakeLists.txt - - name: Refresh GLPK's bundled config.guess/config.sub for riscv64 - run: | - # Real cp312 build log (job 131256088489): GLPK 5.0's own bundled - # config.guess predates riscv64 recognition entirely (CLAUDE.md gotcha 138, - # same root cause already fixed for msprime's GSL dependency) - - # "./config.guess: unable to guess system type" / "configure: error: cannot - # guess build type; you must specify one", dated 2012-09-25 in the real log - # output. ExternalProject_Add(glpk ...) has no PATCH_COMMAND of its own, so - # add one that copies the manylinux image's own current automake config.guess/ - # config.sub into the extracted source tree before configure runs - same - # fix shape build-msprime.yml already uses for GSL 2.8's identical gap. - sed -i '/^ BUILD_IN_SOURCE ON$/a\ PATCH_COMMAND bash -c "cp /usr/share/automake-*/config.guess /usr/share/automake-*/config.sub ."' CMakeLists.txt - grep -n -A1 BUILD_IN_SOURCE CMakeLists.txt + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # GLPK is a leaf dependency (requires_dist: cmeel only), no cross-package + # library linking here to repair; cmeel installs into a shared prefix. + cibw-repair-wheel-command: '' - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + env: + CMEEL_GLPK_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG - # GLPK is a leaf dependency (requires_dist: cmeel only), no cross-package - # library linking here to repair; cmeel installs into a shared prefix. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-glpk-${{ env.CMEEL_GLPK_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -143,15 +156,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-glpk-${{ env.CMEEL_GLPK_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-glpk ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-gmp.yml b/.github/workflows/build-cmeel-gmp.yml index 8c1b86300f2b..d4e0fe6dc078 100644 --- a/.github/workflows/build-cmeel-gmp.yml +++ b/.github/workflows/build-cmeel-gmp.yml @@ -48,39 +48,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-gmp ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-gmp" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-gmp" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # gmp's own configure runs a `make check` TEST_COMMAND (see CMakeLists.txt) + # which exercises its riscv64 mpn assembly/generic-C fallback at build time. + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_GMP_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-gmp v${{ env.CMEEL_GMP_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cmake-wheel/cmeel-gmp - ref: v${{ env.CMEEL_GMP_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG - # gmp's own configure runs a `make check` TEST_COMMAND (see CMakeLists.txt) - # which exercises its riscv64 mpn assembly/generic-C fallback at build time. - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-gmp-${{ env.CMEEL_GMP_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -109,15 +114,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-gmp-${{ env.CMEEL_GMP_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-gmp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-lapack.yml b/.github/workflows/build-cmeel-lapack.yml index 4ee9fd2bf6ec..9e3a8f1e4222 100644 --- a/.github/workflows/build-cmeel-lapack.yml +++ b/.github/workflows/build-cmeel-lapack.yml @@ -50,58 +50,67 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-lapack ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-lapack" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-lapack" + ref: "v${{ matrix.version }}.c2" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 180 + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply --directory=lapack python-wheels/patches/cmeel-lapack/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # Reference LAPACK/BLAS (netlib.org) is plain standards-conforming + # Fortran/C with no architecture-specific code path anywhere in its + # own CMakeLists.txt (confirmed against the real v3.12.1 source): + # unlike OpenBLAS's per-arch optimized kernels, this needs no patch + # for CMAKE_POLICY_VERSION_MINIMUM (its own floor is 3.13, already + # above cmeel[build]'s CMake >= 4 floor of 3.5). It does need our + # own patches/cmeel-lapack patch above, though: contrary to this + # comment's own earlier claim, cmeel the build-backend has no RPATH + # mechanism of its own (confirmed against its real source - its + # only runtime-path handling is an LD_LIBRARY_PATH shim for + # cmeel_run()-wrapped executables, not for raw .so files); without + # our patch, liblapack.so can't find its own sibling libblas.so at + # runtime once CMake's install step strips its build RPATH. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_LAPACK_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-lapack v${{ env.CMEEL_LAPACK_VERSION }}.c2 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/cmeel-lapack - ref: v${{ env.CMEEL_LAPACK_VERSION }}.c2 - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch LAPACK source - run: git apply --directory=lapack python-wheels/patches/cmeel-lapack/${{ env.CMEEL_LAPACK_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG - # Reference LAPACK/BLAS (netlib.org) is plain standards-conforming - # Fortran/C with no architecture-specific code path anywhere in its - # own CMakeLists.txt (confirmed against the real v3.12.1 source): - # unlike OpenBLAS's per-arch optimized kernels, this needs no patch - # for CMAKE_POLICY_VERSION_MINIMUM (its own floor is 3.13, already - # above cmeel[build]'s CMake >= 4 floor of 3.5). It does need our - # own patches/cmeel-lapack patch above, though: contrary to this - # comment's own earlier claim, cmeel the build-backend has no RPATH - # mechanism of its own (confirmed against its real source - its - # only runtime-path handling is an LD_LIBRARY_PATH shim for - # cmeel_run()-wrapped executables, not for raw .so files); without - # our patch, liblapack.so can't find its own sibling libblas.so at - # runtime once CMake's install step strips its build RPATH. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-lapack-${{ env.CMEEL_LAPACK_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -131,15 +140,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-lapack-${{ env.CMEEL_LAPACK_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-lapack ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-libomp.yml b/.github/workflows/build-cmeel-libomp.yml index a899684b31cb..bfcb011b389b 100644 --- a/.github/workflows/build-cmeel-libomp.yml +++ b/.github/workflows/build-cmeel-libomp.yml @@ -48,53 +48,58 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-libomp ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-libomp" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-libomp" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + cibw-build: "cp312-manylinux_riscv64" + # LLVM's openmp runtime (confirmed against the real llvm-project + # llvmorg-21.1.8 source, openmp/ subdirectory) already recognizes + # riscv64 natively in its own architecture detection + # (LibompGetArchitecture.cmake keys off the standard __riscv / + # __riscv_xlen compiler macros, and config-ix.cmake lists riscv64 + # as a known LIBOMP_ARCH) and its only x86-specific compiler flag + # (-msse2, LibompHandleFlags.cmake) is gated behind a real + # check_cxx_compiler_flag probe rather than an unconditional set, + # so riscv64 GCC simply fails that probe and never gets the flag + # -- unlike cmeel-gklib/cmeel-metis's unconditional -march=native, + # this needs no patch. Its own cmake_minimum_required (3.20.0) is + # already above cmeel[build]'s CMake >= 4 floor of 3.5, so no + # CMAKE_POLICY_VERSION_MINIMUM override either. Upstream's own + # release.yml already builds this identically on aarch64 + # (ubuntu-24.04-arm) with no extra flags. + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets + # itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_LIBOMP_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-libomp v${{ env.CMEEL_LIBOMP_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cmake-wheel/cmeel-libomp - ref: v${{ env.CMEEL_LIBOMP_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # LLVM's openmp runtime (confirmed against the real llvm-project - # llvmorg-21.1.8 source, openmp/ subdirectory) already recognizes - # riscv64 natively in its own architecture detection - # (LibompGetArchitecture.cmake keys off the standard __riscv / - # __riscv_xlen compiler macros, and config-ix.cmake lists riscv64 - # as a known LIBOMP_ARCH) and its only x86-specific compiler flag - # (-msse2, LibompHandleFlags.cmake) is gated behind a real - # check_cxx_compiler_flag probe rather than an unconditional set, - # so riscv64 GCC simply fails that probe and never gets the flag - # -- unlike cmeel-gklib/cmeel-metis's unconditional -march=native, - # this needs no patch. Its own cmake_minimum_required (3.20.0) is - # already above cmeel[build]'s CMake >= 4 floor of 3.5, so no - # CMAKE_POLICY_VERSION_MINIMUM override either. Upstream's own - # release.yml already builds this identically on aarch64 - # (ubuntu-24.04-arm) with no extra flags. - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets - # itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-libomp-${{ env.CMEEL_LIBOMP_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -124,15 +129,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-libomp-${{ env.CMEEL_LIBOMP_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-libomp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-m4.yml b/.github/workflows/build-cmeel-m4.yml index 5469a83f71b3..5a3159292dc6 100644 --- a/.github/workflows/build-cmeel-m4.yml +++ b/.github/workflows/build-cmeel-m4.yml @@ -48,58 +48,67 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-m4 ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-m4" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-m4" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + pre-build: |- + # The real published wheel (cmeel_m4-1.4.20-0-py3-none-manylinux_2_28_x86_64.whl, + # confirmed via unzip -l) ships no LICENSE/COPYING file at all - a gap against + # patching-and-licensing.md's "wheel carries the LICENSE file(s) from the + # upstream source" rule, present in the upstream cmake-wheel/cmeel-m4 wrapper + # itself on every platform, not riscv64-specific. GNU m4's own release tarball + # ships COPYING at its top level (confirmed: tar -tJf m4-1.4.20.tar.xz). This + # wrapper's ExternalProject_Add(m4 ...) uses BUILD_IN_SOURCE ON with no explicit + # SOURCE_DIR, so CMake's own default applies (confirmed against the real + # ExternalProject.cmake module source, not guessed): SOURCE_DIR = + # /m4-prefix/src/m4, and its single-top-level-directory + # extraction logic (ExternalProject/extractfile.cmake.in) renames m4-1.4.20/ + # directly onto that SOURCE_DIR, so COPYING lands at + # /m4-prefix/src/m4/COPYING once the build step runs - before the top-level + # install() rules execute. Add a second install(FILES ...) rule beside the + # existing "dummy README.md" one, pointing at that path. + sed -i '/^install(FILES "README.md" DESTINATION "share\/cmeel-\${NAME}\/")$/a install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}-prefix/src/${NAME}/COPYING" DESTINATION "share/cmeel-${NAME}/")' CMakeLists.txt + grep -n COPYING CMakeLists.txt + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # m4 is a build-time tool (bin/m4 only, no .so); cmeel installs into a + # shared prefix with no cross-package library linking here to repair. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_M4_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-m4 v${{ env.CMEEL_M4_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/cmeel-m4 - ref: v${{ env.CMEEL_M4_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Install upstream's COPYING into the wheel - run: | - # The real published wheel (cmeel_m4-1.4.20-0-py3-none-manylinux_2_28_x86_64.whl, - # confirmed via unzip -l) ships no LICENSE/COPYING file at all - a gap against - # patching-and-licensing.md's "wheel carries the LICENSE file(s) from the - # upstream source" rule, present in the upstream cmake-wheel/cmeel-m4 wrapper - # itself on every platform, not riscv64-specific. GNU m4's own release tarball - # ships COPYING at its top level (confirmed: tar -tJf m4-1.4.20.tar.xz). This - # wrapper's ExternalProject_Add(m4 ...) uses BUILD_IN_SOURCE ON with no explicit - # SOURCE_DIR, so CMake's own default applies (confirmed against the real - # ExternalProject.cmake module source, not guessed): SOURCE_DIR = - # /m4-prefix/src/m4, and its single-top-level-directory - # extraction logic (ExternalProject/extractfile.cmake.in) renames m4-1.4.20/ - # directly onto that SOURCE_DIR, so COPYING lands at - # /m4-prefix/src/m4/COPYING once the build step runs - before the top-level - # install() rules execute. Add a second install(FILES ...) rule beside the - # existing "dummy README.md" one, pointing at that path. - sed -i '/^install(FILES "README.md" DESTINATION "share\/cmeel-\${NAME}\/")$/a install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}-prefix/src/${NAME}/COPYING" DESTINATION "share/cmeel-${NAME}/")' CMakeLists.txt - grep -n COPYING CMakeLists.txt - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG - # m4 is a build-time tool (bin/m4 only, no .so); cmeel installs into a - # shared prefix with no cross-package library linking here to repair. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-m4-${{ env.CMEEL_M4_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -122,15 +131,9 @@ jobs: pip install -q wheelhouse/*.whl m4 --version - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-m4-${{ env.CMEEL_M4_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-m4 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-metis.yml b/.github/workflows/build-cmeel-metis.yml index 26724674b337..c7b98cfeaec5 100644 --- a/.github/workflows/build-cmeel-metis.yml +++ b/.github/workflows/build-cmeel-metis.yml @@ -48,121 +48,128 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-metis ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-metis" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-metis" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + pre-build: |- + # The wrapper's own CMakeLists.txt already PATCH_COMMANDs the + # fetched KarypisLab/METIS v5.2.1 tarball to bump its bundled + # cmake_minimum_required from 2.8 to 3.10 and wire in the real + # cmeel-gklib dependency (target_link_libraries(metis PUBLIC + # GKlib)). That patch never touches METIS's OWN bundled copy of + # GKlib's old build config (conf/gkbuild.cmake), confirmed + # against the real v5.2.1 source to unconditionally append + # -march=native on GCC with zero architecture gating at all + # (unlike GKlib's own current GKlibSystem.cmake, which at least + # keys NO_X86 off CMAKE_SYSTEM_PROCESSOR, even though that flag + # only gates one helper app there too) -- the exact failure mode + # cmeel-gklib already hit and fixed: riscv64 GCC rejects + # -march=native outright ("ISA string must begin with rv32 or + # rv64"), on every C file in libmetis, not one optional tool. + # Extend the existing PATCH_COMMAND with the same scoping + # cmeel-gklib's own fix used for GKlibSystem.cmake's PPC branch, + # instead of leaving it as the unconditional VALGRIND-vs-else + # fallback upstream wrote assuming x86. + cat > metis-riscv64-patches.sh <<'SCRIPT' + #!/bin/sh + set -e + sed -i.bak 's/VERSION 2.8/VERSION 3.10/' CMakeLists.txt + echo 'target_link_libraries(metis PUBLIC GKlib)' >> libmetis/CMakeLists.txt + sed -i '/-march=x86-64 -mtune=generic/{n;s/^else()$/elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")/}' conf/gkbuild.cmake + SCRIPT + chmod +x metis-riscv64-patches.sh + python3 - <<'PYEOF' + import pathlib + p = pathlib.Path("CMakeLists.txt") + text = p.read_text() + old = ( + ' PATCH_COMMAND\n' + ' "sh" "-c"\n' + ' "sed -i.bak \'s/VERSION 2.8/VERSION 3.10/\' CMakeLists.txt ' + '&& echo \'target_link_libraries(metis PUBLIC GKlib)\' >> ' + 'libmetis/CMakeLists.txt"\n' + ) + assert old in text, "expected cmeel-metis PATCH_COMMAND block not found; wrapper CMakeLists.txt may have changed upstream" + new = ' PATCH_COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/metis-riscv64-patches.sh\n' + text = text.replace(old, new, 1) + + # The wrapper's own top-level CMakeLists.txt (this file, checked out + # above, not METIS's fetched tarball) sets its Linux ORIGIN variable + # to the CMake string literal "\$\$ORIGIN" (two literal dollar + # signs), on the assumption it will pass through one layer of GNU + # Make "$$"->"$" unescaping before reaching the linker. Confirmed + # against the real wrapper source (cmake-wheel/cmeel-metis v5.2.1.1.c0) + # and the real CI log (readelf -d on the built libmetis.so: RPATH + # "$$ORIGIN/../lib", baked in literally) that this never happens: + # CONFIGURE_COMMAND hands it to METIS's own `make config` as the + # LDFLAGS *environment variable*, and Make's "$$" escaping only + # rewrites characters written directly in Makefile source text, not + # the contents of an environment variable it merely forwards -- so + # the double dollar survives unchanged into the linker command, + # producing a malformed RPATH that never resolves at runtime + # ("libGKlib.so: cannot open shared object file"), confirmed via the + # diagnostic step below. This is a genuine one-character upstream + # wrapper bug (present for every platform, not riscv64-specific), + # not something either of our own patches above introduced; fix it + # here so the RPATH actually baked into libmetis.so is the single- + # dollar "$ORIGIN/../lib" every other cmeel-*-depends-on-cmeel-* + # package in this repo already resolves correctly (e.g. cmeel-clp). + old_origin = ' set(ORIGIN "\\$\\$ORIGIN")\n' + assert old_origin in text, "expected cmeel-metis ORIGIN variable not found; wrapper CMakeLists.txt may have changed upstream" + new_origin = ' set(ORIGIN "\\$ORIGIN")\n' + text = text.replace(old_origin, new_origin, 1) + + p.write_text(text) + PYEOF + cat CMakeLists.txt + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-manylinux_riscv64" + # pyproject.toml's build-system.requires pulls in cmeel-gklib with no + # version pin; without PIP_EXTRA_INDEX_URL, pip's build-isolation + # install only sees the default PyPI index (where cmeel-gklib has no + # riscv64 wheel), so it falls back to building cmeel-gklib from its + # sdist instead of installing our already-published riscv64 wheel - + # hitting GKlib's own unpatched cmake_minimum_required(VERSION 2.8) + # (our riscv64 PATCH_COMMAND fixes only apply during + # build-cmeel-gklib.yml's own CI run, never baked into the sdist). + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets + # itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_METIS_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-metis v${{ env.CMEEL_METIS_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/cmeel-metis - ref: v${{ env.CMEEL_METIS_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Patch METIS's -march=native and the wrapper's broken RPATH for riscv64 - run: | - # The wrapper's own CMakeLists.txt already PATCH_COMMANDs the - # fetched KarypisLab/METIS v5.2.1 tarball to bump its bundled - # cmake_minimum_required from 2.8 to 3.10 and wire in the real - # cmeel-gklib dependency (target_link_libraries(metis PUBLIC - # GKlib)). That patch never touches METIS's OWN bundled copy of - # GKlib's old build config (conf/gkbuild.cmake), confirmed - # against the real v5.2.1 source to unconditionally append - # -march=native on GCC with zero architecture gating at all - # (unlike GKlib's own current GKlibSystem.cmake, which at least - # keys NO_X86 off CMAKE_SYSTEM_PROCESSOR, even though that flag - # only gates one helper app there too) -- the exact failure mode - # cmeel-gklib already hit and fixed: riscv64 GCC rejects - # -march=native outright ("ISA string must begin with rv32 or - # rv64"), on every C file in libmetis, not one optional tool. - # Extend the existing PATCH_COMMAND with the same scoping - # cmeel-gklib's own fix used for GKlibSystem.cmake's PPC branch, - # instead of leaving it as the unconditional VALGRIND-vs-else - # fallback upstream wrote assuming x86. - cat > metis-riscv64-patches.sh <<'SCRIPT' - #!/bin/sh - set -e - sed -i.bak 's/VERSION 2.8/VERSION 3.10/' CMakeLists.txt - echo 'target_link_libraries(metis PUBLIC GKlib)' >> libmetis/CMakeLists.txt - sed -i '/-march=x86-64 -mtune=generic/{n;s/^else()$/elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")/}' conf/gkbuild.cmake - SCRIPT - chmod +x metis-riscv64-patches.sh - python3 - <<'PYEOF' - import pathlib - p = pathlib.Path("CMakeLists.txt") - text = p.read_text() - old = ( - ' PATCH_COMMAND\n' - ' "sh" "-c"\n' - ' "sed -i.bak \'s/VERSION 2.8/VERSION 3.10/\' CMakeLists.txt ' - '&& echo \'target_link_libraries(metis PUBLIC GKlib)\' >> ' - 'libmetis/CMakeLists.txt"\n' - ) - assert old in text, "expected cmeel-metis PATCH_COMMAND block not found; wrapper CMakeLists.txt may have changed upstream" - new = ' PATCH_COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/metis-riscv64-patches.sh\n' - text = text.replace(old, new, 1) - - # The wrapper's own top-level CMakeLists.txt (this file, checked out - # above, not METIS's fetched tarball) sets its Linux ORIGIN variable - # to the CMake string literal "\$\$ORIGIN" (two literal dollar - # signs), on the assumption it will pass through one layer of GNU - # Make "$$"->"$" unescaping before reaching the linker. Confirmed - # against the real wrapper source (cmake-wheel/cmeel-metis v5.2.1.1.c0) - # and the real CI log (readelf -d on the built libmetis.so: RPATH - # "$$ORIGIN/../lib", baked in literally) that this never happens: - # CONFIGURE_COMMAND hands it to METIS's own `make config` as the - # LDFLAGS *environment variable*, and Make's "$$" escaping only - # rewrites characters written directly in Makefile source text, not - # the contents of an environment variable it merely forwards -- so - # the double dollar survives unchanged into the linker command, - # producing a malformed RPATH that never resolves at runtime - # ("libGKlib.so: cannot open shared object file"), confirmed via the - # diagnostic step below. This is a genuine one-character upstream - # wrapper bug (present for every platform, not riscv64-specific), - # not something either of our own patches above introduced; fix it - # here so the RPATH actually baked into libmetis.so is the single- - # dollar "$ORIGIN/../lib" every other cmeel-*-depends-on-cmeel-* - # package in this repo already resolves correctly (e.g. cmeel-clp). - old_origin = ' set(ORIGIN "\\$\\$ORIGIN")\n' - assert old_origin in text, "expected cmeel-metis ORIGIN variable not found; wrapper CMakeLists.txt may have changed upstream" - new_origin = ' set(ORIGIN "\\$ORIGIN")\n' - text = text.replace(old_origin, new_origin, 1) - - p.write_text(text) - PYEOF - cat CMakeLists.txt - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # pyproject.toml's build-system.requires pulls in cmeel-gklib with no - # version pin; without PIP_EXTRA_INDEX_URL, pip's build-isolation - # install only sees the default PyPI index (where cmeel-gklib has no - # riscv64 wheel), so it falls back to building cmeel-gklib from its - # sdist instead of installing our already-published riscv64 wheel - - # hitting GKlib's own unpatched cmake_minimum_required(VERSION 2.8) - # (our riscv64 PATCH_COMMAND fixes only apply during - # build-cmeel-gklib.yml's own CI run, never baked into the sdist). - CIBW_ENVIRONMENT: >- - CMEEL_LOG_LEVEL=DEBUG - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets - # itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-metis-${{ env.CMEEL_METIS_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -206,15 +213,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-metis-${{ env.CMEEL_METIS_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-metis ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-octomap.yml b/.github/workflows/build-cmeel-octomap.yml index c81b75f1f00b..e6cc0430ac29 100644 --- a/.github/workflows/build-cmeel-octomap.yml +++ b/.github/workflows/build-cmeel-octomap.yml @@ -48,39 +48,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-octomap ${{ matrix.version }} manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-octomap" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-octomap" + ref: "v${{ matrix.version }}.c5" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + # has-sitelib = false: the wheel holds no Python extension, so one + # py3-none wheel covers every interpreter. + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG CMEEL_RUN_TESTS=false" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_OCTOMAP_VERSION: ${{ matrix.version }} - steps: - # cmeel-octomap's release tags carry a packaging-revision suffix (.c5) that is the - # wheel's build tag, not part of its version; .c5 is the revision 1.10.0 released last. - - name: Checkout cmeel-octomap v${{ env.CMEEL_OCTOMAP_VERSION }}.c5 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cmake-wheel/cmeel-octomap - ref: v${{ env.CMEEL_OCTOMAP_VERSION }}.c5 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG CMEEL_RUN_TESTS=false - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-octomap-${{ env.CMEEL_OCTOMAP_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -119,15 +124,9 @@ jobs: "$prefix/bin/graph2tree" -i scan.graph -o tree.bt test -s tree.bt - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-octomap-${{ env.CMEEL_OCTOMAP_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-octomap ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-qhull.yml b/.github/workflows/build-cmeel-qhull.yml index 2bd56a2228b9..07ef3b95dc99 100644 --- a/.github/workflows/build-cmeel-qhull.yml +++ b/.github/workflows/build-cmeel-qhull.yml @@ -48,42 +48,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-qhull ${{ matrix.version }} manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-qhull" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-qhull" + ref: "v${{ matrix.version }}.c1" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + # has-sitelib = false: the wheel holds no Python extension, so one + # py3-none wheel covers every interpreter. + cibw-build: "cp312-manylinux_riscv64" + # qhull declares cmake_minimum_required(VERSION 3.0) and cmeel[build] resolves + # CMake >= 4, which refuses anything below 3.5; the cmeel backend owns the + # configure line, so the policy floor has to come from the environment. + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG CMAKE_POLICY_VERSION_MINIMUM=3.5" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_QHULL_VERSION: ${{ matrix.version }} - steps: - # cmeel-qhull's release tags carry a packaging-revision suffix that is the wheel's - # build tag, not part of its version; .c1 is the revision 8.0.2.1 released last. - - name: Checkout cmeel-qhull v${{ env.CMEEL_QHULL_VERSION }}.c1 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cmake-wheel/cmeel-qhull - ref: v${{ env.CMEEL_QHULL_VERSION }}.c1 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # qhull declares cmake_minimum_required(VERSION 3.0) and cmeel[build] resolves - # CMake >= 4, which refuses anything below 3.5; the cmeel backend owns the - # configure line, so the policy floor has to come from the environment. - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG CMAKE_POLICY_VERSION_MINIMUM=3.5 - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-qhull-${{ env.CMEEL_QHULL_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -121,15 +126,9 @@ jobs: "$prefix/bin/rbox" 500 D4 | "$prefix/bin/qdelaunay" s "$prefix/bin/rbox" 100 D2 | "$prefix/bin/qvoronoi" s - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-qhull-${{ env.CMEEL_QHULL_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-qhull ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-qpoases.yml b/.github/workflows/build-cmeel-qpoases.yml index acc8de422d06..efd7df9b9629 100644 --- a/.github/workflows/build-cmeel-qpoases.yml +++ b/.github/workflows/build-cmeel-qpoases.yml @@ -48,38 +48,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-qpoases ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-qpoases" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-qpoases" + ref: "v${{ matrix.version }}.c1" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_QPOASES_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. cmeel-qpoases tags carry a - # packaging-revision suffix (build-number = 1 -> .c1) beyond the wheel version. - - name: Checkout cmeel-qpoases v${{ env.CMEEL_QPOASES_VERSION }}.c1 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cmake-wheel/cmeel-qpoases - ref: v${{ env.CMEEL_QPOASES_VERSION }}.c1 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-qpoases-${{ env.CMEEL_QPOASES_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -107,15 +111,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-qpoases-${{ env.CMEEL_QPOASES_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-qpoases ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-spirv-tools.yml b/.github/workflows/build-cmeel-spirv-tools.yml index 2e1a33469cf7..fd2c63f31eb2 100644 --- a/.github/workflows/build-cmeel-spirv-tools.yml +++ b/.github/workflows/build-cmeel-spirv-tools.yml @@ -48,92 +48,84 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-spirv-tools ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-spirv-tools" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-spirv-tools" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 180 + checkout-submodules: "true" + pre-build: |- + # The real published wheel (cmeel_spirv_tools-2025.5-0-py3-none- + # manylinux_2_28_x86_64.whl, confirmed via unzip -l) ships no + # LICENSE/COPYING file at all - the same gap already found and + # fixed for cmeel-m4/cmeel-glpk/cmeel-cddlib, present in the + # upstream cmake-wheel/cmeel-spirv-tools wrapper itself on every + # platform, not riscv64-specific. The wrapper's own pyproject.toml + # and METADATA both claim "BSD-3-Clause", but the real submodule's + # own top-level LICENSE file (confirmed: spirv-tools/LICENSE at the + # pinned commit) is the Apache License, Version 2.0 - the wrapper's + # declared license is simply wrong, same class of mismatch already + # found for cmeel-cddlib (whose pyproject.toml says generic "GPL" + # when the real upstream COPYING is GPLv2). docs/packages below + # records the real license, Apache-2.0. + # + # Unlike cmeel-m4/cmeel-glpk/cmeel-cddlib's ExternalProject_Add + # extraction-path indirection, the submodule's LICENSE file is + # already sitting in-tree at spirv-tools/LICENSE before the build + # even starts (no CMAKE_CURRENT_BINARY_DIR prefix lookup needed). + # Add a second install(FILES ...) rule beside the submodule's own + # existing header-install block (confirmed unique anchor line in + # the real source, not guessed), pointing at it. + sed -i '/^endif(ENABLE_SPIRV_TOOLS_INSTALL)$/a install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" DESTINATION share/cmeel-spirv-tools/)' spirv-tools/CMakeLists.txt + grep -n LICENSE spirv-tools/CMakeLists.txt + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-manylinux_riscv64" + # cmeel-spirv-headers (the only build-time dependency, via + # pyproject.toml's build-system.requires) is a true py3-none-any + # header-only wheel already published on public PyPI - pip's + # build-isolation install resolves it from the default index with + # no PIP_EXTRA_INDEX_URL needed (unlike cmeel-metis/cmeel-gklib's + # own riscv64-specific build-time dependency, which has no public + # upstream wheel at all). + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # SPIRV-Tools is an 11-binary toolchain build (spirv-as/-opt/-link/ + # -reduce/-diff/-lint/-val/-dis/-cfg/-objdump plus a lesspipe.sh + # script) with no cross-package .so to repair: cmeel installs + # everything into its own shared prefix, and the one real .so + # (libSPIRV-Tools-shared.so) has no external cmeel-* runtime + # dependency to resolve. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_SPIRV_TOOLS_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. Unlike cmeel-m4/cmeel-glpk/ - # cmeel-cddlib (which use ExternalProject_Add to fetch an upstream - # tarball and build it under cmeel's own generic template - # CMakeLists.txt), this wrapper has no top-level CMakeLists.txt of its - # own: pyproject.toml's `source = "spirv-tools"` points straight at a - # real KhronosGroup/SPIRV-Tools git submodule, built with its own full - # CMakeLists.txt (cmake_minimum_required 3.22.1, already above - # cmeel[build]'s CMake >= 4 floor of 3.5; no -march=native/-mavx/-msse - # or other x86-specific flag anywhere in its CMake tree or source/ - # tools/ - confirmed against the real KhronosGroup/SPIRV-Tools source - # at the submodule's pinned commit, not guessed). The wrapper's own - # cmeel.patch (applied automatically by cmeel[build] itself - confirmed - # against the real cmeel package source, cmeel/utils.py's patch() - # function) swaps the submodule's own vendored-SPIRV-Headers lookup for - # find_package(SPIRV-Headers REQUIRED CONFIG), resolved from - # cmeel-spirv-headers's build-time dependency - itself a true - # py3-none-any header-only wheel already installable on riscv64 with - # no port needed (docs/packages/cmeel-spirv-headers.yaml: not-applicable). - - name: Checkout cmeel-spirv-tools v${{ env.CMEEL_SPIRV_TOOLS_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/cmeel-spirv-tools - ref: v${{ env.CMEEL_SPIRV_TOOLS_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Install upstream's LICENSE into the wheel - run: | - # The real published wheel (cmeel_spirv_tools-2025.5-0-py3-none- - # manylinux_2_28_x86_64.whl, confirmed via unzip -l) ships no - # LICENSE/COPYING file at all - the same gap already found and - # fixed for cmeel-m4/cmeel-glpk/cmeel-cddlib, present in the - # upstream cmake-wheel/cmeel-spirv-tools wrapper itself on every - # platform, not riscv64-specific. The wrapper's own pyproject.toml - # and METADATA both claim "BSD-3-Clause", but the real submodule's - # own top-level LICENSE file (confirmed: spirv-tools/LICENSE at the - # pinned commit) is the Apache License, Version 2.0 - the wrapper's - # declared license is simply wrong, same class of mismatch already - # found for cmeel-cddlib (whose pyproject.toml says generic "GPL" - # when the real upstream COPYING is GPLv2). docs/packages below - # records the real license, Apache-2.0. - # - # Unlike cmeel-m4/cmeel-glpk/cmeel-cddlib's ExternalProject_Add - # extraction-path indirection, the submodule's LICENSE file is - # already sitting in-tree at spirv-tools/LICENSE before the build - # even starts (no CMAKE_CURRENT_BINARY_DIR prefix lookup needed). - # Add a second install(FILES ...) rule beside the submodule's own - # existing header-install block (confirmed unique anchor line in - # the real source, not guessed), pointing at it. - sed -i '/^endif(ENABLE_SPIRV_TOOLS_INSTALL)$/a install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" DESTINATION share/cmeel-spirv-tools/)' spirv-tools/CMakeLists.txt - grep -n LICENSE spirv-tools/CMakeLists.txt - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cmeel-spirv-headers (the only build-time dependency, via - # pyproject.toml's build-system.requires) is a true py3-none-any - # header-only wheel already published on public PyPI - pip's - # build-isolation install resolves it from the default index with - # no PIP_EXTRA_INDEX_URL needed (unlike cmeel-metis/cmeel-gklib's - # own riscv64-specific build-time dependency, which has no public - # upstream wheel at all). - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG - # SPIRV-Tools is an 11-binary toolchain build (spirv-as/-opt/-link/ - # -reduce/-diff/-lint/-val/-dis/-cfg/-objdump plus a lesspipe.sh - # script) with no cross-package .so to repair: cmeel installs - # everything into its own shared prefix, and the one real .so - # (libSPIRV-Tools-shared.so) has no external cmeel-* runtime - # dependency to resolve. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-spirv-tools-${{ env.CMEEL_SPIRV_TOOLS_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -166,15 +158,9 @@ jobs: " "$(python3 -c "import pathlib, sysconfig; print(pathlib.Path(sysconfig.get_paths()['purelib']) / 'cmeel.prefix/bin/spirv-dis')")" --version - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-spirv-tools-${{ env.CMEEL_SPIRV_TOOLS_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-spirv-tools ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-tinyxml.yml b/.github/workflows/build-cmeel-tinyxml.yml index 6fdaef616ee9..274d59018c95 100644 --- a/.github/workflows/build-cmeel-tinyxml.yml +++ b/.github/workflows/build-cmeel-tinyxml.yml @@ -65,7 +65,7 @@ jobs: # tinyxml declares cmake_minimum_required(VERSION 3.1) and cmeel[build] # resolves CMake >= 4, which refuses it; the cmeel backend owns the configure # line, so the floor goes in the environment (gotcha 257). - cibw-environment: CMEEL_LOG_LEVEL=DEBUG CMAKE_POLICY_VERSION_MINIMUM=3.5 + cibw-environment-linux: CMEEL_LOG_LEVEL=DEBUG CMAKE_POLICY_VERSION_MINIMUM=3.5 # cmeel links libtinyxml.so with an $ORIGIN RUNPATH into the shared # cmeel prefix; repair would only re-tag it, as upstream's own # release.yml assumes. diff --git a/.github/workflows/build-cmeel-tinyxml2.yml b/.github/workflows/build-cmeel-tinyxml2.yml index 35a09f299701..f838052cb85c 100644 --- a/.github/workflows/build-cmeel-tinyxml2.yml +++ b/.github/workflows/build-cmeel-tinyxml2.yml @@ -62,7 +62,7 @@ jobs: # has-sitelib = false: the wheel holds no Python extension, so one # py3-none wheel covers every interpreter. cibw-build: cp312-manylinux_riscv64 - cibw-environment: CMEEL_LOG_LEVEL=DEBUG PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" # cmeel links libtinyxml2.so with an $ORIGIN RUNPATH into the shared # cmeel prefix; repair would only re-tag it, as upstream's own # release.yml assumes. diff --git a/.github/workflows/build-cmeel-urdfdom.yml b/.github/workflows/build-cmeel-urdfdom.yml index 13303846e77d..334e0e74febe 100644 --- a/.github/workflows/build-cmeel-urdfdom.yml +++ b/.github/workflows/build-cmeel-urdfdom.yml @@ -48,37 +48,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-urdfdom ${{ matrix.version }} manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-urdfdom" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-urdfdom" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + # has-sitelib = false: the wheel holds no Python extension, so one + # py3-none wheel covers every interpreter. + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_URDFDOM_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cmeel-urdfdom v${{ env.CMEEL_URDFDOM_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/cmeel-urdfdom - ref: v${{ env.CMEEL_URDFDOM_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-urdfdom-${{ env.CMEEL_URDFDOM_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -129,15 +136,9 @@ jobs: "$prefix/bin/check_urdf" robot.urdf | tee check.log grep -q "Successfully Parsed XML" check.log - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-urdfdom-${{ env.CMEEL_URDFDOM_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-urdfdom ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-yaml-cpp.yml b/.github/workflows/build-cmeel-yaml-cpp.yml index d89b6b74ca27..be07ad97b716 100644 --- a/.github/workflows/build-cmeel-yaml-cpp.yml +++ b/.github/workflows/build-cmeel-yaml-cpp.yml @@ -48,40 +48,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-yaml-cpp ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-yaml-cpp" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-yaml-cpp" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + cibw-build: "cp312-manylinux_riscv64" + # yaml-cpp declares cmake_minimum_required(VERSION 3.4) and cmeel[build] + # resolves CMake >= 4, which refuses anything below 3.5; the cmeel backend + # owns the configure line, so the floor goes in the environment (gotcha 257). + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG CMAKE_POLICY_VERSION_MINIMUM=3.5" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_YAML_CPP_VERSION: ${{ matrix.version }} - steps: - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - - name: Checkout cmeel-yaml-cpp v${{ env.CMEEL_YAML_CPP_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cmake-wheel/cmeel-yaml-cpp - ref: v${{ env.CMEEL_YAML_CPP_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # yaml-cpp declares cmake_minimum_required(VERSION 3.4) and cmeel[build] - # resolves CMake >= 4, which refuses anything below 3.5; the cmeel backend - # owns the configure line, so the floor goes in the environment (gotcha 257). - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG CMAKE_POLICY_VERSION_MINIMUM=3.5 - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-yaml-cpp-${{ env.CMEEL_YAML_CPP_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -109,15 +114,9 @@ jobs: print(lib) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-yaml-cpp-${{ env.CMEEL_YAML_CPP_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-yaml-cpp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmeel-zlib.yml b/.github/workflows/build-cmeel-zlib.yml index 2c4e9febda80..d1576934c553 100644 --- a/.github/workflows/build-cmeel-zlib.yml +++ b/.github/workflows/build-cmeel-zlib.yml @@ -48,37 +48,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmeel-zlib ${{ matrix.version }} manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmeel-zlib" + version: "${{ matrix.version }}" + repository: "cmake-wheel/cmeel-zlib" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMEEL_ZLIB_VERSION: ${{ matrix.version }} - steps: - # The wheel holds no Python extension ([tool.cmeel] has-sitelib = false), so one - # py3-none-manylinux_riscv64 wheel covers every interpreter. - - name: Checkout cmeel-zlib v${{ env.CMEEL_ZLIB_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cmake-wheel/cmeel-zlib - ref: v${{ env.CMEEL_ZLIB_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: cmeel-zlib-${{ env.CMEEL_ZLIB_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -116,15 +121,9 @@ jobs: print(lib, z.zlibVersion(), size.value) " - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmeel-zlib-${{ env.CMEEL_ZLIB_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmeel-zlib ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cmsis-pack-manager.yml b/.github/workflows/build-cmsis-pack-manager.yml index c99d345498b1..14d1ad841f5c 100644 --- a/.github/workflows/build-cmsis-pack-manager.yml +++ b/.github/workflows/build-cmsis-pack-manager.yml @@ -49,46 +49,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cmsis-pack-manager ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cmsis-pack-manager" + version: "${{ matrix.version }}" + repository: "pyocd/cmsis-pack-manager" + ref: "v${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 180 + # maturin's cffi bindings reach the Rust cdylib through cffi's ABI mode, so + # the wheel is py3-none: one build serves every interpreter, and the further + # identifiers only re-run the test command against it. + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 cp314t-manylinux_riscv64" + # Upstream also installs libffi-devel, libatomic and openssl-devel here; the + # first two the image already ships, and the crate graph uses rustls. + cibw-before-all-linux: "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.71.1 --profile=minimal -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-sources: "tests pyproject.toml" + cibw-test-extras: "test" + # hypothesis' newest release has no free-threaded riscv64 wheel, and pip + # resolves by version, not by what has one; ours is a release older. + cibw-test-environment: "PIP_ONLY_BINARY=hypothesis" + cibw-test-command: "pytest --cache-clear" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: CMSIS_PACK_MANAGER_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cmsis-pack-manager ${{ env.CMSIS_PACK_MANAGER_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pyocd/cmsis-pack-manager - ref: v${{ env.CMSIS_PACK_MANAGER_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - # maturin's cffi bindings reach the Rust cdylib through cffi's ABI mode, so - # the wheel is py3-none: one build serves every interpreter, and the further - # identifiers only re-run the test command against it. - CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 cp314t-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream also installs libffi-devel, libatomic and openssl-devel here; the - # first two the image already ships, and the crate graph uses rustls. - CIBW_BEFORE_ALL_LINUX: > - curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.71.1 --profile=minimal -y - CIBW_ENVIRONMENT: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_EXTRAS: test - # hypothesis' newest release has no free-threaded riscv64 wheel, and pip - # resolves by version, not by what has one; ours is a release older. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=hypothesis - CIBW_TEST_COMMAND: pytest --cache-clear + name: cmsis-pack-manager-${{ env.CMSIS_PACK_MANAGER_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries the Rust cdylib run: | @@ -103,15 +108,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cmsis-pack-manager-${{ env.CMSIS_PACK_MANAGER_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cmsis-pack-manager ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-coacd.yml b/.github/workflows/build-coacd.yml index 8ff86488eb7c..5c675b7a30a2 100644 --- a/.github/workflows/build-coacd.yml +++ b/.github/workflows/build-coacd.yml @@ -49,6 +49,60 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build coacd ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # setup.py's bdist_wheel_abi3.get_tag() tags the wheel abi3 at the + # building interpreter's version (matches upstream's published + # cp39-abi3 filename), so build once on cp39 and reuse+test the + # rest via find_compatible_wheel. cp314t is dropped: the override + # never guards Py_GIL_DISABLED, so a free-threaded build still + # tags plain abi3, and abi3 is absent from a free-threaded + # interpreter's own compatible-tag set, so pip could never install + # such a wheel there anyway. + - tag: cp39-abi3 + build: >- + cp39-manylinux_riscv64 cp312-manylinux_riscv64 + cp313-manylinux_riscv64 cp314-manylinux_riscv64 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "coacd" + version: "${{ matrix.version }}" + repository: "SarahWeiii/CoACD" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: 360 + checkout-submodules: "true" + pre-build: |- + curl -fsSL --retry 5 "https://raw.githubusercontent.com/oneapi-src/oneTBB/v2022.0.0/LICENSE.txt" -o LICENSE.onetbb + curl -fsSL --retry 5 "https://raw.githubusercontent.com/AcademySoftwareFoundation/openvdb/v8.2.0/LICENSE" -o LICENSE.openvdb + curl -fsSL --retry 5 "https://raw.githubusercontent.com/boostorg/boost/boost-1.81.0/LICENSE_1_0.txt" -o LICENSE.boost + curl -fsSL --retry 5 "https://raw.githubusercontent.com/gabime/spdlog/v1.8.2/LICENSE" -o LICENSE.spdlog + curl -fsSL --retry 5 "https://raw.githubusercontent.com/madler/zlib/v1.2.11/zlib.h" | sed -n '4,23p' > LICENSE.zlib + cp 3rd/cdt/LICENSE LICENSE.cdt + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.build }}" + # setup.py links -static-libstdc++; the riscv64 image ships only + # the shared libstdc++.so (gotcha 77). + cibw-before-all-linux: "dnf -y install libstdc++-static" + # numpy has no riscv64 wheel on public PyPI; needed both at build + # time (build-system.requires) and at install time. + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "trimesh" + cibw-test-sources: "run_tests.py examples" + cibw-test-command: "python run_tests.py -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: @@ -68,51 +122,14 @@ jobs: build: >- cp39-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - env: COACD_VERSION: ${{ matrix.version }} - steps: - - name: Checkout CoACD ${{ env.COACD_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: SarahWeiii/CoACD - ref: ${{ env.COACD_VERSION }} - submodules: true - persist-credentials: false - - # CMakeLists.txt FetchContent-pulls zlib/Boost/OpenVDB/oneTBB/spdlog - # from source and statically links them (BUILD_SHARED_LIBS=OFF); - # upstream's own wheel ships none of their licences, nor CDT's (a git - # submodule). Stage them all at the root for setuptools' default - # LICEN[CS]E* glob to pick up. - - name: Stage the vendored dependencies' licences - run: | - curl -fsSL --retry 5 "https://raw.githubusercontent.com/oneapi-src/oneTBB/v2022.0.0/LICENSE.txt" -o LICENSE.onetbb - curl -fsSL --retry 5 "https://raw.githubusercontent.com/AcademySoftwareFoundation/openvdb/v8.2.0/LICENSE" -o LICENSE.openvdb - curl -fsSL --retry 5 "https://raw.githubusercontent.com/boostorg/boost/boost-1.81.0/LICENSE_1_0.txt" -o LICENSE.boost - curl -fsSL --retry 5 "https://raw.githubusercontent.com/gabime/spdlog/v1.8.2/LICENSE" -o LICENSE.spdlog - curl -fsSL --retry 5 "https://raw.githubusercontent.com/madler/zlib/v1.2.11/zlib.h" | sed -n '4,23p' > LICENSE.zlib - cp 3rd/cdt/LICENSE LICENSE.cdt - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py links -static-libstdc++; the riscv64 image ships only - # the shared libstdc++.so (gotcha 77). - CIBW_BEFORE_ALL_LINUX: dnf -y install libstdc++-static - # numpy has no riscv64 wheel on public PyPI; needed both at build - # time (build-system.requires) and at install time. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: trimesh - CIBW_TEST_SOURCES: run_tests.py examples - CIBW_TEST_COMMAND: python run_tests.py -v + name: coacd-${{ env.COACD_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -129,12 +146,6 @@ jobs: assert licences == expected, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: coacd-${{ env.COACD_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -170,7 +181,7 @@ jobs: publish: name: Publish coacd ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-color-operations.yml b/.github/workflows/build-color-operations.yml index 16638c0c96b0..2bfdb0aa0985 100644 --- a/.github/workflows/build-color-operations.yml +++ b/.github/workflows/build-color-operations.yml @@ -49,37 +49,41 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build color-operations ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "color-operations" + version: "${{ matrix.version }}" + repository: "vincentsarago/color-operations" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + # Upstream comments these out but runs the same suite in its `tests` job. + cibw-test-requires: "pytest colormath==2.0.2" + cibw-test-command: "pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: COLOR_OPERATIONS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout color-operations ${{ env.COLOR_OPERATIONS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: vincentsarago/color-operations - ref: ${{ env.COLOR_OPERATIONS_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - # Upstream comments these out but runs the same suite in its `tests` job. - CIBW_TEST_REQUIRES: pytest colormath==2.0.2 - CIBW_TEST_COMMAND: pytest {project}/tests + name: color-operations-${{ env.COLOR_OPERATIONS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -92,16 +96,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: color-operations-${{ env.COLOR_OPERATIONS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish color-operations ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-compreffor.yml b/.github/workflows/build-compreffor.yml index cf5203b3e452..c1960dac5213 100644 --- a/.github/workflows/build-compreffor.yml +++ b/.github/workflows/build-compreffor.yml @@ -49,32 +49,38 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build compreffor ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "compreffor" + version: "${{ matrix.version }}" + repository: "googlefonts/compreffor" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pytest fonttools" + cibw-test-command: "pytest --pyargs compreffor" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: COMPREFFOR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout compreffor ${{ env.COMPREFFOR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: googlefonts/compreffor - ref: v${{ env.COMPREFFOR_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pytest fonttools - CIBW_TEST_COMMAND: pytest --pyargs compreffor + name: compreffor-${{ env.COMPREFFOR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the compiled extension made it into the wheel run: | @@ -86,15 +92,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: compreffor-${{ env.COMPREFFOR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish compreffor ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-connected-components-3d.yml b/.github/workflows/build-connected-components-3d.yml index 1f47bf5b1a05..456948f66728 100644 --- a/.github/workflows/build-connected-components-3d.yml +++ b/.github/workflows/build-connected-components-3d.yml @@ -48,6 +48,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build connected-components-3d ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + - python: cp312 + scipy: scipy + k: not test_connected_components_stack + - python: cp313 + scipy: scipy + k: not test_connected_components_stack + - python: cp314 + scipy: scipy + k: not test_connected_components_stack + - python: cp314t + scipy: '' + k: not test_connected_components_stack and not test_compare_scipy + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "connected-components-3d" + version: "${{ matrix.version }}" + repository: "seung-lab/connected-components-3d" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + # numpy is a build-time requirement (headers, via pyproject.toml's + # build-system.requires) and, despite not being declared as a + # runtime dependency by name in pyproject.toml, an implicit one too + # (the compiled extension calls numpy's C API at import time; it is + # declared in install_requires in setup.py). Only our registry has + # it for riscv64; only-binary keeps a newer PyPI release from + # winning the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + # fastremap has no riscv64 wheel on either index, so pip builds it + # from sdist; scipy has no cp314t wheel on any index/platform yet, + # so it and its tests are dropped on that leg only (gotcha 149). + cibw-test-requires: "pytest numpy fastremap ${{ matrix.scipy }}" + # automated_test.py sits next to the unbuilt cc3d/ source package; + # staging only the test file keeps that directory out of test_cwd + # so `import cc3d` resolves to the installed wheel (gotcha 25). + cibw-test-sources: "automated_test.py" + # crackle-codec (the optional "stack" extra's codec) has no riscv64 + # wheel anywhere, so test_connected_components_stack is deselected + # on every leg rather than building its pybind11/google_crc32c + # dependency chain from source for one optional extra. + cibw-test-command: "python -m pytest -v automated_test.py -k \"${{ matrix.k }}\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: @@ -67,48 +118,14 @@ jobs: - python: cp314t scipy: '' k: not test_connected_components_stack and not test_compare_scipy - env: CC3D_VERSION: ${{ matrix.version }} - steps: - - name: Checkout connected-components-3d ${{ env.CC3D_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: seung-lab/connected-components-3d - ref: ${{ env.CC3D_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build-time requirement (headers, via pyproject.toml's - # build-system.requires) and, despite not being declared as a - # runtime dependency by name in pyproject.toml, an implicit one too - # (the compiled extension calls numpy's C API at import time; it is - # declared in install_requires in setup.py). Only our registry has - # it for riscv64; only-binary keeps a newer PyPI release from - # winning the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - # fastremap has no riscv64 wheel on either index, so pip builds it - # from sdist; scipy has no cp314t wheel on any index/platform yet, - # so it and its tests are dropped on that leg only (gotcha 149). - CIBW_TEST_REQUIRES: pytest numpy fastremap ${{ matrix.scipy }} - # automated_test.py sits next to the unbuilt cc3d/ source package; - # staging only the test file keeps that directory out of test_cwd - # so `import cc3d` resolves to the installed wheel (gotcha 25). - CIBW_TEST_SOURCES: automated_test.py - # crackle-codec (the optional "stack" extra's codec) has no riscv64 - # wheel anywhere, so test_connected_components_stack is deselected - # on every leg rather than building its pybind11/google_crc32c - # dependency chain from source for one optional extra. - CIBW_TEST_COMMAND: >- - python -m pytest -v automated_test.py -k "${{ matrix.k }}" + name: connected-components-3d-${{ env.CC3D_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -121,16 +138,9 @@ jobs: assert licences == {"AUTHORS", "COPYING", "COPYING.LESSER"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: connected-components-3d-${{ env.CC3D_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish connected-components-3d ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-contourpy.yml b/.github/workflows/build-contourpy.yml index eaf31b7e9b93..77edd83c2805 100644 --- a/.github/workflows/build-contourpy.yml +++ b/.github/workflows/build-contourpy.yml @@ -59,7 +59,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # numpy has no riscv64 wheel on public PyPI; PIP_ONLY_BINARY keeps the # test env from source-building it when the registry is slow to resolve. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" timeout-minutes: 90 publish: diff --git a/.github/workflows/build-convertbng.yml b/.github/workflows/build-convertbng.yml index a4f29ed1244e..1508663099fa 100644 --- a/.github/workflows/build-convertbng.yml +++ b/.github/workflows/build-convertbng.yml @@ -77,9 +77,7 @@ jobs: # Replaces pyproject.toml's [tool.cibuildwheel.linux] environment, so # its PATH entry for the rustup toolchain from before-all is repeated; # numpy has riscv64 wheels only on our registry. - cibw-environment: >- - PATH="$HOME/.cargo/bin:$PATH" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PATH=\"$HOME/.cargo/bin:$PATH\"" cibw-test-environment: PIP_ONLY_BINARY=numpy timeout-minutes: 90 diff --git a/.github/workflows/build-convertertools.yml b/.github/workflows/build-convertertools.yml index b86b804335b7..9ae10e74b6c4 100644 --- a/.github/workflows/build-convertertools.yml +++ b/.github/workflows/build-convertertools.yml @@ -59,7 +59,7 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 - cibw-environment: REQUIRE_CYTHON=1 + cibw-environment-linux: REQUIRE_CYTHON=1 cibw-test-requires: pytest # build_ext.py suppresses every compile error, so REQUIRE_CYTHON alone cannot catch a pure-Python wheel. cibw-test-sources: tests diff --git a/.github/workflows/build-coolprop.yml b/.github/workflows/build-coolprop.yml index 8f65bbee2610..364ddb7d26d6 100644 --- a/.github/workflows/build-coolprop.yml +++ b/.github/workflows/build-coolprop.yml @@ -5,7 +5,7 @@ # from python_buildwheels.yml's set-matrix job): v8 is a nanobind/scikit-build-core/CMake # build, with CPM.cmake fetching Eigen/fmt/nlohmann_json/msgpack-c/valijson/IF97/ # REFPROP-headers/boost-headers at configure time and statically compiling them in. -# Upstream's full-wheels matrix is py_versions=[39, 310, 311, 312] — the cp312 build is +# Upstream's full-wheels matrix is py_versions=[39, 310, 311, 312] - the cp312 build is # abi3-tagged (COOLPROP_NANOBIND=ON turns on both the nanobind core and, on Python >= 3.12, # the cp312-abi3 wheel tag) and covers 3.13/3.14 too, so those are dropped to avoid # duplicate abi3 wheels; 3.9-3.11 stay per-version. musllinux is skipped upstream too @@ -56,54 +56,60 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build coolprop ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "coolprop" + version: "${{ matrix.version }}" + repository: "CoolProp/CoolProp" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + set -euxo pipefail + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/5.0.1/COPYING.MPL2" -o LICENSE.eigen + curl -fsSL --retry 5 "https://raw.githubusercontent.com/msgpack/msgpack-c/919908742b4fdbc575e77fe1a8657e70c9573c44/LICENSE_1_0.txt" -o LICENSE.msgpack-c + curl -fsSL --retry 5 "https://raw.githubusercontent.com/nlohmann/json/v3.12.0/LICENSE.MIT" -o LICENSE.nlohmann-json + curl -fsSL --retry 5 "https://raw.githubusercontent.com/tristanpenman/valijson/v1.0.6/LICENSE" -o LICENSE.valijson + curl -fsSL --retry 5 "https://raw.githubusercontent.com/CoolProp/IF97/7aaced024a702f0985474bf293cdaae9c8d06521/LICENSE" -o LICENSE.if97 + curl -fsSL --retry 5 "https://raw.githubusercontent.com/CoolProp/REFPROP-headers/b4faab1b73911c32c4b69c526c7e92f74edb67de/LICENSE" -o LICENSE.refprop-headers + curl -fsSL --retry 5 "https://raw.githubusercontent.com/CoolProp/boost-headers/c68104660ca4bd80d0d5cb34c4eba0cf5bab3f73/LICENSE" -o LICENSE.boost-headers + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fmtlib/fmt/12.0.0/LICENSE" -o LICENSE.fmt + cp externals/miniz-3.1.1/LICENSE LICENSE.miniz + cp externals/incbin/UNLICENSE LICENSE.incbin + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-build-linux: "pip install ninja && git config --global --add safe.directory \"*\"" + cibw-environment-linux: "COOLPROP_NANOBIND=ON" + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + cibw-test-command: "python -c \"import CoolProp; from CoolProp.CoolProp import PropsSI; from CoolProp.State import State; assert '?' not in CoolProp.__gitrevision__; assert isinstance(PropsSI('T','P',101325,'Q',0,'Water'), float)\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: COOLPROP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout CoolProp/CoolProp v${{ env.COOLPROP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: CoolProp/CoolProp - ref: v${{ env.COOLPROP_VERSION }} - persist-credentials: false - - # Statically-linked CPM deps (cmake/dependencies.cmake) ship no licence in upstream's - # own wheel; stage them at the root so scikit-build-core's default PEP 639 licence - # glob (LICEN[CS]E*, root only — confirmed by diffing upstream's published wheel, - # which carries only its own root LICENSE) picks them all up. miniz/incbin are - # committed under externals/ already; the rest are pinned in dependencies.cmake. - - name: Stage vendored dependency licences - run: | - set -euxo pipefail - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/5.0.1/COPYING.MPL2" -o LICENSE.eigen - curl -fsSL --retry 5 "https://raw.githubusercontent.com/msgpack/msgpack-c/919908742b4fdbc575e77fe1a8657e70c9573c44/LICENSE_1_0.txt" -o LICENSE.msgpack-c - curl -fsSL --retry 5 "https://raw.githubusercontent.com/nlohmann/json/v3.12.0/LICENSE.MIT" -o LICENSE.nlohmann-json - curl -fsSL --retry 5 "https://raw.githubusercontent.com/tristanpenman/valijson/v1.0.6/LICENSE" -o LICENSE.valijson - curl -fsSL --retry 5 "https://raw.githubusercontent.com/CoolProp/IF97/7aaced024a702f0985474bf293cdaae9c8d06521/LICENSE" -o LICENSE.if97 - curl -fsSL --retry 5 "https://raw.githubusercontent.com/CoolProp/REFPROP-headers/b4faab1b73911c32c4b69c526c7e92f74edb67de/LICENSE" -o LICENSE.refprop-headers - curl -fsSL --retry 5 "https://raw.githubusercontent.com/CoolProp/boost-headers/c68104660ca4bd80d0d5cb34c4eba0cf5bab3f73/LICENSE" -o LICENSE.boost-headers - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fmtlib/fmt/12.0.0/LICENSE" -o LICENSE.fmt - cp externals/miniz-3.1.1/LICENSE LICENSE.miniz - cp externals/incbin/UNLICENSE LICENSE.incbin - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_BUILD_LINUX: pip install ninja && git config --global --add safe.directory "*" - CIBW_ENVIRONMENT: COOLPROP_NANOBIND=ON PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy - CIBW_TEST_COMMAND: >- - python -c "import CoolProp; from CoolProp.CoolProp import PropsSI; from CoolProp.State import State; - assert '?' not in CoolProp.__gitrevision__; assert isinstance(PropsSI('T','P',101325,'Q',0,'Water'), float)" + name: coolprop-${{ env.COOLPROP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -121,15 +127,9 @@ jobs: assert licences == expected, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: coolprop-${{ env.COOLPROP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish coolprop ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-coreforecast.yml b/.github/workflows/build-coreforecast.yml index 47c69107609d..c988213e096b 100644 --- a/.github/workflows/build-coreforecast.yml +++ b/.github/workflows/build-coreforecast.yml @@ -48,6 +48,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build coreforecast ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + # pandas is a hard, unguarded test dependency in most test modules; + # pypi.riseproject.dev has no riscv64 cp314t pandas wheel yet (PyPI + # itself does), so the tests can't collect there. Build still runs. + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "coreforecast" + version: "${{ matrix.version }}" + repository: "Nixtla/coreforecast" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-submodules: "recursive" + pre-build: |- + cp external_libs/skiplist/LICENSE LICENSE.skiplist + cp external_libs/stl-cpp/LICENSE-MIT LICENSE.stl-cpp + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,pandas" + # The newest numpy/pandas on PyPI have no riscv64 wheel in our registry yet. The + # default build[uv] frontend also installs the test requirements with uv, which + # ignored UV_NO_BUILD here and source-built numpy and then that pandas sdist (an + # xsimd error). pip honours PIP_ONLY_BINARY, so it takes the newest wheels we have. + cibw-build-frontend: "build" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,pandas" + cibw-test-skip: "${{ case(endsWith(matrix.python, 't'), '*', '') }}" + cibw-test-requires: "pandas pytest" + cibw-test-command: "python -m pytest {project}/tests -k \"not efficiency\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv # 60m was too tight: the pybind11/Eigen build runs anywhere from ~50m to # over 60m depending on runner load, so this job was intermittently @@ -61,48 +102,14 @@ jobs: # pypi.riseproject.dev has no riscv64 cp314t pandas wheel yet (PyPI # itself does), so the tests can't collect there. Build still runs. include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: COREFORECAST_VERSION: ${{ matrix.version }} - steps: - - name: Checkout coreforecast v${{ env.COREFORECAST_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Nixtla/coreforecast - ref: v${{ env.COREFORECAST_VERSION }} - submodules: recursive - persist-credentials: false - - # external_libs/{skiplist,stl-cpp} are header-only submodules - # compiled into the wheel, but upstream's own wheel ships only its own - # LICENSE. Stage theirs at the root for scikit-build-core's default - # wheel.license-files glob to pick up. - - name: Stage the vendored dependencies' licences - run: | - cp external_libs/skiplist/LICENSE LICENSE.skiplist - cp external_libs/stl-cpp/LICENSE-MIT LICENSE.stl-cpp - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pandas - # The newest numpy/pandas on PyPI have no riscv64 wheel in our registry yet. The - # default build[uv] frontend also installs the test requirements with uv, which - # ignored UV_NO_BUILD here and source-built numpy and then that pandas sdist (an - # xsimd error). pip honours PIP_ONLY_BINARY, so it takes the newest wheels we have. - CIBW_BUILD_FRONTEND: build - CIBW_TEST_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pandas - CIBW_TEST_SKIP: ${{ case(endsWith(matrix.python, 't'), '*', '') }} - CIBW_TEST_REQUIRES: pandas pytest - CIBW_TEST_COMMAND: python -m pytest {project}/tests -k "not efficiency" + name: coreforecast-${{ env.COREFORECAST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -117,15 +124,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: coreforecast-${{ env.COREFORECAST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish coreforecast ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cppcheck.yml b/.github/workflows/build-cppcheck.yml index 66ea36925785..bc2bebbf45b5 100644 --- a/.github/workflows/build-cppcheck.yml +++ b/.github/workflows/build-cppcheck.yml @@ -53,60 +53,62 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build cppcheck ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cppcheck" + version: "${{ matrix.version }}" + repository: "msclock/cppcheck-wheel" + ref: "v${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 120 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/cppcheck/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # wheel.py-api = "py3", so one build serves every interpreter. + cibw-build: "cp312-manylinux_riscv64" + # Replaces pyproject.toml's own [tool.cibuildwheel.linux] before-build: its + # `pip install cmake==4.4.4`/`ninja==1.13.2` pins have no riscv64 wheel on + # PyPI or this registry, and vcpkg (bootstrapped in-tree, builtin-baseline + # 2026-10-04) has no prebuilt cmake/ninja/git for riscv64 either, so it + # needs VCPKG_FORCE_SYSTEM_BINARIES plus real binaries on PATH - the + # manylinux_riscv64 image's own dnf packages, same as build-ale-py.yml. + cibw-before-build-linux: "dnf install -y --setopt=install_weak_deps=False zip perl-IPC-Cmd pkgconf-pkg-config cmake ninja-build && cmake --version && ninja --version" + # Repeats pyproject.toml's own `environment` table: CIBW_ENVIRONMENT replaces + # rather than merges with it (gotcha 107). vcpkg's upstream overrides table + # only sets VCPKG_FORCE_SYSTEM_BINARIES for the Linux arches it already knows + # about (x86_64/aarch64/armv7l/ppc64le/s390x/i686), not riscv64. + # cppcheck is non-PIE on this image; keep its base above vm.mmap_min_addr once + # auditwheel's patchelf prepends a segment (gotcha 595). + # The version comes from setuptools_scm, which reads this shallow, + # patched checkout as 1.5.4.dev0+g.d; pin it (gotchas 3, 31). + cibw-environment-linux: "VCPKG_FORCE_SYSTEM_BINARIES=1 LDFLAGS=\"-Wl,-Ttext-segment=0x200000\" SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CPPCHECK=${{ matrix.version }}" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: CPPCHECK_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cppcheck-wheel v${{ env.CPPCHECK_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: msclock/cppcheck-wheel - ref: v${{ env.CPPCHECK_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch cppcheck-wheel source - run: git apply python-wheels/patches/cppcheck/${{ env.CPPCHECK_VERSION }}/00*.patch - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # wheel.py-api = "py3", so one build serves every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces pyproject.toml's own [tool.cibuildwheel.linux] before-build: its - # `pip install cmake==4.4.4`/`ninja==1.13.2` pins have no riscv64 wheel on - # PyPI or this registry, and vcpkg (bootstrapped in-tree, builtin-baseline - # 2026-10-04) has no prebuilt cmake/ninja/git for riscv64 either, so it - # needs VCPKG_FORCE_SYSTEM_BINARIES plus real binaries on PATH - the - # manylinux_riscv64 image's own dnf packages, same as build-ale-py.yml. - CIBW_BEFORE_BUILD_LINUX: >- - dnf install -y --setopt=install_weak_deps=False - zip perl-IPC-Cmd pkgconf-pkg-config cmake ninja-build && - cmake --version && ninja --version - # Repeats pyproject.toml's own `environment` table: CIBW_ENVIRONMENT replaces - # rather than merges with it (gotcha 107). vcpkg's upstream overrides table - # only sets VCPKG_FORCE_SYSTEM_BINARIES for the Linux arches it already knows - # about (x86_64/aarch64/armv7l/ppc64le/s390x/i686), not riscv64. - # cppcheck is non-PIE on this image; keep its base above vm.mmap_min_addr once - # auditwheel's patchelf prepends a segment (gotcha 595). - # The version comes from setuptools_scm, which reads this shallow, - # patched checkout as 1.5.4.dev0+g.d; pin it (gotchas 3, 31). - CIBW_ENVIRONMENT: >- - VCPKG_FORCE_SYSTEM_BINARIES=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - LDFLAGS="-Wl,-Ttext-segment=0x200000" - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CPPCHECK=${{ env.CPPCHECK_VERSION }} + name: cppcheck-${{ env.CPPCHECK_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Verify the wheel ships the cppcheck binary run: | @@ -117,15 +119,9 @@ jobs: assert any(n.endswith("/Cppcheck/cppcheck") for n in names), names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cppcheck-${{ env.CPPCHECK_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cppcheck ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cramjam.yml b/.github/workflows/build-cramjam.yml index 3764ea59caa8..e99b60b2517d 100644 --- a/.github/workflows/build-cramjam.yml +++ b/.github/workflows/build-cramjam.yml @@ -48,44 +48,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cramjam ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cramjam" + version: "${{ matrix.version }}" + repository: "milesgranger/pyrus-cramjam" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # cramjam ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + # PIP_EXTRA_INDEX_URL resolves the [dev] test deps that have no + # riscv64 wheel on public PyPI (numpy, hypothesis). + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-extras: "dev" + cibw-test-sources: "tests pyproject.toml" + cibw-test-command: "python -m pytest -vs --benchmark-skip -n0 --dist no" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CRAMJAM_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cramjam ${{ env.CRAMJAM_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: milesgranger/pyrus-cramjam - ref: v${{ env.CRAMJAM_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cramjam ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - # PIP_EXTRA_INDEX_URL resolves the [dev] test deps that have no - # riscv64 wheel on public PyPI (numpy, hypothesis). - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_EXTRAS: dev - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_COMMAND: python -m pytest -vs --benchmark-skip -n0 --dist no + name: cramjam-${{ env.CRAMJAM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel carries the compiled extension run: | @@ -97,15 +101,9 @@ jobs: print("\n".join(sos)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cramjam-${{ env.CRAMJAM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cramjam ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-crc32c.yml b/.github/workflows/build-crc32c.yml index 24f1e118574d..1462274d5db6 100644 --- a/.github/workflows/build-crc32c.yml +++ b/.github/workflows/build-crc32c.yml @@ -49,32 +49,38 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build crc32c ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "crc32c" + version: "${{ matrix.version }}" + repository: "ICRAR/crc32c" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pytest" + cibw-test-command: "python -u {project}/run-tests.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: CRC32C_VERSION: ${{ matrix.version }} - steps: - - name: Checkout crc32c v${{ env.CRC32C_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ICRAR/crc32c - ref: v${{ env.CRC32C_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: python -u {project}/run-tests.py + name: crc32c-${{ env.CRC32C_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -86,15 +92,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: crc32c-${{ env.CRC32C_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish crc32c ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-crick.yml b/.github/workflows/build-crick.yml index f18a2869e845..52f452e41a0a 100644 --- a/.github/workflows/build-crick.yml +++ b/.github/workflows/build-crick.yml @@ -50,58 +50,66 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build crick ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "crick" + version: "${{ matrix.version }}" + repository: "dask/crick" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-fetch-depth: 0 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/crick/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + git update-index --skip-worktree crick/stats_stubs.c crick/space_saving_stubs.c.in + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a build-time requirement (headers + libnpymath) and, despite not + # being declared as a runtime dependency, an implicit one too (the compiled + # extensions call numpy's C API at import time). Only our registry has it + # for riscv64; only-binary keeps a newer PyPI release from winning the + # resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest numpy" + cibw-test-command: "python -m pytest --pyargs crick" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CRICK_VERSION: ${{ matrix.version }} - steps: - - name: Checkout crick ${{ env.CRICK_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: dask/crick - ref: ${{ env.CRICK_VERSION }} - fetch-depth: 0 # versioneer derives the version from `git describe` - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/crick/${{ env.CRICK_VERSION }}/*.patch - - # `git apply` dirties the tree, and versioneer (unlike setuptools_scm) has no - # PRETEND_VERSION escape hatch -- `git describe --dirty` would otherwise turn - # 0.0.8 into 0.0.8+0.g.dirty. skip-worktree hides the two patched files - # from git's dirty check while keeping their patched content on disk. - - name: Pin the version past the patch (CLAUDE.md gotcha 315) - run: git update-index --skip-worktree crick/stats_stubs.c crick/space_saving_stubs.c.in - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build-time requirement (headers + libnpymath) and, despite not - # being declared as a runtime dependency, an implicit one too (the compiled - # extensions call numpy's C API at import time). Only our registry has it - # for riscv64; only-binary keeps a newer PyPI release from winning the - # resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest numpy - CIBW_TEST_COMMAND: python -m pytest --pyargs crick + name: crick-${{ env.CRICK_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -114,16 +122,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: crick-${{ env.CRICK_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish crick ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cronexpr.yml b/.github/workflows/build-cronexpr.yml index 198fd1812c77..6b78414ea1a1 100644 --- a/.github/workflows/build-cronexpr.yml +++ b/.github/workflows/build-cronexpr.yml @@ -60,9 +60,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # scikit-build-core fetches cmake/ninja from PyPI when missing on PATH, and CMake # 4+ rejects supertinycron's CPM-fetched cmake_minimum_required(3.5) (gotcha 257). - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CMAKE_POLICY_VERSION_MINIMUM=3.5 + cibw-environment-linux: "CMAKE_POLICY_VERSION_MINIMUM=3.5" cibw-test-command: >- python -c "import _ccronexpr as m; assert m.__file__.endswith('.so'), m.__file__" && python -c "import cronexpr, unittest; diff --git a/.github/workflows/build-crosshair-tool.yml b/.github/workflows/build-crosshair-tool.yml index 9045520cbaa6..b2be23937032 100644 --- a/.github/workflows/build-crosshair-tool.yml +++ b/.github/workflows/build-crosshair-tool.yml @@ -60,13 +60,10 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 cibw-build-frontend: "build" - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # The newest Pillow on PyPI has no riscv64 wheel in our registry yet, so pip took its # sdist (no libjpeg headers in the image) over the newest wheel we do have; the dev # extras are only needed for the tests, so require a wheel for it. - cibw-test-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=pillow + cibw-test-environment: "PIP_ONLY_BINARY=pillow" cibw-test-extras: "dev" cibw-test-requires: "pytest" cibw-test-command: pytest {project}/crosshair -m smoke diff --git a/.github/workflows/build-cumm.yml b/.github/workflows/build-cumm.yml index 87c81f44cafb..80187eacd92c 100644 --- a/.github/workflows/build-cumm.yml +++ b/.github/workflows/build-cumm.yml @@ -60,7 +60,7 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: 'CUMM_CUDA_VERSION= CUMM_DISABLE_JIT=1' + cibw-environment-linux: 'CUMM_CUDA_VERSION= CUMM_DISABLE_JIT=1' cibw-test-command: python -c "import cumm; from cumm import tensorview as tv; assert tv.is_cpu_only(); a = tv.zeros([2, 3], tv.float32, -1); print(list(a.shape), cumm.__version__)" timeout-minutes: 90 diff --git a/.github/workflows/build-curated-tokenizers.yml b/.github/workflows/build-curated-tokenizers.yml index 3e1114475aa4..d94a79d9b760 100644 --- a/.github/workflows/build-curated-tokenizers.yml +++ b/.github/workflows/build-curated-tokenizers.yml @@ -51,35 +51,41 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build curated-tokenizers ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "curated-tokenizers" + version: "${{ matrix.version }}" + repository: "explosion/curated-tokenizers" + ref: "release-v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "recursive" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream leaves cibuildwheel's test-command empty and tests the wheel in a + # separate workflow; the suite ships inside the wheel, so run it here. + cibw-test-requires: "pytest" + cibw-test-command: "python -m pytest --pyargs curated_tokenizers" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: CURATED_TOKENIZERS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout curated-tokenizers release-v${{ env.CURATED_TOKENIZERS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: explosion/curated-tokenizers - ref: release-v${{ env.CURATED_TOKENIZERS_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream leaves cibuildwheel's test-command empty and tests the wheel in a - # separate workflow; the suite ships inside the wheel, so run it here. - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: python -m pytest --pyargs curated_tokenizers + name: curated-tokenizers-${{ env.CURATED_TOKENIZERS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extensions run: | @@ -91,15 +97,9 @@ jobs: print("\n".join(sos)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: curated-tokenizers-${{ env.CURATED_TOKENIZERS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish curated-tokenizers ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cutadapt.yml b/.github/workflows/build-cutadapt.yml index 88ef6f52a85c..2c2db6c10dfd 100644 --- a/.github/workflows/build-cutadapt.yml +++ b/.github/workflows/build-cutadapt.yml @@ -58,9 +58,7 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # Shallow checkout has no tag history for setuptools_scm to read. - cibw-environment: >- - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CUTADAPT=${{ matrix.version }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CUTADAPT=${{ matrix.version }}" timeout-minutes: 60 publish: diff --git a/.github/workflows/build-cvxopt.yml b/.github/workflows/build-cvxopt.yml index 230bc84df2a3..5f0e855de5ca 100644 --- a/.github/workflows/build-cvxopt.yml +++ b/.github/workflows/build-cvxopt.yml @@ -52,53 +52,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cvxopt ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cvxopt" + version: "${{ matrix.version }}" + repository: "cvxopt/cvxopt" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Replaces upstream's before_all_linux.sh, which exits on any + # architecture other than x86_64/i686/aarch64. + cibw-before-all-linux: "dnf -y install openblas-devel fftw-devel && curl -fsSL -o /tmp/suitesparse.tar.gz https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v7.11.0.tar.gz && echo \"93ed4c4e546a49fc75884c3a8b807d5af4a91e39d191fbbc60a07380b12a35d1 /tmp/suitesparse.tar.gz\" | sha256sum -c - && tar xzf /tmp/suitesparse.tar.gz -C {project} && cp {project}/SuiteSparse-7.11.0/LICENSE.txt {project}/LICENSE.suitesparse && cp /usr/share/licenses/openblas/LICENSE {project}/LICENSE.openblas && cp /usr/share/licenses/fftw-libs-double/COPYING {project}/LICENSE.fftw" + # Upstream's own linux environment table, minus the gsl, glpk and dsdp + # extensions (no riscv64 packages, and no EPEL for it either). The + # *_LIB_DIR overrides are needed because setup.py only guesses + # /usr/lib64 when it finds SuiteSparse installed there. + cibw-environment-linux: "CVXOPT_BLAS_LIB=openblas CVXOPT_LAPACK_LIB=openblas CVXOPT_BLAS_LIB_DIR=/usr/lib64 CVXOPT_BUILD_FFTW=1 CVXOPT_FFTW_LIB_DIR=/usr/lib64 CVXOPT_SUITESPARSE_SRC_DIR=SuiteSparse-7.11.0" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CVXOPT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cvxopt ${{ env.CVXOPT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cvxopt/cvxopt - ref: ${{ env.CVXOPT_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces upstream's before_all_linux.sh, which exits on any - # architecture other than x86_64/i686/aarch64. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install openblas-devel fftw-devel && - curl -fsSL -o /tmp/suitesparse.tar.gz https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v${{ env.SUITESPARSE_VERSION }}.tar.gz && - echo "${{ env.SUITESPARSE_SHA256 }} /tmp/suitesparse.tar.gz" | sha256sum -c - && - tar xzf /tmp/suitesparse.tar.gz -C {project} && - cp {project}/SuiteSparse-${{ env.SUITESPARSE_VERSION }}/LICENSE.txt {project}/LICENSE.suitesparse && - cp /usr/share/licenses/openblas/LICENSE {project}/LICENSE.openblas && - cp /usr/share/licenses/fftw-libs-double/COPYING {project}/LICENSE.fftw - # Upstream's own linux environment table, minus the gsl, glpk and dsdp - # extensions (no riscv64 packages, and no EPEL for it either). The - # *_LIB_DIR overrides are needed because setup.py only guesses - # /usr/lib64 when it finds SuiteSparse installed there. - CIBW_ENVIRONMENT: >- - CVXOPT_BLAS_LIB=openblas - CVXOPT_LAPACK_LIB=openblas - CVXOPT_BLAS_LIB_DIR=/usr/lib64 - CVXOPT_BUILD_FFTW=1 - CVXOPT_FFTW_LIB_DIR=/usr/lib64 - CVXOPT_SUITESPARSE_SRC_DIR=SuiteSparse-${{ env.SUITESPARSE_VERSION }} + name: cvxopt-${{ env.CVXOPT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extensions and all licences run: | @@ -117,12 +111,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cvxopt-${{ env.CVXOPT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -175,7 +163,7 @@ jobs: publish: name: Publish cvxopt ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cvxpy-base.yml b/.github/workflows/build-cvxpy-base.yml index a0f78ac8eb0b..3ee4af4af358 100644 --- a/.github/workflows/build-cvxpy-base.yml +++ b/.github/workflows/build-cvxpy-base.yml @@ -48,56 +48,64 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cvxpy-base ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cvxpy-base" + version: "${{ matrix.version }}" + repository: "cvxpy/cvxpy" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + sed -i.bak -e 's/name = "cvxpy"/name = "cvxpy-base"/g' pyproject.toml + sed -i.bak '/clarabel >= /d' pyproject.toml + sed -i.bak '/osqp >= /d' pyproject.toml + sed -i.bak '/scs >= /d' pyproject.toml + sed -i.bak '/highspy >= /d' pyproject.toml + sed -i.bak -e 's/name="cvxpy",/name="cvxpy-base",/g' setup.py + rm -rf pyproject.toml.bak setup.py.bak + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + curl -fsSL --retry 5 https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 -o COPYING.eigen + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,osqp,clarabel,scs,highspy,qdldl,sparsediffpy" + cibw-test-requires: "pytest hypothesis scs clarabel osqp highspy" + # test_max: SCS's DQCP bisection lands on 0.858 (expected 0.1715) on riscv64 only; the + # same scs 3.3.1 passes on x86_64. test_nd_broadcast_generated: hypothesis 200ms deadline. + cibw-test-command: "python -c \"import cvxpy; print(cvxpy.installed_solvers())\" && python -m pytest --pyargs cvxpy.tests -k \"not (TestDqcp and test_max) and not test_nd_broadcast_generated\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CVXPY_BASE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cvxpy v${{ env.CVXPY_BASE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cvxpy/cvxpy - ref: v${{ env.CVXPY_BASE_VERSION }} - persist-credentials: false - - - name: Adapt pyproject.toml - run: | - sed -i.bak -e 's/name = "cvxpy"/name = "cvxpy-base"/g' pyproject.toml - sed -i.bak '/clarabel >= /d' pyproject.toml - sed -i.bak '/osqp >= /d' pyproject.toml - sed -i.bak '/scs >= /d' pyproject.toml - sed -i.bak '/highspy >= /d' pyproject.toml - sed -i.bak -e 's/name="cvxpy",/name="cvxpy-base",/g' setup.py - rm -rf pyproject.toml.bak setup.py.bak - - # cvxpy/cvxcore/include/Eigen (Eigen 3.4.0) is compiled into _cvxcore but - # vendored without its licence; stage it for the default COPYING* glob. - - name: Stage the vendored dependency's licence - run: curl -fsSL --retry 5 https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 -o COPYING.eigen - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,osqp,clarabel,scs,highspy,qdldl,sparsediffpy - CIBW_TEST_REQUIRES: pytest hypothesis scs clarabel osqp highspy - # test_max: SCS's DQCP bisection lands on 0.858 (expected 0.1715) on riscv64 only; the - # same scs 3.3.1 passes on x86_64. test_nd_broadcast_generated: hypothesis 200ms deadline. - CIBW_TEST_COMMAND: >- - python -c "import cvxpy; print(cvxpy.installed_solvers())" && - python -m pytest --pyargs cvxpy.tests - -k "not (TestDqcp and test_max) and not test_nd_broadcast_generated" + name: cvxpy-base-${{ env.CVXPY_BASE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and all licences run: | @@ -112,15 +120,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cvxpy-base-${{ env.CVXPY_BASE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cvxpy-base ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cvxpy.yml b/.github/workflows/build-cvxpy.yml index 57d559fd2d82..0d3617b05688 100644 --- a/.github/workflows/build-cvxpy.yml +++ b/.github/workflows/build-cvxpy.yml @@ -48,46 +48,50 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cvxpy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cvxpy" + version: "${{ matrix.version }}" + repository: "cvxpy/cvxpy" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + curl -fsSL --retry 5 https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 -o COPYING.eigen + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,osqp,clarabel,scs,highspy,qdldl,sparsediffpy" + cibw-test-requires: "pytest hypothesis scs clarabel osqp highspy" + # test_max: SCS's DQCP bisection lands on 0.858 (expected 0.1715) on riscv64 only; the + # same scs 3.3.1 passes on x86_64. test_nd_broadcast_generated: hypothesis 200ms deadline. + cibw-test-command: "python -c \"import cvxpy; print(cvxpy.installed_solvers())\" && python -m pytest --pyargs cvxpy.tests -k \"not (TestDqcp and test_max) and not test_nd_broadcast_generated\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CVXPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cvxpy v${{ env.CVXPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cvxpy/cvxpy - ref: v${{ env.CVXPY_VERSION }} - persist-credentials: false - - # cvxpy/cvxcore/include/Eigen (Eigen 3.4.0) is compiled into _cvxcore but - # vendored without its licence; stage it for the default COPYING* glob. - - name: Stage the vendored dependency's licence - run: curl -fsSL --retry 5 https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 -o COPYING.eigen - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,osqp,clarabel,scs,highspy,qdldl,sparsediffpy - CIBW_TEST_REQUIRES: pytest hypothesis scs clarabel osqp highspy - # test_max: SCS's DQCP bisection lands on 0.858 (expected 0.1715) on riscv64 only; the - # same scs 3.3.1 passes on x86_64. test_nd_broadcast_generated: hypothesis 200ms deadline. - CIBW_TEST_COMMAND: >- - python -c "import cvxpy; print(cvxpy.installed_solvers())" && - python -m pytest --pyargs cvxpy.tests - -k "not (TestDqcp and test_max) and not test_nd_broadcast_generated" + name: cvxpy-${{ env.CVXPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and all licences run: | @@ -102,15 +106,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cvxpy-${{ env.CVXPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cvxpy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cyksuid.yml b/.github/workflows/build-cyksuid.yml index 59acfa212a90..4c8e6de563f4 100644 --- a/.github/workflows/build-cyksuid.yml +++ b/.github/workflows/build-cyksuid.yml @@ -74,7 +74,7 @@ jobs: # __pyx_vectorcallfunc); bumped to build across the whole matrix. cibw-before-build: pip install "cython==3.3.0" setuptools cibw-build-frontend: "pip; args: --no-build-isolation" - cibw-environment: CYTHON=1 + cibw-environment-linux: CYTHON=1 cibw-test-requires: pytest cibw-test-command: >- python -c "from cyksuid import _ksuid, fast_base62; diff --git a/.github/workflows/build-cylp.yml b/.github/workflows/build-cylp.yml index 227ac2e58f99..345daf865919 100644 --- a/.github/workflows/build-cylp.yml +++ b/.github/workflows/build-cylp.yml @@ -46,51 +46,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cylp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cylp" + version: "${{ matrix.version }}" + repository: "coin-or/CyLP" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 480 + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Passed rather than set through CIBW_ENVIRONMENT, which would replace pyproject.toml's. + # auditwheel vendors the coinbrew-built CoinUtils/Osi/Clp/Cgl/Cbc; ship their licences. + cibw-before-build-linux: |- + for p in CoinUtils Osi Clp Cgl Cbc; do + cp "$p/LICENSE" "LICENSE.$(echo "$p" | tr '[:upper:]' '[:lower:]')" + done + # Upstream sets test-requires but no test-command, so its own suite never runs there. + cibw-test-sources: "cylp/tests cylp/input" + cibw-test-requires: "pytest" + # Deselected tests fail identically with upstream's own x86_64 wheel: the Python pivot + # tests segfault, the rest use np.float and the removed CyCbcModel.branchAndBound. + cibw-test-command: "pytest cylp/tests -k \"not (TestCyClpSimplex and (Dantzig or LIFO or MostFrequent or test_PE)) and not TestQP and not (TestMIP and (NodeCompare or SetInt_CopyIn or isInt or (multiDim and not Cbc_solve))) and not scale_scale and not scale_unscale\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 480 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CYLP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout CyLP v${{ env.CYLP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: coin-or/CyLP - ref: v${{ env.CYLP_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 - # Passed rather than set through CIBW_ENVIRONMENT, which would replace pyproject.toml's. - CIBW_ENVIRONMENT_PASS_LINUX: PIP_EXTRA_INDEX_URL PIP_ONLY_BINARY - PIP_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY: numpy,scipy - # auditwheel vendors the coinbrew-built CoinUtils/Osi/Clp/Cgl/Cbc; ship their licences. - CIBW_BEFORE_BUILD_LINUX: | - for p in CoinUtils Osi Clp Cgl Cbc; do - cp "$p/LICENSE" "LICENSE.$(echo "$p" | tr '[:upper:]' '[:lower:]')" - done - # Upstream sets test-requires but no test-command, so its own suite never runs there. - CIBW_TEST_SOURCES: cylp/tests cylp/input - CIBW_TEST_REQUIRES: pytest - # Deselected tests fail identically with upstream's own x86_64 wheel: the Python pivot - # tests segfault, the rest use np.float and the removed CyCbcModel.branchAndBound. - CIBW_TEST_COMMAND: >- - pytest cylp/tests - -k "not (TestCyClpSimplex and (Dantzig or LIFO or MostFrequent or test_PE)) - and not TestQP - and not (TestMIP and (NodeCompare or SetInt_CopyIn or isInt or (multiDim and not Cbc_solve))) - and not scale_scale and not scale_unscale" + name: cylp-${{ env.CYLP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extensions, the COIN-OR libraries and their licences run: | @@ -111,15 +111,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cylp-${{ env.CYLP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cylp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cymem.yml b/.github/workflows/build-cymem.yml index 113c3d2d0329..a5e818db8548 100644 --- a/.github/workflows/build-cymem.yml +++ b/.github/workflows/build-cymem.yml @@ -53,48 +53,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cymem ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - CYMEM_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout cymem release-v${{ env.CYMEM_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: explosion/cymem - ref: release-v${{ env.CYMEM_VERSION }} - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cymem" + version: "${{ matrix.version }}" + repository: "explosion/cymem" + ref: "release-v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + shopt -s nullglob + patches=(python-wheels/patches/cymem/${{ matrix.version }}/00*.patch) + if (( ${#patches[@]} )); then git apply "${patches[@]}"; fi - # 2.0.13 needs the cpython-freethreading enable group dropped; 2.0.16 dropped - # it upstream and has no patch, so only apply what exists for this version. - - name: Patch cymem source - run: | - shopt -s nullglob - patches=(python-wheels/patches/cymem/${{ env.CYMEM_VERSION }}/00*.patch) - if (( ${#patches[@]} )); then git apply "${patches[@]}"; fi + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream leaves cibuildwheel's test-command empty and tests the wheel in a + # separate workflow; the suite ships inside the wheel, so run it here. + cibw-test-requires: "pytest" + cibw-test-command: "python -m pytest --pyargs cymem -Werror" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + CYMEM_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream leaves cibuildwheel's test-command empty and tests the wheel in a - # separate workflow; the suite ships inside the wheel, so run it here. - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: python -m pytest --pyargs cymem -Werror + name: cymem-${{ env.CYMEM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension run: | @@ -106,15 +114,9 @@ jobs: print("\n".join(sos)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cymem-${{ env.CYMEM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cymem ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cysignals.yml b/.github/workflows/build-cysignals.yml index 599ecffdad42..7e4ceaceabe5 100644 --- a/.github/workflows/build-cysignals.yml +++ b/.github/workflows/build-cysignals.yml @@ -49,6 +49,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cysignals ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cysignals" + version: "${{ matrix.version }}" + repository: "sagemath/cysignals" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 30 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/cysignals/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # Upstream's pyproject.toml sets build-frontend = "build[uv]"; that + # crashes cibuildwheel's post-build audit step on our self-hosted + # runner, which has no host `uv` (gotcha 13). + cibw-build-frontend: "build" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv # cysignals's own test suite deliberately triggers stack overflows, infinite # loops and alarm-based interrupts; fail fast if one of those hangs instead @@ -58,43 +94,14 @@ jobs: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CYSIGNALS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cysignals ${{ env.CYSIGNALS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: sagemath/cysignals - ref: ${{ env.CYSIGNALS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # 1.13.0 needs its pyproject.toml's cpython-freethreading enable group - # dropped (cibuildwheel 3.0+ rejects it); upstream removed it in 1.13.1, - # so later versions may have no patches/ directory at all. - - name: Patch cysignals source - if: hashFiles(format('python-wheels/patches/cysignals/{0}/*.patch', env.CYSIGNALS_VERSION)) != '' - run: git apply python-wheels/patches/cysignals/${{ env.CYSIGNALS_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # Upstream's pyproject.toml sets build-frontend = "build[uv]"; that - # crashes cibuildwheel's post-build audit step on our self-hosted - # runner, which has no host `uv` (gotcha 13). - CIBW_BUILD_FRONTEND: build + name: cysignals-${{ env.CYSIGNALS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extensions and licence run: | @@ -110,15 +117,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cysignals-${{ env.CYSIGNALS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cysignals ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cysystemd.yml b/.github/workflows/build-cysystemd.yml index 51a6a6eac5df..6805a591a024 100644 --- a/.github/workflows/build-cysystemd.yml +++ b/.github/workflows/build-cysystemd.yml @@ -49,137 +49,144 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cysystemd ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cysystemd" + version: "${{ matrix.version }}" + repository: "mosquito/cysystemd" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + python3 scripts/bump_version.py ${{ matrix.version }} + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of every shared library + # auditwheel vendors out of the build image alongside libsystemd. + # setuptools' default LICENSE* glob copies them into the wheel. + set -euo pipefail + + project="${1:?usage: collect-licenses.sh }" + + # ldd is transitive, so libsystemd alone covers its whole closure; + # ldd does not list the root itself, so resolve that too. + mapfile -t libs < <( + { + ldd /usr/lib64/libsystemd.so.0 | tr ' ' '\n' | grep '^/' + readlink -f /usr/lib64/libsystemd.so.0 + } | sort -u + ) + + # `rpm -qf` reports unowned files on stdout, so keep only bare package names. + # glibc and the gcc runtime are on auditwheel's manylinux allowlist and + # are never vendored into the wheel. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc)$' + ) + + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + + # Some subpackages leave the licence to a sibling of the same source RPM. + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi + + # Others mark it %doc rather than %license, and the image installs no docs. + if [ -z "${files[0]:-}" ]; then + dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi + + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done + + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "dnf install -y systemd-devel && bash {project}/collect-licenses.sh {project}" + cibw-before-build: "pip install -U Cython setuptools" + cibw-build-frontend: "pip; args: --no-build-isolation" + # Upstream ships no test suite (no tests/ dir, and publish.yml has no + # test step). The build container has no running systemd/journald, so + # exercise the compiled extensions against what is actually there: + # notify()/send() report failure through their return value rather than + # raising, and the reader's real open-error path needs no live journal. + cibw-test-command: |- + python3 - <<'PYEOF' + import cysystemd + import cysystemd._daemon + import cysystemd._journal + import cysystemd.reader + from cysystemd import journal, daemon + from cysystemd.daemon import Notification + from cysystemd.reader import JournalReader, JournalOpenMode + + assert cysystemd.__version__ == "${{ matrix.version }}", cysystemd.__version__ + for mod in (cysystemd._daemon, cysystemd._journal, cysystemd.reader): + assert mod.__file__.endswith(".so"), mod.__file__ + + assert list(journal.Priority) + + result = daemon.notify(Notification.STATUS, "riscv64 ci smoke test") + print("notify:", result) + + journal.send(message="riscv64 ci smoke test", priority=journal.Priority.INFO) + + try: + reader = JournalReader() + reader.open(JournalOpenMode.SYSTEM) + print("journal open: OK,", sum(1 for _ in reader), "entries") + except OSError as e: + print("journal open skipped: no live journal in this container:", e) + PYEOF + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: CYSYSTEMD_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cysystemd ${{ env.CYSYSTEMD_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: mosquito/cysystemd - ref: ${{ env.CYSYSTEMD_VERSION }} - persist-credentials: false - - # The tag's cysystemd/__init__.py keeps whatever version_info was last - # committed; upstream's own release CI writes the real one in this step - # right before building (gotcha 3), so a wheel built without it reports - # a stale/wrong version. - - name: Set version from tag - run: python3 scripts/bump_version.py ${{ env.CYSYSTEMD_VERSION }} - - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of every shared library - # auditwheel vendors out of the build image alongside libsystemd. - # setuptools' default LICENSE* glob copies them into the wheel. - set -euo pipefail - - project="${1:?usage: collect-licenses.sh }" - - # ldd is transitive, so libsystemd alone covers its whole closure; - # ldd does not list the root itself, so resolve that too. - mapfile -t libs < <( - { - ldd /usr/lib64/libsystemd.so.0 | tr ' ' '\n' | grep '^/' - readlink -f /usr/lib64/libsystemd.so.0 - } | sort -u - ) - - # `rpm -qf` reports unowned files on stdout, so keep only bare package names. - # glibc and the gcc runtime are on auditwheel's manylinux allowlist and - # are never vendored into the wheel. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc)$' - ) - - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - - # Some subpackages leave the licence to a sibling of the same source RPM. - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi - - # Others mark it %doc rather than %license, and the image installs no docs. - if [ -z "${files[0]:-}" ]; then - dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi - - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done - - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - dnf install -y systemd-devel && - bash {project}/collect-licenses.sh {project} - CIBW_BEFORE_BUILD: pip install -U Cython setuptools - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - # Upstream ships no test suite (no tests/ dir, and publish.yml has no - # test step). The build container has no running systemd/journald, so - # exercise the compiled extensions against what is actually there: - # notify()/send() report failure through their return value rather than - # raising, and the reader's real open-error path needs no live journal. - CIBW_TEST_COMMAND: | - python3 - <<'PYEOF' - import cysystemd - import cysystemd._daemon - import cysystemd._journal - import cysystemd.reader - from cysystemd import journal, daemon - from cysystemd.daemon import Notification - from cysystemd.reader import JournalReader, JournalOpenMode - - assert cysystemd.__version__ == "${{ env.CYSYSTEMD_VERSION }}", cysystemd.__version__ - for mod in (cysystemd._daemon, cysystemd._journal, cysystemd.reader): - assert mod.__file__.endswith(".so"), mod.__file__ - - assert list(journal.Priority) - - result = daemon.notify(Notification.STATUS, "riscv64 ci smoke test") - print("notify:", result) - - journal.send(message="riscv64 ci smoke test", priority=journal.Priority.INFO) - - try: - reader = JournalReader() - reader.open(JournalOpenMode.SYSTEM) - print("journal open: OK,", sum(1 for _ in reader), "entries") - except OSError as e: - print("journal open skipped: no live journal in this container:", e) - PYEOF + name: cysystemd-${{ env.CYSYSTEMD_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extensions and licences run: | @@ -198,12 +205,6 @@ jobs: assert expected_pkgs <= have_pkgs, expected_pkgs - have_pkgs EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cysystemd-${{ env.CYSYSTEMD_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -239,7 +240,7 @@ jobs: publish: name: Publish cysystemd ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-cyvcf2.yml b/.github/workflows/build-cyvcf2.yml index 42769210691c..5720c56d860e 100644 --- a/.github/workflows/build-cyvcf2.yml +++ b/.github/workflows/build-cyvcf2.yml @@ -49,67 +49,69 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build cyvcf2 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "cyvcf2" + version: "${{ matrix.version }}" + repository: "brentp/cyvcf2" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/cyvcf2/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "dnf install -y autoconf automake libtool cmake ninja-build zlib-devel bzip2-devel xz-devel" + # No libcurl-devel and no EPEL on riscv64 (as build-pysam.yml/build-pybigwig.yml), + # so drop --enable-libcurl/--enable-s3/--with-libdeflate from upstream's own + # options; each defaults to "check" and htslib's configure silently disables it + # when the headers are absent instead of failing. bz2/lzma default to required, + # matching the devel packages installed above. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy CYVCF2_HTSLIB_CONFIGURE_OPTIONS=\"--enable-lzma --enable-bz2\"" + cibw-test-requires: "pytest" + cibw-test-sources: "cyvcf2/tests pyproject.toml" + # test_reader.py/test_writer.py reach the compiled extension via a + # package-relative `from ..cyvcf2 import ...`, so cyvcf2/tests alone (no + # cyvcf2/__init__.py) isn't a deep enough package for that import to resolve. + # Merge the installed package (the compiled wheel) into the staged tree so the + # relative import lands on it directly, still exercising the compiled .so; its + # auditwheel-repaired RPATH is $ORIGIN-relative to a sibling cyvcf2.libs/ + # (bz2/lzma), so stage that alongside it too. + cibw-test-command: "site_pkg=\"$(python -c 'import cyvcf2, os; print(os.path.dirname(cyvcf2.__file__))')\" && cp -a \"$site_pkg/.\" cyvcf2/ && cp -a \"$site_pkg/../cyvcf2.libs\" . && python -m pytest -v cyvcf2/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: CYVCF2_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cyvcf2 v${{ env.CYVCF2_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: brentp/cyvcf2 - ref: v${{ env.CYVCF2_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch cyvcf2 source - run: git apply python-wheels/patches/cyvcf2/${{ env.CYVCF2_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - dnf install -y autoconf automake libtool cmake ninja-build - zlib-devel bzip2-devel xz-devel - # No libcurl-devel and no EPEL on riscv64 (as build-pysam.yml/build-pybigwig.yml), - # so drop --enable-libcurl/--enable-s3/--with-libdeflate from upstream's own - # options; each defaults to "check" and htslib's configure silently disables it - # when the headers are absent instead of failing. bz2/lzma default to required, - # matching the devel packages installed above. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CYVCF2_HTSLIB_CONFIGURE_OPTIONS="--enable-lzma --enable-bz2" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: cyvcf2/tests pyproject.toml - # test_reader.py/test_writer.py reach the compiled extension via a - # package-relative `from ..cyvcf2 import ...`, so cyvcf2/tests alone (no - # cyvcf2/__init__.py) isn't a deep enough package for that import to resolve. - # Merge the installed package (the compiled wheel) into the staged tree so the - # relative import lands on it directly, still exercising the compiled .so; its - # auditwheel-repaired RPATH is $ORIGIN-relative to a sibling cyvcf2.libs/ - # (bz2/lzma), so stage that alongside it too. - CIBW_TEST_COMMAND: >- - site_pkg="$(python -c 'import cyvcf2, os; print(os.path.dirname(cyvcf2.__file__))')" && - cp -a "$site_pkg/." cyvcf2/ && - cp -a "$site_pkg/../cyvcf2.libs" . && - python -m pytest -v cyvcf2/tests + name: cyvcf2-${{ env.CYVCF2_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension and vendored licences run: | @@ -125,15 +127,9 @@ jobs: assert {"LICENSE", "LICENSE.htslib", "LICENSE.htscodecs"} <= set(lic), lic EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: cyvcf2-${{ env.CYVCF2_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish cyvcf2 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-datasketches.yml b/.github/workflows/build-datasketches.yml index 0d1043454285..1f1790e17ad9 100644 --- a/.github/workflows/build-datasketches.yml +++ b/.github/workflows/build-datasketches.yml @@ -51,49 +51,58 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build datasketches ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "datasketches" + version: "${{ matrix.version }}" + repository: "apache/datasketches-python" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/datasketches/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-test-requires: "pytest" + # tests/ has __init__.py, and the checkout root's own datasketches/ package + # (source, no compiled _datasketches) would shadow the installed wheel if + # pytest ran from the checkout (gotcha 25); stage only tests/ into an empty cwd. + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DATASKETCHES_VERSION: ${{ matrix.version }} - steps: - - name: Checkout apache/datasketches-python ${{ env.DATASKETCHES_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: apache/datasketches-python - ref: ${{ env.DATASKETCHES_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - # vector_of_kll_sketches's own operator= assigns to its const k_/d_ members, - # which GCC 13 rejects when instantiating the nanobind bindings (not riscv64-specific, - # reproduces on any manylinux arch; gotcha 23 shape). - - name: Patch datasketches source - run: git apply python-wheels/patches/datasketches/${{ env.DATASKETCHES_VERSION }}/00*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest - # tests/ has __init__.py, and the checkout root's own datasketches/ package - # (source, no compiled _datasketches) would shadow the installed wheel if - # pytest ran from the checkout (gotcha 25); stage only tests/ into an empty cwd. - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest tests + name: datasketches-${{ env.DATASKETCHES_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -108,15 +117,9 @@ jobs: assert "LICENSE" in licences, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: datasketches-${{ env.DATASKETCHES_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish datasketches ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-davey.yml b/.github/workflows/build-davey.yml index 3bea1cf647c2..6264f766dc83 100644 --- a/.github/workflows/build-davey.yml +++ b/.github/workflows/build-davey.yml @@ -49,46 +49,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build davey ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "davey" + version: "${{ matrix.version }}" + repository: "Snazzah/davey" + ref: "py-${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + cp LICENSE davey-python/LICENSE + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "davey-python" + # musllinux is out of reach: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # davey-python ships no [tool.cibuildwheel], so the Rust toolchain + # its maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "davey-python/test" + cibw-test-command: "cd davey-python && python -m pytest test -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DAVEY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout davey py-${{ env.DAVEY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Snazzah/davey - ref: py-${{ env.DAVEY_VERSION }} - persist-credentials: false - - - name: Stage the licence beside davey-python's pyproject.toml - # maturin globs LICEN[CS]E* relative to the pyproject directory, which - # is davey-python here -- upstream's own published wheels carry none. - run: cp LICENSE davey-python/LICENSE - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: davey-python - output-dir: wheelhouse/ - env: - # musllinux is out of reach: rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # davey-python ships no [tool.cibuildwheel], so the Rust toolchain - # its maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: davey-python/test - CIBW_TEST_COMMAND: cd davey-python && python -m pytest test -v + name: davey-${{ env.DAVEY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and licence made it into the wheel run: | @@ -101,15 +108,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: davey-${{ env.DAVEY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish davey ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-dbt-extractor.yml b/.github/workflows/build-dbt-extractor.yml index 0c5e0649c0a3..754bb78de59d 100644 --- a/.github/workflows/build-dbt-extractor.yml +++ b/.github/workflows/build-dbt-extractor.yml @@ -57,54 +57,51 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build dbt-extractor ${{ matrix.version }} cp39-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "dbt-extractor" + version: "${{ matrix.version }}" + repository: "dbt-labs/dbt-extractor" + ref: "89d46724fc9c7dcd94a03f58342bc4f0d2b7a82e" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 90 + # pyo3 is built with the `abi3-py39` feature, so maturin emits a single + # cp39-abi3 wheel whatever interpreter builds it - matching the one + # Linux wheel upstream publishes per arch. cibuildwheel compiles once + # for cp312 and then reuses that wheel for cp313/cp314 while still + # running the test phase on each. musllinux is excluded because + # rustup.rs ships no riscv64 musl toolchain (as in build-fastuuid.yml). + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # cibuildwheel's default frontend runs `python -m build /project` with + # cwd=/project, and the repo root holds a dev helper named build.py + # that shadows the `build` module (it imports tree_sitter at top level, + # so the run dies before maturin is reached). pip is unaffected. + cibw-build-frontend: "pip" + # dbt-extractor ships no [tool.cibuildwheel], so install the Rust + # toolchain its maturin backend needs in-container and put it on PATH. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # Upstream only checks `import dbt_extractor` after building a wheel; + # extract from a model that exercises all three result kinds instead. + cibw-test-command: "python -c \"import dbt_extractor; src = '''{{ config(materialized='table', tags=['a','b']) }} select * from {{ ref('other_model') }} join {{ source('my_src','my_tbl') }}'''; r = dbt_extractor.py_extract_from_source(src); assert r['refs'] == [{'name': 'other_model'}], r; assert r['sources'] == {('my_src','my_tbl')}, r; assert r['configs'] == [('materialized','table'), ('tags',['a','b'])], r; print('dbt_extractor OK:', r)\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: DBT_EXTRACTOR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout dbt-extractor ${{ env.DBT_EXTRACTOR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: dbt-labs/dbt-extractor - ref: ${{ env.DBT_EXTRACTOR_REF }} - persist-credentials: false - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # pyo3 is built with the `abi3-py39` feature, so maturin emits a single - # cp39-abi3 wheel whatever interpreter builds it - matching the one - # Linux wheel upstream publishes per arch. cibuildwheel compiles once - # for cp312 and then reuses that wheel for cp313/cp314 while still - # running the test phase on each. musllinux is excluded because - # rustup.rs ships no riscv64 musl toolchain (as in build-fastuuid.yml). - CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cibuildwheel's default frontend runs `python -m build /project` with - # cwd=/project, and the repo root holds a dev helper named build.py - # that shadows the `build` module (it imports tree_sitter at top level, - # so the run dies before maturin is reached). pip is unaffected. - CIBW_BUILD_FRONTEND: pip - # dbt-extractor ships no [tool.cibuildwheel], so install the Rust - # toolchain its maturin backend needs in-container and put it on PATH. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' - # Upstream only checks `import dbt_extractor` after building a wheel; - # extract from a model that exercises all three result kinds instead. - CIBW_TEST_COMMAND: >- - python -c "import dbt_extractor; - src = '''{{ config(materialized='table', tags=['a','b']) }} - select * from {{ ref('other_model') }} join {{ source('my_src','my_tbl') }}'''; - r = dbt_extractor.py_extract_from_source(src); - assert r['refs'] == [{'name': 'other_model'}], r; - assert r['sources'] == {('my_src','my_tbl')}, r; - assert r['configs'] == [('materialized','table'), ('tags',['a','b'])], r; - print('dbt_extractor OK:', r)" + name: dbt-extractor-${{ env.DBT_EXTRACTOR_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -117,15 +114,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: dbt-extractor-${{ env.DBT_EXTRACTOR_VERSION }}-cp39-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish dbt-extractor ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-dclab.yml b/.github/workflows/build-dclab.yml index 13128947c40f..118e5d116136 100644 --- a/.github/workflows/build-dclab.yml +++ b/.github/workflows/build-dclab.yml @@ -50,44 +50,46 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build dclab ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "dclab" + version: "${{ matrix.version }}" + repository: "DC-Analysis/dclab" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DCLAB=${{ matrix.version }}" + # dclab pins hdf5plugin<5, but our registry only carries hdf5plugin 7.x (its + # Zstd filter API, the only one dclab uses, is unchanged); install the wheel + # bare and stage the runtime deps from the registry instead (gotcha 122). + cibw-test-environment: "PIP_NO_DEPS=1" + cibw-before-test: "PIP_NO_DEPS=0 PIP_ONLY_BINARY=numpy,scipy,h5py,hdf5plugin pip install numpy \"scipy>=1.10.0,!=1.18.0\" \"h5py>=3.0.0,<4\" hdf5plugin pytest" + cibw-test-sources: "tests" + cibw-test-command: "pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DCLAB_VERSION: ${{ matrix.version }} - steps: - - name: Checkout dclab ${{ env.DCLAB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: DC-Analysis/dclab - ref: ${{ env.DCLAB_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DCLAB=${{ env.DCLAB_VERSION }} - # dclab pins hdf5plugin<5, but our registry only carries hdf5plugin 7.x (its - # Zstd filter API, the only one dclab uses, is unchanged); install the wheel - # bare and stage the runtime deps from the registry instead (gotcha 122). - CIBW_TEST_ENVIRONMENT: PIP_NO_DEPS=1 - CIBW_BEFORE_TEST: >- - PIP_NO_DEPS=0 PIP_ONLY_BINARY=numpy,scipy,h5py,hdf5plugin - pip install numpy "scipy>=1.10.0,!=1.18.0" "h5py>=3.0.0,<4" hdf5plugin pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: pytest tests + name: dclab-${{ env.DCLAB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -113,16 +115,9 @@ jobs: }, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: dclab-${{ env.DCLAB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish dclab ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ddtrace.yml b/.github/workflows/build-ddtrace.yml index 702a7921a048..7601d198de33 100644 --- a/.github/workflows/build-ddtrace.yml +++ b/.github/workflows/build-ddtrace.yml @@ -52,66 +52,74 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build ddtrace ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ddtrace" + version: "${{ matrix.version }}" + repository: "DataDog/dd-trace-py" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 720 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply -v python-wheels/patches/ddtrace/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PATH=$PATH:$HOME/.cargo/bin" + # setup.py drops libddwaf into the wheel from + # ddtrace/appsec/_ddwaf/libddwaf//lib/ and skips the download + # when that tree already exists, so building it here is enough. + cibw-before-all-linux: |- + set -euxo pipefail + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + dnf -y install libstdc++-static # libddwaf links -static-libstdc++ + git clone --depth 1 --branch "2.0.0" \ + https://github.com/DataDog/libddwaf.git /tmp/libddwaf + cmake -S /tmp/libddwaf -B /tmp/libddwaf/build \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLIBDDWAF_BUILD_STATIC=OFF -DLIBDDWAF_TESTING=OFF + cmake --build /tmp/libddwaf/build --parallel "$(nproc)" + cmake --install /tmp/libddwaf/build --prefix /tmp/libddwaf/install + install -D /tmp/libddwaf/install/lib*/libddwaf.so \ + {project}/ddtrace/appsec/_ddwaf/libddwaf/riscv64/lib/libddwaf.so + # setup.py drives CMake through the `cmake` PyPI package, whose oldest + # riscv64 wheel is 4.1.0 - outside pyproject.toml's `cmake<3.28` pin, + # hence the preinstall and pip's unvalidated --no-build-isolation. + cibw-before-build: "pip install cython \"cmake>=4.1\" \"setuptools-rust<2\" \"patchelf>=0.17.0.0\" setuptools wheel" + cibw-build-frontend: "pip; args: --no-build-isolation" + cibw-test-command: "python {project}/tests/smoke_test.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 720 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DDTRACE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout dd-trace-py v${{ env.DDTRACE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: DataDog/dd-trace-py - ref: v${{ env.DDTRACE_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply riscv64 patches - run: git apply -v python-wheels/patches/ddtrace/${{ env.DDTRACE_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_LINUX: >- - PATH=$PATH:$HOME/.cargo/bin - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # setup.py drops libddwaf into the wheel from - # ddtrace/appsec/_ddwaf/libddwaf//lib/ and skips the download - # when that tree already exists, so building it here is enough. - CIBW_BEFORE_ALL_LINUX: | - set -euxo pipefail - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - dnf -y install libstdc++-static # libddwaf links -static-libstdc++ - git clone --depth 1 --branch "${{ env.LIBDDWAF_VERSION }}" \ - https://github.com/DataDog/libddwaf.git /tmp/libddwaf - cmake -S /tmp/libddwaf -B /tmp/libddwaf/build \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DLIBDDWAF_BUILD_STATIC=OFF -DLIBDDWAF_TESTING=OFF - cmake --build /tmp/libddwaf/build --parallel "$(nproc)" - cmake --install /tmp/libddwaf/build --prefix /tmp/libddwaf/install - install -D /tmp/libddwaf/install/lib*/libddwaf.so \ - {project}/ddtrace/appsec/_ddwaf/libddwaf/riscv64/lib/libddwaf.so - # setup.py drives CMake through the `cmake` PyPI package, whose oldest - # riscv64 wheel is 4.1.0 — outside pyproject.toml's `cmake<3.28` pin, - # hence the preinstall and pip's unvalidated --no-build-isolation. - CIBW_BEFORE_BUILD: >- - pip install cython "cmake>=4.1" "setuptools-rust<2" - "patchelf>=0.17.0.0" setuptools wheel - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_TEST_COMMAND: python {project}/tests/smoke_test.py + name: ddtrace-${{ env.DDTRACE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the native extensions made it into the wheel run: | @@ -124,15 +132,9 @@ jobs: print(whl, len(names), "shared objects") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ddtrace-${{ env.DDTRACE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish ddtrace ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-debugpy.yml b/.github/workflows/build-debugpy.yml index 96541b693a90..abdd27879b60 100644 --- a/.github/workflows/build-debugpy.yml +++ b/.github/workflows/build-debugpy.yml @@ -63,9 +63,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # setup.py swallows the pydevd Cython build failure and ships a wheel # with no .so unless this is set (CLAUDE.md gotcha 20). - cibw-environment: >- - REQUIRE_CYTHON_BUILD=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "REQUIRE_CYTHON_BUILD=1" # tests/ is a package whose conftest registers tests.* plugins, so it has # to sit in the (empty) test cwd; pytest.ini carries testpaths and -n8. cibw-test-sources: tests pytest.ini diff --git a/.github/workflows/build-deepsearch-glm.yml b/.github/workflows/build-deepsearch-glm.yml index 8fa907364d36..6d0c7a20e983 100644 --- a/.github/workflows/build-deepsearch-glm.yml +++ b/.github/workflows/build-deepsearch-glm.yml @@ -50,67 +50,75 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build deepsearch-glm ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "deepsearch-glm" + version: "${{ matrix.version }}" + repository: "docling-project/docling-nlp" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 720 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/deepsearch-glm/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # The repo-root build.py (poetry's build script) shadows the `build` module under + # `python -m build`; upstream's cibuildwheel 2.x defaulted to pip. + cibw-build-frontend: "pip" + # The C++ dependencies (fmt, json, loguru, cxxopts, pcre2, fasttext, utfcpp, + # sentencepiece) are fetched by CMake's ExternalProject_Add and statically + # linked by the build; upstream ships none of their licences. + cibw-before-build: |- + curl -fsSL -o {project}/LICENSE.fmt https://raw.githubusercontent.com/fmtlib/fmt/10.2.1/LICENSE + curl -fsSL -o {project}/LICENSE.json https://raw.githubusercontent.com/nlohmann/json/v3.11.3/LICENSE.MIT + curl -fsSL -o {project}/LICENSE.loguru https://raw.githubusercontent.com/emilk/loguru/4adaa185883e3c04da25913579c451d3c32cfac1/LICENSE + curl -fsSL -o {project}/LICENSE.cxxopts https://raw.githubusercontent.com/jarro2783/cxxopts/v3.2.0/LICENSE + curl -fsSL -o {project}/LICENSE.pcre2 https://raw.githubusercontent.com/PCRE2Project/pcre2/pcre2-10.44/LICENCE + curl -fsSL -o {project}/LICENSE.fasttext https://raw.githubusercontent.com/PeterStaar-IBM/fastText/9d5b2a2b364f49ed2707ff3be48a0f1ba6d86022/LICENSE + curl -fsSL -o {project}/LICENSE.utfcpp https://raw.githubusercontent.com/nemtrif/utfcpp/v4.0.5/LICENSE + curl -fsSL -o {project}/LICENSE.sentencepiece https://raw.githubusercontent.com/google/sentencepiece/v0.2.0/LICENSE + # fastText and sentencepiece, fetched by ExternalProject_Add, declare + # cmake_minimum_required below CMake 4's 3.5 floor. + cibw-environment-linux: "BUILD_THREADS=4 CMAKE_POLICY_VERSION_MINIMUM=3.5" + # Upstream's own CI never runs its data-driven test suite (tests/test_*.py) on + # Linux wheels at all - those tests download pretrained NLP models and reference + # data over the network. Mirror upstream's one Linux-safe check instead (the + # "Quick test wheel" step it does run on Windows/macOS): the three pybind11 + # extensions import cleanly. + cibw-test-command: "python -c \"from deepsearch_glm import andromeda_structs, andromeda_nlp, andromeda_glm\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 720 - strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DEEPSEARCH_GLM_VERSION: ${{ matrix.version }} - steps: - - name: Checkout deepsearch-glm v${{ env.DEEPSEARCH_GLM_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: docling-project/docling-nlp - ref: v${{ env.DEEPSEARCH_GLM_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch deepsearch-glm source - run: git apply python-wheels/patches/deepsearch-glm/${{ env.DEEPSEARCH_GLM_VERSION }}/00*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # The repo-root build.py (poetry's build script) shadows the `build` module under - # `python -m build`; upstream's cibuildwheel 2.x defaulted to pip. - CIBW_BUILD_FRONTEND: pip - # The C++ dependencies (fmt, json, loguru, cxxopts, pcre2, fasttext, utfcpp, - # sentencepiece) are fetched by CMake's ExternalProject_Add and statically - # linked by the build; upstream ships none of their licences. - CIBW_BEFORE_BUILD: | - curl -fsSL -o {project}/LICENSE.fmt https://raw.githubusercontent.com/fmtlib/fmt/10.2.1/LICENSE - curl -fsSL -o {project}/LICENSE.json https://raw.githubusercontent.com/nlohmann/json/v3.11.3/LICENSE.MIT - curl -fsSL -o {project}/LICENSE.loguru https://raw.githubusercontent.com/emilk/loguru/4adaa185883e3c04da25913579c451d3c32cfac1/LICENSE - curl -fsSL -o {project}/LICENSE.cxxopts https://raw.githubusercontent.com/jarro2783/cxxopts/v3.2.0/LICENSE - curl -fsSL -o {project}/LICENSE.pcre2 https://raw.githubusercontent.com/PCRE2Project/pcre2/pcre2-10.44/LICENCE - curl -fsSL -o {project}/LICENSE.fasttext https://raw.githubusercontent.com/PeterStaar-IBM/fastText/9d5b2a2b364f49ed2707ff3be48a0f1ba6d86022/LICENSE - curl -fsSL -o {project}/LICENSE.utfcpp https://raw.githubusercontent.com/nemtrif/utfcpp/v4.0.5/LICENSE - curl -fsSL -o {project}/LICENSE.sentencepiece https://raw.githubusercontent.com/google/sentencepiece/v0.2.0/LICENSE - # fastText and sentencepiece, fetched by ExternalProject_Add, declare - # cmake_minimum_required below CMake 4's 3.5 floor. - CIBW_ENVIRONMENT: >- - BUILD_THREADS=4 - CMAKE_POLICY_VERSION_MINIMUM=3.5 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream's own CI never runs its data-driven test suite (tests/test_*.py) on - # Linux wheels at all - those tests download pretrained NLP models and reference - # data over the network. Mirror upstream's one Linux-safe check instead (the - # "Quick test wheel" step it does run on Windows/macOS): the three pybind11 - # extensions import cleanly. - CIBW_TEST_COMMAND: >- - python -c "from deepsearch_glm import andromeda_structs, andromeda_nlp, andromeda_glm" + name: deepsearch-glm-${{ env.DEEPSEARCH_GLM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -140,15 +148,9 @@ jobs: assert licences == expected, sorted(licences) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: deepsearch-glm-${{ env.DEEPSEARCH_GLM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish deepsearch-glm ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-delta-kernel-rust-sharing-wrapper.yml b/.github/workflows/build-delta-kernel-rust-sharing-wrapper.yml index 17d5cd7c15af..194cc4773f44 100644 --- a/.github/workflows/build-delta-kernel-rust-sharing-wrapper.yml +++ b/.github/workflows/build-delta-kernel-rust-sharing-wrapper.yml @@ -57,6 +57,60 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build delta-kernel-rust-sharing-wrapper ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # pyo3's abi3-py310 feature is on unconditionally (Cargo.toml), so + # one abi3 wheel serves every GIL-ful interpreter; pyo3 disables + # abi3 under Py_GIL_DISABLED, giving the free-threaded build its + # own wheel (matches build-primp.yml). + - tag: cp310-abi3 + # Whatever interpreter builds it, the wheel carries the cp310-abi3 + # tag the crate's Cargo.toml claims (gotcha 181), so this is built + # on cp312 -- our floor -- and re-tested on the newer ones via + # find_compatible_wheel; cp310/cp311 are not in our support matrix. + build: >- + cp312-manylinux_riscv64 cp313-manylinux_riscv64 + cp314-manylinux_riscv64 + - tag: cp314t + build: cp314t-manylinux_riscv64 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "delta-kernel-rust-sharing-wrapper" + version: "${{ matrix.version }}" + repository: "delta-io/delta-sharing" + ref: "d0712f61b728670896fdd1fec5d4ed2967073c79" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: 360 + pre-build: |- + cp LICENSE.txt python/delta-kernel-rust-sharing-wrapper/ + sed -i '/^license = /a license-file = "LICENSE.txt"' python/delta-kernel-rust-sharing-wrapper/Cargo.toml + grep -qx 'license-file = "LICENSE.txt"' python/delta-kernel-rust-sharing-wrapper/Cargo.toml + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "python/delta-kernel-rust-sharing-wrapper" + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.build }}" + # The crate ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # No test suite ships for this wrapper (upstream's own + # build-kernel-wheels.yml only builds and uploads, never tests it); + # exercise the URL-parsing/object_store construction path that + # every real caller goes through first (delta_sharing/reader.py). + cibw-test-command: "python -c \"import delta_kernel_rust_sharing_wrapper as m, tempfile; assert m.delta_kernel_rust_sharing_wrapper.__file__.endswith('.so'), m.delta_kernel_rust_sharing_wrapper.__file__; d = tempfile.mkdtemp(); location = f'file://{d}/'; table = m.Table(location); engine = m.PythonInterface(location); assert table is not None and engine is not None; print('delta_kernel_rust_sharing_wrapper OK')\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: @@ -78,57 +132,14 @@ jobs: cp314-manylinux_riscv64 - tag: cp314t build: cp314t-manylinux_riscv64 - env: DELTA_KERNEL_RUST_SHARING_WRAPPER_VERSION: ${{ matrix.version }} - steps: - - name: Checkout delta-sharing ${{ env.DELTA_KERNEL_RUST_SHARING_WRAPPER_REF }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: delta-io/delta-sharing - ref: ${{ env.DELTA_KERNEL_RUST_SHARING_WRAPPER_REF }} - persist-credentials: false - - - name: Bundle LICENSE.txt into the wheel - # The crate's pyproject.toml has no [project] table -- metadata comes - # straight from Cargo.toml -- so maturin's dir-glob licence - # auto-discovery never runs (gotcha 146); only an explicit Cargo - # `license-file` key gets a licence file into dist-info/licenses/ - # (same fix as build-minify-html.yml). The crate has no LICENSE of - # its own, so copy the repo-root one in. - run: | - cp LICENSE.txt python/delta-kernel-rust-sharing-wrapper/ - sed -i '/^license = /a license-file = "LICENSE.txt"' python/delta-kernel-rust-sharing-wrapper/Cargo.toml - grep -qx 'license-file = "LICENSE.txt"' python/delta-kernel-rust-sharing-wrapper/Cargo.toml - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: python/delta-kernel-rust-sharing-wrapper - output-dir: wheelhouse/ - env: - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # The crate ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' - # No test suite ships for this wrapper (upstream's own - # build-kernel-wheels.yml only builds and uploads, never tests it); - # exercise the URL-parsing/object_store construction path that - # every real caller goes through first (delta_sharing/reader.py). - CIBW_TEST_COMMAND: >- - python -c "import delta_kernel_rust_sharing_wrapper as m, tempfile; - assert m.delta_kernel_rust_sharing_wrapper.__file__.endswith('.so'), m.delta_kernel_rust_sharing_wrapper.__file__; - d = tempfile.mkdtemp(); - location = f'file://{d}/'; - table = m.Table(location); - engine = m.PythonInterface(location); - assert table is not None and engine is not None; - print('delta_kernel_rust_sharing_wrapper OK')" + name: delta-kernel-rust-sharing-wrapper-${{ env.DELTA_KERNEL_RUST_SHARING_WRAPPER_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check the extension and licence made it into the wheel run: | @@ -142,15 +153,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: delta-kernel-rust-sharing-wrapper-${{ env.DELTA_KERNEL_RUST_SHARING_WRAPPER_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish delta-kernel-rust-sharing-wrapper ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-dependency-injector.yml b/.github/workflows/build-dependency-injector.yml index af9364e994bc..4c9e6f0d7f93 100644 --- a/.github/workflows/build-dependency-injector.yml +++ b/.github/workflows/build-dependency-injector.yml @@ -57,44 +57,45 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build dependency-injector ${{ matrix.version }} cp310-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "dependency-injector" + version: "${{ matrix.version }}" + repository: "ets-labs/python-dependency-injector" + ref: "${{ matrix.version }}" + artifact-tag: "cp310-abi3-manylinux_riscv64" + timeout-minutes: 90 + # cp310 first, matching setup.py's py_limited_api="cp310" floor (gotcha 96): + # building the abi3 wheel on a newer interpreter can silently break older + # ones despite the tag. The later entries build nothing; they re-test it. + cibw-build: "cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + cibw-environment-linux: "DEPENDENCY_INJECTOR_LIMITED_API=1" + # cp310/cp311 lag our registry's newest numpy/scipy (gotcha 67/84): the + # newest PyPI release still supporting 3.10 has no riscv64 wheel here, so + # unconstrained pip tries to build it from source and fails on missing OpenBLAS. + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy" + cibw-test-requires: "pytest pytest-asyncio httpx fastapi flask aiohttp numpy scipy boto3 mypy_boto3_s3 pydantic-settings werkzeug fast-depends \"cython>=3,<4\" setuptools" + cibw-test-extras: "yaml" + cibw-test-sources: "tests pyproject.toml" + cibw-test-command: "python -m pytest tests/unit" + + verify_wheels: + needs: [setup, build_abi3] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: DEPENDENCY_INJECTOR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout dependency-injector ${{ env.DEPENDENCY_INJECTOR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ets-labs/python-dependency-injector - ref: ${{ env.DEPENDENCY_INJECTOR_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - # cp310 first, matching setup.py's py_limited_api="cp310" floor (gotcha 96): - # building the abi3 wheel on a newer interpreter can silently break older - # ones despite the tag. The later entries build nothing; they re-test it. - CIBW_BUILD: >- - cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - DEPENDENCY_INJECTOR_LIMITED_API=1 - # cp310/cp311 lag our registry's newest numpy/scipy (gotcha 67/84): the - # newest PyPI release still supporting 3.10 has no riscv64 wheel here, so - # unconstrained pip tries to build it from source and fails on missing OpenBLAS. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,scipy - CIBW_TEST_REQUIRES: ${{ env.TEST_REQUIRES }} - CIBW_TEST_EXTRAS: yaml - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_COMMAND: ${{ env.TEST_COMMAND }} + name: dependency-injector-${{ env.DEPENDENCY_INJECTOR_VERSION }}-cp310-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the Cython extensions made it into the wheel run: | @@ -117,15 +118,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: dependency-injector-${{ env.DEPENDENCY_INJECTOR_VERSION }}-cp310-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - - # Free-threaded builds get no abi3 wheel: setup.py drops py_limited_api under - # Py_GIL_DISABLED, same shape as build-pycryptodomex.yml. Upstream itself skips - # cp3??t-* in CIBW_SKIP, so this has no upstream wheel to mirror. build_freethreaded: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -134,45 +126,24 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build dependency-injector ${{ matrix.version }} cp314t-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 90 - - env: - DEPENDENCY_INJECTOR_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout dependency-injector ${{ env.DEPENDENCY_INJECTOR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ets-labs/python-dependency-injector - ref: ${{ env.DEPENDENCY_INJECTOR_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: cp314t-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - DEPENDENCY_INJECTOR_LIMITED_API=1 - CIBW_TEST_REQUIRES: ${{ env.TEST_REQUIRES }} - CIBW_TEST_EXTRAS: yaml - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_COMMAND: ${{ env.TEST_COMMAND }} - - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: dependency-injector-${{ env.DEPENDENCY_INJECTOR_VERSION }}-cp314t-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "dependency-injector" + version: "${{ matrix.version }}" + repository: "ets-labs/python-dependency-injector" + ref: "${{ matrix.version }}" + artifact-tag: "cp314t-manylinux_riscv64" + timeout-minutes: 90 + cibw-build: "cp314t-manylinux_riscv64" + cibw-environment-linux: "DEPENDENCY_INJECTOR_LIMITED_API=1" + cibw-test-requires: "pytest pytest-asyncio httpx fastapi flask aiohttp numpy scipy boto3 mypy_boto3_s3 pydantic-settings werkzeug fast-depends \"cython>=3,<4\" setuptools" + cibw-test-extras: "yaml" + cibw-test-sources: "tests pyproject.toml" + cibw-test-command: "python -m pytest tests/unit" publish: name: Publish dependency-injector ${{ matrix.version }} - needs: [setup, build_abi3, build_freethreaded] + needs: [setup, build_abi3, build_freethreaded, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-diffq-fixed.yml b/.github/workflows/build-diffq-fixed.yml index 60253951d938..1e6182514c43 100644 --- a/.github/workflows/build-diffq-fixed.yml +++ b/.github/workflows/build-diffq-fixed.yml @@ -62,9 +62,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # diffq.bitpack is a plain Cython extension (no torch/CUDA headers at # build time); torch is only a runtime import, needed for the tests. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=Cython,numpy,torch + cibw-environment-linux: "PIP_ONLY_BINARY=Cython,numpy,torch" cibw-test-sources: diffq/tests cibw-test-requires: pytest torch # diffq/tests lives inside the diffq package itself, so staging it diff --git a/.github/workflows/build-diffq.yml b/.github/workflows/build-diffq.yml index b59482d01850..7bfa4ff40174 100644 --- a/.github/workflows/build-diffq.yml +++ b/.github/workflows/build-diffq.yml @@ -59,9 +59,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # diffq.bitpack is a plain Cython extension (no torch/CUDA headers at # build time); torch is only a runtime import, needed for the tests. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=Cython,numpy,torch + cibw-environment-linux: "PIP_ONLY_BINARY=Cython,numpy,torch" cibw-test-sources: diffq/tests cibw-test-requires: pytest torch # diffq/tests lives inside the diffq package itself, so staging it diff --git a/.github/workflows/build-djlint.yml b/.github/workflows/build-djlint.yml index 84a8fe4cd781..166fa0a947b5 100644 --- a/.github/workflows/build-djlint.yml +++ b/.github/workflows/build-djlint.yml @@ -69,9 +69,7 @@ jobs: python -c "import tomllib; print(*tomllib.load(open('pyproject.toml', 'rb'))['tool']['hatch']['build']['targets']['wheel']['hooks']['mypyc']['dependencies'], sep='\n')" > /tmp/mypyc-requirements.txt && pip install hatchling -r /tmp/mypyc-requirements.txt typing-extensions # Restates upstream's [tool.cibuildwheel] environment, which this replaces. - cibw-environment: >- - HATCH_BUILD_HOOK_ENABLE_MYPYC=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "HATCH_BUILD_HOOK_ENABLE_MYPYC=1" # test_third_party_licenses.py (new in 1.46.6) reads mypy's installed license metadata. cibw-test-requires: pytest pytest-xdist mypy # pyproject.toml is what djlint resolves reported paths against. diff --git a/.github/workflows/build-dlib-bin.yml b/.github/workflows/build-dlib-bin.yml index b1b6bdebe0ff..5e7e488f29f7 100644 --- a/.github/workflows/build-dlib-bin.yml +++ b/.github/workflows/build-dlib-bin.yml @@ -48,6 +48,72 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build dlib-bin ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + # Upstream publishes no free-threaded wheel, so cp314t is not built. + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "dlib-bin" + version: "${{ matrix.version }}" + repository: "davisking/dlib" + ref: '' + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 600 + pre-build: |- + export DLIB_BIN_VERSION='${{ matrix.version }}' + echo "DLIB_TAG=v${DLIB_BIN_VERSION%.post*}" >> "$GITHUB_ENV" + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + git fetch -q --no-tags origin "${DLIB_TAG}" + git checkout -q --detach FETCH_HEAD + + sed -i'' -e "s/name='dlib'/name='dlib-bin'/" setup.py + sed -i'' -e "s/version=read_version_from_cmakelists('dlib\/CMakeLists.txt')/version='$DLIB_BIN_VERSION'/" setup.py + sed -i'' -e "s/url='https:\/\/github\.com\/davisking\/dlib'/url='https:\/\/github\.com\/alesanfra\/dlib-wheels'/" setup.py + sed -i'' -e "s/_cmake_extra_options = \[\]/_cmake_extra_options = \['-DDLIB_NO_GUI_SUPPORT=ON'\]/" setup.py + grep -q "name='dlib-bin'" setup.py + grep -q "version='$DLIB_BIN_VERSION'" setup.py + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cp dlib/external/libpng/LICENSE LICENSE.libpng + cp dlib/external/pybind11/LICENSE LICENSE.pybind11 + sed -n '/Copyright (C) 1995-2017 Jean-loup Gailly/,/madler@alumni.caltech.edu/p' \ + dlib/external/zlib/zlib.h > LICENSE.zlib + sed -n '/^LEGAL ISSUES$/,/^REFERENCES$/p' dlib/external/libjpeg/README \ + | sed '$d' > LICENSE.libjpeg + for f in LICENSE.libpng LICENSE.pybind11 LICENSE.zlib LICENSE.libjpeg; do + test -s "$f" || { echo "$f is empty"; exit 1; } + done + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-build: "pip install cmake" + # Upstream's wheel job only imports dlib; this runs the suite dlib's + # own build_python.yml runs, staged so the checkout cannot shadow the + # wheel. numpy resolves from the RISE registry. + cibw-test-requires: "pytest numpy" + cibw-test-sources: "tools/python/test examples/faces" + cibw-test-command: "python -m pytest tools/python/test" + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 600 strategy: @@ -55,65 +121,14 @@ jobs: # Upstream publishes no free-threaded wheel, so cp314t is not built. matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DLIB_BIN_VERSION: ${{ matrix.version }} - steps: - # davisking/dlib tags only the base release; a .postN dlib-bin version is - # the same upstream source republished under a new distribution version. - - name: Determine upstream git tag - run: echo "DLIB_TAG=v${DLIB_BIN_VERSION%.post*}" >> "$GITHUB_ENV" - - - name: Checkout dlib ${{ env.DLIB_TAG }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: davisking/dlib - ref: ${{ env.DLIB_TAG }} - persist-credentials: false - - - name: Patch dlib configuration - run: | - sed -i'' -e "s/name='dlib'/name='dlib-bin'/" setup.py - sed -i'' -e "s/version=read_version_from_cmakelists('dlib\/CMakeLists.txt')/version='$DLIB_BIN_VERSION'/" setup.py - sed -i'' -e "s/url='https:\/\/github\.com\/davisking\/dlib'/url='https:\/\/github\.com\/alesanfra\/dlib-wheels'/" setup.py - sed -i'' -e "s/_cmake_extra_options = \[\]/_cmake_extra_options = \['-DDLIB_NO_GUI_SUPPORT=ON'\]/" setup.py - grep -q "name='dlib-bin'" setup.py - grep -q "version='$DLIB_BIN_VERSION'" setup.py - - # dlib compiles its bundled libpng, zlib and libjpeg into the extension - # whenever the system libraries are absent, which they are in the - # manylinux image, and the bindings are built with pybind11. Upstream - # ships none of their licences, on any architecture. - - name: Stage the bundled libraries' licences - run: | - cp dlib/external/libpng/LICENSE LICENSE.libpng - cp dlib/external/pybind11/LICENSE LICENSE.pybind11 - sed -n '/Copyright (C) 1995-2017 Jean-loup Gailly/,/madler@alumni.caltech.edu/p' \ - dlib/external/zlib/zlib.h > LICENSE.zlib - sed -n '/^LEGAL ISSUES$/,/^REFERENCES$/p' dlib/external/libjpeg/README \ - | sed '$d' > LICENSE.libjpeg - for f in LICENSE.libpng LICENSE.pybind11 LICENSE.zlib LICENSE.libjpeg; do - test -s "$f" || { echo "$f is empty"; exit 1; } - done - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_BUILD: pip install cmake - # Upstream's wheel job only imports dlib; this runs the suite dlib's - # own build_python.yml runs, staged so the checkout cannot shadow the - # wheel. numpy resolves from the RISE registry. - CIBW_TEST_REQUIRES: pytest numpy - CIBW_TEST_SOURCES: tools/python/test examples/faces - CIBW_TEST_COMMAND: python -m pytest tools/python/test - CIBW_TEST_ENVIRONMENT: >- - PIP_ONLY_BINARY=numpy - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + name: dlib-bin-${{ env.DLIB_BIN_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and the licences run: | @@ -136,15 +151,9 @@ jobs: }, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: dlib-bin-${{ env.DLIB_BIN_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish dlib-bin ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-dm-tree.yml b/.github/workflows/build-dm-tree.yml index 1b6628189f6f..1ae6060c1534 100644 --- a/.github/workflows/build-dm-tree.yml +++ b/.github/workflows/build-dm-tree.yml @@ -52,49 +52,46 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build dm-tree ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "dm-tree" + version: "${{ matrix.version }}" + repository: "deepmind/tree" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-environment-linux: "MAKEFLAGS=-j$(nproc) ABSEIL_VERSION=20260107.1 PYBIND11_VERSION=3.0.1" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # CMakeLists.txt statically links abseil-cpp into _tree.so via FetchContent; + # upstream's own wheels ship no licence for it, so pull it from the same + # tarball CMake fetches. pybind11 is header-only but its templates end up + # compiled into the same .so, so carry its licence too. + cibw-before-all-linux: "mkdir -p /tmp/abseil-cpp /tmp/pybind11 && curl -sSLf \"https://github.com/abseil/abseil-cpp/archive/refs/tags/${ABSEIL_VERSION}.tar.gz\" | tar -xz -C /tmp/abseil-cpp --strip-components=1 && curl -sSLf \"https://github.com/pybind/pybind11/archive/refs/tags/v${PYBIND11_VERSION}.tar.gz\" | tar -xz -C /tmp/pybind11 --strip-components=1 && cp /tmp/abseil-cpp/LICENSE {project}/LICENSE.abseil-cpp && cp /tmp/pybind11/LICENSE {project}/LICENSE.pybind11" + cibw-test-requires: "pytest" + cibw-test-command: "pytest --pyargs tree" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DM_TREE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout tree ${{ env.DM_TREE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: deepmind/tree - ref: ${{ env.DM_TREE_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # CMakeLists.txt statically links abseil-cpp into _tree.so via FetchContent; - # upstream's own wheels ship no licence for it, so pull it from the same - # tarball CMake fetches. pybind11 is header-only but its templates end up - # compiled into the same .so, so carry its licence too. - CIBW_BEFORE_ALL_LINUX: >- - mkdir -p /tmp/abseil-cpp /tmp/pybind11 && - curl -sSLf "https://github.com/abseil/abseil-cpp/archive/refs/tags/${ABSEIL_VERSION}.tar.gz" - | tar -xz -C /tmp/abseil-cpp --strip-components=1 && - curl -sSLf "https://github.com/pybind/pybind11/archive/refs/tags/v${PYBIND11_VERSION}.tar.gz" - | tar -xz -C /tmp/pybind11 --strip-components=1 && - cp /tmp/abseil-cpp/LICENSE {project}/LICENSE.abseil-cpp && - cp /tmp/pybind11/LICENSE {project}/LICENSE.pybind11 - CIBW_ENVIRONMENT_PASS_LINUX: ABSEIL_VERSION PYBIND11_VERSION - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - MAKEFLAGS=-j$(nproc) - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest --pyargs tree + name: dm-tree-${{ env.DM_TREE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and the licences made it into the wheel run: | @@ -109,15 +106,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: dm-tree-${{ env.DM_TREE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish dm-tree ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-dnaio.yml b/.github/workflows/build-dnaio.yml index 5e2698a0767f..0971cecfec77 100644 --- a/.github/workflows/build-dnaio.yml +++ b/.github/workflows/build-dnaio.yml @@ -59,7 +59,7 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # Shallow checkout has no tag history for setuptools_scm to read. - cibw-environment: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DNAIO=${{ matrix.version }} + cibw-environment-linux: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DNAIO=${{ matrix.version }} timeout-minutes: 60 publish: diff --git a/.github/workflows/build-docling-parse.yml b/.github/workflows/build-docling-parse.yml index eb7a277c8e9b..df5442fa83f9 100644 --- a/.github/workflows/build-docling-parse.yml +++ b/.github/workflows/build-docling-parse.yml @@ -49,17 +49,64 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build docling-parse ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "docling-parse" + version: "${{ matrix.version }}" + repository: "docling-project/docling-parse" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 720 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # pyproject pins cmake<4.0.0, which has no riscv64 wheel; the image's own + # cmake is used instead, so the build requirements are preinstalled here. + cibw-build-frontend: "pip; args: --no-build-isolation" + # The C++ dependencies are fetched and statically linked by the build, and + # upstream ships none of their licences. + cibw-before-build: |- + pip install "setuptools>=77.0.3" "pybind11>=2.13.6" "wheel>=0.43.0" + curl -fsSL -o {project}/LICENSE.qpdf https://raw.githubusercontent.com/qpdf/qpdf/v12.2.0/LICENSE.txt + curl -fsSL -o {project}/LICENSE.libjpeg-turbo https://raw.githubusercontent.com/libjpeg-turbo/libjpeg-turbo/3.1.1/LICENSE.md + curl -fsSL -o {project}/LICENSE.openjpeg https://raw.githubusercontent.com/uclouvain/openjpeg/v2.5.3/LICENSE + curl -fsSL -o {project}/LICENSE.lcms2 https://raw.githubusercontent.com/mm2/Little-CMS/lcms2.17/LICENSE + curl -fsSL -o {project}/LICENSE.freetype https://raw.githubusercontent.com/freetype/freetype/VER-2-13-3/docs/FTL.TXT + curl -fsSL -o {project}/LICENSE.blend2d https://raw.githubusercontent.com/blend2d/blend2d/6dbc2cefbc996379e07104e34519a440b49b15d7/LICENSE.md + curl -fsSL -o {project}/LICENSE.utfcpp https://raw.githubusercontent.com/nemtrif/utfcpp/v4.0.6/LICENSE + curl -fsSL -o {project}/LICENSE.json https://raw.githubusercontent.com/nlohmann/json/v3.12.0/LICENSE.MIT + curl -fsSL -o {project}/LICENSE.loguru https://raw.githubusercontent.com/emilk/loguru/4adaa185883e3c04da25913579c451d3c32cfac1/LICENSE + curl -fsSL -o {project}/LICENSE.cxxopts https://raw.githubusercontent.com/jarro2783/cxxopts/v3.3.1/LICENSE + curl -fsSL -o {project}/LICENSE.pdfium https://raw.githubusercontent.com/chromium/pdfium/main/LICENSE + cibw-environment-linux: "BUILD_THREADS=4 CMAKE_BUILD_TYPE=Release" + cibw-test-sources: "tests" + cibw-test-requires: "pytest numpy huggingface_hub fonttools" + # Upstream's test runner installs the same static (CFF) Noto CJK face for the + # non-embedded-font tests; the manylinux image ships no fonts at all. + cibw-before-test-linux: "dnf -y install google-noto-sans-cjk-fonts" + # pandas and pillow (dependencies of the wheel) are sdist-only on PyPI at their + # newest releases and fail to build from source here; take the registry's + # riscv64 wheels. + cibw-test-environment: "DOCLING_PARSE_CJK_FALLBACK_FONT=/usr/share/fonts/google-noto-sans-cjk-fonts/NotoSansCJK-Regular.ttc PIP_ONLY_BINARY=pandas,pillow" + # Blend2D generates its compositing pipelines with asmjit, which has no riscv64 + # backend, and its reference pipeline drops the Multiply blend mode - the same tests + # fail on aarch64 built with BLEND2D_NO_JIT=ON. + cibw-test-command: "python -m pytest -v tests/test_unit_*.py -k \"not multiply\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 720 - strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DOCLING_PARSE_VERSION: ${{ matrix.version }} - steps: - name: Checkout docling-parse v${{ env.DOCLING_PARSE_VERSION }} uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -68,49 +115,11 @@ jobs: ref: v${{ env.DOCLING_PARSE_VERSION }} persist-credentials: false - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # pyproject pins cmake<4.0.0, which has no riscv64 wheel; the image's own - # cmake is used instead, so the build requirements are preinstalled here. - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - # The C++ dependencies are fetched and statically linked by the build, and - # upstream ships none of their licences. - CIBW_BEFORE_BUILD: | - pip install "setuptools>=77.0.3" "pybind11>=2.13.6" "wheel>=0.43.0" - curl -fsSL -o {project}/LICENSE.qpdf https://raw.githubusercontent.com/qpdf/qpdf/v12.2.0/LICENSE.txt - curl -fsSL -o {project}/LICENSE.libjpeg-turbo https://raw.githubusercontent.com/libjpeg-turbo/libjpeg-turbo/3.1.1/LICENSE.md - curl -fsSL -o {project}/LICENSE.openjpeg https://raw.githubusercontent.com/uclouvain/openjpeg/v2.5.3/LICENSE - curl -fsSL -o {project}/LICENSE.lcms2 https://raw.githubusercontent.com/mm2/Little-CMS/lcms2.17/LICENSE - curl -fsSL -o {project}/LICENSE.freetype https://raw.githubusercontent.com/freetype/freetype/VER-2-13-3/docs/FTL.TXT - curl -fsSL -o {project}/LICENSE.blend2d https://raw.githubusercontent.com/blend2d/blend2d/6dbc2cefbc996379e07104e34519a440b49b15d7/LICENSE.md - curl -fsSL -o {project}/LICENSE.utfcpp https://raw.githubusercontent.com/nemtrif/utfcpp/v4.0.6/LICENSE - curl -fsSL -o {project}/LICENSE.json https://raw.githubusercontent.com/nlohmann/json/v3.12.0/LICENSE.MIT - curl -fsSL -o {project}/LICENSE.loguru https://raw.githubusercontent.com/emilk/loguru/4adaa185883e3c04da25913579c451d3c32cfac1/LICENSE - curl -fsSL -o {project}/LICENSE.cxxopts https://raw.githubusercontent.com/jarro2783/cxxopts/v3.3.1/LICENSE - curl -fsSL -o {project}/LICENSE.pdfium https://raw.githubusercontent.com/chromium/pdfium/main/LICENSE - CIBW_ENVIRONMENT: >- - BUILD_THREADS=4 - CMAKE_BUILD_TYPE=Release - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_SOURCES: tests - CIBW_TEST_REQUIRES: pytest numpy huggingface_hub fonttools - # Upstream's test runner installs the same static (CFF) Noto CJK face for the - # non-embedded-font tests; the manylinux image ships no fonts at all. - CIBW_BEFORE_TEST_LINUX: dnf -y install google-noto-sans-cjk-fonts - # pandas and pillow (dependencies of the wheel) are sdist-only on PyPI at their - # newest releases and fail to build from source here; take the registry's - # riscv64 wheels. - CIBW_TEST_ENVIRONMENT: >- - DOCLING_PARSE_CJK_FALLBACK_FONT=/usr/share/fonts/google-noto-sans-cjk-fonts/NotoSansCJK-Regular.ttc - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=pandas,pillow - # Blend2D generates its compositing pipelines with asmjit, which has no riscv64 - # backend, and its reference pipeline drops the Multiply blend mode — the same tests - # fail on aarch64 built with BLEND2D_NO_JIT=ON. - CIBW_TEST_COMMAND: python -m pytest -v tests/test_unit_*.py -k "not multiply" + name: docling-parse-${{ env.DOCLING_PARSE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -145,15 +154,9 @@ jobs: - name: Check Blend2D debug assertions are absent run: python3 scripts/check_no_blend2d_assertions.py ./wheelhouse/*.whl - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: docling-parse-${{ env.DOCLING_PARSE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish docling-parse ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-dracopy.yml b/.github/workflows/build-dracopy.yml index 9e5991e3a1db..70090e4da41c 100644 --- a/.github/workflows/build-dracopy.yml +++ b/.github/workflows/build-dracopy.yml @@ -52,48 +52,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build dracopy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "dracopy" + version: "${{ matrix.version }}" + repository: "seung-lab/DracoPy" + ref: "e6b344903e58cc0f080675c652b6ea9bd2d72462" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "recursive" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Mirrors upstream's own CIBW_BEFORE_BUILD (build_aarch64.yml); the + # submodule is already present via `submodules: recursive` above, so + # the `git submodule` calls upstream runs here are dropped. cmake and + # cython are setup.py setup_requires, not pyproject.toml build-system + # requires, so they need to already be importable/on PATH before + # setup.py runs, isolated build or not. + cibw-before-build: "pip install \"cmake>=3.30.2\" cython numpy scikit-build setuptools wheel" + # numpy and cmake have riscv64 wheels only on our registry. + cibw-test-requires: "pytest numpy" + cibw-test-sources: "tests.py pytest.ini testdata_files" + cibw-test-command: "cd {project} && python -m pytest -v tests.py" + # numpy has no riscv64 wheel on public PyPI; keep pip on our registry's copy. + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DRACOPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout DracoPy ${{ env.DRACOPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: seung-lab/DracoPy - ref: ${{ env.DRACOPY_REF }} - # Google's Draco mesh compression library is a submodule and is - # statically linked (libdraco.a) into the DracoPy extension. - submodules: recursive - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Mirrors upstream's own CIBW_BEFORE_BUILD (build_aarch64.yml); the - # submodule is already present via `submodules: recursive` above, so - # the `git submodule` calls upstream runs here are dropped. cmake and - # cython are setup.py setup_requires, not pyproject.toml build-system - # requires, so they need to already be importable/on PATH before - # setup.py runs, isolated build or not. - CIBW_BEFORE_BUILD: pip install "cmake>=3.30.2" cython numpy scikit-build setuptools wheel - # numpy and cmake have riscv64 wheels only on our registry. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest numpy - CIBW_TEST_SOURCES: tests.py pytest.ini testdata_files - CIBW_TEST_COMMAND: cd {project} && python -m pytest -v tests.py - # numpy has no riscv64 wheel on public PyPI; keep pip on our registry's copy. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy + name: dracopy-${{ env.DRACOPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -108,15 +112,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: dracopy-${{ env.DRACOPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish dracopy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-drjit.yml b/.github/workflows/build-drjit.yml index 0f1794ebc1ce..a867ba79a4de 100644 --- a/.github/workflows/build-drjit.yml +++ b/.github/workflows/build-drjit.yml @@ -51,49 +51,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build drjit ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "drjit" + version: "${{ matrix.version }}" + repository: "mitsuba-renderer/drjit" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/drjit/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # nanothread/drjit-core/drjit each set their own *_NATIVE_FLAGS cache + # var to -march=haswell for a scikit-build/non-aarch64 build; riscv64 + # GCC rejects it outright ("ISA string must begin with rv32 or rv64"). + cibw-environment-linux: "SKBUILD_CMAKE_ARGS='-DDRJIT_NATIVE_FLAGS=;-DDRJIT_CORE_NATIVE_FLAGS=;-DNANOTHREAD_NATIVE_FLAGS='" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DRJIT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout drjit v${{ env.DRJIT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: mitsuba-renderer/drjit - ref: v${{ env.DRJIT_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - # DRJIT_ENABLE_LLVM/DRJIT_ENABLE_CUDA both resolve their backend by - # dlopen()-ing libLLVM.so/libcuda.so at runtime (DRJIT_DYNAMIC_LLVM, - # DRJIT_DYNAMIC_CUDA), so the build itself needs neither an LLVM install - # nor the CUDA toolkit; ext/drjit-core/include/drjit-core/intrin.h and - # src/lock.h just assume every non-aarch64 target is x86. - - name: Patch drjit source - run: git apply python-wheels/patches/drjit/${{ env.DRJIT_VERSION }}/00*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # nanothread/drjit-core/drjit each set their own *_NATIVE_FLAGS cache - # var to -march=haswell for a scikit-build/non-aarch64 build; riscv64 - # GCC rejects it outright ("ISA string must begin with rv32 or rv64"). - CIBW_ENVIRONMENT: >- - SKBUILD_CMAKE_ARGS='-DDRJIT_NATIVE_FLAGS=;-DDRJIT_CORE_NATIVE_FLAGS=;-DNANOTHREAD_NATIVE_FLAGS=' + name: drjit-${{ env.DRJIT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -112,15 +119,9 @@ jobs: }, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: drjit-${{ env.DRJIT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish drjit ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-dtw-python.yml b/.github/workflows/build-dtw-python.yml index c4d4dc4a9f14..69cebe9d7337 100644 --- a/.github/workflows/build-dtw-python.yml +++ b/.github/workflows/build-dtw-python.yml @@ -49,36 +49,41 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build dtw-python ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "dtw-python" + version: "${{ matrix.version }}" + repository: "DynamicTimeWarping/dtw-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy" + cibw-test-requires: "pytest" + cibw-test-command: "pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DTW_PYTHON_VERSION: ${{ matrix.version }} - steps: - - name: Checkout dtw-python v${{ env.DTW_PYTHON_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: DynamicTimeWarping/dtw-python - ref: v${{ env.DTW_PYTHON_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - output-dir: wheelhouse/ - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: "pytest {project}/tests" + name: dtw-python-${{ env.DTW_PYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and license made it into the wheel run: | @@ -92,15 +97,9 @@ jobs: print(sys.argv[1], "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: dtw-python-${{ env.DTW_PYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish dtw-python ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-duckdb.yml b/.github/workflows/build-duckdb.yml index ddcf35d9d1bf..36a62cdfc17e 100644 --- a/.github/workflows/build-duckdb.yml +++ b/.github/workflows/build-duckdb.yml @@ -48,54 +48,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build duckdb ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "duckdb" + version: "${{ matrix.version }}" + repository: "duckdb/duckdb-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 1440 + checkout-submodules: "true" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's build[uv] frontend crashes cibuildwheel's audit step here (no host uv). + cibw-build-frontend: "build" + # Upstream's `yum install -y ccache clang lld` minus ccache (EPEL-only, and the riscv64 manylinux image has no + # EPEL): since 2.0.0 the Linux wheels link with ThinLTO (DUCKDB_PY_LTO=thin), which needs clang and lld. + cibw-before-build: "yum install -y clang lld" + # Upstream's release job pins the version the same way (packaging.yml set-version). + cibw-environment-linux: "CC=clang CXX=clang++ OVERRIDE_GIT_DESCRIBE=v${{ matrix.version }}" + # Test phase only, so it can't starve the build backend (gotcha 12). + cibw-test-environment: "PIP_ONLY_BINARY=:all:" + cibw-test-sources: "tests" + # Upstream's test group minus deps with no riscv64 wheel; their tests are importorskip-guarded. + cibw-test-requires: "pytest pytest-reraise pytest-timeout pytest-timestamper packaging psutil pytz requests typing-extensions urllib3 fsspec numpy pandas==3.0.3" + # Upstream's `testsuite: fast` invocation (tests/slow needs network fixtures). + cibw-test-command: "python -c \"import _duckdb; assert _duckdb.__file__.endswith('.so'), _duckdb.__file__\" && python -m pytest --confcutdir=. --rootdir . -c {project}/pyproject.toml ./tests/fast" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 1440 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DUCKDB_VERSION: ${{ matrix.version }} - steps: - - name: Checkout duckdb-python v${{ env.DUCKDB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: duckdb/duckdb-python - ref: v${{ env.DUCKDB_VERSION }} - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's build[uv] frontend crashes cibuildwheel's audit step here (no host uv). - CIBW_BUILD_FRONTEND: build - # Upstream's `yum install -y ccache clang lld` minus ccache (EPEL-only, and the riscv64 manylinux image has no - # EPEL): since 2.0.0 the Linux wheels link with ThinLTO (DUCKDB_PY_LTO=thin), which needs clang and lld. - CIBW_BEFORE_BUILD: yum install -y clang lld - # Upstream's release job pins the version the same way (packaging.yml set-version). - CIBW_ENVIRONMENT: >- - CC=clang - CXX=clang++ - OVERRIDE_GIT_DESCRIBE=v${{ env.DUCKDB_VERSION }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Test phase only, so it can't starve the build backend (gotcha 12). - CIBW_TEST_ENVIRONMENT: 'PIP_ONLY_BINARY=:all:' - CIBW_TEST_SOURCES: tests - # Upstream's test group minus deps with no riscv64 wheel; their tests are importorskip-guarded. - CIBW_TEST_REQUIRES: >- - pytest pytest-reraise pytest-timeout pytest-timestamper packaging psutil - pytz requests typing-extensions urllib3 fsspec numpy pandas==3.0.3 - # Upstream's `testsuite: fast` invocation (tests/slow needs network fixtures). - CIBW_TEST_COMMAND: >- - python -c "import _duckdb; assert _duckdb.__file__.endswith('.so'), _duckdb.__file__" && - python -m pytest --confcutdir=. --rootdir . -c {project}/pyproject.toml ./tests/fast + name: duckdb-${{ env.DUCKDB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension module made it into the wheel run: | @@ -107,15 +106,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: duckdb-${{ env.DUCKDB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish duckdb ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-dukpy.yml b/.github/workflows/build-dukpy.yml index 7dcbd263ccf5..6b8c72e8fe61 100644 --- a/.github/workflows/build-dukpy.yml +++ b/.github/workflows/build-dukpy.yml @@ -49,39 +49,43 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build dukpy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "dukpy" + version: "${{ matrix.version }}" + repository: "amol-/dukpy" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # Mirrors upstream's run-tests.yml (testing+webassets extras); all four + # are pure-Python wheels on public PyPI, so no registry plumbing needed. + cibw-test-requires: "pytest pytest-cov mock webassets" + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import dukpy._dukpy as e; assert e.__file__.endswith('.so'), e.__file__\" && pytest -v --cov=dukpy --cov-report=term-missing tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DUKPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout dukpy ${{ env.DUKPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: amol-/dukpy - ref: ${{ env.DUKPY_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # Mirrors upstream's run-tests.yml (testing+webassets extras); all four - # are pure-Python wheels on public PyPI, so no registry plumbing needed. - CIBW_TEST_REQUIRES: pytest pytest-cov mock webassets - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import dukpy._dukpy as e; assert e.__file__.endswith('.so'), e.__file__" && - pytest -v --cov=dukpy --cov-report=term-missing tests + name: dukpy-${{ env.DUKPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and license made it into the wheel run: | @@ -94,15 +98,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: dukpy-${{ env.DUKPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish dukpy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-dwave-optimization.yml b/.github/workflows/build-dwave-optimization.yml index 92da622270e4..f6ab22cb3d22 100644 --- a/.github/workflows/build-dwave-optimization.yml +++ b/.github/workflows/build-dwave-optimization.yml @@ -59,9 +59,7 @@ jobs: ref: ${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: >- - PIP_ONLY_BINARY=numpy - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" timeout-minutes: 120 publish: diff --git a/.github/workflows/build-dwave-samplers.yml b/.github/workflows/build-dwave-samplers.yml index f2ac70727195..d68b24291107 100644 --- a/.github/workflows/build-dwave-samplers.yml +++ b/.github/workflows/build-dwave-samplers.yml @@ -61,15 +61,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # The build-time dimod==0.12.21 pin, and dimod for cp310/cp311 tests, have no # riscv64 wheel; pip compiles them from their PyPI sdists. - cibw-environment: >- - PIP_ONLY_BINARY=numpy - PIP_PREFER_BINARY=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - UV_ONLY_BINARY=numpy - UV_PREFER_BINARY=1 - UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - UV_INDEX_STRATEGY=unsafe-best-match - + cibw-environment-linux: "PIP_ONLY_BINARY=numpy PIP_PREFER_BINARY=1 UV_ONLY_BINARY=numpy UV_PREFER_BINARY=1 UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ UV_INDEX_STRATEGY=unsafe-best-match" publish: name: Publish dwave-samplers ${{ matrix.version }} needs: [setup, build_wheels] diff --git a/.github/workflows/build-dynet38.yml b/.github/workflows/build-dynet38.yml index 90906a75e3fd..a5b3fc9ee28c 100644 --- a/.github/workflows/build-dynet38.yml +++ b/.github/workflows/build-dynet38.yml @@ -52,48 +52,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build dynet38 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "dynet38" + version: "${{ matrix.version }}" + repository: "taishi-i/dynet" + ref: "3c9f35de86e98a5809e9c81394194c8f6e0aa0dc" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/dynet38/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_USE_PEP517=1 PIP_ONLY_BINARY=numpy" + # setup.py links _dynet against build/-64bit/dynet/libdynet.so but gives it an RPATH into the deleted build venv. + cibw-repair-wheel-command-linux: "LD_LIBRARY_PATH=\"$(echo {project}/build/py3*-64bit/dynet)\" auditwheel repair -w {dest_dir} {wheel}" + cibw-test-command: "cd {project}/tests/python && python test.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: DYNET38_VERSION: ${{ matrix.version }} - steps: - - name: Checkout dynet ${{ env.DYNET38_REF }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: taishi-i/dynet - ref: ${{ env.DYNET38_REF }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/dynet38/${{ env.DYNET38_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_USE_PEP517=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - # setup.py links _dynet against build/-64bit/dynet/libdynet.so but gives it an RPATH into the deleted build venv. - CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- - LD_LIBRARY_PATH="$(echo {project}/build/py3*-64bit/dynet)" - auditwheel repair -w {dest_dir} {wheel} - CIBW_TEST_COMMAND: cd {project}/tests/python && python test.py + name: dynet38-${{ env.DYNET38_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -106,16 +113,9 @@ jobs: assert licences == {"LICENSE.txt", "LICENSE.eigen-mpl2"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: dynet38-${{ env.DYNET38_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish dynet38 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-eclipse-sumo.yml b/.github/workflows/build-eclipse-sumo.yml index a715575df91b..4b912e3b7726 100644 --- a/.github/workflows/build-eclipse-sumo.yml +++ b/.github/workflows/build-eclipse-sumo.yml @@ -76,6 +76,71 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build eclipse-sumo ${{ matrix.version }} cp312-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "eclipse-sumo" + version: "${{ matrix.version }}" + repository: "eclipse-sumo/sumo" + ref: '' + artifact-tag: "cp312-manylinux_riscv64" + timeout-minutes: 240 + checkout-fetch-depth: 0 + pre-build: |- + export ECLIPSE_SUMO_VERSION='${{ matrix.version }}' + echo "ECLIPSE_SUMO_TAG=v${ECLIPSE_SUMO_VERSION//./_}" >> "$GITHUB_ENV" + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + git fetch -q --no-tags --filter=tree:0 origin "${ECLIPSE_SUMO_TAG}" + git checkout -q --detach FETCH_HEAD + + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + set -euo pipefail + for p in python-wheels/patches/eclipse-sumo/${ECLIPSE_SUMO_VERSION}/*.patch; do + git apply -v "$p" + done + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + curl -fsSL --retry 5 "https://raw.githubusercontent.com/apache/xerces-c/v3.3.0/LICENSE" -o LICENSE.xercesc + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + python tools/build_config/version.py --pep440 build_config/pyproject/eclipse-sumo.toml pyproject.toml + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-manylinux_riscv64" + cibw-before-all-linux: "dnf -y install eigen3-devel && cd \"$(mktemp -d)\" && curl -fsSL --retry 5 \"https://dlcdn.apache.org/xerces/c/3/sources/xerces-c-3.3.0.tar.gz\" | tar xz && cd \"xerces-c-3.3.0\" && cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr && cmake --build build --parallel \"$(nproc)\" && cmake --install build" + # SUMO's executables link non-PIE at riscv64's 0x10000; auditwheel's patchelf then maps a segment below mmap_min_addr and they SIGSEGV at exec (gotcha 595). + cibw-config-settings: "cmake.args=-DCHECK_OPTIONAL_LIBS=OFF;-DENABLE_FOX=OFF;-DENABLE_PROJ=OFF;-DENABLE_PARQUET=OFF;-DENABLE_PYTHON_BINDINGS=OFF;-DENABLE_JAVA_BINDINGS=OFF;-DENABLE_CS_BINDINGS=OFF;-DCMAKE_EXE_LINKER_FLAGS=-Wl,-Ttext-segment=0x200000" + cibw-test-requires: "sumo-data" + cibw-test-command: "python -c \"import sumo; print('SUMO_HOME=' + sumo.SUMO_HOME)\" && sumo --version && netconvert --version && duarouter --version && netgenerate --grid --grid.number=3 -o net.xml && test -s net.xml" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 strategy: @@ -84,68 +149,12 @@ jobs: version: ${{ fromJSON(needs.setup.outputs.versions) }} env: ECLIPSE_SUMO_VERSION: ${{ matrix.version }} - steps: - - name: Determine upstream git tag - # eclipse-sumo tags with underscores (v1_28_0), not v1.28.0 - CLAUDE.md gotcha 274. - run: echo "ECLIPSE_SUMO_TAG=v${ECLIPSE_SUMO_VERSION//./_}" >> "$GITHUB_ENV" - - - name: Checkout sumo ${{ env.ECLIPSE_SUMO_TAG }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: eclipse-sumo/sumo - ref: ${{ env.ECLIPSE_SUMO_TAG }} - fetch-depth: 0 - filter: tree:0 - submodules: false - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: | - set -euo pipefail - for p in python-wheels/patches/eclipse-sumo/${ECLIPSE_SUMO_VERSION}/*.patch; do - git apply -v "$p" - done - - # Upstream vendors Xerces-C (Apache-2.0) into the wheel via auditwheel but - # ships no copy of its licence; staged here for the license-files patch - # above, the same shape as build-ompl.yml staging boost/yaml-cpp's. - - name: Stage vendored dependency licences - run: curl -fsSL --retry 5 "https://raw.githubusercontent.com/apache/xerces-c/v${{ env.XERCESC_VERSION }}/LICENSE" -o LICENSE.xercesc - - - name: Preparing wheel eclipse-sumo - run: python tools/build_config/version.py --pep440 build_config/pyproject/eclipse-sumo.toml pyproject.toml - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: cp312-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install eigen3-devel && - cd "$(mktemp -d)" && - curl -fsSL --retry 5 "https://dlcdn.apache.org/xerces/c/3/sources/xerces-c-${{ env.XERCESC_VERSION }}.tar.gz" | tar xz && - cd "xerces-c-${{ env.XERCESC_VERSION }}" && - cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr && - cmake --build build --parallel "$(nproc)" && - cmake --install build - # SUMO's executables link non-PIE at riscv64's 0x10000; auditwheel's patchelf then maps a segment below mmap_min_addr and they SIGSEGV at exec (gotcha 595). - CIBW_CONFIG_SETTINGS: >- - cmake.args=-DCHECK_OPTIONAL_LIBS=OFF;-DENABLE_FOX=OFF;-DENABLE_PROJ=OFF;-DENABLE_PARQUET=OFF;-DENABLE_PYTHON_BINDINGS=OFF;-DENABLE_JAVA_BINDINGS=OFF;-DENABLE_CS_BINDINGS=OFF;-DCMAKE_EXE_LINKER_FLAGS=-Wl,-Ttext-segment=0x200000 - CIBW_TEST_REQUIRES: sumo-data - CIBW_TEST_COMMAND: >- - python -c "import sumo; print('SUMO_HOME=' + sumo.SUMO_HOME)" && - sumo --version && netconvert --version && duarouter --version && - netgenerate --grid --grid.number=3 -o net.xml && - test -s net.xml + name: eclipse-sumo-${{ env.ECLIPSE_SUMO_VERSION }}-cp312-manylinux_riscv64 + path: wheelhouse - name: Check the compiled binaries and vendored licences made it into the wheel run: | @@ -162,15 +171,9 @@ jobs: assert lic == ["LICENSE", "LICENSE.xercesc"], lic EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: eclipse-sumo-${{ env.ECLIPSE_SUMO_VERSION }}-cp312-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish eclipse-sumo ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ecos.yml b/.github/workflows/build-ecos.yml index ae1ca12658ad..cec4e7fcaee5 100644 --- a/.github/workflows/build-ecos.yml +++ b/.github/workflows/build-ecos.yml @@ -59,9 +59,7 @@ jobs: checkout-submodules: recursive cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # numpy (build and test) and scipy (test) have no riscv64 wheel on public PyPI. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy" # test_interface.py sits next to the ecos/ package source (src/ecos/); # staging only the test files (not src/ecos/) keeps pytest's rootdir # insertion from shadowing the installed wheel (gotcha 25). diff --git a/.github/workflows/build-edt.yml b/.github/workflows/build-edt.yml index 1a6fb021540c..3a21d0ab7184 100644 --- a/.github/workflows/build-edt.yml +++ b/.github/workflows/build-edt.yml @@ -50,50 +50,59 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build edt ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "edt" + version: "${{ matrix.version }}" + repository: "seung-lab/euclidean-distance-transform-3d" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/edt/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a build-time requirement (headers, via pyproject.toml's + # build-system.requires) and, despite not being declared as a + # runtime dependency by name, an implicit one too (the compiled + # extension calls numpy's C API at import time). Only our registry + # has it for riscv64; only-binary keeps a newer PyPI release from + # winning the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest numpy scipy" + cibw-test-command: "python -m pytest -v {project}/automated_test.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: EDT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout edt ${{ env.EDT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: seung-lab/euclidean-distance-transform-3d - ref: ${{ env.EDT_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/edt/${{ env.EDT_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build-time requirement (headers, via pyproject.toml's - # build-system.requires) and, despite not being declared as a - # runtime dependency by name, an implicit one too (the compiled - # extension calls numpy's C API at import time). Only our registry - # has it for riscv64; only-binary keeps a newer PyPI release from - # winning the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest numpy scipy - CIBW_TEST_COMMAND: python -m pytest -v {project}/automated_test.py + name: edt-${{ env.EDT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -106,16 +115,9 @@ jobs: assert licences == {"COPYING", "COPYING.LESSER"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: edt-${{ env.EDT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish edt ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-efel.yml b/.github/workflows/build-efel.yml index ed1cf21f6318..5c3f2318aae7 100644 --- a/.github/workflows/build-efel.yml +++ b/.github/workflows/build-efel.yml @@ -58,9 +58,7 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 checkout-fetch-depth: 0 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,h5py + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,h5py" timeout-minutes: 120 publish: diff --git a/.github/workflows/build-eigenpy.yml b/.github/workflows/build-eigenpy.yml index 908c90f7f420..4312264c11dc 100644 --- a/.github/workflows/build-eigenpy.yml +++ b/.github/workflows/build-eigenpy.yml @@ -48,56 +48,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build eigenpy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "eigenpy" + version: "${{ matrix.version }}" + repository: "cmake-wheel/eigenpy" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 480 + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/eigenpy/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy's newest release has no riscv64 wheel; the registry's must win over its sdist. + cibw-environment-linux: "CMEEL_LOG_LEVEL=\"DEBUG\" CMEEL_JOBS=\"1\" CMEEL_TEST_JOBS=\"1\" CMEEL_CMAKE_ARGS=\"-DBUILD_TESTING_SCIPY=OFF\" PIP_ONLY_BINARY=numpy,scipy" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + cibw-test-command: "cd {project}/unittest/python && for t in BDCSVD ComplexEigenSolver ComplexSchur EigenSolver FullPivLU GeneralizedEigenSolver GeneralizedSelfAdjointEigenSolver HessenbergDecomposition JacobiSVD LDLT LLT MINRES PartialPivLU QR RealQZ RealSchur SelfAdjointEigenSolver Tridiagonalization dimensions id version; do echo \"test_$t.py\" && python \"test_$t.py\" || exit 1; done" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 480 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: EIGENPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout eigenpy v${{ env.EIGENPY_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/eigenpy - ref: v${{ env.EIGENPY_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch eigenpy source - run: git apply python-wheels/patches/eigenpy/${{ env.EIGENPY_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy's newest release has no riscv64 wheel; the registry's must win over its sdist. - CIBW_ENVIRONMENT: >- - CMEEL_LOG_LEVEL="DEBUG" CMEEL_JOBS="1" CMEEL_TEST_JOBS="1" - CMEEL_CMAKE_ARGS="-DBUILD_TESTING_SCIPY=OFF" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" - CIBW_TEST_COMMAND: >- - cd {project}/unittest/python && - for t in BDCSVD ComplexEigenSolver ComplexSchur EigenSolver FullPivLU - GeneralizedEigenSolver GeneralizedSelfAdjointEigenSolver HessenbergDecomposition - JacobiSVD LDLT LLT MINRES PartialPivLU QR RealQZ RealSchur - SelfAdjointEigenSolver Tridiagonalization dimensions id version; - do echo "test_$t.py" && python "test_$t.py" || exit 1; done + name: eigenpy-${{ env.EIGENPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -108,15 +109,9 @@ jobs: assert any("/site-packages/eigenpy/eigenpy_pywrap" in n and n.endswith(".so") for n in names), names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: eigenpy-${{ env.EIGENPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish eigenpy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-emcache.yml b/.github/workflows/build-emcache.yml index 03b3ab63b576..250527ed219c 100644 --- a/.github/workflows/build-emcache.yml +++ b/.github/workflows/build-emcache.yml @@ -59,7 +59,6 @@ jobs: checkout-submodules: true cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-before-build: make -C vendor/murmur3 static && make cythonize - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # Rocky 10's memcached stands in for upstream's compose.yaml service containers. cibw-before-test-linux: >- dnf -y install memcached && diff --git a/.github/workflows/build-emval.yml b/.github/workflows/build-emval.yml index f8a5b6d7abd9..80b48c7dc026 100644 --- a/.github/workflows/build-emval.yml +++ b/.github/workflows/build-emval.yml @@ -49,6 +49,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build emval ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + tag: [cp38-abi3, cp314t] + include: + # pyo3's abi3-py38 feature (Cargo.toml) gives one wheel for every + # GIL-ful interpreter; free-threaded builds disable abi3 and get + # their own (upstream's CI.yml builds them as a separate maturin + # pass with `-i python3.14t` for the same reason). + - tag: cp38-abi3 + # requires-python is >=3.10, so built on cp310 and re-tested on + # the newer interpreters via find_compatible_wheel. + build: >- + cp310-manylinux_riscv64 cp311-manylinux_riscv64 + cp312-manylinux_riscv64 cp313-manylinux_riscv64 + cp314-manylinux_riscv64 + test-requires: pytest polars + test-args: '' + - tag: cp314t + build: cp314t-manylinux_riscv64 + test-requires: pytest + # polars ships no free-threaded build on any platform. + test-args: --ignore=tests/test_polars_plugin.py + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "emval" + version: "${{ matrix.version }}" + repository: "bnkc/emval" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: 360 + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.build }}" + # emval ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "${{ matrix.test-requires }}" + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import emval._emval as m; assert m.__file__.endswith('.so'), m.__file__\" && python -m pytest -v tests ${{ matrix.test-args }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: @@ -75,38 +121,14 @@ jobs: test-requires: pytest # polars ships no free-threaded build on any platform. test-args: --ignore=tests/test_polars_plugin.py - env: EMVAL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout emval v${{ env.EMVAL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: bnkc/emval - ref: v${{ env.EMVAL_VERSION }} - persist-credentials: false - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # emval ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: ${{ matrix.test-requires }} - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import emval._emval as m; assert m.__file__.endswith('.so'), m.__file__" && - python -m pytest -v tests ${{ matrix.test-args }} + name: emval-${{ env.EMVAL_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check the licence made it into the wheel run: | @@ -118,15 +140,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: emval-${{ env.EMVAL_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish emval ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-epaper-dithering.yml b/.github/workflows/build-epaper-dithering.yml index cb491c1c247c..e1ee9efff0eb 100644 --- a/.github/workflows/build-epaper-dithering.yml +++ b/.github/workflows/build-epaper-dithering.yml @@ -49,47 +49,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build epaper-dithering ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "epaper-dithering" + version: "${{ matrix.version }}" + repository: "OpenDisplay-org/epaper-dithering" + ref: "epaper-dithering-v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + cp LICENSE packages/python/LICENSE + cp THIRD_PARTY_NOTICES.md packages/python/NOTICE.THIRD_PARTY_NOTICES.md + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "packages/python" + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" PIP_ONLY_BINARY=pillow,numpy" + cibw-test-extras: "test" + cibw-test-sources: "packages/python/tests" + cibw-test-command: "python -m pytest packages/python/tests -v --tb=short" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: EPAPER_DITHERING_VERSION: ${{ matrix.version }} - steps: - - name: Checkout epaper-dithering v${{ env.EPAPER_DITHERING_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: OpenDisplay-org/epaper-dithering - ref: epaper-dithering-v${{ env.EPAPER_DITHERING_VERSION }} - persist-credentials: false - - # maturin only globs licence files next to pyproject.toml; both live at the repo root. - - name: Stage licence files - run: | - cp LICENSE packages/python/LICENSE - cp THIRD_PARTY_NOTICES.md packages/python/NOTICE.THIRD_PARTY_NOTICES.md - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: packages/python - output-dir: wheelhouse/ - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=pillow,numpy - CIBW_TEST_EXTRAS: test - CIBW_TEST_SOURCES: packages/python/tests - CIBW_TEST_COMMAND: python -m pytest packages/python/tests -v --tb=short + name: epaper-dithering-${{ env.EPAPER_DITHERING_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -101,15 +107,9 @@ jobs: assert licences == {"LICENSE", "NOTICE.THIRD_PARTY_NOTICES.md"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: epaper-dithering-${{ env.EPAPER_DITHERING_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish epaper-dithering ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-essentia.yml b/.github/workflows/build-essentia.yml index e9299337d429..5add7b22e389 100644 --- a/.github/workflows/build-essentia.yml +++ b/.github/workflows/build-essentia.yml @@ -53,126 +53,136 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build essentia ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 720 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - ESSENTIA_VERSION: ${{ matrix.version }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "essentia" + version: "${{ matrix.version }}" + repository: "MTG/essentia" + ref: "8dbdc0735c0dc54fc2c57e083883b4baba7bf272" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 720 + checkout-fetch-depth: 0 + pre-build: |- + git fetch --tags --force + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - steps: - - name: Checkout essentia ${{ env.ESSENTIA_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: MTG/essentia - ref: ${{ env.ESSENTIA_REF }} - fetch-depth: 0 - persist-credentials: false + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Fetch release tags from GitHub - run: git fetch --tags --force + git apply python-wheels/patches/essentia/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + . packaging/build_config.sh + mkdir -p ../licences && cd ../licences + stage() { + name=$1 url=$2 pattern=${3:-} + curl -fsSL --retry 5 "$url" -o "$name.tar.gz" + mkdir "$name" && tar -xf "$name.tar.gz" -C "$name" --strip-components=1 + if [ -n "$pattern" ]; then + cat "$name/$pattern" > "$GITHUB_WORKSPACE/LICENSE.$name" + else + find "$name" -maxdepth 1 -type f \( -name 'COPYING*' -o -name 'LICEN[CS]E*' -o -name 'COPYRIGHT*' \) \ + | sort | xargs cat > "$GITHUB_WORKSPACE/LICENSE.$name" + fi + test -s "$GITHUB_WORKSPACE/LICENSE.$name" + } + stage eigen "https://gitlab.com/libeigen/eigen/-/archive/$EIGEN_VERSION/eigen-$EIGEN_VERSION.tar.gz" + stage fftw "http://www.fftw.org/$FFTW_VERSION.tar.gz" + stage lame "https://sourceforge.net/projects/lame/files/lame/$LAME_VERSION/lame-$LAME_VERSION.tar.gz/download" + stage ffmpeg "https://ffmpeg.org/releases/$FFMPEG_VERSION.tar.gz" + stage libsamplerate "https://github.com/libsndfile/libsamplerate/releases/download/0.1.9/$LIBSAMPLERATE_VERSION.tar.gz" + # zlib 1.2.12 has no LICENSE file; its licence text is in the README. + stage zlib "https://zlib.net/fossils/$ZLIB_VERSION.tar.gz" README + stage taglib "http://taglib.github.io/releases/$TAGLIB_VERSION.tar.gz" + stage libyaml "http://pyyaml.org/download/libyaml/$LIBYAML_VERSION.tar.gz" + stage chromaprint "https://github.com/acoustid/chromaprint/releases/download/v$CHROMAPRINT_VERSION/chromaprint-$CHROMAPRINT_VERSION.tar.gz" + cd "$GITHUB_WORKSPACE" + cp src/3rdparty/kiss_fft130/COPYING LICENSE.kissfft + cp "Essentia Licensing.txt" LICENSE.essentia-third-party + rm -rf ../licences - - name: Patch essentia source - run: git apply python-wheels/patches/essentia/${{ env.ESSENTIA_VERSION }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Stage the statically linked libraries' licence texts - run: | - . packaging/build_config.sh - mkdir -p ../licences && cd ../licences - stage() { - name=$1 url=$2 pattern=${3:-} - curl -fsSL --retry 5 "$url" -o "$name.tar.gz" - mkdir "$name" && tar -xf "$name.tar.gz" -C "$name" --strip-components=1 - if [ -n "$pattern" ]; then - cat "$name/$pattern" > "$GITHUB_WORKSPACE/LICENSE.$name" - else - find "$name" -maxdepth 1 -type f \( -name 'COPYING*' -o -name 'LICEN[CS]E*' -o -name 'COPYRIGHT*' \) \ - | sort | xargs cat > "$GITHUB_WORKSPACE/LICENSE.$name" - fi - test -s "$GITHUB_WORKSPACE/LICENSE.$name" - } - stage eigen "https://gitlab.com/libeigen/eigen/-/archive/$EIGEN_VERSION/eigen-$EIGEN_VERSION.tar.gz" - stage fftw "http://www.fftw.org/$FFTW_VERSION.tar.gz" - stage lame "https://sourceforge.net/projects/lame/files/lame/$LAME_VERSION/lame-$LAME_VERSION.tar.gz/download" - stage ffmpeg "https://ffmpeg.org/releases/$FFMPEG_VERSION.tar.gz" - stage libsamplerate "https://github.com/libsndfile/libsamplerate/releases/download/0.1.9/$LIBSAMPLERATE_VERSION.tar.gz" - # zlib 1.2.12 has no LICENSE file; its licence text is in the README. - stage zlib "https://zlib.net/fossils/$ZLIB_VERSION.tar.gz" README - stage taglib "http://taglib.github.io/releases/$TAGLIB_VERSION.tar.gz" - stage libyaml "http://pyyaml.org/download/libyaml/$LIBYAML_VERSION.tar.gz" - stage chromaprint "https://github.com/acoustid/chromaprint/releases/download/v$CHROMAPRINT_VERSION/chromaprint-$CHROMAPRINT_VERSION.tar.gz" - cd "$GITHUB_WORKSPACE" - cp src/3rdparty/kiss_fft130/COPYING LICENSE.kissfft - cp "Essentia Licensing.txt" LICENSE.essentia-third-party - rm -rf ../licences + cat > riscv64_smoke.py <<'EOF' + import os + import tempfile - - name: Write the smoke test - run: | - cat > riscv64_smoke.py <<'EOF' - import os - import tempfile + import numpy as np - import numpy as np + import essentia + import essentia.standard as es + import essentia.streaming + from essentia.standard import Chromaprinter, MetadataReader, MonoLoader, YamlInput - import essentia - import essentia.standard as es - import essentia.streaming - from essentia.standard import Chromaprinter, MetadataReader, MonoLoader, YamlInput + sr = 44100 + t = np.arange(sr * 5) / sr + x = (0.5 * np.sin(2 * np.pi * 440 * t)).astype(np.float32) + spec = es.Spectrum()(es.Windowing(type="hann")(x[:4096])) + peak = np.argmax(spec) * sr / 4096 + assert abs(peak - 440) < sr / 4096, peak + f = os.path.join(tempfile.mkdtemp(), "sine.wav") + es.MonoWriter(filename=f, sampleRate=sr, format="wav")(x) + y = MonoLoader(filename=f, sampleRate=22050)() + assert abs(len(y) - 5 * 22050) < 2048, len(y) + meta = MetadataReader(filename=f)() + assert meta[-2] == sr, meta[-4:] + fp = Chromaprinter(sampleRate=sr)(x) + assert isinstance(fp, str) and fp, fp + print("essentia", essentia.__version__, "ok", fp[:24], meta[-4:]) + EOF - sr = 44100 - t = np.arange(sr * 5) / sr - x = (0.5 * np.sin(2 * np.pi * 440 * t)).astype(np.float32) - spec = es.Spectrum()(es.Windowing(type="hann")(x[:4096])) - peak = np.argmax(spec) * sr / 4096 - assert abs(peak - 440) < sr / 4096, peak - f = os.path.join(tempfile.mkdtemp(), "sine.wav") - es.MonoWriter(filename=f, sampleRate=sr, format="wav")(x) - y = MonoLoader(filename=f, sampleRate=22050)() - assert abs(len(y) - 5 * 22050) < 2048, len(y) - meta = MetadataReader(filename=f)() - assert meta[-2] == sr, meta[-4:] - fp = Chromaprinter(sampleRate=sr)(x) - assert isinstance(fp, str) and fp, fp - print("essentia", essentia.__version__, "ok", fp[:24], meta[-4:]) - EOF + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-config-file: "cibuildwheel.toml" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PROJECT_NAME=essentia ESSENTIA_PROJECT_NAME=essentia ESSENTIA_WHEEL_SKIP_3RDPARTY=1 ESSENTIA_WHEEL_ONLY_PYTHON=1 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig CMAKE_POLICY_VERSION_MINIMUM=3.5 PIP_ONLY_BINARY=numpy" + # Upstream's image ships these static dependencies prebuilt; it has no + # riscv64 variant, so build them with upstream's own script. No Gaia: its + # Linux build compiles Qt 5 from source, and the macOS wheels skip it too. + cibw-before-all-linux: "git config --global --add safe.directory '*' && PREFIX=/usr/local packaging/build_3rdparty_static_debian.sh && python3 waf configure --build-static --static-dependencies --pkg-config-path=\"${PKG_CONFIG_PATH}\" && python3 waf && python3 waf install" + cibw-test-sources: "riscv64_smoke.py" + cibw-test-command: "python riscv64_smoke.py" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 720 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + ESSENTIA_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - config-file: cibuildwheel.toml - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_LINUX: >- - PROJECT_NAME=essentia - ESSENTIA_PROJECT_NAME=essentia - ESSENTIA_WHEEL_SKIP_3RDPARTY=1 - ESSENTIA_WHEEL_ONLY_PYTHON=1 - PKG_CONFIG_PATH=/usr/local/lib/pkgconfig - CMAKE_POLICY_VERSION_MINIMUM=3.5 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - # Upstream's image ships these static dependencies prebuilt; it has no - # riscv64 variant, so build them with upstream's own script. No Gaia: its - # Linux build compiles Qt 5 from source, and the macOS wheels skip it too. - CIBW_BEFORE_ALL_LINUX: >- - git config --global --add safe.directory '*' && - PREFIX=/usr/local packaging/build_3rdparty_static_debian.sh && - python3 waf configure --build-static --static-dependencies --pkg-config-path="${PKG_CONFIG_PATH}" && - python3 waf && - python3 waf install - CIBW_TEST_SOURCES: riscv64_smoke.py - CIBW_TEST_COMMAND: python riscv64_smoke.py + name: essentia-${{ env.ESSENTIA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel version, extension and licences run: | @@ -191,12 +201,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: essentia-${{ env.ESSENTIA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -254,7 +258,7 @@ jobs: publish: name: Publish essentia ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-etcpak.yml b/.github/workflows/build-etcpak.yml index 6d92b633bf36..9f4fc16b17c1 100644 --- a/.github/workflows/build-etcpak.yml +++ b/.github/workflows/build-etcpak.yml @@ -58,47 +58,55 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build etcpak ${{ matrix.version }} cp37-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "etcpak" + version: "${{ matrix.version }}" + repository: "K0lb3/etcpak" + ref: "e2a7464bb4f98cb1765d9756ae6cb8e5f9a24d70" + artifact-tag: "cp37-abi3-manylinux_riscv64" + timeout-minutes: 90 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/etcpak/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # setup.py tags every CPython build cp37-abi3 with no Py_GIL_DISABLED + # guard, so cp314t would hit CPython's limited-API #error; upstream ships + # no free-threaded wheel either. Built once on cp312, retested on the rest. + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # abi3audit flags the module's own PyBC7CompressBlockParamsObject global by + # its Py prefix; upstream's released aarch64 abi3 wheel exports it too. + cibw-audit-command: '' + cibw-test-extras: "tests" + cibw-test-command: "pytest {package}/tests -v" + cibw-environment-linux: "PIP_ONLY_BINARY=Pillow,numpy,scipy,PyWavelets,texture2ddecoder" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: ETCPAK_VERSION: ${{ matrix.version }} - steps: - - name: Checkout etcpak ${{ env.ETCPAK_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: K0lb3/etcpak - ref: ${{ env.ETCPAK_REF }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch etcpak source - run: git apply python-wheels/patches/etcpak/${{ env.ETCPAK_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - # setup.py tags every CPython build cp37-abi3 with no Py_GIL_DISABLED - # guard, so cp314t would hit CPython's limited-API #error; upstream ships - # no free-threaded wheel either. Built once on cp312, retested on the rest. - CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # abi3audit flags the module's own PyBC7CompressBlockParamsObject global by - # its Py prefix; upstream's released aarch64 abi3 wheel exports it too. - CIBW_AUDIT_COMMAND: '' - CIBW_TEST_EXTRAS: tests - CIBW_TEST_COMMAND: pytest {package}/tests -v - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=Pillow,numpy,scipy,PyWavelets,texture2ddecoder + name: etcpak-${{ env.ETCPAK_VERSION }}-cp37-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension and licences made it into the wheel run: | @@ -112,15 +120,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: etcpak-${{ env.ETCPAK_VERSION }}-cp37-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish etcpak ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ethos-u-vela.yml b/.github/workflows/build-ethos-u-vela.yml index 66460a6cdca9..5158f2dbabae 100644 --- a/.github/workflows/build-ethos-u-vela.yml +++ b/.github/workflows/build-ethos-u-vela.yml @@ -49,47 +49,68 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build ethos-u-vela ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 240 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - ETHOS_U_VELA_VERSION: ${{ matrix.version }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ethos-u-vela" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + pre-build: |- + export ETHOS_U_VELA_VERSION='${{ matrix.version }}' + set -euo pipefail + shopt -s dotglob + rm -rf ./* + git clone -q --depth 1 --branch "${ETHOS_U_VELA_VERSION}" https://gitlab.arm.com/artificial-intelligence/ethos-u/ethos-u-vela.git . - steps: - - name: Checkout ethos-u-vela ${{ env.ETHOS_U_VELA_VERSION }} - run: | - set -euo pipefail - shopt -s dotglob - rm -rf ./* - git clone -q --depth 1 --branch "${ETHOS_U_VELA_VERSION}" https://gitlab.arm.com/artificial-intelligence/ethos-u/ethos-u-vela.git . + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - sparse-checkout: patches/ethos-u-vela - persist-credentials: false + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" sparse-checkout init --cone + git -C "python-wheels" sparse-checkout set "patches/ethos-u-vela" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Patch ethos-u-vela source - run: | - git apply -v python-wheels/patches/ethos-u-vela/${{ env.ETHOS_U_VELA_VERSION }}/*.patch - rm -rf python-wheels + git apply -v python-wheels/patches/ethos-u-vela/${{ matrix.version }}/*.patch + rm -rf python-wheels - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py only passes -j to CMake for `build_ext --parallel`, which pip never sets. + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION=${{ matrix.version }} CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 240 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + ETHOS_U_VELA_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py only passes -j to CMake for `build_ext --parallel`, which pip never sets. - CIBW_ENVIRONMENT: >- - SETUPTOOLS_SCM_PRETEND_VERSION=${{ env.ETHOS_U_VELA_VERSION }} - CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + name: ethos-u-vela-${{ env.ETHOS_U_VELA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -103,15 +124,9 @@ jobs: assert licences == {"LICENSE.txt"} | {f"ethosu/regor/dependencies/thirdparty/{d}/LICENSE" for d in ("flatbuffers", "fmt", "gemmlowp", "pybind11")}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ethos-u-vela-${{ env.ETHOS_U_VELA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish ethos-u-vela ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-eventio.yml b/.github/workflows/build-eventio.yml index f88664a5c6b8..f8c436d86b5b 100644 --- a/.github/workflows/build-eventio.yml +++ b/.github/workflows/build-eventio.yml @@ -51,40 +51,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build eventio ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "eventio" + version: "${{ matrix.version }}" + repository: "cta-observatory/pyeventio" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,zstandard" + # The Cython extensions don't declare free-threading support, and pyproject.toml's filterwarnings=error turns 3.14t's GIL re-enable warning into collection errors (gotcha 127). + cibw-test-environment: "PYTHON_GIL=1" + cibw-test-extras: "test" + cibw-test-sources: "tests pyproject.toml" + cibw-test-command: "pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: EVENTIO_VERSION: ${{ matrix.version }} - steps: - - name: Checkout eventio v${{ env.EVENTIO_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: cta-observatory/pyeventio - ref: v${{ env.EVENTIO_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,zstandard - # The Cython extensions don't declare free-threading support, and pyproject.toml's filterwarnings=error turns 3.14t's GIL re-enable warning into collection errors (gotcha 127). - CIBW_TEST_ENVIRONMENT: PYTHON_GIL=1 - CIBW_TEST_EXTRAS: test - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_COMMAND: pytest tests + name: eventio-${{ env.EVENTIO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -95,16 +100,9 @@ jobs: assert exts == {"header", "var_int", "parsing"}, exts EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: eventio-${{ env.EVENTIO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish eventio ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-evtx.yml b/.github/workflows/build-evtx.yml index 1ca47086b199..6a7296b5aa57 100644 --- a/.github/workflows/build-evtx.yml +++ b/.github/workflows/build-evtx.yml @@ -49,6 +49,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build evtx ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + platform: ["manylinux", "musllinux"] + # pyo3's abi3-py310 feature gives one cp310-abi3 wheel, built on cp310 and + # re-tested on cp311-cp314; pyo3 drops abi3 under Py_GIL_DISABLED. + python: ["abi3", "cp314t"] + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "evtx" + version: "${{ matrix.version }}" + repository: "omerbenamram/pyevtx-rs" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + pre-build: |- + ver=$(grep -A1 '^name = "evtx"$' Cargo.lock | sed -n 's/^version = "\(.*\)"$/\1/p') + curl -sSfL "https://crates.io/api/v1/crates/evtx/${ver}/download" \ + | tar xz --strip-components=1 "evtx-${ver}/LICENSE-MIT" "evtx-${ver}/LICENSE-APACHE" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python == 'abi3' && 'cp31?' || matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "tests samples python/evtx/__init__.py" + cibw-test-command: "python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv # musllinux's static-libc Rust link takes markedly longer than manylinux's # on this runner (observed ~2h, right at the old 120-minute ceiling). @@ -61,40 +99,14 @@ jobs: # pyo3's abi3-py310 feature gives one cp310-abi3 wheel, built on cp310 and # re-tested on cp311-cp314; pyo3 drops abi3 under Py_GIL_DISABLED. python: ["abi3", "cp314t"] - env: EVTX_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyevtx-rs ${{ env.EVTX_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: omerbenamram/pyevtx-rs - ref: ${{ env.EVTX_VERSION }} - persist-credentials: false - - # pyevtx-rs has no licence file; the wheel statically links the evtx crate - # (same author, MIT OR Apache-2.0), so ship that crate's licence texts. - - name: Stage the evtx crate's licence texts - run: | - ver=$(grep -A1 '^name = "evtx"$' Cargo.lock | sed -n 's/^version = "\(.*\)"$/\1/p') - curl -sSfL "https://crates.io/api/v1/crates/evtx/${ver}/download" \ - | tar xz --strip-components=1 "evtx-${ver}/LICENSE-MIT" "evtx-${ver}/LICENSE-APACHE" - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_BUILD: ${{ matrix.python == 'abi3' && 'cp31?' || matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests samples python/evtx/__init__.py - CIBW_TEST_COMMAND: python -m pytest tests + name: evtx-${{ env.EVTX_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -108,12 +120,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: evtx-${{ env.EVTX_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -148,7 +154,7 @@ jobs: publish: name: Publish evtx ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-executorch.yml b/.github/workflows/build-executorch.yml index ca4eeee5e5b2..3f4e06797034 100644 --- a/.github/workflows/build-executorch.yml +++ b/.github/workflows/build-executorch.yml @@ -55,170 +55,162 @@ jobs: matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} name: Build executorch ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "executorch" + version: "${{ matrix.version }}" + repository: "pytorch/executorch" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 720 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/executorch/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + set -euo pipefail + cp backends/xnnpack/third-party/FP16/LICENSE LICENSE.FP16 + cp backends/xnnpack/third-party/FXdiv/LICENSE LICENSE.FXdiv + cp backends/xnnpack/third-party/XNNPACK/LICENSE LICENSE.XNNPACK + cp backends/xnnpack/third-party/cpuinfo/LICENSE LICENSE.cpuinfo + cp backends/xnnpack/third-party/pthreadpool/LICENSE LICENSE.pthreadpool + cp third-party/flatbuffers/LICENSE LICENSE.flatbuffers + cp third-party/flatcc/LICENSE LICENSE.flatcc + cp kernels/optimized/third-party/eigen/LICENSE LICENSE.eigen + cp third-party/pocketfft/LICENSE.md LICENSE.pocketfft + cp third-party/json/LICENSE.MIT LICENSE.json + cp third-party/pybind11/LICENSE LICENSE.pybind11 + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cat > riscv64_smoke_test.py <<'EOF' + import platform + + import torch + from torch.export import export + + from executorch.backends.xnnpack.partition.xnnpack_partitioner import ( + XnnpackPartitioner, + ) + from executorch.exir import to_edge, to_edge_transform_and_lower + from executorch.extension.pybindings.portable_lib import ( + _get_registered_backend_names, + _load_for_executorch_from_buffer, + ) + + registered = _get_registered_backend_names() + assert "XnnpackBackend" in registered, registered + assert "OpenvinoBackend" in registered, registered + if platform.machine() in ("x86_64", "amd64"): + assert "QnnBackend" in registered, registered + + + class Model(torch.nn.Module): + def __init__(self): + super().__init__() + self.linear = torch.nn.Linear(4, 4) + + def forward(self, x): + return self.linear(x).relu() + + + model = Model().eval() + example_inputs = (torch.randn(2, 4),) + expected = model(*example_inputs) + + portable_prog = to_edge(export(model, example_inputs, strict=True)).to_executorch() + portable_module = _load_for_executorch_from_buffer(portable_prog.buffer) + portable_out = portable_module.forward(example_inputs)[0] + assert torch.allclose(portable_out, expected, atol=1e-4), (portable_out, expected) + print("portable (non-delegated) execution OK") + + xnnpack_prog = to_edge_transform_and_lower( + export(model, example_inputs, strict=True), + partitioner=[XnnpackPartitioner()], + ).to_executorch() + xnnpack_module = _load_for_executorch_from_buffer(xnnpack_prog.buffer) + xnnpack_out = xnnpack_module.forward(example_inputs)[0] + assert torch.allclose(xnnpack_out, expected, atol=1e-4), (xnnpack_out, expected) + print("XNNPACK-delegated execution OK") + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # No riscv64 cmake wheel exists, so pip builds it from source as a + # build dependency; its own CMake bootstrap needs OpenSSL's dev + # headers to find libcrypto. + cibw-before-all-linux: "dnf -y install openssl-devel" + # get_torch_base_path (tools/cmake/Utils.cmake) runs `import torch` in + # the same interpreter as the build backend to add it to + # CMAKE_PREFIX_PATH, but torch is only a runtime dependency + # (setup.py), not a build-system.requires entry, so PEP 517 isolation + # hides it from that interpreter. Preinstall build-system.requires + # plus torch and turn isolation off (mirrors build-torchaudio.yml / + # build-torchcodec.yml). + cibw-build-frontend: "pip; args: --no-build-isolation" + # torch_pin.py pins TORCH_VERSION="2.13.0": this CMake build compiles + # against the installed torch's real headers alongside executorch's own + # vendored, 2.13.0-frozen copy of them (runtime/core/portable_type/c10), + # so an unbounded floor (setup.py's own unpinned "torch>=2.13.0a0") lets + # pip resolve a newer registry release whose headers conflict with the + # vendored ones in the same translation unit (gotcha 615). + cibw-before-build: "pip install \"cmake>=3.24,<4.0.0\" \"packaging>=24.2\" pyyaml \"setuptools>=77.0.3\" wheel zstd certifi && pip install --only-binary=:all: \"torch==2.13.0\"" + # Without BUILD_VERSION, setup.py appends + to version.txt + # (mirrors build-torchaudio.yml / build-torchcodec.yml). + # XNNPACK's rvvfp16arith microkernels are assembled with -march=..._zvfh, which + # the image's binutils 2.41 rejects (zvfh landed in 2.42; gotcha 420), so the + # fp16 vector family is switched off; plain RVV stays enabled. The XNNPACK + # pinned by 1.5.x has these kernels, 1.4.1's does not and ignores the option. + cibw-environment-linux: "BUILD_VERSION=${{ matrix.version }} CMAKE_BUILD_PARALLEL_LEVEL=8 CMAKE_ARGS=\"-DXNNPACK_ENABLE_RISCV_FP16_VECTOR=OFF\"" + # The torch wheel already carries these and loads them RTLD_GLOBAL (gotcha 17). + cibw-repair-wheel-command: "auditwheel repair -w {dest_dir} {wheel} --exclude libtorch.so --exclude libtorch_cpu.so --exclude libtorch_python.so --exclude libtorch_global_deps.so --exclude libc10.so --exclude libgomp.so.1 --exclude libgfortran.so.5 --exclude libopenblas.so.0" + # The test install of the executorch wheel pulls pandas as a dependency; + # PyPI's newest pandas has no riscv64 wheel and its sdist fails to build + # (meson/xsimd), so install pandas wheel-only, with the registry's + # riscv64 wheels visible, and let pip back off to a release that has one. + cibw-test-environment: "PIP_ONLY_BINARY=pandas" + # Match the build-time pin (gotcha 615): the wheel's own metadata still + # says "torch>=2.13.0a0", so without this the test install would resolve + # a newer torch than the extension was actually compiled against. + cibw-test-requires: "torch==2.13.0" + cibw-test-sources: "riscv64_smoke_test.py" + cibw-test-command: "python -X faulthandler riscv64_smoke_test.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 720 - + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: EXECUTORCH_VERSION: ${{ matrix.version }} - steps: - - name: Checkout executorch v${{ env.EXECUTORCH_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pytorch/executorch - ref: v${{ env.EXECUTORCH_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/executorch/${{ env.EXECUTORCH_VERSION }}/*.patch - - # Every library below is statically linked into the compiled extensions, and - # setuptools' license-files (widened by the patch above) only reaches the - # project root. - - name: Stage the vendored licences - run: | - set -euo pipefail - cp backends/xnnpack/third-party/FP16/LICENSE LICENSE.FP16 - cp backends/xnnpack/third-party/FXdiv/LICENSE LICENSE.FXdiv - cp backends/xnnpack/third-party/XNNPACK/LICENSE LICENSE.XNNPACK - cp backends/xnnpack/third-party/cpuinfo/LICENSE LICENSE.cpuinfo - cp backends/xnnpack/third-party/pthreadpool/LICENSE LICENSE.pthreadpool - cp third-party/flatbuffers/LICENSE LICENSE.flatbuffers - cp third-party/flatcc/LICENSE LICENSE.flatcc - cp kernels/optimized/third-party/eigen/LICENSE LICENSE.eigen - cp third-party/pocketfft/LICENSE.md LICENSE.pocketfft - cp third-party/json/LICENSE.MIT LICENSE.json - cp third-party/pybind11/LICENSE LICENSE.pybind11 - - # Upstream's own smoke test (.ci/scripts/wheel/test_linux.py) exercises the - # examples/ tree, which needs torchvision for its MobileNetV3 model; - # torchvision has no riscv64 wheel. This test keeps upstream's own - # assertions (registered backend names) and replaces the model with a small - # hand-built one, run through both the portable (non-delegated) path and a - # real XNNPACK-delegated export, so the compiled extension, the portable - # kernels and the XNNPACK backend are all genuinely exercised end to end. - - name: Write the riscv64 smoke test - run: | - cat > riscv64_smoke_test.py <<'EOF' - import platform - - import torch - from torch.export import export - - from executorch.backends.xnnpack.partition.xnnpack_partitioner import ( - XnnpackPartitioner, - ) - from executorch.exir import to_edge, to_edge_transform_and_lower - from executorch.extension.pybindings.portable_lib import ( - _get_registered_backend_names, - _load_for_executorch_from_buffer, - ) - - registered = _get_registered_backend_names() - assert "XnnpackBackend" in registered, registered - assert "OpenvinoBackend" in registered, registered - if platform.machine() in ("x86_64", "amd64"): - assert "QnnBackend" in registered, registered - - - class Model(torch.nn.Module): - def __init__(self): - super().__init__() - self.linear = torch.nn.Linear(4, 4) - - def forward(self, x): - return self.linear(x).relu() - - - model = Model().eval() - example_inputs = (torch.randn(2, 4),) - expected = model(*example_inputs) - - portable_prog = to_edge(export(model, example_inputs, strict=True)).to_executorch() - portable_module = _load_for_executorch_from_buffer(portable_prog.buffer) - portable_out = portable_module.forward(example_inputs)[0] - assert torch.allclose(portable_out, expected, atol=1e-4), (portable_out, expected) - print("portable (non-delegated) execution OK") - - xnnpack_prog = to_edge_transform_and_lower( - export(model, example_inputs, strict=True), - partitioner=[XnnpackPartitioner()], - ).to_executorch() - xnnpack_module = _load_for_executorch_from_buffer(xnnpack_prog.buffer) - xnnpack_out = xnnpack_module.forward(example_inputs)[0] - assert torch.allclose(xnnpack_out, expected, atol=1e-4), (xnnpack_out, expected) - print("XNNPACK-delegated execution OK") - EOF - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # No riscv64 cmake wheel exists, so pip builds it from source as a - # build dependency; its own CMake bootstrap needs OpenSSL's dev - # headers to find libcrypto. - CIBW_BEFORE_ALL_LINUX: dnf -y install openssl-devel - # get_torch_base_path (tools/cmake/Utils.cmake) runs `import torch` in - # the same interpreter as the build backend to add it to - # CMAKE_PREFIX_PATH, but torch is only a runtime dependency - # (setup.py), not a build-system.requires entry, so PEP 517 isolation - # hides it from that interpreter. Preinstall build-system.requires - # plus torch and turn isolation off (mirrors build-torchaudio.yml / - # build-torchcodec.yml). - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - # torch_pin.py pins TORCH_VERSION="2.13.0": this CMake build compiles - # against the installed torch's real headers alongside executorch's own - # vendored, 2.13.0-frozen copy of them (runtime/core/portable_type/c10), - # so an unbounded floor (setup.py's own unpinned "torch>=2.13.0a0") lets - # pip resolve a newer registry release whose headers conflict with the - # vendored ones in the same translation unit (gotcha 615). - CIBW_BEFORE_BUILD: >- - pip install "cmake>=3.24,<4.0.0" "packaging>=24.2" pyyaml - "setuptools>=77.0.3" wheel zstd certifi && - pip install --only-binary=:all: "torch==2.13.0" - # Without BUILD_VERSION, setup.py appends + to version.txt - # (mirrors build-torchaudio.yml / build-torchcodec.yml). - # XNNPACK's rvvfp16arith microkernels are assembled with -march=..._zvfh, which - # the image's binutils 2.41 rejects (zvfh landed in 2.42; gotcha 420), so the - # fp16 vector family is switched off; plain RVV stays enabled. The XNNPACK - # pinned by 1.5.x has these kernels, 1.4.1's does not and ignores the option. - CIBW_ENVIRONMENT: >- - BUILD_VERSION=${{ env.EXECUTORCH_VERSION }} - CMAKE_BUILD_PARALLEL_LEVEL=8 - CMAKE_ARGS="-DXNNPACK_ENABLE_RISCV_FP16_VECTOR=OFF" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # The torch wheel already carries these and loads them RTLD_GLOBAL (gotcha 17). - CIBW_REPAIR_WHEEL_COMMAND: >- - auditwheel repair -w {dest_dir} {wheel} - --exclude libtorch.so - --exclude libtorch_cpu.so - --exclude libtorch_python.so - --exclude libtorch_global_deps.so - --exclude libc10.so - --exclude libgomp.so.1 - --exclude libgfortran.so.5 - --exclude libopenblas.so.0 - # The test install of the executorch wheel pulls pandas as a dependency; - # PyPI's newest pandas has no riscv64 wheel and its sdist fails to build - # (meson/xsimd), so install pandas wheel-only, with the registry's - # riscv64 wheels visible, and let pip back off to a release that has one. - CIBW_TEST_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=pandas - # Match the build-time pin (gotcha 615): the wheel's own metadata still - # says "torch>=2.13.0a0", so without this the test install would resolve - # a newer torch than the extension was actually compiled against. - CIBW_TEST_REQUIRES: torch==2.13.0 - CIBW_TEST_SOURCES: riscv64_smoke_test.py - CIBW_TEST_COMMAND: python -X faulthandler riscv64_smoke_test.py + name: executorch-${{ env.EXECUTORCH_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extensions and the vendored licences made it into the wheel run: | @@ -241,15 +233,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: executorch-${{ env.EXECUTORCH_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish executorch ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-exp-gateway-native.yml b/.github/workflows/build-exp-gateway-native.yml index 2fc17a77fd07..053470378833 100644 --- a/.github/workflows/build-exp-gateway-native.yml +++ b/.github/workflows/build-exp-gateway-native.yml @@ -52,6 +52,119 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build exp-gateway-native ${{ matrix.version }} cp312-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "exp-gateway-native" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "cp312-manylinux_riscv64" + timeout-minutes: 360 + pre-build: |- + export EXP_GATEWAY_NATIVE_VERSION='${{ matrix.version }}' + set -euo pipefail + url="$(curl -sSfL "https://pypi.org/pypi/exp-gateway-native/${EXP_GATEWAY_NATIVE_VERSION}/json" \ + | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" + curl -sSfL -o sdist.tar.gz "$url" + tar xzf sdist.tar.gz + mv "exp_gateway_native-${EXP_GATEWAY_NATIVE_VERSION}" pkg + test -f pkg/pyproject.toml + test -f pkg/Cargo.lock + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + mkdir -p pkg/tests + cat > pkg/tests/test_exp_gateway_native.py <<'PYTEST' + """Smoke tests for the riscv64 exp-gateway-native wheel. + + Upstream ships no Python test suite, so these exercise the compiled + PyO3 extension directly: the module-level helpers and the + dependency-free RegexDetector/CaptureResponse/fixture encoders that + need no running server or control-plane callback. + """ + + import json + + import exp_gateway_native as egn + + + def test_extension_module_is_compiled(): + from exp_gateway_native import exp_gateway_native as ext + + assert ext.__file__.endswith(".so"), ext.__file__ + + + def test_metrics_snapshot_json(): + snapshot = json.loads(egn.metrics_snapshot_json()) + assert isinstance(snapshot, dict) + + + def test_regex_detector_matches_and_redacts(): + spec = json.dumps({"patterns": [r"\d{3}-\d{2}-\d{4}"], "replacement": "[redacted]"}) + detector = egn.RegexDetector(spec) + assert detector.matches("ssn 123-45-6789 on file") + assert not detector.matches("no match here") + assert detector.redact("ssn 123-45-6789 on file") == "ssn [redacted] on file" + assert detector.redact("no match here") is None + + + def test_capture_response_round_trip(): + body = json.dumps({"id": "resp_1", "object": "response", "status": "completed"}).encode() + response = egn.CaptureResponse("responses", body, False) + assert response.completed is True + assert json.loads(response.body_json)["id"] == "resp_1" + assert response.events_json is None + + + def test_execution_bindings_register_and_remove(): + bindings = egn.ExecutionBindings(capacity=8) + bindings.remove("absent-token") + + + def test_failure_public_error_fixture(): + encoded = json.loads(egn.failure_public_error_fixture("throttled", "slow down")) + assert encoded["code"] == "unavailable_route" + assert encoded["message"] == "slow down" + + + def test_normalize_stream_fixture_rejects_unknown_dialect(): + try: + egn.normalize_stream_fixture("not-a-real-dialect", "[]") + except Exception as exc: + assert "dialect" in str(exc).lower() or "not-a-real-dialect" in str(exc) + else: + raise AssertionError("expected normalize_stream_fixture to reject an unknown dialect") + PYTEST + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "pkg" + # pyo3 abi3-py312 (Cargo.toml), matching upstream's own single + # wheel per platform for every 3.12+ interpreter. + cibw-build: "cp312-manylinux_riscv64" + # No [tool.cibuildwheel] table upstream, so the Rust toolchain the + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "pkg/tests" + cibw-test-command: "python -m pytest -v pkg/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv # axum/tokio/reqwest/rustls/rusqlite(bundled)/symphonia pull a large crate # graph into the cdylib; sase-core-rs's sase_gateway alone needed ~20 min @@ -61,105 +174,14 @@ jobs: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: EXP_GATEWAY_NATIVE_VERSION: ${{ matrix.version }} - steps: - - name: Fetch exp-gateway-native ${{ env.EXP_GATEWAY_NATIVE_VERSION }} sdist - run: | - set -euo pipefail - url="$(curl -sSfL "https://pypi.org/pypi/exp-gateway-native/${EXP_GATEWAY_NATIVE_VERSION}/json" \ - | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" - curl -sSfL -o sdist.tar.gz "$url" - tar xzf sdist.tar.gz - mv "exp_gateway_native-${EXP_GATEWAY_NATIVE_VERSION}" pkg - test -f pkg/pyproject.toml - test -f pkg/Cargo.lock - - - name: Stage smoke tests - run: | - mkdir -p pkg/tests - cat > pkg/tests/test_exp_gateway_native.py <<'PYTEST' - """Smoke tests for the riscv64 exp-gateway-native wheel. - - Upstream ships no Python test suite, so these exercise the compiled - PyO3 extension directly: the module-level helpers and the - dependency-free RegexDetector/CaptureResponse/fixture encoders that - need no running server or control-plane callback. - """ - - import json - - import exp_gateway_native as egn - - - def test_extension_module_is_compiled(): - from exp_gateway_native import exp_gateway_native as ext - - assert ext.__file__.endswith(".so"), ext.__file__ - - - def test_metrics_snapshot_json(): - snapshot = json.loads(egn.metrics_snapshot_json()) - assert isinstance(snapshot, dict) - - - def test_regex_detector_matches_and_redacts(): - spec = json.dumps({"patterns": [r"\d{3}-\d{2}-\d{4}"], "replacement": "[redacted]"}) - detector = egn.RegexDetector(spec) - assert detector.matches("ssn 123-45-6789 on file") - assert not detector.matches("no match here") - assert detector.redact("ssn 123-45-6789 on file") == "ssn [redacted] on file" - assert detector.redact("no match here") is None - - - def test_capture_response_round_trip(): - body = json.dumps({"id": "resp_1", "object": "response", "status": "completed"}).encode() - response = egn.CaptureResponse("responses", body, False) - assert response.completed is True - assert json.loads(response.body_json)["id"] == "resp_1" - assert response.events_json is None - - - def test_execution_bindings_register_and_remove(): - bindings = egn.ExecutionBindings(capacity=8) - bindings.remove("absent-token") - - - def test_failure_public_error_fixture(): - encoded = json.loads(egn.failure_public_error_fixture("throttled", "slow down")) - assert encoded["code"] == "unavailable_route" - assert encoded["message"] == "slow down" - - - def test_normalize_stream_fixture_rejects_unknown_dialect(): - try: - egn.normalize_stream_fixture("not-a-real-dialect", "[]") - except Exception as exc: - assert "dialect" in str(exc).lower() or "not-a-real-dialect" in str(exc) - else: - raise AssertionError("expected normalize_stream_fixture to reject an unknown dialect") - PYTEST - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: pkg - output-dir: wheelhouse/ - # pyo3 abi3-py312 (Cargo.toml), matching upstream's own single - # wheel per platform for every 3.12+ interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # No [tool.cibuildwheel] table upstream, so the Rust toolchain the - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: pkg/tests - CIBW_TEST_COMMAND: python -m pytest -v pkg/tests + name: exp-gateway-native-${{ env.EXP_GATEWAY_NATIVE_VERSION }}-cp312-manylinux_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extension run: | @@ -171,15 +193,9 @@ jobs: print("extension:", sos[0]) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: exp-gateway-native-${{ env.EXP_GATEWAY_NATIVE_VERSION }}-cp312-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish exp-gateway-native ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ezdxf.yml b/.github/workflows/build-ezdxf.yml index e2a98471b419..92e31e145853 100644 --- a/.github/workflows/build-ezdxf.yml +++ b/.github/workflows/build-ezdxf.yml @@ -65,9 +65,7 @@ jobs: cibw-before-build: pip install setuptools wheel cython # Only our registry has numpy and Pillow wheels for riscv64; only-binary keeps a # newer PyPI release from winning the resolution and compiling from sdist. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,Pillow + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,Pillow" cibw-test-requires: pytest Pillow # setup.py marks every Cython module optional, so a compile failure is # swallowed and the wheel silently ships the pure-Python fallback. diff --git a/.github/workflows/build-faiss-cpu.yml b/.github/workflows/build-faiss-cpu.yml index 4aba318ed96b..97328d0fdde0 100644 --- a/.github/workflows/build-faiss-cpu.yml +++ b/.github/workflows/build-faiss-cpu.yml @@ -54,38 +54,46 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build faiss-cpu ${{ matrix.version }} cp310-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "faiss-cpu" + version: "${{ matrix.version }}" + repository: "facebookresearch/faiss" + ref: "v${{ matrix.version }}" + artifact-tag: "cp310-abi3-manylinux_riscv64" + timeout-minutes: 600 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/faiss-cpu/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-manylinux_riscv64" + # numpy (build and test), scipy and swig have no riscv64 wheels on PyPI. + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 600 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: FAISS_CPU_VERSION: ${{ matrix.version }} - steps: - - name: Checkout faiss v${{ env.FAISS_CPU_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: facebookresearch/faiss - ref: v${{ env.FAISS_CPU_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch faiss source - run: git apply python-wheels/patches/faiss-cpu/${{ env.FAISS_CPU_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy (build and test), scipy and swig have no riscv64 wheels on PyPI. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + name: faiss-cpu-${{ env.FAISS_CPU_VERSION }}-cp310-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the wheel is a compiled abi3 wheel run: | @@ -99,12 +107,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: faiss-cpu-${{ env.FAISS_CPU_VERSION }}-cp310-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -140,7 +142,7 @@ jobs: publish: name: Publish faiss-cpu ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fast-histogram.yml b/.github/workflows/build-fast-histogram.yml index ba6ab0f23771..1458c697af7d 100644 --- a/.github/workflows/build-fast-histogram.yml +++ b/.github/workflows/build-fast-histogram.yml @@ -53,46 +53,46 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build fast-histogram ${{ matrix.version }} cp39-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fast-histogram" + version: "${{ matrix.version }}" + repository: "astrofrog/fast-histogram" + ref: "v${{ matrix.version }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + # setup.cfg pins `[bdist_wheel] py_limited_api = cp39` unconditionally, + # so one abi3 wheel serves every interpreter it claims; upstream + # publishes no free-threaded (cp314t) wheel -- and building under one + # would fail outright, since setuptools rejects py_limited_api under + # Py_GIL_DISABLED -- so there is no second job here. + # Built on cp39 -- the oldest interpreter the abi3 tag claims -- and + # re-tested on the newer ones via find_compatible_wheel. + cibw-build: "cp39-manylinux_riscv64 cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # numpy is both a build and a runtime requirement, and only our + # registry has it for riscv64; only-binary keeps a newer PyPI release + # from winning the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest hypothesis[numpy]" + # Mirrors upstream's own wheel test command (main.yml's publish job). + cibw-test-command: "python -m pytest --pyargs fast_histogram -m \"not hypothesis\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: FAST_HISTOGRAM_VERSION: ${{ matrix.version }} - steps: - - name: Checkout fast-histogram v${{ env.FAST_HISTOGRAM_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: astrofrog/fast-histogram - ref: v${{ env.FAST_HISTOGRAM_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # setup.cfg pins `[bdist_wheel] py_limited_api = cp39` unconditionally, - # so one abi3 wheel serves every interpreter it claims; upstream - # publishes no free-threaded (cp314t) wheel -- and building under one - # would fail outright, since setuptools rejects py_limited_api under - # Py_GIL_DISABLED -- so there is no second job here. - # Built on cp39 -- the oldest interpreter the abi3 tag claims -- and - # re-tested on the newer ones via find_compatible_wheel. - CIBW_BUILD: >- - cp39-manylinux_riscv64 cp310-manylinux_riscv64 - cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is both a build and a runtime requirement, and only our - # registry has it for riscv64; only-binary keeps a newer PyPI release - # from winning the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest hypothesis[numpy] - # Mirrors upstream's own wheel test command (main.yml's publish job). - CIBW_TEST_COMMAND: python -m pytest --pyargs fast_histogram -m "not hypothesis" + name: fast-histogram-${{ env.FAST_HISTOGRAM_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -105,16 +105,9 @@ jobs: print(whl, "ok") EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fast-histogram-${{ env.FAST_HISTOGRAM_VERSION }}-cp39-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish fast-histogram ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fast-simplification.yml b/.github/workflows/build-fast-simplification.yml index 9964f46411a0..7b6c853ea8bc 100644 --- a/.github/workflows/build-fast-simplification.yml +++ b/.github/workflows/build-fast-simplification.yml @@ -49,36 +49,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build fast-simplification ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fast-simplification" + version: "${{ matrix.version }}" + repository: "pyvista/fast-simplification" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # pyvista (and the VTK it wraps) has no riscv64 wheel; the suite's own + # has_vtk guard skips every test that needs it when pyvista is absent. + cibw-test-requires: "pytest" + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: FAST_SIMPLIFICATION_VERSION: ${{ matrix.version }} - steps: - - name: Checkout fast-simplification v${{ env.FAST_SIMPLIFICATION_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pyvista/fast-simplification - ref: v${{ env.FAST_SIMPLIFICATION_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # pyvista (and the VTK it wraps) has no riscv64 wheel; the suite's own - # has_vtk guard skips every test that needs it when pyvista is absent. - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy + name: fast-simplification-${{ env.FAST_SIMPLIFICATION_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -93,15 +99,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fast-simplification-${{ env.FAST_SIMPLIFICATION_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish fast-simplification ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fastavro.yml b/.github/workflows/build-fastavro.yml index d95185978fa8..6c7ce69b2b11 100644 --- a/.github/workflows/build-fastavro.yml +++ b/.github/workflows/build-fastavro.yml @@ -49,6 +49,54 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build fastavro ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # Per-interpreter (not abi3), matching upstream's own wheel matrix. + # `test_requires` varies because 3.14 has zstd in the stdlib and the + # registry ships no free-threaded pandas wheel. + include: + - python: "cp312" + test_requires: "backports.zstd pandas<3.0.4" + pytest_k: "" + - python: "cp313" + test_requires: "backports.zstd pandas<3.0.4" + pytest_k: "" + - python: "cp314" + test_requires: "pandas<3.0.4" + pytest_k: "" + - python: "cp314t" + test_requires: "" + pytest_k: "and not test_pandas_datetime" + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fastavro" + version: "${{ matrix.version }}" + repository: "fastavro/fastavro" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + timeout-minutes: 180 + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + # cramjam (the snappy codec the suite needs) has no riscv64 wheel and + # builds from its maturin sdist, so Rust has to be in the container. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # Upstream tests the checkout, not the wheel; stage only the suite so the + # repo-root `fastavro/` can't shadow the installed extension modules. + cibw-test-sources: "tests pytest.ini" + cibw-test-requires: "pytest numpy lz4 zlib_ng cramjam ${{ matrix.test_requires }}" + # is_testing_cython_modules() is upstream's own check that the compiled + # modules, not the pure-Python fallback, are in use. + # test_regular_vs_ordered_dict_record_typeerror asserts on a traceback + # source line, so it only passes next to the .pyx sources of an in-place + # build; it fails against any installed wheel, on every architecture. + cibw-test-command: "python -c \"from tests.conftest import is_testing_cython_modules as c; assert c()\" && python -m pytest tests -k \"not test_regular_vs_ordered_dict_record_typeerror ${{ matrix.pytest_k }}\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: @@ -71,45 +119,14 @@ jobs: - python: "cp314t" test_requires: "" pytest_k: "and not test_pandas_datetime" - env: FASTAVRO_VERSION: ${{ matrix.version }} - steps: - - name: Checkout fastavro ${{ env.FASTAVRO_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: fastavro/fastavro - ref: ${{ env.FASTAVRO_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cramjam (the snappy codec the suite needs) has no riscv64 wheel and - # builds from its maturin sdist, so Rust has to be in the container. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream tests the checkout, not the wheel; stage only the suite so the - # repo-root `fastavro/` can't shadow the installed extension modules. - CIBW_TEST_SOURCES: tests pytest.ini - CIBW_TEST_REQUIRES: pytest numpy lz4 zlib_ng cramjam ${{ matrix.test_requires }} - # is_testing_cython_modules() is upstream's own check that the compiled - # modules, not the pure-Python fallback, are in use. - # test_regular_vs_ordered_dict_record_typeerror asserts on a traceback - # source line, so it only passes next to the .pyx sources of an in-place - # build; it fails against any installed wheel, on every architecture. - CIBW_TEST_COMMAND: >- - python -c "from tests.conftest import is_testing_cython_modules as c; assert c()" - && python -m pytest tests - -k "not test_regular_vs_ordered_dict_record_typeerror ${{ matrix.pytest_k }}" + name: fastavro-${{ env.FASTAVRO_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Check the Cython extensions made it into the wheel run: | @@ -126,15 +143,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fastavro-${{ env.FASTAVRO_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish fastavro ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fastcluster.yml b/.github/workflows/build-fastcluster.yml index 617f50f99d6d..4be397573a4f 100644 --- a/.github/workflows/build-fastcluster.yml +++ b/.github/workflows/build-fastcluster.yml @@ -61,9 +61,7 @@ jobs: # has it for riscv64; only-binary keeps a newer PyPI release from winning # the resolution and then compiling from sdist. scipy is test-only, same # registry-only situation. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy" # Upstream's own test job: pytest against the bundled tests/, with scipy # available for the reference distance computations. cibw-test-requires: pytest scipy>=1.15 diff --git a/.github/workflows/build-fastecdsa.yml b/.github/workflows/build-fastecdsa.yml index 1f987c788bec..fd83ed9219f6 100644 --- a/.github/workflows/build-fastecdsa.yml +++ b/.github/workflows/build-fastecdsa.yml @@ -48,47 +48,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build fastecdsa ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fastecdsa" + version: "${{ matrix.version }}" + repository: "AntonKueltz/fastecdsa" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # v4.0.0 rewrote the extension in Rust (maturin, pyo3); it ships no + # [tool.cibuildwheel], so the Rust toolchain its build backend needs is + # installed in-container here and put on PATH for the build (same + # pattern as build-fastuuid.yml). No more GMP: the new fastecdsa-rs-core + # crate is pure Rust (crypto-bigint/num-bigint), so there is nothing left + # to auditwheel-vendor and no extra CFLAGS/LDFLAGS to set. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # pyproject.toml is deliberately left unstaged: its addopts demand pytest-cov + # and its pythonpath would import the checkout instead of the wheel. + cibw-test-sources: "tests" + # tests/wycheproof/*.py and the point-at-infinity/ed25519/ed448 tests + # import parameterized directly; upstream's own pyproject.toml test + # extra lists it but CIBW_TEST_REQUIRES doesn't inherit extras. + cibw-test-requires: "pytest parameterized" + cibw-test-command: "python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: FASTECDSA_VERSION: ${{ matrix.version }} - steps: - - name: Checkout fastecdsa v${{ env.FASTECDSA_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: AntonKueltz/fastecdsa - ref: v${{ env.FASTECDSA_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # v4.0.0 rewrote the extension in Rust (maturin, pyo3); it ships no - # [tool.cibuildwheel], so the Rust toolchain its build backend needs is - # installed in-container here and put on PATH for the build (same - # pattern as build-fastuuid.yml). No more GMP: the new fastecdsa-rs-core - # crate is pure Rust (crypto-bigint/num-bigint), so there is nothing left - # to auditwheel-vendor and no extra CFLAGS/LDFLAGS to set. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' - # pyproject.toml is deliberately left unstaged: its addopts demand pytest-cov - # and its pythonpath would import the checkout instead of the wheel. - CIBW_TEST_SOURCES: tests - # tests/wycheproof/*.py and the point-at-infinity/ed25519/ed448 tests - # import parameterized directly; upstream's own pyproject.toml test - # extra lists it but CIBW_TEST_REQUIRES doesn't inherit extras. - CIBW_TEST_REQUIRES: pytest parameterized - CIBW_TEST_COMMAND: python -m pytest tests + name: fastecdsa-${{ env.FASTECDSA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and licence made it into the wheel run: | @@ -102,15 +107,9 @@ jobs: print(sorted(sos), sorted(lic)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fastecdsa-${{ env.FASTECDSA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish fastecdsa ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-faster-coco-eval.yml b/.github/workflows/build-faster-coco-eval.yml index c0d1a9e4db1f..908db12925a8 100644 --- a/.github/workflows/build-faster-coco-eval.yml +++ b/.github/workflows/build-faster-coco-eval.yml @@ -59,9 +59,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # numpy is both a build and a runtime requirement, and only our # registry has it for riscv64. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" # Mirrors upstream's own unittest.yml (`pip install # "[tests]"` + `pytest`); the `tests` extra's # `pycocotools ; python_version < "3.13"` marker keeps it off diff --git a/.github/workflows/build-faster-eth-abi.yml b/.github/workflows/build-faster-eth-abi.yml index 12a8fe3df8b2..bb3140bafa05 100644 --- a/.github/workflows/build-faster-eth-abi.yml +++ b/.github/workflows/build-faster-eth-abi.yml @@ -57,7 +57,6 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test cibw-test-sources: tests pyproject.toml # Upstream tests via tox (tox.ini core/wheel envs), not in cibuildwheel; the import assert catches a pure-Python wheel. diff --git a/.github/workflows/build-fastnumbers.yml b/.github/workflows/build-fastnumbers.yml index 9fb8227092b3..cc20ea89983e 100644 --- a/.github/workflows/build-fastnumbers.yml +++ b/.github/workflows/build-fastnumbers.yml @@ -49,40 +49,43 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build fastnumbers ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fastnumbers" + version: "${{ matrix.version }}" + repository: "SethMMorton/fastnumbers" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy has no riscv64 wheel on public PyPI. + # PyPI's newest hypothesis has no riscv64 wheel (maturin sdist, needs Rust); + # pin to binary-only so pip resolves our registry's riscv64 wheel instead + # of the newer sdist-only release (gotcha 210). + cibw-test-environment: "PIP_ONLY_BINARY=hypothesis" + cibw-test-requires: "pytest pytest-faulthandler hypothesis typing_extensions numpy" + cibw-test-command: "cd {project} && pytest --hypothesis-profile=standard --doctest-glob=README.rst" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: FASTNUMBERS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout fastnumbers ${{ env.FASTNUMBERS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: SethMMorton/fastnumbers - ref: ${{ env.FASTNUMBERS_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy has no riscv64 wheel on public PyPI. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # PyPI's newest hypothesis has no riscv64 wheel (maturin sdist, needs Rust); - # pin to binary-only so pip resolves our registry's riscv64 wheel instead - # of the newer sdist-only release (gotcha 210). - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=hypothesis - CIBW_TEST_REQUIRES: pytest pytest-faulthandler hypothesis typing_extensions numpy - CIBW_TEST_COMMAND: >- - cd {project} && - pytest --hypothesis-profile=standard --doctest-glob=README.rst + name: fastnumbers-${{ env.FASTNUMBERS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C++ extension made it into the wheel run: | @@ -94,15 +97,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fastnumbers-${{ env.FASTNUMBERS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish fastnumbers ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fastokens.yml b/.github/workflows/build-fastokens.yml index ffb9075441b6..cecdf396da75 100644 --- a/.github/workflows/build-fastokens.yml +++ b/.github/workflows/build-fastokens.yml @@ -51,70 +51,75 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build fastokens ${{ matrix.version }} cp39-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fastokens" + version: "${{ matrix.version }}" + repository: "Atero-ai/fastokens" + ref: "v${{ matrix.version }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 360 + pre-build: |- + export FASTOKENS_VERSION='${{ matrix.version }}' + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + patches="$PWD/python-wheels/patches/fastokens/${FASTOKENS_VERSION}" + if [ -d "$patches" ]; then + git apply -v "$patches"/*.patch + fi + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # pyo3's abi3-py39 feature is on unconditionally (python/Cargo.toml), so one + # cp39-abi3 wheel serves every GIL-ful interpreter; upstream ships no + # free-threaded wheel because abi3 and Py_GIL_DISABLED only meet on 3.14+. + # cibuildwheel compiles once on cp39 -- the oldest interpreter the tag claims + # -- and re-tests that wheel on the newer ones. musllinux is dropped: + # rustup.rs ships no riscv64 musl toolchain. + cibw-build: "cp39-manylinux_riscv64 cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # cibuildwheel's default abi3audit run reports one ABI version mismatch: + # python/src/lib.rs declares PyUnicode_AsUTF8AndSize (stable ABI only from 3.10) + # itself and calls it only after checking at runtime that the interpreter is 3.10+. + # Upstream's own released x86_64 cp39-abi3 wheel fails the identical audit. + cibw-audit-command: '' + # fastokens ships no [tool.cibuildwheel], so the Rust toolchain its maturin + # backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "python/tests" + # test_thread_safety.py downloads Qwen/Qwen3-0.6B from the Hugging Face Hub. + cibw-test-command: "python -m pytest -v python/tests --ignore=python/tests/test_thread_safety.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: FASTOKENS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout fastokens v${{ env.FASTOKENS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Atero-ai/fastokens - ref: v${{ env.FASTOKENS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # Only some versions need patching, so a missing directory is not an error. - - name: Patch fastokens source - run: | - patches="$PWD/python-wheels/patches/fastokens/${FASTOKENS_VERSION}" - if [ -d "$patches" ]; then - git apply -v "$patches"/*.patch - fi - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # pyo3's abi3-py39 feature is on unconditionally (python/Cargo.toml), so one - # cp39-abi3 wheel serves every GIL-ful interpreter; upstream ships no - # free-threaded wheel because abi3 and Py_GIL_DISABLED only meet on 3.14+. - # cibuildwheel compiles once on cp39 -- the oldest interpreter the tag claims - # -- and re-tests that wheel on the newer ones. musllinux is dropped: - # rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: >- - cp39-manylinux_riscv64 cp310-manylinux_riscv64 - cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cibuildwheel's default abi3audit run reports one ABI version mismatch: - # python/src/lib.rs declares PyUnicode_AsUTF8AndSize (stable ABI only from 3.10) - # itself and calls it only after checking at runtime that the interpreter is 3.10+. - # Upstream's own released x86_64 cp39-abi3 wheel fails the identical audit. - CIBW_AUDIT_COMMAND: '' - # fastokens ships no [tool.cibuildwheel], so the Rust toolchain its maturin - # backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: python/tests - # test_thread_safety.py downloads Qwen/Qwen3-0.6B from the Hugging Face Hub. - CIBW_TEST_COMMAND: >- - python -m pytest -v python/tests - --ignore=python/tests/test_thread_safety.py + name: fastokens-${{ env.FASTOKENS_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -128,15 +133,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fastokens-${{ env.FASTOKENS_VERSION }}-cp39-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish fastokens ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fastparquet.yml b/.github/workflows/build-fastparquet.yml index 0da943deed71..dc304148a908 100644 --- a/.github/workflows/build-fastparquet.yml +++ b/.github/workflows/build-fastparquet.yml @@ -51,6 +51,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build fastparquet ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: ["cp312", "cp313", "cp314", "cp314t"] + include: + # pandas, a hard runtime requirement, publishes no free-threaded wheel on + # any architecture, so the suite cannot run under cp314t. + - python: "cp314t" + test_skip: "*" + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fastparquet" + version: "${{ matrix.version }}" + repository: "dask/fastparquet" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + timeout-minutes: 180 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/fastparquet/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + # A patch dirties the checkout, so setuptools_scm would derive + # 2026.5.1.dev0 from `git describe` instead of the tag. + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_FASTPARQUET=${{ matrix.version }}" + # pandas and cramjam are newer on PyPI than the riscv64 wheels we ship; + # refusing sdists makes pip resolve back to the versions we have. + cibw-test-environment: "PIP_ONLY_BINARY=:all:" + cibw-test-skip: "${{ matrix.test_skip }}" + cibw-test-requires: "pytest \"pandas<3\"" + cibw-test-sources: "fastparquet/test test-data pyproject.toml" + # test/util.py resolves test-data relative to the working directory, and + # upstream's test_wheel.yaml renames the source package out of the way so + # `import fastparquet` picks up the installed wheel. + cibw-test-command: "mv fastparquet fastparquet-src && python -m pytest fastparquet-src/test" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: @@ -63,50 +113,14 @@ jobs: # any architecture, so the suite cannot run under cp314t. - python: "cp314t" test_skip: "*" - env: FASTPARQUET_VERSION: ${{ matrix.version }} - steps: - - name: Checkout fastparquet ${{ env.FASTPARQUET_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: dask/fastparquet - ref: ${{ env.FASTPARQUET_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # 2026.5.0 needs the numpy 2.5 compat backport; 2026.9.0 ships it, so - # later versions may have no patches/ directory at all. - - name: Patch fastparquet source - if: hashFiles(format('python-wheels/patches/fastparquet/{0}/*.patch', env.FASTPARQUET_VERSION)) != '' - run: git apply python-wheels/patches/fastparquet/${{ env.FASTPARQUET_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # A patch dirties the checkout, so setuptools_scm would derive - # 2026.5.1.dev0 from `git describe` instead of the tag. - CIBW_ENVIRONMENT: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_FASTPARQUET=${{ env.FASTPARQUET_VERSION }} PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # pandas and cramjam are newer on PyPI than the riscv64 wheels we ship; - # refusing sdists makes pip resolve back to the versions we have. - CIBW_TEST_ENVIRONMENT: 'PIP_ONLY_BINARY=:all:' - CIBW_TEST_SKIP: ${{ matrix.test_skip }} - CIBW_TEST_REQUIRES: pytest "pandas<3" - CIBW_TEST_SOURCES: fastparquet/test test-data pyproject.toml - # test/util.py resolves test-data relative to the working directory, and - # upstream's test_wheel.yaml renames the source package out of the way so - # `import fastparquet` picks up the installed wheel. - CIBW_TEST_COMMAND: mv fastparquet fastparquet-src && python -m pytest fastparquet-src/test + name: fastparquet-${{ env.FASTPARQUET_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Check the Cython extensions made it into the wheel run: | @@ -120,15 +134,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fastparquet-${{ env.FASTPARQUET_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish fastparquet ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fastremap.yml b/.github/workflows/build-fastremap.yml index cd5cf492bb7e..bc25b924f11e 100644 --- a/.github/workflows/build-fastremap.yml +++ b/.github/workflows/build-fastremap.yml @@ -50,54 +50,61 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build fastremap ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fastremap" + version: "${{ matrix.version }}" + repository: "seung-lab/fastremap" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/fastremap/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a build-time requirement (pyproject.toml's build-system.requires) + # and an implicit runtime one (the compiled extension calls numpy's C API at + # import time). Only our registry has it for riscv64; only-binary keeps a + # newer PyPI release from winning the resolution and compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest numpy" + # automated_test.py sits next to the unbuilt fastremap/ source package; + # staging only the test file keeps that directory out of test_cwd so + # `import fastremap` resolves to the installed wheel (gotcha 25). + cibw-test-sources: "automated_test.py" + cibw-test-command: "python -m pytest -v automated_test.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: FASTREMAP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout fastremap ${{ env.FASTREMAP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: seung-lab/fastremap - ref: ${{ env.FASTREMAP_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # meson-python (upstream's backend since 1.21.0) only ships the files named - # in `license-files`; see patches/fastremap/1.21.0 for details. - - name: Apply patches - run: git apply python-wheels/patches/fastremap/${{ env.FASTREMAP_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build-time requirement (pyproject.toml's build-system.requires) - # and an implicit runtime one (the compiled extension calls numpy's C API at - # import time). Only our registry has it for riscv64; only-binary keeps a - # newer PyPI release from winning the resolution and compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest numpy - # automated_test.py sits next to the unbuilt fastremap/ source package; - # staging only the test file keeps that directory out of test_cwd so - # `import fastremap` resolves to the installed wheel (gotcha 25). - CIBW_TEST_SOURCES: automated_test.py - CIBW_TEST_COMMAND: python -m pytest -v automated_test.py + name: fastremap-${{ env.FASTREMAP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -110,16 +117,9 @@ jobs: assert licences == {"LICENSE", "AUTHORS"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fastremap-${{ env.FASTREMAP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish fastremap ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fasttext-numpy2.yml b/.github/workflows/build-fasttext-numpy2.yml index 19bfe40bc8c8..20c34bc92778 100644 --- a/.github/workflows/build-fasttext-numpy2.yml +++ b/.github/workflows/build-fasttext-numpy2.yml @@ -61,7 +61,6 @@ jobs: # sdist was cut from, verified byte-identical against it. Move together with # the package version. cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # Upstream's own unit tests diverge to NaN during training on any # architecture, including with the released x86_64 wheel, so exercise # the inference path this fork exists for instead. diff --git a/.github/workflows/build-fastwarc.yml b/.github/workflows/build-fastwarc.yml index b6b796d565c4..abf3b6db4aa6 100644 --- a/.github/workflows/build-fastwarc.yml +++ b/.github/workflows/build-fastwarc.yml @@ -49,76 +49,72 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build fastwarc ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fastwarc" + version: "${{ matrix.version }}" + repository: "chatnoir-eu/chatnoir-resiliparse" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + cp LICENSE fastwarc-py/ + cat > collect-lz4-license.sh <<'EOF' + #!/bin/bash + set -euo pipefail + project="${1:?usage: collect-lz4-license.sh }" + mapfile -t files < <(rpm -q --licensefiles lz4-libs 2>/dev/null || true) + if [ -z "${files[0]:-}" ]; then + dnf -y --disablerepo=extras reinstall --setopt=tsflags= lz4-libs + mapfile -t files < <(rpm -qd lz4-libs | grep -iE '/(LICEN[CS]E|COPYING)') + fi + cp "${files[0]}" "$project/LICENSE.lz4" + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "fastwarc-py" + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # zlib-devel resolves without EPEL; lz4-devel needs the extras + # mirror disabled (gotcha 51). The image ships no Rust toolchain for + # the setuptools-rust/pyo3 extension; rustup provisions a native + # riscv64gc-unknown-linux-gnu one (gotcha 10). + cibw-before-all-linux: "dnf -y --disablerepo=extras install zlib-devel lz4-devel && bash {project}/collect-lz4-license.sh {project}/fastwarc-py && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # test-sources paths are relative to cibuildwheel's cwd (the checkout + # root), not to package-dir, and are staged at that same relative + # path (gotcha 104); fastwarc-pytest's own fixture lookup climbs two + # parents to fastwarc-rs/tests/fixtures, so that sibling has to be + # staged too. + cibw-test-sources: "fastwarc-py/fastwarc-pytest fastwarc-rs/tests/fixtures" + cibw-test-command: "python -m pytest -v fastwarc-py/fastwarc-pytest" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: FASTWARC_VERSION: ${{ matrix.version }} - steps: - # fastwarc-py is a subdirectory of the chatnoir-resiliparse monorepo; its - # pytest suite reads fixtures from the sibling fastwarc-rs/tests/fixtures, - # so the checkout is at the workspace root, not fastwarc-py itself. - - name: Checkout chatnoir-resiliparse v${{ env.FASTWARC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: chatnoir-eu/chatnoir-resiliparse - ref: v${{ env.FASTWARC_VERSION }} - persist-credentials: false - - - name: Stage the LICENSE and the lz4-licence collector - # Upstream's wheel ships no LICENSE at all: setuptools' default - # license_files glob runs against fastwarc-py, not the repo root the - # Apache-2.0 file actually sits in (gotcha 86). The Cython legacy - # extension links lz4, which auditwheel vendors into the wheel (zlib - # stays external - it's on the manylinux allowlist, lz4 isn't), so - # collect the licence actually shipped by the build image's own - # package rather than hand-pinning an lz4 release tag (gotcha 137). - run: | - cp LICENSE fastwarc-py/ - cat > collect-lz4-license.sh <<'EOF' - #!/bin/bash - set -euo pipefail - project="${1:?usage: collect-lz4-license.sh }" - mapfile -t files < <(rpm -q --licensefiles lz4-libs 2>/dev/null || true) - if [ -z "${files[0]:-}" ]; then - dnf -y --disablerepo=extras reinstall --setopt=tsflags= lz4-libs - mapfile -t files < <(rpm -qd lz4-libs | grep -iE '/(LICEN[CS]E|COPYING)') - fi - cp "${files[0]}" "$project/LICENSE.lz4" - EOF - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: fastwarc-py - output-dir: wheelhouse/ - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # zlib-devel resolves without EPEL; lz4-devel needs the extras - # mirror disabled (gotcha 51). The image ships no Rust toolchain for - # the setuptools-rust/pyo3 extension; rustup provisions a native - # riscv64gc-unknown-linux-gnu one (gotcha 10). - CIBW_BEFORE_ALL_LINUX: >- - dnf -y --disablerepo=extras install zlib-devel lz4-devel && - bash {project}/collect-lz4-license.sh {project}/fastwarc-py && - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # test-sources paths are relative to cibuildwheel's cwd (the checkout - # root), not to package-dir, and are staged at that same relative - # path (gotcha 104); fastwarc-pytest's own fixture lookup climbs two - # parents to fastwarc-rs/tests/fixtures, so that sibling has to be - # staged too. - CIBW_TEST_SOURCES: fastwarc-py/fastwarc-pytest fastwarc-rs/tests/fixtures - CIBW_TEST_COMMAND: python -m pytest -v fastwarc-py/fastwarc-pytest + name: fastwarc-${{ env.FASTWARC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extensions and the licences made it into the wheel run: | @@ -133,15 +129,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fastwarc-${{ env.FASTWARC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish fastwarc ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fatfs-ng.yml b/.github/workflows/build-fatfs-ng.yml index 5deac74dd76f..dc0475070da1 100644 --- a/.github/workflows/build-fatfs-ng.yml +++ b/.github/workflows/build-fatfs-ng.yml @@ -49,46 +49,49 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build fatfs-ng ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fatfs-ng" + version: "${{ matrix.version }}" + repository: "Jason2866/pyfatfs" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # No pyproject.toml, so setup.py's setup_requires=['cython'] is a + # no-op under build isolation; install it the same way upstream's + # own CIBW_BEFORE_BUILD does. + cibw-before-build: "pip install \"cython>=3.0.0\"" + cibw-environment-linux: "CYTHONIZE=1" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + # 4 of test_esp32_wl.py's tests fail identically on every platform + # (confirmed on x86_64 too, not riscv64-specific): ESP32WearLeveling + # never sets self.wl_state_size/wl_temp_size in __init__, a + # pre-existing upstream bug unrelated to this port. + cibw-test-command: "python -m pytest {project}/tests -k \"not test_wl_state_creation and not test_overhead_calculation and not test_wl_state_invalid_crc and not test_fat_data_too_large\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: FATFS_NG_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyfatfs v${{ env.FATFS_NG_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Jason2866/pyfatfs - ref: v${{ env.FATFS_NG_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # No pyproject.toml, so setup.py's setup_requires=['cython'] is a - # no-op under build isolation; install it the same way upstream's - # own CIBW_BEFORE_BUILD does. - CIBW_BEFORE_BUILD: pip install "cython>=3.0.0" - CIBW_ENVIRONMENT: CYTHONIZE=1 - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - # 4 of test_esp32_wl.py's tests fail identically on every platform - # (confirmed on x86_64 too, not riscv64-specific): ESP32WearLeveling - # never sets self.wl_state_size/wl_temp_size in __init__, a - # pre-existing upstream bug unrelated to this port. - CIBW_TEST_COMMAND: >- - python -m pytest {project}/tests -k - "not test_wl_state_creation and not test_overhead_calculation - and not test_wl_state_invalid_crc and not test_fat_data_too_large" + name: fatfs-ng-${{ env.FATFS_NG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wrapper extension made it into the wheel run: | @@ -100,15 +103,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fatfs-ng-${{ env.FATFS_NG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish fatfs-ng ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-faust-cchardet.yml b/.github/workflows/build-faust-cchardet.yml index d6bdf169d3e7..6f685214fa29 100644 --- a/.github/workflows/build-faust-cchardet.yml +++ b/.github/workflows/build-faust-cchardet.yml @@ -51,44 +51,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build faust-cchardet ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "faust-cchardet" + version: "${{ matrix.version }}" + repository: "faust-streaming/cChardet" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/faust-cchardet/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: FAUST_CCHARDET_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cChardet v${{ env.FAUST_CCHARDET_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: faust-streaming/cChardet - ref: v${{ env.FAUST_CCHARDET_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # pyproject.toml declares `license` but no `license-files`, and - # meson-python's build backend has no default COPYING/LICENSE glob, so - # every wheel upstream publishes ships with none. See - # patches/faust-cchardet/3.2.0 for details. - - name: Patch cChardet source - run: git apply python-wheels/patches/faust-cchardet/${{ env.FAUST_CCHARDET_VERSION }}/*.patch - - - name: Build and test wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + name: faust-cchardet-${{ env.FAUST_CCHARDET_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension and licence run: | @@ -101,15 +109,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: faust-cchardet-${{ env.FAUST_CCHARDET_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish faust-cchardet ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-faust-streaming.yml b/.github/workflows/build-faust-streaming.yml index c8a3f7c7ed9e..8ae9c033dfc9 100644 --- a/.github/workflows/build-faust-streaming.yml +++ b/.github/workflows/build-faust-streaming.yml @@ -49,47 +49,50 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build faust-streaming ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "faust-streaming" + version: "${{ matrix.version }}" + repository: "faust-streaming/faust" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # The repo-root faust/ would otherwise shadow the installed wheel's extensions. + cibw-test-sources: "tests pyproject.toml" + # Upstream's test.txt minus its lint/publish tools, which is what freethreading.txt is. + # That file only caps hypothesis (<6.130, before it grew a native extension) on 3.13t + # and expects 3.14t to take the latest, but hypothesis publishes no free-threaded + # riscv64 wheel (its riscv64 wheels are abi3, which a free-threaded build cannot use), + # so pip builds the sdist, whose Rust bootstrap fails on riscv64. Take the same pure + # Python release on cp314t first; the suite only uses hypothesis' pure-Python API. + cibw-before-test: "${{ matrix.python == 'cp314t' && 'pip install \"hypothesis<6.130\" && ' || '' }}pip install -r {project}/requirements/freethreading.txt" + cibw-test-environment: "FAUST_REQUIRE_CYTHON=1 ${{ matrix.python == 'cp314t' && 'PYTHON_GIL=0' || '' }}" + cibw-test-command: "python -m pytest --no-cov tests/unit tests/functional ${{ matrix.python != 'cp314t' && 'tests/integration tests/meticulous tests/regression' || '' }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: FAUST_STREAMING_VERSION: ${{ matrix.version }} - steps: - - name: Checkout faust v${{ env.FAUST_STREAMING_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: faust-streaming/faust - ref: v${{ env.FAUST_STREAMING_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - name: Build and test wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # The repo-root faust/ would otherwise shadow the installed wheel's extensions. - CIBW_TEST_SOURCES: tests pyproject.toml - # Upstream's test.txt minus its lint/publish tools, which is what freethreading.txt is. - # That file only caps hypothesis (<6.130, before it grew a native extension) on 3.13t - # and expects 3.14t to take the latest, but hypothesis publishes no free-threaded - # riscv64 wheel (its riscv64 wheels are abi3, which a free-threaded build cannot use), - # so pip builds the sdist, whose Rust bootstrap fails on riscv64. Take the same pure - # Python release on cp314t first; the suite only uses hypothesis' pure-Python API. - CIBW_BEFORE_TEST: ${{ matrix.python == 'cp314t' && 'pip install "hypothesis<6.130" && ' || '' }}pip install -r {project}/requirements/freethreading.txt - CIBW_TEST_ENVIRONMENT: >- - FAUST_REQUIRE_CYTHON=1 - ${{ matrix.python == 'cp314t' && 'PYTHON_GIL=0' || '' }} - CIBW_TEST_COMMAND: >- - python -m pytest --no-cov tests/unit tests/functional - ${{ matrix.python != 'cp314t' && 'tests/integration tests/meticulous tests/regression' || '' }} + name: faust-streaming-${{ env.FAUST_STREAMING_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extensions and licence run: | @@ -104,15 +107,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: faust-streaming-${{ env.FAUST_STREAMING_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish faust-streaming ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fenics-basix.yml b/.github/workflows/build-fenics-basix.yml index 09066e763ddd..1ed97fb8dbc9 100644 --- a/.github/workflows/build-fenics-basix.yml +++ b/.github/workflows/build-fenics-basix.yml @@ -49,6 +49,40 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build fenics-basix ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # Upstream's own PyPI wheels are cp312-abi3 (via nanobind's stable + # ABI, `-Cwheel.py-api=cp312`) covering 3.12-3.14 in one build, plus + # a separate non-abi3 cp311 build; no cp314t is published anywhere + # upstream (nanobind stable ABI and free-threading don't mix here). + tag: ["cp312-abi3"] + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fenics-basix" + version: "${{ matrix.version }}" + repository: "FEniCS/basix" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: 300 + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + cibw-before-build: "dnf -y install openblas-devel ninja-build" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,pillow" + # Upstream's own pyproject.toml tests against extra "test", which + # pulls in extra "optional" -> numba -> llvmlite. llvmlite ships no + # riscv64 wheel, and building it from source needs a patched LLVM + # that isn't installed in this image (CLAUDE.md gotcha 40/187: + # llvmlite's conda-only prebuilt LLVM wall; see also build-nutpie.yml). + # Upstream already carries a numba-free fallback, "test-no-numba", + # for the two other platforms where llvmlite has no wheel either + # (macosx_x86_64, win_arm64); use it here too. + cibw-test-extras: "test-no-numba" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv # riscv64 builds run several times slower than x86_64; raised from 90 after jobs were killed mid-build by the timeout, not a dead runner. timeout-minutes: 300 @@ -61,41 +95,14 @@ jobs: # a separate non-abi3 cp311 build; no cp314t is published anywhere # upstream (nanobind stable ABI and free-threading don't mix here). tag: ["cp312-abi3"] - env: BASIX_VERSION: ${{ matrix.version }} - steps: - - name: Checkout basix v${{ env.BASIX_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: FEniCS/basix - ref: v${{ env.BASIX_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: >- - cp312-manylinux_riscv64 cp313-manylinux_riscv64 - cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_BUILD: dnf -y install openblas-devel ninja-build - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pillow - # Upstream's own pyproject.toml tests against extra "test", which - # pulls in extra "optional" -> numba -> llvmlite. llvmlite ships no - # riscv64 wheel, and building it from source needs a patched LLVM - # that isn't installed in this image (CLAUDE.md gotcha 40/187: - # llvmlite's conda-only prebuilt LLVM wall; see also build-nutpie.yml). - # Upstream already carries a numba-free fallback, "test-no-numba", - # for the two other platforms where llvmlite has no wheel either - # (macosx_x86_64, win_arm64); use it here too. - CIBW_TEST_EXTRAS: test-no-numba + name: fenics-basix-${{ env.BASIX_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -111,15 +118,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fenics-basix-${{ env.BASIX_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish fenics-basix ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fill-voids.yml b/.github/workflows/build-fill-voids.yml index 0aedb4fa1c24..82f6c94a8924 100644 --- a/.github/workflows/build-fill-voids.yml +++ b/.github/workflows/build-fill-voids.yml @@ -50,56 +50,65 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build fill-voids ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fill-voids" + version: "${{ matrix.version }}" + repository: "seung-lab/fill_voids" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/fill-voids/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a build-time requirement (pyproject.toml's build-system.requires, + # via cython's `cimport numpy`) and an implicit runtime one too (the compiled + # extension calls numpy's C API at import time; pbr turns requirements.txt's + # numpy/fastremap into install_requires). Only our registry has numpy for + # riscv64; only-binary keeps a newer PyPI release from winning the resolution + # and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + # fastremap has no riscv64 wheel on either index, so pip builds it from + # sdist inside the container (same as connected-components-3d). + cibw-test-requires: "pytest numpy scipy fastremap" + # automated_test.py sits next to the unbuilt fill_voids/ source package; + # staging only the test file keeps that directory out of test_cwd so + # `import fill_voids` resolves to the installed wheel (gotcha 25). + cibw-test-sources: "automated_test.py" + cibw-test-command: "python -m pytest -v automated_test.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: FILL_VOIDS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout fill-voids ${{ env.FILL_VOIDS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: seung-lab/fill_voids - ref: ${{ env.FILL_VOIDS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch fill-voids source - run: git apply python-wheels/patches/fill-voids/${{ env.FILL_VOIDS_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build-time requirement (pyproject.toml's build-system.requires, - # via cython's `cimport numpy`) and an implicit runtime one too (the compiled - # extension calls numpy's C API at import time; pbr turns requirements.txt's - # numpy/fastremap into install_requires). Only our registry has numpy for - # riscv64; only-binary keeps a newer PyPI release from winning the resolution - # and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - # fastremap has no riscv64 wheel on either index, so pip builds it from - # sdist inside the container (same as connected-components-3d). - CIBW_TEST_REQUIRES: pytest numpy scipy fastremap - # automated_test.py sits next to the unbuilt fill_voids/ source package; - # staging only the test file keeps that directory out of test_cwd so - # `import fill_voids` resolves to the installed wheel (gotcha 25). - CIBW_TEST_SOURCES: automated_test.py - CIBW_TEST_COMMAND: python -m pytest -v automated_test.py + name: fill-voids-${{ env.FILL_VOIDS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -112,16 +121,9 @@ jobs: assert licences == {"AUTHORS", "COPYING", "COPYING.LESSER"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fill-voids-${{ env.FILL_VOIDS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish fill-voids ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-filprofiler.yml b/.github/workflows/build-filprofiler.yml index 1923c82450a7..df910683b1ef 100644 --- a/.github/workflows/build-filprofiler.yml +++ b/.github/workflows/build-filprofiler.yml @@ -61,7 +61,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-before-all-linux: "yum install -y lld && curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y" cibw-before-build: "touch filpreload/src/_filpreload.c" - cibw-environment: 'PATH="$PATH:$HOME/.cargo/bin"' + cibw-environment-linux: 'PATH="$PATH:$HOME/.cargo/bin"' cibw-test-command: python -m filprofiler run {project}/benchmarks/pystone.py timeout-minutes: 90 diff --git a/.github/workflows/build-finufft.yml b/.github/workflows/build-finufft.yml index eaa9f3d0995f..0bda4b856fbe 100644 --- a/.github/workflows/build-finufft.yml +++ b/.github/workflows/build-finufft.yml @@ -53,6 +53,50 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build finufft ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "finufft" + version: "${{ matrix.version }}" + repository: "flatironinstitute/finufft" + ref: "v${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 360 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/finufft/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "python/finufft" + cibw-build: "cp312-manylinux_riscv64" + # Upstream's own pyproject.toml pins musllinux-x86_64-image to the + # "musllinux_1_1" alias, which cibuildwheel 4.x rejects at config-load + # time for any build, even this riscv64-only, musllinux-less one. + cibw-musllinux-x86-64-image: "musllinux_1_2" + # Upstream's build-system pins cmake<4, which has no riscv64 wheel, so pip + # builds CMake from source; its bootstrap needs OpenSSL's dev headers. + cibw-before-all-linux: "dnf -y install openssl-devel" + cibw-config-settings: "\"cmake.define.FINUFFT_ARCH_FLAGS\"=\"\"" + # Licence notices for the patch above: upstream's own LICENSE lives at the repo + # root, outside package-dir, and FFTW (statically linked, GPL-2.0-or-later) ships + # no licence text of its own. + cibw-before-build: "cp {project}/LICENSE {package}/LICENSE && curl -fsSL --retry 5 https://raw.githubusercontent.com/FFTW/fftw3/master/COPYING -o {package}/LICENSE.fftw" + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv # riscv64 builds run several times slower than x86_64; raised from 120 after jobs were killed mid-build by the timeout, not a dead runner. timeout-minutes: 360 @@ -62,49 +106,12 @@ jobs: version: ${{ fromJSON(needs.setup.outputs.versions) }} env: FINUFFT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout flatironinstitute/finufft v${{ env.FINUFFT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: flatironinstitute/finufft - ref: v${{ env.FINUFFT_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch finufft source - run: git apply python-wheels/patches/finufft/${{ env.FINUFFT_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: python/finufft - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: cp312-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's own pyproject.toml pins musllinux-x86_64-image to the - # "musllinux_1_1" alias, which cibuildwheel 4.x rejects at config-load - # time for any build, even this riscv64-only, musllinux-less one. - CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2 - # Upstream's build-system pins cmake<4, which has no riscv64 wheel, so pip - # builds CMake from source; its bootstrap needs OpenSSL's dev headers. - CIBW_BEFORE_ALL_LINUX: dnf -y install openssl-devel - CIBW_CONFIG_SETTINGS: > - "cmake.define.FINUFFT_ARCH_FLAGS"="" - # Licence notices for the patch above: upstream's own LICENSE lives at the repo - # root, outside package-dir, and FFTW (statically linked, GPL-2.0-or-later) ships - # no licence text of its own. - CIBW_BEFORE_BUILD: >- - cp {project}/LICENSE {package}/LICENSE && - curl -fsSL --retry 5 https://raw.githubusercontent.com/FFTW/fftw3/master/COPYING -o {package}/LICENSE.fftw - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy + name: finufft-${{ env.FINUFFT_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the compiled library and licences made it into the wheel run: | @@ -119,15 +126,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: finufft-${{ env.FINUFFT_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish finufft ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-flpc.yml b/.github/workflows/build-flpc.yml index 80370c819e53..707a71971513 100644 --- a/.github/workflows/build-flpc.yml +++ b/.github/workflows/build-flpc.yml @@ -52,61 +52,65 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build flpc ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "flpc" + version: "${{ matrix.version }}" + repository: "itsmeadarsh2008/flpc" + ref: "542fd3a313a5875e862b3210b88fa5bea59f1b66" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # flpc ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + # PYO3_USE_ABI3_FORWARD_COMPATIBILITY unblocks cp314, which is newer + # than pyo3 0.22's known-version ceiling (3.13); verified locally + # that the resulting extension still builds per-interpreter (no + # abi3 feature is enabled) and runs correctly. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1" + cibw-test-command: |- + python3 - <<'PYEOF' + import flpc + p = flpc.compile(r"(\w+) (\w+)") + m = flpc.search(p, "Hello World") + assert m.group(0) == "Hello World", m.group(0) + assert m.groups() == ["Hello", "World"], m.groups() + assert m.span(0) == (0, 11), m.span(0) + assert flpc.findall(p, "Hello World Hello Python") == ["Hello World", "Hello Python"] + digits = flpc.compile(r"\d+") + assert flpc.sub(digits, "#", "room 42 and 7") == "room # and #" + email = flpc.compile(r"(\w+)@(\w+)\.com") + fm = flpc.fmatch(email, "user@example.com") + assert fm.group(0) == "user@example.com", fm.group(0) + up = flpc.compile(".*") + um = flpc.fmatch(up, "hello \N{EARTH GLOBE AMERICAS}") + assert um.span(0) == (0, 7), um.span(0) + print("flpc OK") + PYEOF + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: FLPC_VERSION: ${{ matrix.version }} - steps: - - name: Checkout flpc ${{ env.FLPC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: itsmeadarsh2008/flpc - ref: ${{ env.FLPC_REF }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # flpc ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - # PYO3_USE_ABI3_FORWARD_COMPATIBILITY unblocks cp314, which is newer - # than pyo3 0.22's known-version ceiling (3.13); verified locally - # that the resulting extension still builds per-interpreter (no - # abi3 feature is enabled) and runs correctly. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 - CIBW_TEST_COMMAND: | - python3 - <<'PYEOF' - import flpc - p = flpc.compile(r"(\w+) (\w+)") - m = flpc.search(p, "Hello World") - assert m.group(0) == "Hello World", m.group(0) - assert m.groups() == ["Hello", "World"], m.groups() - assert m.span(0) == (0, 11), m.span(0) - assert flpc.findall(p, "Hello World Hello Python") == ["Hello World", "Hello Python"] - digits = flpc.compile(r"\d+") - assert flpc.sub(digits, "#", "room 42 and 7") == "room # and #" - email = flpc.compile(r"(\w+)@(\w+)\.com") - fm = flpc.fmatch(email, "user@example.com") - assert fm.group(0) == "user@example.com", fm.group(0) - up = flpc.compile(".*") - um = flpc.fmatch(up, "hello \N{EARTH GLOBE AMERICAS}") - assert um.span(0) == (0, 7), um.span(0) - print("flpc OK") - PYEOF + name: flpc-${{ env.FLPC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -119,15 +123,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: flpc-${{ env.FLPC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish flpc ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fnv-hash-fast.yml b/.github/workflows/build-fnv-hash-fast.yml index bd8ead2ce203..aed73d4f0611 100644 --- a/.github/workflows/build-fnv-hash-fast.yml +++ b/.github/workflows/build-fnv-hash-fast.yml @@ -58,7 +58,7 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: REQUIRE_EXTENSION=1 + cibw-environment-linux: REQUIRE_EXTENSION=1 cibw-test-requires: pytest # build_ext.py's build_extensions() swallows every compile error # unconditionally, so REQUIRE_EXTENSION never actually fails the diff --git a/.github/workflows/build-fpylll.yml b/.github/workflows/build-fpylll.yml index 0acb10884195..421bac913c66 100644 --- a/.github/workflows/build-fpylll.yml +++ b/.github/workflows/build-fpylll.yml @@ -55,59 +55,54 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build fpylll ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "fpylll" + version: "${{ matrix.version }}" + repository: "fplll/fpylll" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # gmp/mpfr come from Rocky 10's own repos (gmp-devel, mpfr-devel); + # fplll itself has no Rocky package and is built once per container + # from its own release tarball, with the same configure flags + # tests.yml uses. --libdir=/usr/lib64 matches where gmp-devel/ + # mpfr-devel already put their libraries, so no extra -L/-I or + # LD_LIBRARY_PATH plumbing is needed for setup.py's hardcoded + # sys.prefix-relative include/library dirs. libqd is skipped: + # Rocky 10 ships no qd package on any arch, and HAVE_QD=no is one + # of the two configurations tests.yml itself exercises. + cibw-before-all-linux: "dnf -y install gmp-devel mpfr-devel && cd /tmp && curl -fsSLO https://github.com/fplll/fplll/releases/download/5.5.0/fplll-5.5.0.tar.gz && echo \"f0af6bdd0ebd5871e87ff3ef7737cb5360b1e38181a4e5a8c1236f3476fec3b2 fplll-5.5.0.tar.gz\" | sha256sum -c - && tar xzf fplll-5.5.0.tar.gz && cd fplll-5.5.0 && ./configure --disable-static --prefix=/usr --libdir=/usr/lib64 --with-max-enum-dim=64 --with-max-parallel-enum-dim=20 && make -j\"$(nproc)\" && make install && ldconfig && cp COPYING /project/LICENSE.fplll && cp /usr/share/licenses/gmp/COPYINGv3 /project/LICENSE.gmp && cp /usr/share/licenses/mpfr/COPYING.LESSER /project/LICENSE.mpfr" + # cysignals is a genuine runtime import of fpylll.fplll.integer_matrix + # (upstream's own install_requires), not just a test dependency; our + # registry already hosts a riscv64 wheel for it. + cibw-test-requires: "pytest numpy cysignals" + cibw-test-sources: "tests" + cibw-test-command: "PY_IGNORE_IMPORTMISMATCH=1 python -m pytest tests -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: FPYLLL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout fpylll ${{ env.FPYLLL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: fplll/fpylll - ref: ${{ env.FPYLLL_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # gmp/mpfr come from Rocky 10's own repos (gmp-devel, mpfr-devel); - # fplll itself has no Rocky package and is built once per container - # from its own release tarball, with the same configure flags - # tests.yml uses. --libdir=/usr/lib64 matches where gmp-devel/ - # mpfr-devel already put their libraries, so no extra -L/-I or - # LD_LIBRARY_PATH plumbing is needed for setup.py's hardcoded - # sys.prefix-relative include/library dirs. libqd is skipped: - # Rocky 10 ships no qd package on any arch, and HAVE_QD=no is one - # of the two configurations tests.yml itself exercises. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install gmp-devel mpfr-devel && - cd /tmp && - curl -fsSLO https://github.com/fplll/fplll/releases/download/${{ env.FPLLL_CXX_VERSION }}/fplll-${{ env.FPLLL_CXX_VERSION }}.tar.gz && - echo "${{ env.FPLLL_CXX_SHA256 }} fplll-${{ env.FPLLL_CXX_VERSION }}.tar.gz" | sha256sum -c - && - tar xzf fplll-${{ env.FPLLL_CXX_VERSION }}.tar.gz && - cd fplll-${{ env.FPLLL_CXX_VERSION }} && - ./configure --disable-static --prefix=/usr --libdir=/usr/lib64 --with-max-enum-dim=64 --with-max-parallel-enum-dim=20 && - make -j"$(nproc)" && make install && ldconfig && - cp COPYING /project/LICENSE.fplll && - cp /usr/share/licenses/gmp/COPYINGv3 /project/LICENSE.gmp && - cp /usr/share/licenses/mpfr/COPYING.LESSER /project/LICENSE.mpfr - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # cysignals is a genuine runtime import of fpylll.fplll.integer_matrix - # (upstream's own install_requires), not just a test dependency; our - # registry already hosts a riscv64 wheel for it. - CIBW_TEST_REQUIRES: pytest numpy cysignals - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: PY_IGNORE_IMPORTMISMATCH=1 python -m pytest tests -v + name: fpylll-${{ env.FPYLLL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extensions and vendored libraries made it into the wheel run: | @@ -123,12 +118,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: fpylll-${{ env.FPYLLL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -162,7 +151,7 @@ jobs: publish: name: Publish fpylll ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-freetype-py.yml b/.github/workflows/build-freetype-py.yml index c1016da4dce5..c6a739a7d913 100644 --- a/.github/workflows/build-freetype-py.yml +++ b/.github/workflows/build-freetype-py.yml @@ -54,64 +54,69 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build freetype-py ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "freetype-py" + version: "${{ matrix.version }}" + repository: "rougier/freetype-py" + ref: "v${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/freetype-py/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + ft_ver="$(sed -n 's/^FREETYPE_TARBALL = "freetype-\(.*\)\.tar\.xz"/\1/p' setup-build-freetype.py)" + hb_ver="$(sed -n 's/^HARFBUZZ_TARBALL = "harfbuzz-\(.*\)\.tar\.xz"/\1/p' setup-build-freetype.py)" + ft_tag="VER-$(echo "$ft_ver" | tr '.' '-')" + curl -fsSL --retry 5 "https://raw.githubusercontent.com/freetype/freetype/${ft_tag}/docs/FTL.TXT" -o LICENSE.FreeType.txt + curl -fsSL --retry 5 "https://raw.githubusercontent.com/harfbuzz/harfbuzz/${hb_ver}/COPYING" -o COPYING.HarfBuzz + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # setup.py's BdistWheel.get_tag() forces py3-none, so one build serves every interpreter. + cibw-build: "cp312-manylinux_riscv64" + # backend.py adds a `cmake` build dependency, but the `cmake` PyPI package has + # no riscv64 wheel; use the image's own cmake and skip isolated dependency resolution. + # setup.py's SharedLibBuildExt calls distutils.dir_util.mkpath()/file_util.copy_file() + # with dry_run=, a kwarg setuptools >=81 dropped from its vendored distutils (gotcha 256). + cibw-before-build: "dnf install -y cmake && pip install -q -U \"setuptools<81\" wheel \"setuptools_scm[toml]\" certifi" + cibw-build-frontend: "pip; args: --no-build-isolation" + # CMAKE_POLICY_VERSION_MINIMUM (gotcha 257) as an env var, not a `-D` flag: + # setup-build-freetype.py's cmake invocations aren't ours to add flags to. + cibw-environment-linux: "FREETYPEPY_BUNDLE_FT=yes PYTHON_ARCH=64 SETUPTOOLS_SCM_PRETEND_VERSION_FOR_FREETYPE_PY=${{ matrix.version }} CMAKE_POLICY_VERSION_MINIMUM=3.5" + cibw-test-requires: "pytest" + cibw-test-command: "pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: FREETYPE_PY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout freetype-py v${{ env.FREETYPE_PY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: rougier/freetype-py - ref: v${{ env.FREETYPE_PY_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # mirrors.sarata.com (setup-build-freetype.py's default FreeType mirror) 403s - # non-browser clients (gotcha 258); gotcha 31 pins the sdist version since this dirties the tree. - - name: Patch freetype-py source - run: git apply python-wheels/patches/freetype-py/${{ env.FREETYPE_PY_VERSION }}/*.patch - - # setup.py bundles a compiled FreeType (statically linking Harfbuzz); upstream - # ships only its own LICENSE.txt, so stage the two other licences ourselves. - - name: Stage the FreeType and HarfBuzz licences - run: | - ft_ver="$(sed -n 's/^FREETYPE_TARBALL = "freetype-\(.*\)\.tar\.xz"/\1/p' setup-build-freetype.py)" - hb_ver="$(sed -n 's/^HARFBUZZ_TARBALL = "harfbuzz-\(.*\)\.tar\.xz"/\1/p' setup-build-freetype.py)" - ft_tag="VER-$(echo "$ft_ver" | tr '.' '-')" - curl -fsSL --retry 5 "https://raw.githubusercontent.com/freetype/freetype/${ft_tag}/docs/FTL.TXT" -o LICENSE.FreeType.txt - curl -fsSL --retry 5 "https://raw.githubusercontent.com/harfbuzz/harfbuzz/${hb_ver}/COPYING" -o COPYING.HarfBuzz - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # setup.py's BdistWheel.get_tag() forces py3-none, so one build serves every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # backend.py adds a `cmake` build dependency, but the `cmake` PyPI package has - # no riscv64 wheel; use the image's own cmake and skip isolated dependency resolution. - # setup.py's SharedLibBuildExt calls distutils.dir_util.mkpath()/file_util.copy_file() - # with dry_run=, a kwarg setuptools >=81 dropped from its vendored distutils (gotcha 256). - CIBW_BEFORE_BUILD: >- - dnf install -y cmake && - pip install -q -U "setuptools<81" wheel "setuptools_scm[toml]" certifi - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - # CMAKE_POLICY_VERSION_MINIMUM (gotcha 257) as an env var, not a `-D` flag: - # setup-build-freetype.py's cmake invocations aren't ours to add flags to. - CIBW_ENVIRONMENT: >- - FREETYPEPY_BUNDLE_FT=yes PYTHON_ARCH=64 - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_FREETYPE_PY=${{ env.FREETYPE_PY_VERSION }} - CMAKE_POLICY_VERSION_MINIMUM=3.5 - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest {project}/tests + name: freetype-py-${{ env.FREETYPE_PY_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the bundled library and licences made it into the wheel run: | @@ -127,15 +132,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: freetype-py-${{ env.FREETYPE_PY_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish freetype-py ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-freud-analysis.yml b/.github/workflows/build-freud-analysis.yml index b8d68683dd22..80dbeb4286d0 100644 --- a/.github/workflows/build-freud-analysis.yml +++ b/.github/workflows/build-freud-analysis.yml @@ -55,90 +55,90 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build freud-analysis ${{ matrix.version }} cp312-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "freud-analysis" + version: "${{ matrix.version }}" + repository: "glotzerlab/freud" + ref: "v${{ matrix.version }}" + artifact-tag: "cp312-abi3-manylinux_riscv64" + timeout-minutes: 300 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/freud-analysis/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + git submodule update --init --depth=1 -- extern/Eigen extern/voro++ extern/fsph + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + set -euo pipefail + cat extern/Eigen/COPYING.README extern/Eigen/COPYING.MPL2 extern/Eigen/COPYING.BSD extern/Eigen/COPYING.LGPL > LICENSE.eigen + cp extern/voro++/LICENSE LICENSE.voropp + cp extern/fsph/LICENSE LICENSE.fsph + curl -fsSL --retry 5 https://raw.githubusercontent.com/jodesarro/bessel-library/main/LICENSE -o LICENSE.bessel-library + curl -fsSL --retry 5 https://raw.githubusercontent.com/wjakob/nanobind/v3.1.0/LICENSE -o LICENSE.nanobind + curl -fsSL --retry 5 https://raw.githubusercontent.com/Tessil/robin-map/master/LICENSE -o LICENSE.robin-map + curl -fsSL --retry 5 "https://raw.githubusercontent.com/uxlfoundation/oneTBB/v2022.1.0/LICENSE.txt" -o LICENSE.tbb + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-manylinux_riscv64" + # Upstream's own before-build script (unmodified: it ships in the checked-out + # tree) builds oneTBB from source and installs it to the default CMake prefix, + # which freud/CMake/FindTBB.cmake's find_package_config_first() then picks up. + cibw-before-build: "source .github/workflows/cibuildwheel-before-build.sh {package} linux" + cibw-environment-linux: "CMAKE_PREFIX_PATH=/project/tbb LD_LIBRARY_PATH=/project/tbb/lib/intel64/gcc4.8:$LD_LIBRARY_PATH CMAKE_ARGS=-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=True PIP_ONLY_BINARY=numpy,scipy,matplotlib" + # Upstream's own repair-wheel-command pipes auditwheel repair into a + # pipx-installed abi3audit; the riscv64 image carries no pipx (CLAUDE.md gotcha + # 217), and it is redundant besides, since cibuildwheel's own default + # audit-command already abi3audits every abi3-tagged wheel natively. + cibw-repair-wheel-command-linux: "auditwheel repair -w {dest_dir} {wheel}" + # matplotlib (a CIBW_TEST_REQUIRES pin) transitively pulls in pillow/contourpy/ + # kiwisolver; none publish a riscv64 wheel on PyPI newer than ours, and pillow's + # sdist build fails outright (no libjpeg headers in the manylinux image). Pin + # these to our registry's wheels for the test install too. + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy,matplotlib,contourpy,kiwisolver,pillow" + cibw-test-requires: "pytest==9.1.1 numpy==2.5.2 scipy==1.18.1 gsd==5.0.1 matplotlib==3.11.1 sympy==1.14.0" + cibw-test-command: "pytest {package}/tests -v --log-level=DEBUG" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 300 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: FREUD_ANALYSIS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout glotzerlab/freud v${{ env.FREUD_ANALYSIS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: glotzerlab/freud - ref: v${{ env.FREUD_ANALYSIS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - # pyproject.toml's license-files is an explicit ["LICENSE"] list, so - # scikit-build-core's default licence glob never runs; widen it to also match - # LICENSE.* instead of setting SKBUILD_WHEEL_LICENSE_FILES, since scikit-build-core - # refuses to have both project.license-files and the env var set at once. - - name: Patch freud-analysis source - run: git apply python-wheels/patches/freud-analysis/${{ env.FREUD_ANALYSIS_VERSION }}/00*.patch - - # doc/source/gettingstarted/examples is a doc-only submodule, unneeded for the build. - - name: Fetch the Eigen/voro++/fsph submodules - run: git submodule update --init --depth=1 -- extern/Eigen extern/voro++ extern/fsph - - # The extension compiles in Eigen (MPL2, plus BSD/LGPL components since - # EIGEN_MPL2_ONLY is never defined), voro++ (BSD-ish) and fsph (MIT) from their - # submodules, extern/bessel-library.hpp (MIT, vendored straight into the repo, licence - # only in its header comment) and oneTBB (Apache-2.0, see below); nanobind (BSD-3-Clause, - # a pip build dependency, not vendored) also vendors tsl::robin_map (MIT). Upstream's - # own wheel ships only its own LICENSE; the patch above widens pyproject.toml's - # license-files so these all get picked up too. - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - cat extern/Eigen/COPYING.README extern/Eigen/COPYING.MPL2 extern/Eigen/COPYING.BSD extern/Eigen/COPYING.LGPL > LICENSE.eigen - cp extern/voro++/LICENSE LICENSE.voropp - cp extern/fsph/LICENSE LICENSE.fsph - curl -fsSL --retry 5 https://raw.githubusercontent.com/jodesarro/bessel-library/main/LICENSE -o LICENSE.bessel-library - curl -fsSL --retry 5 https://raw.githubusercontent.com/wjakob/nanobind/v3.1.0/LICENSE -o LICENSE.nanobind - curl -fsSL --retry 5 https://raw.githubusercontent.com/Tessil/robin-map/master/LICENSE -o LICENSE.robin-map - curl -fsSL --retry 5 "https://raw.githubusercontent.com/uxlfoundation/oneTBB/v${{ env.TBB_VERSION }}/LICENSE.txt" -o LICENSE.tbb - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: cp312-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's own before-build script (unmodified: it ships in the checked-out - # tree) builds oneTBB from source and installs it to the default CMake prefix, - # which freud/CMake/FindTBB.cmake's find_package_config_first() then picks up. - CIBW_BEFORE_BUILD: source .github/workflows/cibuildwheel-before-build.sh {package} linux - CIBW_ENVIRONMENT: >- - CMAKE_PREFIX_PATH=/project/tbb - LD_LIBRARY_PATH=/project/tbb/lib/intel64/gcc4.8:$LD_LIBRARY_PATH - CMAKE_ARGS=-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=True - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,matplotlib - # Upstream's own repair-wheel-command pipes auditwheel repair into a - # pipx-installed abi3audit; the riscv64 image carries no pipx (CLAUDE.md gotcha - # 217), and it is redundant besides, since cibuildwheel's own default - # audit-command already abi3audits every abi3-tagged wheel natively. - CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair -w {dest_dir} {wheel} - # matplotlib (a CIBW_TEST_REQUIRES pin) transitively pulls in pillow/contourpy/ - # kiwisolver; none publish a riscv64 wheel on PyPI newer than ours, and pillow's - # sdist build fails outright (no libjpeg headers in the manylinux image). Pin - # these to our registry's wheels for the test install too. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,scipy,matplotlib,contourpy,kiwisolver,pillow - CIBW_TEST_REQUIRES: >- - pytest==9.1.1 numpy==2.5.2 scipy==1.18.1 gsd==5.0.1 matplotlib==3.11.1 - sympy==1.14.0 - CIBW_TEST_COMMAND: pytest {package}/tests -v --log-level=DEBUG + name: freud-analysis-${{ env.FREUD_ANALYSIS_VERSION }}-cp312-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -156,15 +156,9 @@ jobs: assert licences == expected, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: freud-analysis-${{ env.FREUD_ANALYSIS_VERSION }}-cp312-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish freud-analysis ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-fuzzyset2.yml b/.github/workflows/build-fuzzyset2.yml index 6d23d41fdb31..d71dedf4a39c 100644 --- a/.github/workflows/build-fuzzyset2.yml +++ b/.github/workflows/build-fuzzyset2.yml @@ -61,7 +61,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # Cython (pyproject.toml build-system.requires) has no riscv64 wheel on # PyPI; the registry already carries one for cp312-cp314. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # before-test/test-command come from upstream's own [tool.cibuildwheel]; # this only adds a check that cfuzzyset actually compiled. cibw-test-command: >- diff --git a/.github/workflows/build-gdstk.yml b/.github/workflows/build-gdstk.yml index 70fc36601a9b..b48b23cb5150 100644 --- a/.github/workflows/build-gdstk.yml +++ b/.github/workflows/build-gdstk.yml @@ -50,62 +50,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build gdstk ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "gdstk" + version: "${{ matrix.version }}" + repository: "heitzmann/gdstk" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + sed -n '/Author : Angus Johnson/,/http:\/\/www.boost.org\/LICENSE_1_0.txt/p' \ + external/clipper/clipper.hpp > LICENSE.clipper + curl -fsSL --retry 5 "https://raw.githubusercontent.com/qhull/qhull/v8.0.2/COPYING.txt" -o LICENSE.qhull + test -s LICENSE.clipper + test -s LICENSE.qhull + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # zlib is linked from the system; Qhull is not on the manylinux image + # and is built from source, mirroring upstream's own before-all step. + cibw-before-all-linux: "dnf -y install zlib-devel && mkdir -p /tmp/qhull && curl -fsSL \"https://github.com/qhull/qhull/archive/refs/tags/v8.0.2.tar.gz\" | tar -xz -C /tmp/qhull --strip-components=1 && cmake -S /tmp/qhull -B /tmp/qhull/build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release && cmake --build /tmp/qhull/build --parallel --target install && ldconfig" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy LIBRARY_PATH=/usr/local/lib LD_LIBRARY_PATH=/usr/local/lib" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest tests -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: GDSTK_VERSION: ${{ matrix.version }} - steps: - - name: Checkout gdstk v${{ env.GDSTK_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: heitzmann/gdstk - ref: v${{ env.GDSTK_VERSION }} - persist-credentials: false - - # external/clipper is compiled straight into the extension under its own - # BSL-1.0 terms (same licence as gdstk, different copyright holder), and - # Qhull is statically linked in too; stage both notices at the root for - # scikit-build-core's default license-files glob. - - name: Stage the vendored dependencies' licences - run: | - sed -n '/Author : Angus Johnson/,/http:\/\/www.boost.org\/LICENSE_1_0.txt/p' \ - external/clipper/clipper.hpp > LICENSE.clipper - curl -fsSL --retry 5 "https://raw.githubusercontent.com/qhull/qhull/${{ env.QHULL_TAG }}/COPYING.txt" -o LICENSE.qhull - test -s LICENSE.clipper - test -s LICENSE.qhull - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # zlib is linked from the system; Qhull is not on the manylinux image - # and is built from source, mirroring upstream's own before-all step. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install zlib-devel && - mkdir -p /tmp/qhull && - curl -fsSL "https://github.com/qhull/qhull/archive/refs/tags/${{ env.QHULL_TAG }}.tar.gz" - | tar -xz -C /tmp/qhull --strip-components=1 && - cmake -S /tmp/qhull -B /tmp/qhull/build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - -DCMAKE_BUILD_TYPE=Release && - cmake --build /tmp/qhull/build --parallel --target install && - ldconfig - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - LIBRARY_PATH=/usr/local/lib - LD_LIBRARY_PATH=/usr/local/lib - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest tests -v + name: gdstk-${{ env.GDSTK_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -120,15 +115,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: gdstk-${{ env.GDSTK_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish gdstk ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-gemmi.yml b/.github/workflows/build-gemmi.yml index 38b259b9e1df..f11234e10184 100644 --- a/.github/workflows/build-gemmi.yml +++ b/.github/workflows/build-gemmi.yml @@ -52,49 +52,58 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build gemmi ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "gemmi" + version: "${{ matrix.version }}" + repository: "project-gemmi/gemmi" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/gemmi/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # find_package(nanobind 2.4.0) in CMakeLists.txt rejects nanobind 3.x as + # incompatible; pyproject.toml's build-system.requires has no upper bound. + cibw-before-all: "echo 'nanobind<3' > /nanobind-constraint.txt" + # The fetched zlib-ng's RVV chunkset/inflate kernels SIGILL on the first + # gzipped file gemmi reads; fall back to its portable C implementation. + cibw-environment-linux: "SKBUILD_CMAKE_ARGS='-DBUILD_GEMMI_PROGRAM=OFF;-DINSTALL_DEV_FILES=OFF;-DBUILD_SHARED_LIBS=OFF;-DFETCH_ZLIB_NG=ON;-DWITH_RVV=OFF' PIP_CONSTRAINT=/nanobind-constraint.txt PIP_BUILD_CONSTRAINT=/nanobind-constraint.txt" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: GEMMI_VERSION: ${{ matrix.version }} - steps: - - name: Checkout gemmi v${{ env.GEMMI_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: project-gemmi/gemmi - ref: v${{ env.GEMMI_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - # stb_sprintf.h has no riscv64 entry in its 64-bit-pointer-arch allowlist. - - name: Patch gemmi source - run: git apply python-wheels/patches/gemmi/${{ env.GEMMI_VERSION }}/00*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # find_package(nanobind 2.4.0) in CMakeLists.txt rejects nanobind 3.x as - # incompatible; pyproject.toml's build-system.requires has no upper bound. - CIBW_BEFORE_ALL: echo 'nanobind<3' > /nanobind-constraint.txt - # The fetched zlib-ng's RVV chunkset/inflate kernels SIGILL on the first - # gzipped file gemmi reads; fall back to its portable C implementation. - CIBW_ENVIRONMENT: >- - SKBUILD_CMAKE_ARGS='-DBUILD_GEMMI_PROGRAM=OFF;-DINSTALL_DEV_FILES=OFF;-DBUILD_SHARED_LIBS=OFF;-DFETCH_ZLIB_NG=ON;-DWITH_RVV=OFF' - PIP_CONSTRAINT=/nanobind-constraint.txt - PIP_BUILD_CONSTRAINT=/nanobind-constraint.txt + name: gemmi-${{ env.GEMMI_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -109,15 +118,9 @@ jobs: assert licences == {"LICENSE.txt"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: gemmi-${{ env.GEMMI_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish gemmi ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-gensim.yml b/.github/workflows/build-gensim.yml index 32d643e8fb58..58ce44948861 100644 --- a/.github/workflows/build-gensim.yml +++ b/.github/workflows/build-gensim.yml @@ -58,9 +58,7 @@ jobs: ref: ${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy" cibw-test-requires: pytest testfixtures mock # Mirrors upstream's own CIBW_TEST_COMMAND (build-wheels.yml), with a fixed # --deselect list for tests that are not riscv64-specific failures: diff --git a/.github/workflows/build-gersemi.yml b/.github/workflows/build-gersemi.yml index bc9a9f17e349..ec5f88609cb5 100644 --- a/.github/workflows/build-gersemi.yml +++ b/.github/workflows/build-gersemi.yml @@ -63,9 +63,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-before-all-linux: >- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - cibw-environment-linux: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" cibw-test-requires: pytest pytest-clarity six pytest-xdist pytest-timeout pydantic cibw-test-sources: tests .gersemirc.example extension-example gersemi/configuration.schema.json # The test phase runs as root, which can still write the read-only cache diff --git a/.github/workflows/build-gevent.yml b/.github/workflows/build-gevent.yml index 3489a1fba812..13af0434506c 100644 --- a/.github/workflows/build-gevent.yml +++ b/.github/workflows/build-gevent.yml @@ -50,72 +50,64 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build gevent ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - GEVENT_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout gevent ${{ env.GEVENT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: gevent/gevent - ref: ${{ env.GEVENT_VERSION }} - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "gevent" + version: "${{ matrix.version }}" + repository: "gevent/gevent" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + git apply python-wheels/patches/gevent/${{ matrix.version }}/00*.patch - # The wheel statically compiles libev, libuv and c-ares but ships only gevent's - # own LICENSE. - - name: Patch gevent source - run: | - git apply python-wheels/patches/gevent/${{ env.GEVENT_VERSION }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "yum -y install libffi-devel" + # As in make-manylinux: NO_CYTHON_COMPILE keeps Cython, which has no riscv64 + # binary wheel, from compiling its own accelerators here; TRAVIS is how it tells + # setup.py it is on CI, which makes the c-ares extension required, not optional. + cibw-environment-linux: "NO_CYTHON_COMPILE=true CI=1 TRAVIS=true" + cibw-test-extras: "test" + # The monkey-patched stdlib tests live in src/greentest and are found by climbing + # to setup.py, so both have to be staged or the runner just warns and skips them + # (17 of 86 test commands). src/gevent stays out so the wheel is what is imported. + cibw-test-sources: "setup.py src/greentest examples" + # GEVENT_MANYLINUX is test-only: during the build it makes setup.py assume + # c-ares was already configured by a separate step, which we don't have. + cibw-test-environment: "GEVENT_MANYLINUX=1 GEVENT_MANYLINUX_NAME=manylinux_2_39_riscv64 GEVENT_LOOP=libev-cext GEVENTTEST_USE_RESOURCES=-network PYTHONHASHSEED=8675309" + cibw-test-command: "python -c \"import gevent; print(gevent, gevent.__version__)\" && python -c \"import gevent.core; print('default loop', gevent.core.loop)\" && GEVENT_LOOP=libuv python -c \"import gevent.core; print('libuv loop', gevent.core.loop)\" && GEVENT_LOOP=libev-cffi python -c \"import gevent.core; print('libev-cffi loop', gevent.core.loop)\" && python -c \"import gevent.ares; print('ares', gevent.ares)\" && python -c \"import importlib.metadata as m; f=[str(p) for p in m.files('gevent')]; missing=[n for n in ('licenses/LICENSE','licenses/NOTICE','licenses/deps/c-ares/LICENSE.md','licenses/deps/libev/LICENSE','licenses/deps/libuv/LICENSE','licenses/deps/libuv/LICENSE-extra') if not any(s.endswith(n) for s in f)]; assert not missing, missing\" && python -m gevent.tests --second-chance" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + GEVENT_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: yum -y install libffi-devel - # As in make-manylinux: NO_CYTHON_COMPILE keeps Cython, which has no riscv64 - # binary wheel, from compiling its own accelerators here; TRAVIS is how it tells - # setup.py it is on CI, which makes the c-ares extension required, not optional. - CIBW_ENVIRONMENT: >- - NO_CYTHON_COMPILE=true - CI=1 - TRAVIS=true - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_EXTRAS: test - # The monkey-patched stdlib tests live in src/greentest and are found by climbing - # to setup.py, so both have to be staged or the runner just warns and skips them - # (17 of 86 test commands). src/gevent stays out so the wheel is what is imported. - CIBW_TEST_SOURCES: setup.py src/greentest examples - # GEVENT_MANYLINUX is test-only: during the build it makes setup.py assume - # c-ares was already configured by a separate step, which we don't have. - CIBW_TEST_ENVIRONMENT: >- - GEVENT_MANYLINUX=1 - GEVENT_MANYLINUX_NAME=manylinux_2_39_riscv64 - GEVENT_LOOP=libev-cext - GEVENTTEST_USE_RESOURCES=-network - PYTHONHASHSEED=8675309 - CIBW_TEST_COMMAND: >- - python -c "import gevent; print(gevent, gevent.__version__)" && - python -c "import gevent.core; print('default loop', gevent.core.loop)" && - GEVENT_LOOP=libuv python -c "import gevent.core; print('libuv loop', gevent.core.loop)" && - GEVENT_LOOP=libev-cffi python -c "import gevent.core; print('libev-cffi loop', gevent.core.loop)" && - python -c "import gevent.ares; print('ares', gevent.ares)" && - python -c "import importlib.metadata as m; f=[str(p) for p in m.files('gevent')]; missing=[n for n in ('licenses/LICENSE','licenses/NOTICE','licenses/deps/c-ares/LICENSE.md','licenses/deps/libev/LICENSE','licenses/deps/libuv/LICENSE','licenses/deps/libuv/LICENSE-extra') if not any(s.endswith(n) for s in f)]; assert not missing, missing" && - python -m gevent.tests --second-chance + name: gevent-${{ env.GEVENT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the compiled extensions made it into the wheel run: | @@ -135,15 +127,9 @@ jobs: print(whl, len(sos), 'extension modules ok') EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: gevent-${{ env.GEVENT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish gevent ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-geventhttpclient.yml b/.github/workflows/build-geventhttpclient.yml index 2716311129ad..6e8130c101b8 100644 --- a/.github/workflows/build-geventhttpclient.yml +++ b/.github/workflows/build-geventhttpclient.yml @@ -50,6 +50,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build geventhttpclient ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: ["cp312", "cp313", "cp314", "cp314t"] + include: + # gevent, a hard runtime dependency, publishes no free-threaded wheel on + # any platform, so the cp314t wheel cannot be installed to be tested. + - python: "cp314t" + test_skip: "*" + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "geventhttpclient" + version: "${{ matrix.version }}" + repository: "geventhttpclient/geventhttpclient" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + checkout-submodules: "recursive" + pre-build: |- + export GEVENTHTTPCLIENT_VERSION='${{ matrix.version }}' + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + patches="$PWD/python-wheels/patches/geventhttpclient/${GEVENTHTTPCLIENT_VERSION}" + if [ -d "$patches" ]; then + git apply -v "$patches"/*.patch + fi + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + # gevent and brotli have no riscv64 wheel on public PyPI. + cibw-test-skip: "${{ matrix.test_skip }}" + # pyproject.toml registers the `network` marker. + cibw-test-sources: "tests pyproject.toml" + # Up to 2.5.1 the test tools are the `dev` extra; from 2.6.0 they are the `dev` + # dependency group (PEP 735) and the extra is gone (pip only warns about it). + cibw-test-extras: "dev" + cibw-test-groups: "dev" + cibw-test-command: "python -c \"import importlib.metadata as m; l = {str(p).split('.dist-info/licenses/')[1] for p in m.files('geventhttpclient') if '.dist-info/licenses/' in str(p)}; assert l in ({'LICENSE-MIT', 'llhttp/LICENSE-MIT'}, {'LICENSE-MIT', 'llhttp/LICENSE'}), l\" && python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: @@ -62,58 +113,15 @@ jobs: # any platform, so the cp314t wheel cannot be installed to be tested. - python: "cp314t" test_skip: "*" - env: GEVENTHTTPCLIENT_VERSION: ${{ matrix.version }} - steps: - # The llhttp parser is a submodule; setup.py compiles its sources directly. - - name: Checkout geventhttpclient ${{ env.GEVENTHTTPCLIENT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: geventhttpclient/geventhttpclient - ref: ${{ env.GEVENTHTTPCLIENT_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # llhttp is compiled into the extension under its own MIT notice, which - # upstream's wheels do not ship before 2.6.0, so only older versions are patched. - - name: Patch geventhttpclient source - run: | - patches="$PWD/python-wheels/patches/geventhttpclient/${GEVENTHTTPCLIENT_VERSION}" - if [ -d "$patches" ]; then - git apply -v "$patches"/*.patch - fi - - # musllinux is skipped: our registry carries gevent and brotli for - # manylinux riscv64 only, so a musl wheel could be neither installed nor tested. - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # gevent and brotli have no riscv64 wheel on public PyPI. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_SKIP: ${{ matrix.test_skip }} - # pyproject.toml registers the `network` marker. - CIBW_TEST_SOURCES: tests pyproject.toml - # Up to 2.5.1 the test tools are the `dev` extra; from 2.6.0 they are the `dev` - # dependency group (PEP 735) and the extra is gone (pip only warns about it). - CIBW_TEST_EXTRAS: dev - CIBW_TEST_GROUPS: dev - CIBW_TEST_COMMAND: >- - python -c "import importlib.metadata as m; - l = {str(p).split('.dist-info/licenses/')[1] for p in m.files('geventhttpclient') if '.dist-info/licenses/' in str(p)}; - assert l in ({'LICENSE-MIT', 'llhttp/LICENSE-MIT'}, {'LICENSE-MIT', 'llhttp/LICENSE'}), l" && - python -m pytest tests + name: geventhttpclient-${{ env.GEVENTHTTPCLIENT_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - # The only proof the untested cp314t wheel really carries the extension. - name: Check the wheel ships the parser extension run: | python3 - wheelhouse/*.whl <<'EOF' @@ -123,15 +131,9 @@ jobs: assert len(sos) == 1 and sos[0].startswith("geventhttpclient/_parser."), sos EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: geventhttpclient-${{ env.GEVENTHTTPCLIENT_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish geventhttpclient ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-glcontext.yml b/.github/workflows/build-glcontext.yml index 88b9de0f5d48..cb570c982591 100644 --- a/.github/workflows/build-glcontext.yml +++ b/.github/workflows/build-glcontext.yml @@ -49,62 +49,68 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build glcontext ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "glcontext" + version: "${{ matrix.version }}" + repository: "moderngl/glcontext" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # Upstream's own release.yml builds wheels with no CIBW_TEST_COMMAND at + # all (it doesn't test wheels before publishing), and its pytest suite + # (tests/default_context_test.py) hard-requires glcontext.default_backend(), + # which on Linux is the x11 backend - it needs a running X server, absent + # on this headless runner. The manylinux/musllinux riscv64 images do ship + # Mesa with a software rasterizer, so the egl backend (this package's + # actual "headless" use case) creates a real OpenGL context via + # EGL_PLATFORM_DEVICE_EXT/llvmpipe with no display - verified locally, so + # that path gets a genuine functional test. The x11 backend is only + # checked for a clean failure (proves the .so loads and resolves its glX + # symbols) rather than a crash, the same pattern as gotcha 253 for glfw. + cibw-test-command: |- + python3 -c " + import ctypes + import glcontext + + create_egl = glcontext.get_backend_by_name('egl') + ctx = create_egl(mode='standalone', glversion=330) + glGetString = ctypes.CFUNCTYPE(ctypes.c_char_p, ctypes.c_uint32)(ctx.load('glGetString')) + vendor = glGetString(0x1F00) + assert vendor, 'empty GL_VENDOR string' + print('EGL standalone context OK, GL_VENDOR =', vendor) + ctx.release() + + try: + glcontext.default_backend()(mode='standalone', glversion=330) + raise SystemExit('expected x11 context creation to fail without a display') + except Exception as exc: + assert 'display' in str(exc).lower(), exc + print('x11 backend failed gracefully as expected:', exc) + " + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: GLCONTEXT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout glcontext ${{ env.GLCONTEXT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: moderngl/glcontext - ref: ${{ env.GLCONTEXT_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # Upstream's own release.yml builds wheels with no CIBW_TEST_COMMAND at - # all (it doesn't test wheels before publishing), and its pytest suite - # (tests/default_context_test.py) hard-requires glcontext.default_backend(), - # which on Linux is the x11 backend - it needs a running X server, absent - # on this headless runner. The manylinux/musllinux riscv64 images do ship - # Mesa with a software rasterizer, so the egl backend (this package's - # actual "headless" use case) creates a real OpenGL context via - # EGL_PLATFORM_DEVICE_EXT/llvmpipe with no display - verified locally, so - # that path gets a genuine functional test. The x11 backend is only - # checked for a clean failure (proves the .so loads and resolves its glX - # symbols) rather than a crash, the same pattern as gotcha 253 for glfw. - CIBW_TEST_COMMAND: | - python3 -c " - import ctypes - import glcontext - - create_egl = glcontext.get_backend_by_name('egl') - ctx = create_egl(mode='standalone', glversion=330) - glGetString = ctypes.CFUNCTYPE(ctypes.c_char_p, ctypes.c_uint32)(ctx.load('glGetString')) - vendor = glGetString(0x1F00) - assert vendor, 'empty GL_VENDOR string' - print('EGL standalone context OK, GL_VENDOR =', vendor) - ctx.release() - - try: - glcontext.default_backend()(mode='standalone', glversion=330) - raise SystemExit('expected x11 context creation to fail without a display') - except Exception as exc: - assert 'display' in str(exc).lower(), exc - print('x11 backend failed gracefully as expected:', exc) - " + name: glcontext-${{ env.GLCONTEXT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the x11 and egl extensions made it into the wheel run: | @@ -117,15 +123,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: glcontext-${{ env.GLCONTEXT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish glcontext ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-glum.yml b/.github/workflows/build-glum.yml index 2e2c931d4c87..8a3d9e05c1ac 100644 --- a/.github/workflows/build-glum.yml +++ b/.github/workflows/build-glum.yml @@ -49,38 +49,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build glum ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "glum" + version: "${{ matrix.version }}" + repository: "Quantco/glum" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # tabmat (a hard runtime dependency) is not yet ported to riscv64 + # (tracked separately in docs/packages/tabmat.yaml); upstream's own + # cibuildwheel config sets test-requires but no test-command, so no + # wheel-import test runs there either. We match that and verify the + # build from the wheel contents alone, below. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scikit-learn" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: GLUM_VERSION: ${{ matrix.version }} - steps: - - name: Checkout glum v${{ env.GLUM_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Quantco/glum - ref: v${{ env.GLUM_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # tabmat (a hard runtime dependency) is not yet ported to riscv64 - # (tracked separately in docs/packages/tabmat.yaml); upstream's own - # cibuildwheel config sets test-requires but no test-command, so no - # wheel-import test runs there either. We match that and verify the - # build from the wheel contents alone, below. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scikit-learn + name: glum-${{ env.GLUM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -96,12 +100,6 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: glum-${{ env.GLUM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -136,7 +134,7 @@ jobs: publish: name: Publish glum ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-gmpy2.yml b/.github/workflows/build-gmpy2.yml index 6cad28fb5ed1..855b229c24b3 100644 --- a/.github/workflows/build-gmpy2.yml +++ b/.github/workflows/build-gmpy2.yml @@ -50,6 +50,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build gmpy2 ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: ["cp312", "cp313", "cp314", "cp314t"] + include: + # Cython, a hard test-only requirement (test-extras builds and imports + # a Cython extension against gmpy2's headers), publishes no + # free-threaded wheel on any architecture, so the suite cannot run + # under cp314t. + - python: "cp314t" + test_skip: "*" + # musllinux dropped: test-extras' numpy and cython both have no + # musllinux riscv64 wheel on PyPI or our registry, so CIBW_TEST_EXTRAS + # cannot resolve in a musl venv (same reasoning as the tree-sitter-* + # family dropping musllinux for its own test dependency). + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "gmpy2" + version: "${{ matrix.version }}" + repository: "gmpy2/gmpy2" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/gmpy2/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + # Restates upstream's [tool.cibuildwheel.environment], which + # CIBW_ENVIRONMENT replaces wholesale; the patch above leaves the + # tree dirty, so pin the version. PIP_EXTRA_INDEX_URL resolves the + # numpy/cython test-extras, which have no riscv64 wheel on PyPI. + cibw-environment-linux: "LD_LIBRARY_PATH=$(pwd)/.local/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=$(pwd)/.local/lib/pkgconfig PYTEST_ADDOPTS=--verbose SETUPTOOLS_SCM_PRETEND_VERSION_FOR_GMPY2=${{ matrix.version }}" + cibw-test-skip: "${{ matrix.test_skip }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: @@ -68,47 +117,14 @@ jobs: # musllinux riscv64 wheel on PyPI or our registry, so CIBW_TEST_EXTRAS # cannot resolve in a musl venv (same reasoning as the tree-sitter-* # family dropping musllinux for its own test dependency). - env: GMPY2_VERSION: ${{ matrix.version }} - steps: - - name: Checkout gmpy2 v${{ env.GMPY2_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: gmpy2/gmpy2 - ref: v${{ env.GMPY2_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - # The wheels dynamically link GMP/MPFR/MPC but ship only gmpy2's own - # COPYING/COPYING.LESSER. - - name: Patch gmpy2 source - run: git apply python-wheels/patches/gmpy2/${{ env.GMPY2_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Restates upstream's [tool.cibuildwheel.environment], which - # CIBW_ENVIRONMENT replaces wholesale; the patch above leaves the - # tree dirty, so pin the version. PIP_EXTRA_INDEX_URL resolves the - # numpy/cython test-extras, which have no riscv64 wheel on PyPI. - CIBW_ENVIRONMENT: >- - LD_LIBRARY_PATH=$(pwd)/.local/lib:$LD_LIBRARY_PATH - PKG_CONFIG_PATH=$(pwd)/.local/lib/pkgconfig - PYTEST_ADDOPTS=--verbose - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_GMPY2=${{ env.GMPY2_VERSION }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_SKIP: ${{ matrix.test_skip }} + name: gmpy2-${{ env.GMPY2_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -122,15 +138,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: gmpy2-${{ env.GMPY2_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish gmpy2 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-google-re2.yml b/.github/workflows/build-google-re2.yml index 2ca1cf6e9c38..fc33da608297 100644 --- a/.github/workflows/build-google-re2.yml +++ b/.github/workflows/build-google-re2.yml @@ -53,63 +53,64 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build google-re2 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - GOOGLE_RE2_VERSION: ${{ matrix.version }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "google-re2" + version: "${{ matrix.version }}" + repository: "google/re2" + ref: '' + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + export GOOGLE_RE2_VERSION='${{ matrix.version }}' + tag="$(echo "${GOOGLE_RE2_VERSION}" | sed -E 's/^1\.1\.([0-9]{4})([0-9]{2})([0-9]{2})$/\1-\2-\3/')" + echo "RE2_TAG=${tag}" >> "$GITHUB_ENV" - steps: - - name: Derive the upstream tag from the version - run: | - tag="$(echo "${GOOGLE_RE2_VERSION}" | sed -E 's/^1\.1\.([0-9]{4})([0-9]{2})([0-9]{2})$/\1-\2-\3/')" - echo "RE2_TAG=${tag}" >> "$GITHUB_ENV" + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Checkout re2 ${{ env.RE2_TAG }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: google/re2 - ref: ${{ env.RE2_TAG }} - persist-credentials: false + git fetch -q --no-tags origin "${RE2_TAG}" + git checkout -q --detach FETCH_HEAD + cibw-environment-linux: "LIBRARY_PATH=/usr/local/lib LD_LIBRARY_PATH=/usr/local/lib ABSEIL_VERSION=20250512.1 PYBIND11_VERSION=3.1.0" + cibw-package-dir: "python" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream builds the extension with Bazel, which publishes no riscv64 + # binary; setup.py's other path links a system RE2, so build RE2 here. + # abseil-cpp is static-with-PIC so it ends up inside libre2.so, which + # keeps the wheel the size Bazel's static link produces upstream. + cibw-before-all-linux: "mkdir -p /tmp/abseil-cpp && curl -sSLf \"https://github.com/abseil/abseil-cpp/archive/refs/tags/${ABSEIL_VERSION}.tar.gz\" | tar -xz -C /tmp/abseil-cpp --strip-components=1 && cmake -S /tmp/abseil-cpp -B /tmp/abseil-cpp/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CXX_STANDARD=17 -DABSL_PROPAGATE_CXX_STD=ON -DABSL_ENABLE_INSTALL=ON -DCMAKE_INSTALL_LIBDIR=lib && cmake --build /tmp/abseil-cpp/build --parallel --target install && cmake -S {project} -B /tmp/re2-build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_LIBDIR=lib && cmake --build /tmp/re2-build --parallel --target install && ldconfig && cp /tmp/abseil-cpp/LICENSE {package}/LICENSE.abseil-cpp" + # setup.py reads pybind11's include path at import time and declares no + # build-system table, so the pin has to be visible to the build itself. + cibw-before-build: "pip install \"pybind11==${PYBIND11_VERSION}\" setuptools wheel" + cibw-build-frontend: "pip; args: --no-build-isolation" + cibw-repair-wheel-command: "auditwheel repair --strip -w {dest_dir} {wheel}" + cibw-test-requires: "absl-py" + cibw-test-sources: "python/re2_test.py" + cibw-test-command: "python python/re2_test.py" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + GOOGLE_RE2_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: python - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_PASS_LINUX: ABSEIL_VERSION PYBIND11_VERSION - # Upstream builds the extension with Bazel, which publishes no riscv64 - # binary; setup.py's other path links a system RE2, so build RE2 here. - # abseil-cpp is static-with-PIC so it ends up inside libre2.so, which - # keeps the wheel the size Bazel's static link produces upstream. - CIBW_BEFORE_ALL_LINUX: >- - mkdir -p /tmp/abseil-cpp && - curl -sSLf "https://github.com/abseil/abseil-cpp/archive/refs/tags/${ABSEIL_VERSION}.tar.gz" - | tar -xz -C /tmp/abseil-cpp --strip-components=1 && - cmake -S /tmp/abseil-cpp -B /tmp/abseil-cpp/build -DCMAKE_BUILD_TYPE=Release - -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CXX_STANDARD=17 - -DABSL_PROPAGATE_CXX_STD=ON -DABSL_ENABLE_INSTALL=ON -DCMAKE_INSTALL_LIBDIR=lib && - cmake --build /tmp/abseil-cpp/build --parallel --target install && - cmake -S {project} -B /tmp/re2-build -DCMAKE_BUILD_TYPE=Release - -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_LIBDIR=lib && - cmake --build /tmp/re2-build --parallel --target install && - ldconfig && - cp /tmp/abseil-cpp/LICENSE {package}/LICENSE.abseil-cpp - CIBW_ENVIRONMENT: LIBRARY_PATH=/usr/local/lib LD_LIBRARY_PATH=/usr/local/lib - # setup.py reads pybind11's include path at import time and declares no - # build-system table, so the pin has to be visible to the build itself. - CIBW_BEFORE_BUILD: pip install "pybind11==${PYBIND11_VERSION}" setuptools wheel - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_REPAIR_WHEEL_COMMAND: auditwheel repair --strip -w {dest_dir} {wheel} - CIBW_TEST_REQUIRES: absl-py - CIBW_TEST_SOURCES: python/re2_test.py - CIBW_TEST_COMMAND: python python/re2_test.py + name: google-re2-${{ env.GOOGLE_RE2_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and the licences made it into the wheel run: | @@ -123,15 +124,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: google-re2-${{ env.GOOGLE_RE2_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish google-re2 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-gpy.yml b/.github/workflows/build-gpy.yml index 7e2843416a58..805d60c4f674 100644 --- a/.github/workflows/build-gpy.yml +++ b/.github/workflows/build-gpy.yml @@ -48,45 +48,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build GPy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "gpy" + version: "${{ matrix.version }}" + repository: "SheffieldML/GPy" + ref: "refs/tags/v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build-frontend: "build" + # numpy, scipy and Cython (build) and matplotlib's compiled deps (test) need a + # riscv64 wheel; PIP_ONLY_BINARY keeps a newer PyPI sdist from winning the + # resolution and compiling from source instead. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,Cython,matplotlib,pillow,contourpy,kiwisolver" + cibw-test-requires: "pytest matplotlib" + # The suite lives inside the package: --pyargs runs the wheel's copy, while + # {project}/GPy/testing would import GPy from the uncompiled checkout. + cibw-test-command: "python -c \"from GPy.kern.src import stationary_cython, coregionalize_cython; from GPy.util import choleskies_cython, linalg_cython; from GPy.models import state_space_cython\" && pytest --pyargs GPy.testing" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: GPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout GPy v${{ env.GPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: SheffieldML/GPy - # Upstream also has a v1.14.2 *branch* (still at 1.14.1), which a bare ref resolves to first. - ref: refs/tags/v${{ env.GPY_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BUILD_FRONTEND: build - # numpy, scipy and Cython (build) and matplotlib's compiled deps (test) need a - # riscv64 wheel; PIP_ONLY_BINARY keeps a newer PyPI sdist from winning the - # resolution and compiling from source instead. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,Cython,matplotlib,pillow,contourpy,kiwisolver - CIBW_TEST_REQUIRES: pytest matplotlib - # The suite lives inside the package: --pyargs runs the wheel's copy, while - # {project}/GPy/testing would import GPy from the uncompiled checkout. - CIBW_TEST_COMMAND: >- - python -c "from GPy.kern.src import stationary_cython, coregionalize_cython; from GPy.util import choleskies_cython, linalg_cython; from GPy.models import state_space_cython" - && pytest --pyargs GPy.testing + name: gpy-${{ env.GPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -99,16 +101,9 @@ jobs: assert licences == {"AUTHORS.txt", "LICENSE.txt"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: gpy-${{ env.GPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish GPy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-gsd.yml b/.github/workflows/build-gsd.yml index b3c9730155b2..03fb25c339fa 100644 --- a/.github/workflows/build-gsd.yml +++ b/.github/workflows/build-gsd.yml @@ -52,35 +52,41 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build gsd ${{ matrix.version }} cp311-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "gsd" + version: "${{ matrix.version }}" + repository: "glotzerlab/gsd" + ref: "v${{ matrix.version }}" + artifact-tag: "cp311-abi3-manylinux_riscv64" + timeout-minutes: 90 + cibw-build: "cp311-manylinux_riscv64" + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest==8.4.2 numpy==2.3.3" + cibw-test-command: "pytest --pyargs gsd -v --log-level=DEBUG" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: GSD_VERSION: ${{ matrix.version }} - steps: - - name: Checkout glotzerlab/gsd v${{ env.GSD_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: glotzerlab/gsd - ref: v${{ env.GSD_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: cp311-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest==8.4.2 numpy==2.3.3 - CIBW_TEST_COMMAND: pytest --pyargs gsd -v --log-level=DEBUG + name: gsd-${{ env.GSD_VERSION }}-cp311-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension and licence made it into the wheel run: | @@ -93,15 +99,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: gsd-${{ env.GSD_VERSION }}-cp311-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish gsd ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-gseapy.yml b/.github/workflows/build-gseapy.yml index 259eb0f4aae8..d5d3a1032e04 100644 --- a/.github/workflows/build-gseapy.yml +++ b/.github/workflows/build-gseapy.yml @@ -50,6 +50,32 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build gseapy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + # pandas, a hard runtime dependency, has no cp314t riscv64 wheel on pypi.riseproject.dev. + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "gseapy" + version: "${{ matrix.version }}" + repository: "zqfang/GSEApy" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "yum install libatomic -y && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" PIP_ONLY_BINARY=numpy,scipy,pandas,matplotlib,contourpy,kiwisolver,pillow,fonttools,lxml,pyyaml" + cibw-before-build: "python -m pip install -U pip setuptools wheel build setuptools-rust" + cibw-test-extras: "test" + cibw-test-sources: "tests pyproject.toml" + cibw-test-command: "pytest tests" + cibw-test-skip: "${{ case(endsWith(matrix.python, 't'), '*', '') }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: @@ -57,51 +83,21 @@ jobs: matrix: # pandas, a hard runtime dependency, has no cp314t riscv64 wheel on pypi.riseproject.dev. include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: GSEAPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout gseapy v${{ env.GSEAPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: zqfang/GSEApy - ref: v${{ env.GSEAPY_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - yum install libatomic -y && - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas,matplotlib,contourpy,kiwisolver,pillow,fonttools,lxml,pyyaml - CIBW_BEFORE_BUILD: >- - python -m pip install -U pip setuptools wheel build setuptools-rust - CIBW_TEST_EXTRAS: test - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_COMMAND: pytest tests - CIBW_TEST_SKIP: ${{ case(endsWith(matrix.python, 't'), '*', '') }} + name: gseapy-${{ env.GSEAPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the Rust extension is in the wheel run: python3 -m zipfile -l wheelhouse/*.whl | grep -E 'gseapy/gse\..*\.so' - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: gseapy-${{ env.GSEAPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish gseapy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-gstools-cython.yml b/.github/workflows/build-gstools-cython.yml index 4646a0680a70..e32fbbd14140 100644 --- a/.github/workflows/build-gstools-cython.yml +++ b/.github/workflows/build-gstools-cython.yml @@ -49,38 +49,41 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build gstools-cython ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "gstools-cython" + version: "${{ matrix.version }}" + repository: "GeoStat-Framework/GSTools-Cython" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-fetch-depth: 0 + # musllinux is dropped: numpy has no musllinux_riscv64 wheel on pypi.riseproject.dev. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is both a build and a runtime dependency; only our registry has riscv64 + # wheels, and PIP_ONLY_BINARY keeps a newer PyPI sdist from winning the resolution. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: GSTOOLS_CYTHON_VERSION: ${{ matrix.version }} - steps: - - name: Checkout GSTools-Cython v${{ env.GSTOOLS_CYTHON_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: GeoStat-Framework/GSTools-Cython - ref: v${{ env.GSTOOLS_CYTHON_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # musllinux is dropped: numpy has no musllinux_riscv64 wheel on pypi.riseproject.dev. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is both a build and a runtime dependency; only our registry has riscv64 - # wheels, and PIP_ONLY_BINARY keeps a newer PyPI sdist from winning the resolution. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + name: gstools-cython-${{ env.GSTOOLS_CYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the licence and the compiled extensions run: | @@ -93,15 +96,9 @@ jobs: assert any(n.startswith(f"gstools_cython/{ext}.") and n.endswith(".so") for n in names), names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: gstools-cython-${{ env.GSTOOLS_CYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish gstools-cython ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-gsw.yml b/.github/workflows/build-gsw.yml index 73cec854bfc7..6cbc16aa856d 100644 --- a/.github/workflows/build-gsw.yml +++ b/.github/workflows/build-gsw.yml @@ -49,44 +49,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build gsw ${{ matrix.version }} cp311-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "gsw" + version: "${{ matrix.version }}" + repository: "TEOS-10/GSW-python" + ref: "v${{ matrix.version }}" + artifact-tag: "cp311-abi3-manylinux_riscv64" + cibw-build: "cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # setup.py hardcodes Py_LIMITED_API at the cp311 floor unconditionally + # (no free-threaded branch, unlike upstream's own CI which never attempts + # cp314t either), and setuptools-scm can't see the tag from + # cibuildwheel's shallow checkout. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,pandas SETUPTOOLS_SCM_PRETEND_VERSION_FOR_GSW=${{ matrix.version }}" + cibw-test-requires: "pytest pandas>=2" + cibw-test-command: "python -c \"import gsw; print(f'gsw v{gsw.__version__}')\" && python -m pytest --pyargs gsw" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: GSW_VERSION: ${{ matrix.version }} - steps: - - name: Checkout gsw v${{ env.GSW_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: TEOS-10/GSW-python - ref: v${{ env.GSW_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_BUILD: >- - cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py hardcodes Py_LIMITED_API at the cp311 floor unconditionally - # (no free-threaded branch, unlike upstream's own CI which never attempts - # cp314t either), and setuptools-scm can't see the tag from - # cibuildwheel's shallow checkout. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pandas - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_GSW=${{ env.GSW_VERSION }} - CIBW_TEST_REQUIRES: pytest pandas>=2 - CIBW_TEST_COMMAND: >- - python -c "import gsw; print(f'gsw v{gsw.__version__}')" && - python -m pytest --pyargs gsw + name: gsw-${{ env.GSW_VERSION }}-cp311-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -101,16 +101,9 @@ jobs: print(whl, "ok") EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: gsw-${{ env.GSW_VERSION }}-cp311-abi3-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish gsw ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-guardpycfn.yml b/.github/workflows/build-guardpycfn.yml index 312d74c99832..80f0f6742cd2 100644 --- a/.github/workflows/build-guardpycfn.yml +++ b/.github/workflows/build-guardpycfn.yml @@ -58,144 +58,162 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build guardpycfn ${{ matrix.version }} cp39-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "guardpycfn" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 240 + pre-build: |- + export GUARDPYCFN_VERSION='${{ matrix.version }}' + url="$(curl -sSfL "https://pypi.org/pypi/guardpycfn/${GUARDPYCFN_VERSION}/json" \ + | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" + curl -sSfL -o sdist.tar.gz "$url" + # Extracted rather than passed as a tarball so CIBW_TEST_SOURCES resolves. + tar xzf sdist.tar.gz + test -f "guardpycfn-${GUARDPYCFN_VERSION}/pyproject.toml" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + tag="$(cat vendor/UPSTREAM_GUARD_VERSION)" + base="https://raw.githubusercontent.com/aws-cloudformation/cloudformation-guard/${tag#v}" + curl -sSfL -o LICENSE.cfn-guard "$base/LICENSE" + curl -sSfL -o NOTICE.cfn-guard "$base/NOTICE" + curl -sSfL -o NOTICE.cfn-guard-attribution "$base/ATTRIBUTION" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + mkdir -p tests + cat > tests/test_guardpycfn.py <<'PYTEST' + import importlib.util + import json + + import pytest + + import guardpycfn + + TEMPLATE_YAML = """\ + AWSTemplateFormatVersion: '2010-09-09' + Resources: + Bucket: + Type: AWS::S3::Bucket + Properties: + BucketName: demo + """ + + TEMPLATE_JSON = json.dumps( + { + "AWSTemplateFormatVersion": "2010-09-09", + "Resources": { + "Bucket": {"Type": "AWS::S3::Bucket", "Properties": {"BucketName": "demo"}} + }, + } + ) + + NAMED = "rule s3_named { Resources.*[ Type == 'AWS::S3::Bucket' ].Properties.BucketName exists }" + VERSIONED = ( + "rule s3_versioned { Resources.*[ Type == 'AWS::S3::Bucket' ]" + ".Properties.VersioningConfiguration exists }" + ) + + + def test_extension_is_compiled(): + origin = importlib.util.find_spec("guardpycfn.guardpycfn").origin + assert origin.endswith(".abi3.so"), origin + + + @pytest.mark.parametrize("template", [TEMPLATE_YAML, TEMPLATE_JSON]) + def test_compliant(template): + res = guardpycfn.validate_with_guard(template, NAMED) + assert res["tool"] == "guard" + assert res["success"] is True, res + assert res["result"]["status"] == "PASS" + assert res["result"]["compliant"] == ["s3_named"] + assert res["result"]["not_compliant"] == [] + + + def test_not_compliant(): + res = guardpycfn.validate_with_guard(TEMPLATE_YAML, VERSIONED) + assert res["success"] is True, res + assert res["result"]["status"] == "FAIL" + [failure] = res["result"]["not_compliant"] + assert failure["Rule"]["name"] == "s3_versioned" + + + def test_mixed_rules(): + res = guardpycfn.validate_with_guard(TEMPLATE_YAML, NAMED + "\n" + VERSIONED) + assert res["result"]["status"] == "FAIL" + assert res["result"]["compliant"] == ["s3_named"] + assert [r["Rule"]["name"] for r in res["result"]["not_compliant"]] == ["s3_versioned"] + + + @pytest.mark.parametrize("rules", [None, "", " "]) + def test_rules_required(rules): + res = guardpycfn.validate_with_guard(TEMPLATE_YAML, rules) + assert res == { + "tool": "guard", + "success": False, + "error": "rules is required and must be non-empty", + } + + + def test_rules_parse_error(): + res = guardpycfn.validate_with_guard(TEMPLATE_YAML, "this is not guard") + assert res["success"] is False + assert "RULES_STDIN" in res["error"] + + + def test_verbose(): + res = guardpycfn.validate_with_guard(TEMPLATE_YAML, NAMED, verbose=True) + assert res["success"] is True, res + assert res["result"] + PYTEST + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "guardpycfn-${{ matrix.version }}" + # pyo3 `abi3-py39`: compiled once on cp39 (the floor the tag claims), then + # reused and re-tested on the newer interpreters. No free-threaded build: + # abi3 cannot target it and upstream ships none. + cibw-build: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*" + # rustup.rs ships no riscv64 musl host toolchain. + cibw-skip: "*-musllinux_*" + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: GUARDPYCFN_VERSION: ${{ matrix.version }} - steps: - - name: Fetch guardpycfn ${{ env.GUARDPYCFN_VERSION }} sdist - run: | - url="$(curl -sSfL "https://pypi.org/pypi/guardpycfn/${GUARDPYCFN_VERSION}/json" \ - | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" - curl -sSfL -o sdist.tar.gz "$url" - # Extracted rather than passed as a tarball so CIBW_TEST_SOURCES resolves. - tar xzf sdist.tar.gz - test -f "guardpycfn-${GUARDPYCFN_VERSION}/pyproject.toml" - - # The sdist drops cloudformation-guard's LICENSE/NOTICE/ATTRIBUTION (Apache-2.0, - # plus its crates' notices); maturin's default LICEN[CS]E*/NOTICE* globs pick - # them up from the project root. - - name: Stage cloudformation-guard licences - working-directory: guardpycfn-${{ env.GUARDPYCFN_VERSION }} - run: | - tag="$(cat vendor/UPSTREAM_GUARD_VERSION)" - base="https://raw.githubusercontent.com/aws-cloudformation/cloudformation-guard/${tag#v}" - curl -sSfL -o LICENSE.cfn-guard "$base/LICENSE" - curl -sSfL -o NOTICE.cfn-guard "$base/NOTICE" - curl -sSfL -o NOTICE.cfn-guard-attribution "$base/ATTRIBUTION" - - - name: Stage smoke tests - run: | - mkdir -p tests - cat > tests/test_guardpycfn.py <<'PYTEST' - import importlib.util - import json - - import pytest - - import guardpycfn - - TEMPLATE_YAML = """\ - AWSTemplateFormatVersion: '2010-09-09' - Resources: - Bucket: - Type: AWS::S3::Bucket - Properties: - BucketName: demo - """ - - TEMPLATE_JSON = json.dumps( - { - "AWSTemplateFormatVersion": "2010-09-09", - "Resources": { - "Bucket": {"Type": "AWS::S3::Bucket", "Properties": {"BucketName": "demo"}} - }, - } - ) - - NAMED = "rule s3_named { Resources.*[ Type == 'AWS::S3::Bucket' ].Properties.BucketName exists }" - VERSIONED = ( - "rule s3_versioned { Resources.*[ Type == 'AWS::S3::Bucket' ]" - ".Properties.VersioningConfiguration exists }" - ) - - - def test_extension_is_compiled(): - origin = importlib.util.find_spec("guardpycfn.guardpycfn").origin - assert origin.endswith(".abi3.so"), origin - - - @pytest.mark.parametrize("template", [TEMPLATE_YAML, TEMPLATE_JSON]) - def test_compliant(template): - res = guardpycfn.validate_with_guard(template, NAMED) - assert res["tool"] == "guard" - assert res["success"] is True, res - assert res["result"]["status"] == "PASS" - assert res["result"]["compliant"] == ["s3_named"] - assert res["result"]["not_compliant"] == [] - - - def test_not_compliant(): - res = guardpycfn.validate_with_guard(TEMPLATE_YAML, VERSIONED) - assert res["success"] is True, res - assert res["result"]["status"] == "FAIL" - [failure] = res["result"]["not_compliant"] - assert failure["Rule"]["name"] == "s3_versioned" - - - def test_mixed_rules(): - res = guardpycfn.validate_with_guard(TEMPLATE_YAML, NAMED + "\n" + VERSIONED) - assert res["result"]["status"] == "FAIL" - assert res["result"]["compliant"] == ["s3_named"] - assert [r["Rule"]["name"] for r in res["result"]["not_compliant"]] == ["s3_versioned"] - - - @pytest.mark.parametrize("rules", [None, "", " "]) - def test_rules_required(rules): - res = guardpycfn.validate_with_guard(TEMPLATE_YAML, rules) - assert res == { - "tool": "guard", - "success": False, - "error": "rules is required and must be non-empty", - } - - - def test_rules_parse_error(): - res = guardpycfn.validate_with_guard(TEMPLATE_YAML, "this is not guard") - assert res["success"] is False - assert "RULES_STDIN" in res["error"] - - - def test_verbose(): - res = guardpycfn.validate_with_guard(TEMPLATE_YAML, NAMED, verbose=True) - assert res["success"] is True, res - assert res["result"] - PYTEST - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - package-dir: guardpycfn-${{ env.GUARDPYCFN_VERSION }} - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ARCHS: riscv64 - # pyo3 `abi3-py39`: compiled once on cp39 (the floor the tag claims), then - # reused and re-tested on the newer interpreters. No free-threaded build: - # abi3 cannot target it and upstream ships none. - CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*" - # rustup.rs ships no riscv64 musl host toolchain. - CIBW_SKIP: "*-musllinux_*" - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest -v tests + name: guardpycfn-${{ env.GUARDPYCFN_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension module and licences made it into the wheel run: | @@ -211,15 +229,9 @@ jobs: print('OK:', sys.argv[1], sos, lic) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: guardpycfn-${{ env.GUARDPYCFN_VERSION }}-cp39-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish guardpycfn ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-h5py.yml b/.github/workflows/build-h5py.yml index 34e75b2e9b98..059fa38a2982 100644 --- a/.github/workflows/build-h5py.yml +++ b/.github/workflows/build-h5py.yml @@ -56,94 +56,97 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build h5py ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "h5py" + version: "${{ matrix.version }}" + repository: "h5py/h5py" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 420 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/h5py/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # libaec (szip) then HDF5, mirroring h5py/hdf5-manylinux's + # install_libaec.sh and install_hdf5.sh. CMAKE_INSTALL_LIBDIR is pinned + # because HDF5_DIR resolves libraries as $HDF5_DIR/lib only, and cmake + # defaults to lib64 on Rocky (upstream pinned it the same way in + # h5py/hdf5-manylinux@5b15b5d). + cibw-before-all-linux: |- + set -ex + dnf -y install zlib-devel + mkdir -p /tmp/libaec /tmp/hdf5 + curl -fsSL "https://github.com/Deutsches-Klimarechenzentrum/libaec/releases/download/v$LIBAEC_VERSION/libaec-$LIBAEC_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/libaec + cmake -S /tmp/libaec -B /tmp/libaec/build \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_INSTALL_PREFIX="$HDF5_DIR" \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D BUILD_STATIC_LIBS=OFF \ + -D BUILD_TESTING=OFF + cmake --build /tmp/libaec/build -j "$(nproc)" + cmake --install /tmp/libaec/build + ldconfig + curl -fsSL "https://github.com/HDFGroup/hdf5/archive/refs/tags/$HDF5_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/hdf5 + cmake -S /tmp/hdf5 -B /tmp/hdf5/build \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_INSTALL_PREFIX="$HDF5_DIR" \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D BUILD_TESTING=OFF \ + -D BUILD_STATIC_LIBS=OFF \ + -D HDF5_BUILD_EXAMPLES=OFF \ + -D HDF5_BUILD_TOOLS=OFF \ + -D HDF5_BUILD_UTILS=OFF \ + -D HDF5_ENABLE_ZLIB_SUPPORT=ON \ + -D HDF5_ENABLE_SZIP_SUPPORT=ON + cmake --build /tmp/hdf5/build -j "$(nproc)" + cmake --install /tmp/hdf5/build + ldconfig + # HDF5_DIR/HDF5_VERSION are `ENV` in upstream's wheel image; CFLAGS=-g1 + # comes from h5py's own [tool.cibuildwheel.linux.environment], which + # this variable replaces wholesale. + cibw-environment-linux: "HDF5_DIR=/usr/local HDF5_VERSION=2.0.0 LIBAEC_VERSION=1.1.4 CFLAGS=-g1" + # Upstream tests wheels through tox envs that resolve NumPy from the + # scientific-python nightly index and need tox-uv; neither works on + # riscv64, so run the suite the tox `test` env runs, directly. + cibw-test-groups: '' + cibw-test-requires: "pytest pytest-mpi" + cibw-test-sources: "pytest.ini" + cibw-test-environment: "H5PY_TEST_CHECK_FILTERS=1" + cibw-test-command: "python -c \"from h5py.version import info; print(info)\" && python -c \"from h5py import filters; print('Included filters:', filters.encode, filters.decode)\" && python -m pytest --pyargs h5py -rxXs" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 420 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: H5PY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout h5py ${{ env.H5PY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: h5py/h5py - ref: ${{ env.H5PY_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch h5py source - run: git apply python-wheels/patches/h5py/${{ env.H5PY_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # libaec (szip) then HDF5, mirroring h5py/hdf5-manylinux's - # install_libaec.sh and install_hdf5.sh. CMAKE_INSTALL_LIBDIR is pinned - # because HDF5_DIR resolves libraries as $HDF5_DIR/lib only, and cmake - # defaults to lib64 on Rocky (upstream pinned it the same way in - # h5py/hdf5-manylinux@5b15b5d). - CIBW_BEFORE_ALL_LINUX: | - set -ex - dnf -y install zlib-devel - mkdir -p /tmp/libaec /tmp/hdf5 - curl -fsSL "https://github.com/Deutsches-Klimarechenzentrum/libaec/releases/download/v$LIBAEC_VERSION/libaec-$LIBAEC_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/libaec - cmake -S /tmp/libaec -B /tmp/libaec/build \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_INSTALL_PREFIX="$HDF5_DIR" \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D BUILD_STATIC_LIBS=OFF \ - -D BUILD_TESTING=OFF - cmake --build /tmp/libaec/build -j "$(nproc)" - cmake --install /tmp/libaec/build - ldconfig - curl -fsSL "https://github.com/HDFGroup/hdf5/archive/refs/tags/$HDF5_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/hdf5 - cmake -S /tmp/hdf5 -B /tmp/hdf5/build \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_INSTALL_PREFIX="$HDF5_DIR" \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D BUILD_TESTING=OFF \ - -D BUILD_STATIC_LIBS=OFF \ - -D HDF5_BUILD_EXAMPLES=OFF \ - -D HDF5_BUILD_TOOLS=OFF \ - -D HDF5_BUILD_UTILS=OFF \ - -D HDF5_ENABLE_ZLIB_SUPPORT=ON \ - -D HDF5_ENABLE_SZIP_SUPPORT=ON - cmake --build /tmp/hdf5/build -j "$(nproc)" - cmake --install /tmp/hdf5/build - ldconfig - # HDF5_DIR/HDF5_VERSION are `ENV` in upstream's wheel image; CFLAGS=-g1 - # comes from h5py's own [tool.cibuildwheel.linux.environment], which - # this variable replaces wholesale. - CIBW_ENVIRONMENT: >- - HDF5_DIR=/usr/local - HDF5_VERSION=${{ env.HDF5_VERSION }} - LIBAEC_VERSION=${{ env.LIBAEC_VERSION }} - CFLAGS=-g1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream tests wheels through tox envs that resolve NumPy from the - # scientific-python nightly index and need tox-uv; neither works on - # riscv64, so run the suite the tox `test` env runs, directly. - CIBW_TEST_GROUPS: '' - CIBW_TEST_REQUIRES: pytest pytest-mpi - CIBW_TEST_SOURCES: pytest.ini - CIBW_TEST_ENVIRONMENT: H5PY_TEST_CHECK_FILTERS=1 - CIBW_TEST_COMMAND: >- - python -c "from h5py.version import info; print(info)" && - python -c "from h5py import filters; print('Included filters:', filters.encode, filters.decode)" && - python -m pytest --pyargs h5py -rxXs + name: h5py-${{ env.H5PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extensions and the bundled licences run: | @@ -158,15 +161,9 @@ jobs: ), (licence, names) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: h5py-${{ env.H5PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish h5py ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-habluetooth.yml b/.github/workflows/build-habluetooth.yml index 272cdaa64874..b8b1ef896451 100644 --- a/.github/workflows/build-habluetooth.yml +++ b/.github/workflows/build-habluetooth.yml @@ -67,12 +67,7 @@ jobs: cibw-before-all: echo 'Cython<3.3.0' > /cython-constraint.txt # only-binary keeps pip off PyPI's newest cryptography, which has no # riscv64 wheel, so bluetooth-data-tools resolves ours from the registry. - cibw-environment: >- - REQUIRE_CYTHON=1 - PIP_CONSTRAINT=/cython-constraint.txt - PIP_BUILD_CONSTRAINT=/cython-constraint.txt - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=cryptography + cibw-environment-linux: "REQUIRE_CYTHON=1 PIP_CONSTRAINT=/cython-constraint.txt PIP_BUILD_CONSTRAINT=/cython-constraint.txt PIP_ONLY_BINARY=cryptography" # Upstream's pytest ini is not staged (its addopts are coverage-only); # log_level is the one key the caplog assertions need. cibw-test-sources: tests diff --git a/.github/workflows/build-harmonypy.yml b/.github/workflows/build-harmonypy.yml index 7bb8e8b96d1c..b9a10d84e072 100644 --- a/.github/workflows/build-harmonypy.yml +++ b/.github/workflows/build-harmonypy.yml @@ -49,48 +49,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build harmonypy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "harmonypy" + version: "${{ matrix.version }}" + repository: "slowkow/harmonypy" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + set -euo pipefail + armadillo_url="$(grep -o 'https://sourceforge.net/projects/arma/files/armadillo-[0-9.]*\.tar\.xz' CMakeLists.txt)" + mkdir "${RUNNER_TEMP}/armadillo" + curl -fsSL --retry 5 "${armadillo_url}" | tar xJ -C "${RUNNER_TEMP}/armadillo" --strip-components=1 + cp "${RUNNER_TEMP}/armadillo/LICENSE.txt" LICENSE.armadillo + cp "${RUNNER_TEMP}/armadillo/NOTICE.txt" NOTICE.armadillo + nanobind_version="$(curl -fsSL --retry 5 https://pypi.org/pypi/nanobind/json | python3 -c 'import json, sys; print(json.load(sys.stdin)["info"]["version"])')" + git clone --depth 1 --branch "v${nanobind_version}" --recurse-submodules --shallow-submodules \ + https://github.com/wjakob/nanobind.git "${RUNNER_TEMP}/nanobind" + cp "${RUNNER_TEMP}/nanobind/LICENSE" LICENSE.nanobind + cp "${RUNNER_TEMP}/nanobind/ext/robin_map/LICENSE" LICENSE.robin-map + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: HARMONYPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout harmonypy v${{ env.HARMONYPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: slowkow/harmonypy - ref: v${{ env.HARMONYPY_VERSION }} - persist-credentials: false - - # The extension compiles in Armadillo (Apache-2.0, FetchContent'd by - # CMakeLists.txt), nanobind (BSD-3-Clause) and its robin-map (MIT); upstream - # ships only its own LICENSE. - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - armadillo_url="$(grep -o 'https://sourceforge.net/projects/arma/files/armadillo-[0-9.]*\.tar\.xz' CMakeLists.txt)" - mkdir "${RUNNER_TEMP}/armadillo" - curl -fsSL --retry 5 "${armadillo_url}" | tar xJ -C "${RUNNER_TEMP}/armadillo" --strip-components=1 - cp "${RUNNER_TEMP}/armadillo/LICENSE.txt" LICENSE.armadillo - cp "${RUNNER_TEMP}/armadillo/NOTICE.txt" NOTICE.armadillo - nanobind_version="$(curl -fsSL --retry 5 https://pypi.org/pypi/nanobind/json | python3 -c 'import json, sys; print(json.load(sys.stdin)["info"]["version"])')" - git clone --depth 1 --branch "v${nanobind_version}" --recurse-submodules --shallow-submodules \ - https://github.com/wjakob/nanobind.git "${RUNNER_TEMP}/nanobind" - cp "${RUNNER_TEMP}/nanobind/LICENSE" LICENSE.nanobind - cp "${RUNNER_TEMP}/nanobind/ext/robin_map/LICENSE" LICENSE.robin-map - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + name: harmonypy-${{ env.HARMONYPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -104,15 +109,9 @@ jobs: "LICENSE.nanobind", "LICENSE.robin-map"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: harmonypy-${{ env.HARMONYPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish harmonypy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-hdbscan.yml b/.github/workflows/build-hdbscan.yml index 19e161600f66..318bb23172af 100644 --- a/.github/workflows/build-hdbscan.yml +++ b/.github/workflows/build-hdbscan.yml @@ -58,9 +58,7 @@ jobs: ref: release-${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,scikit-learn + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,scikit-learn" cibw-test-requires: pytest # Mirrors upstream's own test invocation (azure-pipelines.yml's RunAllTests # stage: `pytest hdbscan/tests --show-capture=no -v --disable-warnings`), diff --git a/.github/workflows/build-hdf5plugin.yml b/.github/workflows/build-hdf5plugin.yml index 29e0ce19c7d7..e2df67732970 100644 --- a/.github/workflows/build-hdf5plugin.yml +++ b/.github/workflows/build-hdf5plugin.yml @@ -55,61 +55,68 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build hdf5plugin ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "hdf5plugin" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 90 + pre-build: |- + set -euo pipefail + shopt -s dotglob + rm -rf ./* + git init -q . + git remote add origin https://github.com/silx-kit/hdf5plugin + git fetch -q --depth=1 origin "v${{ matrix.version }}" + git checkout -q FETCH_HEAD + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/hdf5plugin/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # setup.py's BDistWheel.get_tag() forces py3-none, so one build serves every interpreter. + cibw-build: "cp312-manylinux_riscv64" + # Mirrors release.yml's non-x86 matrix entries (with_sse2: false): a portable + # build with no host-native SIMD/OpenMP baked in. HDF5PLUGIN_BMI2 is left at + # its default (True on Linux) -- zstd's BMI2 asm self-gates on __x86_64__, a + # no-op here, same as upstream leaves it for ppc64le/aarch64. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,h5py,blosc2 HDF5PLUGIN_OPENMP=False HDF5PLUGIN_NATIVE=False HDF5PLUGIN_SSE2=False HDF5PLUGIN_SSSE3=False HDF5PLUGIN_AVX2=False HDF5PLUGIN_AVX512=False HDF5PLUGIN_CPP11=True HDF5PLUGIN_CPP14=True HDF5PLUGIN_CPP20=True" + cibw-before-test: "pip install packaging h5py blosc2 --only-binary \":all:\"" + cibw-test-command: "python {project}/test/test.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: HDF5PLUGIN_VERSION: ${{ matrix.version }} - steps: - # lib/bitshuffle/zstd and two lib/snappy/third_party/ paths are gitlinks with - # no corresponding .gitmodules entry upstream, which makes actions/checkout's - # own persist-credentials cleanup (`git submodule foreach`) fail with "No url - # found for submodule path"; plain git sidesteps that internal routine. - - name: Checkout hdf5plugin v${{ env.HDF5PLUGIN_VERSION }} - run: | - set -euo pipefail - shopt -s dotglob - rm -rf ./* - git init -q . - git remote add origin https://github.com/silx-kit/hdf5plugin - git fetch -q --depth=1 origin "v${{ env.HDF5PLUGIN_VERSION }}" - git checkout -q FETCH_HEAD - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Patch hdf5plugin source - run: git apply python-wheels/patches/hdf5plugin/${{ env.HDF5PLUGIN_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # setup.py's BDistWheel.get_tag() forces py3-none, so one build serves every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Mirrors release.yml's non-x86 matrix entries (with_sse2: false): a portable - # build with no host-native SIMD/OpenMP baked in. HDF5PLUGIN_BMI2 is left at - # its default (True on Linux) -- zstd's BMI2 asm self-gates on __x86_64__, a - # no-op here, same as upstream leaves it for ppc64le/aarch64. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,h5py,blosc2 - HDF5PLUGIN_OPENMP=False - HDF5PLUGIN_NATIVE=False - HDF5PLUGIN_SSE2=False - HDF5PLUGIN_SSSE3=False - HDF5PLUGIN_AVX2=False - HDF5PLUGIN_AVX512=False - HDF5PLUGIN_CPP11=True - HDF5PLUGIN_CPP14=True - HDF5PLUGIN_CPP20=True - CIBW_BEFORE_TEST: pip install packaging h5py blosc2 --only-binary ":all:" - CIBW_TEST_COMMAND: python {project}/test/test.py + name: hdf5plugin-${{ env.HDF5PLUGIN_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -147,15 +154,9 @@ jobs: assert len(licences) == licence_count, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: hdf5plugin-${{ env.HDF5PLUGIN_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish hdf5plugin ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-hdrhistogram.yml b/.github/workflows/build-hdrhistogram.yml index 141350599bb8..bcc4c16b2f34 100644 --- a/.github/workflows/build-hdrhistogram.yml +++ b/.github/workflows/build-hdrhistogram.yml @@ -52,48 +52,59 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build hdrhistogram ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "hdrhistogram" + version: "${{ matrix.version }}" + repository: "HdrHistogram/HdrHistogram_py" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/hdrhistogram/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # Fixture lookups in test/test_hdrhistogram.py are the literal relative + # path "test/*.hlog", so only "test" is staged (gotcha 36) and conftest.py + # comes along to reproduce upstream's default perf-test skip (tox.yml runs + # plain `tox`, never passing --runperf). tox.ini registers the pytest + # markers the suite uses, silencing PytestUnknownMarkWarning. + cibw-test-sources: "test conftest.py tox.ini" + cibw-test-requires: "pytest" + cibw-test-command: "python -c \"import pyhdrh; assert pyhdrh.__file__.endswith('.so'), pyhdrh.__file__\" && python -m pytest test -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: HDRHISTOGRAM_VERSION: ${{ matrix.version }} - steps: - - name: Checkout HdrHistogram_py ${{ env.HDRHISTOGRAM_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: HdrHistogram/HdrHistogram_py - ref: ${{ env.HDRHISTOGRAM_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/hdrhistogram/${{ env.HDRHISTOGRAM_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # Fixture lookups in test/test_hdrhistogram.py are the literal relative - # path "test/*.hlog", so only "test" is staged (gotcha 36) and conftest.py - # comes along to reproduce upstream's default perf-test skip (tox.yml runs - # plain `tox`, never passing --runperf). tox.ini registers the pytest - # markers the suite uses, silencing PytestUnknownMarkWarning. - CIBW_TEST_SOURCES: test conftest.py tox.ini - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: >- - python -c "import pyhdrh; assert pyhdrh.__file__.endswith('.so'), pyhdrh.__file__" && - python -m pytest test -v + name: hdrhistogram-${{ env.HDRHISTOGRAM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -108,15 +119,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: hdrhistogram-${{ env.HDRHISTOGRAM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish hdrhistogram ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-healpy.yml b/.github/workflows/build-healpy.yml index 2c346616e8c9..ba27dc8f526a 100644 --- a/.github/workflows/build-healpy.yml +++ b/.github/workflows/build-healpy.yml @@ -50,59 +50,60 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build healpy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "healpy" + version: "${{ matrix.version }}" + repository: "healpy/healpy" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/healpy/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy/astropy are hard runtime deps and scipy/matplotlib are test + # extras; only our registry has riscv64 wheels for any of them, and + # only-binary keeps a newer PyPI release from winning the resolution + # and building from sdist instead. + # SETUPTOOLS_SCM_PRETEND_VERSION_FOR_HEALPY: the `git apply` above + # dirties the tree, which setuptools_scm otherwise reports as a + # `.devN+g` version (gotcha 31). + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,astropy,scipy,matplotlib MPLLOCALFREETYPE=1 MPLCONFIGDIR=/tmp SETUPTOOLS_SCM_PRETEND_VERSION_FOR_HEALPY=${{ matrix.version }}" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,astropy,scipy,matplotlib MPLLOCALFREETYPE=1 MPLCONFIGDIR=/tmp" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: HEALPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout healpy ${{ env.HEALPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: healpy/healpy - ref: ${{ env.HEALPY_VERSION }} - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch healpy source - run: git apply python-wheels/patches/healpy/${{ env.HEALPY_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy/astropy are hard runtime deps and scipy/matplotlib are test - # extras; only our registry has riscv64 wheels for any of them, and - # only-binary keeps a newer PyPI release from winning the resolution - # and building from sdist instead. - # SETUPTOOLS_SCM_PRETEND_VERSION_FOR_HEALPY: the `git apply` above - # dirties the tree, which setuptools_scm otherwise reports as a - # `.devN+g` version (gotcha 31). - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,astropy,scipy,matplotlib - MPLLOCALFREETYPE=1 - MPLCONFIGDIR=/tmp - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_HEALPY=${{ env.HEALPY_VERSION }} - CIBW_TEST_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,astropy,scipy,matplotlib - MPLLOCALFREETYPE=1 - MPLCONFIGDIR=/tmp + name: healpy-${{ env.HEALPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -125,13 +126,6 @@ jobs: }, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: healpy-${{ env.HEALPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -167,7 +161,7 @@ jobs: publish: name: Publish healpy ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-hidapi.yml b/.github/workflows/build-hidapi.yml index 31de5bc90ec8..d786264dfcd4 100644 --- a/.github/workflows/build-hidapi.yml +++ b/.github/workflows/build-hidapi.yml @@ -49,103 +49,109 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build hidapi ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "hidapi" + version: "${{ matrix.version }}" + repository: "trezor/cython-hidapi" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "true" + pre-build: |- + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of every shared library + # auditwheel vendors out of the build image alongside libusb/libudev. + # setuptools' default LICENSE* glob copies them into the wheel. + set -euo pipefail + + project="${1:?usage: collect-licenses.sh }" + + # ldd is transitive, so the two linked libs alone cover their whole + # closure; ldd does not list the root itself, so resolve those too. + mapfile -t libs < <( + { + ldd /usr/lib64/libusb-1.0.so | tr ' ' '\n' | grep '^/' + readlink -f /usr/lib64/libusb-1.0.so + ldd /usr/lib64/libudev.so | tr ' ' '\n' | grep '^/' + readlink -f /usr/lib64/libudev.so + } | sort -u + ) + + # `rpm -qf` reports unowned files on stdout, so keep only bare package names. + # glibc and the gcc runtime are on auditwheel's manylinux allowlist and + # are never vendored into the wheel. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc)$' + ) + + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + + # Some subpackages leave the licence to a sibling of the same source RPM. + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi + + # Others mark it %doc rather than %license, and the image installs no docs. + if [ -z "${files[0]:-}" ]; then + dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi + + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done + + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # libudev-devel doesn't exist on Rocky 10; systemd-devel provides libudev.so/libudev.h instead (CLAUDE.md gotcha 252) + cibw-before-all-linux: "dnf install -y libusb1-devel systemd-devel && bash {project}/collect-licenses.sh {project}" + # mirrors upstream's tests.py, plus hidraw since upstream's own suite never exercises that backend + cibw-test-command: "python {project}/tests.py && python -c \"import hidraw; assert len(hidraw.enumerate()) >= 0\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: HIDAPI_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cython-hidapi ${{ env.HIDAPI_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: trezor/cython-hidapi - ref: ${{ env.HIDAPI_VERSION }} - submodules: true - persist-credentials: false - - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of every shared library - # auditwheel vendors out of the build image alongside libusb/libudev. - # setuptools' default LICENSE* glob copies them into the wheel. - set -euo pipefail - - project="${1:?usage: collect-licenses.sh }" - - # ldd is transitive, so the two linked libs alone cover their whole - # closure; ldd does not list the root itself, so resolve those too. - mapfile -t libs < <( - { - ldd /usr/lib64/libusb-1.0.so | tr ' ' '\n' | grep '^/' - readlink -f /usr/lib64/libusb-1.0.so - ldd /usr/lib64/libudev.so | tr ' ' '\n' | grep '^/' - readlink -f /usr/lib64/libudev.so - } | sort -u - ) - - # `rpm -qf` reports unowned files on stdout, so keep only bare package names. - # glibc and the gcc runtime are on auditwheel's manylinux allowlist and - # are never vendored into the wheel. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc)$' - ) - - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - - # Some subpackages leave the licence to a sibling of the same source RPM. - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi - - # Others mark it %doc rather than %license, and the image installs no docs. - if [ -z "${files[0]:-}" ]; then - dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi - - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done - - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # libudev-devel doesn't exist on Rocky 10; systemd-devel provides libudev.so/libudev.h instead (CLAUDE.md gotcha 252) - CIBW_BEFORE_ALL_LINUX: >- - dnf install -y libusb1-devel systemd-devel && - bash {project}/collect-licenses.sh {project} - # mirrors upstream's tests.py, plus hidraw since upstream's own suite never exercises that backend - CIBW_TEST_COMMAND: >- - python {project}/tests.py && - python -c "import hidraw; assert len(hidraw.enumerate()) >= 0" + name: hidapi-${{ env.HIDAPI_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships both compiled extensions and licences run: | @@ -164,12 +170,6 @@ jobs: assert expected_pkgs <= have_pkgs, expected_pkgs - have_pkgs EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: hidapi-${{ env.HIDAPI_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -205,7 +205,7 @@ jobs: publish: name: Publish hidapi ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-hierarchicalforecast.yml b/.github/workflows/build-hierarchicalforecast.yml index 196174219bcc..ca383e1dce36 100644 --- a/.github/workflows/build-hierarchicalforecast.yml +++ b/.github/workflows/build-hierarchicalforecast.yml @@ -49,6 +49,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build hierarchicalforecast ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + # statsforecast needs statsmodels, which has no cp314 riscv64 wheel on + # pypi.riseproject.dev yet; these two modules import it at the top. + # utilsforecast (a hard runtime dep) requires pandas<3, which has no + # cp314t riscv64 wheel on pypi.riseproject.dev. + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "hierarchicalforecast" + version: "${{ matrix.version }}" + repository: "Nixtla/hierarchicalforecast" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "true" + pre-build: |- + cp external_libs/eigen/COPYING.MPL2 COPYING.eigen + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,pandas,scipy,scikit-learn,matplotlib,polars-runtime-32,statsmodels,statsforecast,coreforecast,pyarrow" + cibw-test-skip: "${{ case(endsWith(matrix.python, 't'), '*', '') }}" + # polars is pinned to a version pypi.riseproject.dev has built for + # riscv64; upstream's polars<=1.32.0 predates the polars-runtime split. + # pyarrow is listed explicitly (not left to come in transitively via + # statsforecast, which cp314 skips): polars.DataFrame.to_pandas() needs + # it directly and cp314's test_diagnostics_negative_counting[polars] + # hit a bare ModuleNotFoundError without it. + cibw-test-requires: "pytest pytest-benchmark scipy polars==1.44.2 pyarrow ${{ case(matrix.python == 'cp312', 'statsforecast', matrix.python == 'cp313', 'statsforecast', '') }}" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest tests --import-mode=importlib ${{ case(matrix.python == 'cp314', '--ignore=tests/test_evaluation.py --ignore=tests/test_utils.py', '') }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: @@ -59,43 +100,14 @@ jobs: # utilsforecast (a hard runtime dep) requires pandas<3, which has no # cp314t riscv64 wheel on pypi.riseproject.dev. include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: HIERARCHICALFORECAST_VERSION: ${{ matrix.version }} - steps: - - name: Checkout hierarchicalforecast v${{ env.HIERARCHICALFORECAST_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Nixtla/hierarchicalforecast - ref: v${{ env.HIERARCHICALFORECAST_VERSION }} - submodules: true - persist-credentials: false - - # external_libs/eigen is compiled into the wheel but upstream's wheel - # ships only its own LICENSE; stage eigen's for the default COPYING* glob. - - name: Stage the vendored dependency's licence - run: cp external_libs/eigen/COPYING.MPL2 COPYING.eigen - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: >- - PIP_ONLY_BINARY=numpy,pandas,scipy,scikit-learn,matplotlib,polars-runtime-32,statsmodels,statsforecast,coreforecast,pyarrow - CIBW_TEST_SKIP: ${{ case(endsWith(matrix.python, 't'), '*', '') }} - # polars is pinned to a version pypi.riseproject.dev has built for - # riscv64; upstream's polars<=1.32.0 predates the polars-runtime split. - # pyarrow is listed explicitly (not left to come in transitively via - # statsforecast, which cp314 skips): polars.DataFrame.to_pandas() needs - # it directly and cp314's test_diagnostics_negative_counting[polars] - # hit a bare ModuleNotFoundError without it. - CIBW_TEST_REQUIRES: pytest pytest-benchmark scipy polars==1.44.2 pyarrow ${{ case(matrix.python == 'cp312', 'statsforecast', matrix.python == 'cp313', 'statsforecast', '') }} - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest tests --import-mode=importlib ${{ case(matrix.python == 'cp314', '--ignore=tests/test_evaluation.py --ignore=tests/test_utils.py', '') }} + name: hierarchicalforecast-${{ env.HIERARCHICALFORECAST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -110,12 +122,6 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: hierarchicalforecast-${{ env.HIERARCHICALFORECAST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -151,7 +157,7 @@ jobs: publish: name: Publish hierarchicalforecast ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-highspy.yml b/.github/workflows/build-highspy.yml index 3da0c6089773..61ac3b2c0d53 100644 --- a/.github/workflows/build-highspy.yml +++ b/.github/workflows/build-highspy.yml @@ -49,51 +49,54 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build highspy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "highspy" + version: "${{ matrix.version }}" + repository: "ERGO-Code/HiGHS" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/highspy/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Restates upstream's own environment table, which this replaces. + cibw-environment-linux: "VCPKG_ROOT= VCPKG_INSTALLATION_ROOT= PIP_ONLY_BINARY=numpy" + cibw-test-command: "python -c \"import importlib.metadata as m; got={str(p).split('.dist-info/licenses/', 1)[1] for p in m.files('highspy') if '.dist-info/licenses/' in str(p)}; want={'LICENSE.txt', 'THIRD_PARTY_NOTICES.md', 'extern/pdqsort/license.txt', 'extern/zstr/LICENSE', 'highs/io/filereaderlp/LICENSE'}; assert got == want, got\" && pytest {project}/highspy/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: HIGHSPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout HiGHS v${{ env.HIGHSPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ERGO-Code/HiGHS - ref: v${{ env.HIGHSPY_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Add the vendored third-party licence texts to the wheel - run: git apply python-wheels/patches/highspy/${{ env.HIGHSPY_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Restates upstream's own environment table, which this replaces. - CIBW_ENVIRONMENT: >- - VCPKG_ROOT= - VCPKG_INSTALLATION_ROOT= - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_COMMAND: >- - python -c "import importlib.metadata as m; - got={str(p).split('.dist-info/licenses/', 1)[1] for p in m.files('highspy') if '.dist-info/licenses/' in str(p)}; - want={'LICENSE.txt', 'THIRD_PARTY_NOTICES.md', 'extern/pdqsort/license.txt', 'extern/zstr/LICENSE', 'highs/io/filereaderlp/LICENSE'}; - assert got == want, got" && - pytest {project}/highspy/tests + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + name: highspy-${{ env.HIGHSPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and the solver library run: | @@ -105,15 +108,9 @@ jobs: assert "libhighs.so.1" in names, names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: highspy-${{ env.HIGHSPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish highspy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-hiredis.yml b/.github/workflows/build-hiredis.yml index 49956701c711..efb7926365e6 100644 --- a/.github/workflows/build-hiredis.yml +++ b/.github/workflows/build-hiredis.yml @@ -50,48 +50,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build hiredis ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "hiredis" + version: "${{ matrix.version }}" + repository: "redis/hiredis-py" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/hiredis/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's wheel job runs no tests; this is its integration.yaml suite, + # minus pytest-memray, which has no riscv64 build (sdist only, and it needs + # libunwind/liblz4 headers the image does not ship). + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import importlib.metadata as m; f = sorted(p.name for p in m.files('hiredis') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'LICENSE.hiredis'], f\" && python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: HIREDIS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout hiredis v${{ env.HIREDIS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: redis/hiredis-py - ref: v${{ env.HIREDIS_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch hiredis source - run: git apply python-wheels/patches/hiredis/${{ env.HIREDIS_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's wheel job runs no tests; this is its integration.yaml suite, - # minus pytest-memray, which has no riscv64 build (sdist only, and it needs - # libunwind/liblz4 headers the image does not ship). - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import importlib.metadata as m; f = sorted(p.name for p in m.files('hiredis') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'LICENSE.hiredis'], f" - && python -m pytest tests + name: hiredis-${{ env.HIREDIS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -103,15 +111,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: hiredis-${{ env.HIREDIS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish hiredis ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-histomicstk.yml b/.github/workflows/build-histomicstk.yml index b71813fd1ed5..9a6ef6348efe 100644 --- a/.github/workflows/build-histomicstk.yml +++ b/.github/workflows/build-histomicstk.yml @@ -49,30 +49,38 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build histomicstk ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "histomicstk" + version: "${{ matrix.version }}" + repository: "DigitalSlideArchive/HistomicsTK" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: HISTOMICSTK_VERSION: ${{ matrix.version }} - steps: - - name: Checkout histomicstk v${{ env.HISTOMICSTK_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: DigitalSlideArchive/HistomicsTK - ref: v${{ env.HISTOMICSTK_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + name: histomicstk-${{ env.HISTOMICSTK_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -95,15 +103,9 @@ jobs: assert licences == {"LICENSE", "NOTICE", "AUTHORS.rst"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: histomicstk-${{ env.HISTOMICSTK_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish histomicstk ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-hnswlib.yml b/.github/workflows/build-hnswlib.yml index dca89380ef45..f37e549bfdd7 100644 --- a/.github/workflows/build-hnswlib.yml +++ b/.github/workflows/build-hnswlib.yml @@ -58,10 +58,7 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: >- - HNSWLIB_NO_NATIVE=true - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "HNSWLIB_NO_NATIVE=true PIP_ONLY_BINARY=numpy" # The checkout's own hnswlib/ (the C++ headers) would shadow the # compiled top-level `hnswlib` module if staged (gotcha 25); only # the example and test sources upstream's own CI runs are needed. diff --git a/.github/workflows/build-hunter.yml b/.github/workflows/build-hunter.yml index 8510e0e77855..9db9cdda49e4 100644 --- a/.github/workflows/build-hunter.yml +++ b/.github/workflows/build-hunter.yml @@ -49,47 +49,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build hunter ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "hunter" + version: "${{ matrix.version }}" + repository: "ionelmc/python-hunter" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-container-engine: "docker; create_args: --cap-add=SYS_PTRACE" + # setuptools_scm cannot see the tag history in a shallow checkout. + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_HUNTER=${{ matrix.version }}" + cibw-test-requires: "pytest pytest-benchmark cython manhole process-tests setuptools>=80 setuptools_scm>=8 aspectlib six py tzdata ipdb" + # Upstream runs `tox --skip-pkg-install --direct-yolo -e py3XX-cython-nocov`; tox-direct + # caps tox below 4, so run that env's own setenv and commands instead. + cibw-test-command: "cd {project} && python tests/setup.py clean --all && python tests/setup.py build_ext --force --inplace && PYTHONPATH={project}/tests PYTHONUNBUFFERED=yes PYTHONHUNTERCONFIG= pytest -vv --ignore=src" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: HUNTER_VERSION: ${{ matrix.version }} - steps: - - name: Checkout hunter v${{ env.HUNTER_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ionelmc/python-hunter - ref: v${{ env.HUNTER_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_CONTAINER_ENGINE: "docker; create_args: --cap-add=SYS_PTRACE" - # setuptools_scm cannot see the tag history in a shallow checkout. - CIBW_ENVIRONMENT: >- - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_HUNTER=${{ env.HUNTER_VERSION }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: >- - pytest pytest-benchmark cython manhole process-tests - setuptools>=80 setuptools_scm>=8 aspectlib six py tzdata ipdb - # Upstream runs `tox --skip-pkg-install --direct-yolo -e py3XX-cython-nocov`; tox-direct - # caps tox below 4, so run that env's own setenv and commands instead. - CIBW_TEST_COMMAND: >- - cd {project} && - python tests/setup.py clean --all && - python tests/setup.py build_ext --force --inplace && - PYTHONPATH={project}/tests PYTHONUNBUFFERED=yes PYTHONHUNTERCONFIG= - pytest -vv --ignore=src + name: hunter-${{ env.HUNTER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extensions made it into the wheel run: | @@ -103,15 +100,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: hunter-${{ env.HUNTER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish hunter ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-hypothesis.yml b/.github/workflows/build-hypothesis.yml index 18df6206367d..fbffc89f4f3f 100644 --- a/.github/workflows/build-hypothesis.yml +++ b/.github/workflows/build-hypothesis.yml @@ -64,9 +64,7 @@ jobs: # abi3t wheel; abi3t starts at 3.15, leaving cp314t with no wheel. These are # upstream's per-interpreter builds, which it runs only for x86_64/aarch64. cibw-before-all-linux: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - cibw-environment: >- - PATH=$PATH:$HOME/.cargo/bin - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PATH=$PATH:$HOME/.cargo/bin" # Paths are relative to cibuildwheel's cwd (the checkout root), not package-dir. # Staging only tests/ keeps src/hypothesis out of the test cwd, so the wheel is imported. cibw-test-sources: hypothesis/tests diff --git a/.github/workflows/build-icsneopy.yml b/.github/workflows/build-icsneopy.yml index 055520dec4af..f89e86e5f0e0 100644 --- a/.github/workflows/build-icsneopy.yml +++ b/.github/workflows/build-icsneopy.yml @@ -48,58 +48,66 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build icsneopy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "icsneopy" + version: "${{ matrix.version }}" + repository: "intrepidcs/libicsneo" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + checkout-fetch-depth: 0 + pre-build: |- + set -euo pipefail + tag() { sed -n "/GIT_REPOSITORY .*\/$1\.git/{n;s/.*GIT_TAG *//p}" "$2"; } + gh=https://raw.githubusercontent.com + icspb=$(sed -n '/FetchContent_Declare(icspb/,/)/s/.*GIT_TAG *//p' CMakeLists.txt) + protobuf=$(curl -fsSL --retry 5 "$gh/intrepidcs/icspb/$icspb/CMakeLists.txt" | sed -n 's/.*set(ICSPB_BOOTSTRAP_PROTOBUF_VERSION \([0-9.]*\)).*/\1/p') + abseil=$(curl -fsSL --retry 5 "$gh/protocolbuffers/protobuf/v$protobuf/cmake/dependencies.cmake" | sed -n 's/^set(abseil-cpp-version "\(.*\)")$/\1/p') + libpcap=$(sed -n 's/^VERSION="\(.*\)"$/\1/p' ci/bootstrap-libpcap.sh) + curl -fsSL --retry 5 "$gh/protocolbuffers/protobuf/v$protobuf/LICENSE" -o LICENSE.protobuf + curl -fsSL --retry 5 "$gh/protocolbuffers/protobuf/v$protobuf/third_party/utf8_range/LICENSE" -o LICENSE.utf8_range + curl -fsSL --retry 5 "$gh/abseil/abseil-cpp/$abseil/LICENSE" -o LICENSE.abseil-cpp + curl -fsSL --retry 5 "$gh/the-tcpdump-group/libpcap/libpcap-$libpcap/LICENSE" -o LICENSE.libpcap + curl -fsSL --retry 5 "$gh/Zeranoe/libredxx/$(tag libredxx CMakeLists.txt)/LICENSE" -o LICENSE.libredxx + curl -fsSL --retry 5 "$gh/pybind/pybind11/$(tag pybind11 bindings/python/CMakeLists.txt)/LICENSE" -o LICENSE.pybind11 + cp third-party/fatfs/LICENSE.txt LICENSE.fatfs + cp include/icsneo/third-party/concurrentqueue/LICENSE.md LICENSE.concurrentqueue + cp include/icsneo/third-party/readerwriterqueue/LICENSE.md LICENSE.readerwriterqueue + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-environment-linux: "PCAP_ROOT=/project/libpcap/install SKBUILD_CMAKE_DEFINE=ICSPB_BOOTSTRAP_DIR=/project/icspb" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # ci/bootstrap-cibuildwheel.sh is this yum line plus Intrepid's internal CA, which only their private icspb mirror needs. + cibw-before-all: "yum install -y flex && sh ci/bootstrap-libpcap.sh" + cibw-test-command: "python -c \"import icsneopy; print(icsneopy.get_version()); assert icsneopy.get_supported_devices()\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ICSNEOPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout libicsneo ${{ env.ICSNEOPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: intrepidcs/libicsneo - ref: ${{ env.ICSNEOPY_VERSION }} - fetch-depth: 0 - persist-credentials: false - - # libpcap, protobuf, abseil, libredxx, pybind11 and the in-tree third-party code are compiled into the extension; upstream ships none of their notices. - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - tag() { sed -n "/GIT_REPOSITORY .*\/$1\.git/{n;s/.*GIT_TAG *//p}" "$2"; } - gh=https://raw.githubusercontent.com - icspb=$(sed -n '/FetchContent_Declare(icspb/,/)/s/.*GIT_TAG *//p' CMakeLists.txt) - protobuf=$(curl -fsSL --retry 5 "$gh/intrepidcs/icspb/$icspb/CMakeLists.txt" | sed -n 's/.*set(ICSPB_BOOTSTRAP_PROTOBUF_VERSION \([0-9.]*\)).*/\1/p') - abseil=$(curl -fsSL --retry 5 "$gh/protocolbuffers/protobuf/v$protobuf/cmake/dependencies.cmake" | sed -n 's/^set(abseil-cpp-version "\(.*\)")$/\1/p') - libpcap=$(sed -n 's/^VERSION="\(.*\)"$/\1/p' ci/bootstrap-libpcap.sh) - curl -fsSL --retry 5 "$gh/protocolbuffers/protobuf/v$protobuf/LICENSE" -o LICENSE.protobuf - curl -fsSL --retry 5 "$gh/protocolbuffers/protobuf/v$protobuf/third_party/utf8_range/LICENSE" -o LICENSE.utf8_range - curl -fsSL --retry 5 "$gh/abseil/abseil-cpp/$abseil/LICENSE" -o LICENSE.abseil-cpp - curl -fsSL --retry 5 "$gh/the-tcpdump-group/libpcap/libpcap-$libpcap/LICENSE" -o LICENSE.libpcap - curl -fsSL --retry 5 "$gh/Zeranoe/libredxx/$(tag libredxx CMakeLists.txt)/LICENSE" -o LICENSE.libredxx - curl -fsSL --retry 5 "$gh/pybind/pybind11/$(tag pybind11 bindings/python/CMakeLists.txt)/LICENSE" -o LICENSE.pybind11 - cp third-party/fatfs/LICENSE.txt LICENSE.fatfs - cp include/icsneo/third-party/concurrentqueue/LICENSE.md LICENSE.concurrentqueue - cp include/icsneo/third-party/readerwriterqueue/LICENSE.md LICENSE.readerwriterqueue - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # ci/bootstrap-cibuildwheel.sh is this yum line plus Intrepid's internal CA, which only their private icspb mirror needs. - CIBW_BEFORE_ALL: yum install -y flex && sh ci/bootstrap-libpcap.sh - CIBW_ENVIRONMENT: PCAP_ROOT=/project/libpcap/install - SKBUILD_CMAKE_DEFINE: ICSPB_BOOTSTRAP_DIR=/project/icspb - CIBW_TEST_COMMAND: >- - python -c "import icsneopy; print(icsneopy.get_version()); - assert icsneopy.get_supported_devices()" + name: icsneopy-${{ env.ICSNEOPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -119,16 +127,9 @@ jobs: "LICENSE.readerwriterqueue", "LICENSE.utf8_range"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: icsneopy-${{ env.ICSNEOPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish icsneopy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-icu4py.yml b/.github/workflows/build-icu4py.yml index b461abcfa8c0..6821b200b740 100644 --- a/.github/workflows/build-icu4py.yml +++ b/.github/workflows/build-icu4py.yml @@ -48,60 +48,65 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build icu4py ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "icu4py" + version: "${{ matrix.version }}" + repository: "adamchainz/icu4py" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + pre-build: |- + tag=$(sed -n 's|^BASE_URL = "https://github.com/adamchainz/icu4c-builds/releases/download/\(.*\)"$|\1|p' download_icu.py) + test -n "$tag" + echo "ICU4C_BUILDS_TAG=$tag" >> "$GITHUB_ENV" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + rm -rf "icu4c-builds" + git init -q "icu4c-builds" + git -C "icu4c-builds" remote add origin "${GITHUB_SERVER_URL}/adamchainz/icu4c-builds.git" + git -C "icu4c-builds" fetch -q --no-tags --depth=1 origin "$ICU4C_BUILDS_TAG" + git -C "icu4c-builds" checkout -q --detach FETCH_HEAD + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # CIBW_BEFORE_ALL runs once per container before cibuildwheel puts any + # interpreter-specific bin dir on PATH, so plain `python` resolves to this + # image's default bootstrap interpreter -- cp39 here, regardless of which + # interpreter the job is actually building for. build.py's own + # `from typing import assert_never` needs 3.11+, so it ImportErrors + # identically on every leg. Pin to a floor interpreter new enough instead. + cibw-before-all-linux: "cd {project}/icu4c-builds && /opt/python/cp312-cp312/bin/python build.py --platform linux --in-docker && mkdir -p /tmp/icu && cp -a build/install /tmp/icu/icu && cp /tmp/icu/icu/LICENSE {project}/LICENSE-ICU" + cibw-test-requires: "pytest pytest-randomly" + cibw-test-sources: "tests pyproject.toml" + cibw-test-environment: "PYTHONDEVMODE=1" + cibw-test-command: "python -W error -m pytest tests" + + verify_wheels: + needs: [setup, build] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ICU4PY_VERSION: ${{ matrix.version }} - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: adamchainz/icu4py - ref: ${{ env.ICU4PY_VERSION }} - persist-credentials: false - - # icu4c-builds publishes no riscv64 ICU for download_icu.py; build its pinned release with its own build.py. - - name: Resolve the icu4c-builds release download_icu.py pins - run: | - tag=$(sed -n 's|^BASE_URL = "https://github.com/adamchainz/icu4c-builds/releases/download/\(.*\)"$|\1|p' download_icu.py) - test -n "$tag" - echo "ICU4C_BUILDS_TAG=$tag" >> "$GITHUB_ENV" - - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: adamchainz/icu4c-builds - ref: ${{ env.ICU4C_BUILDS_TAG }} - path: icu4c-builds - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # CIBW_BEFORE_ALL runs once per container before cibuildwheel puts any - # interpreter-specific bin dir on PATH, so plain `python` resolves to this - # image's default bootstrap interpreter -- cp39 here, regardless of which - # interpreter the job is actually building for. build.py's own - # `from typing import assert_never` needs 3.11+, so it ImportErrors - # identically on every leg. Pin to a floor interpreter new enough instead. - CIBW_BEFORE_ALL_LINUX: >- - cd {project}/icu4c-builds && - /opt/python/cp312-cp312/bin/python build.py --platform linux --in-docker && - mkdir -p /tmp/icu && - cp -a build/install /tmp/icu/icu && - cp /tmp/icu/icu/LICENSE {project}/LICENSE-ICU - CIBW_TEST_REQUIRES: pytest pytest-randomly - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_ENVIRONMENT: PYTHONDEVMODE=1 - CIBW_TEST_COMMAND: python -W error -m pytest tests + name: icu4py-${{ env.ICU4PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel bundles ICU and its licence run: | @@ -116,15 +121,9 @@ jobs: print(whl, "OK") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: icu4py-${{ env.ICU4PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish icu4py ${{ matrix.version }} - needs: [setup, build] + needs: [setup, build, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-igraph.yml b/.github/workflows/build-igraph.yml index 6838218b53a6..fe8d881b9b8e 100644 --- a/.github/workflows/build-igraph.yml +++ b/.github/workflows/build-igraph.yml @@ -52,6 +52,67 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build igraph ${{ matrix.version }} cp39-abi3-${{ matrix.libc }}_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + libc: [manylinux, musllinux] + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "igraph" + version: "${{ matrix.version }}" + repository: "igraph/python-igraph" + ref: "${{ matrix.version }}" + artifact-tag: "cp39-abi3-${{ matrix.libc }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "true" + checkout-fetch-depth: 0 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/igraph/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # setup.py's bdist_wheel_abi3 always tags the wheel cp39-abi3 (gotcha 34), + # so build on that floor and let cibuildwheel reuse+retest the same wheel + # on cp312-cp314 (gotcha 96). No free-threaded wheel exists upstream either + # (their own CIBW_SKIP: cp314t-*, since Py_LIMITED_API can't target it). + cibw-environment-linux: "PYTEST_TIMEOUT=60" + cibw-build: "cp39-${{ matrix.libc }}_riscv64 cp312-${{ matrix.libc }}_riscv64 cp313-${{ matrix.libc }}_riscv64 cp314-${{ matrix.libc }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-before-build-linux: |- + if command -v apk > /dev/null; then + apk add flex bison libxml2-dev zlib-dev cairo-dev + elif command -v yum > /dev/null; then + yum install -y flex bison libxml2-devel zlib-devel cairo-devel + fi + pip install -U cmake pip setuptools wheel + python setup.py build_c_core + # numpy/scipy/pandas/matplotlib/Pillow (upstream's `test` extra) have no + # riscv64 wheel below cp312 on our registry; `test-musl` needs none of + # them, so only the manylinux cp39 leg loses test coverage. + cibw-test-skip: "cp39-manylinux_riscv64" + # test_labels renders vertex labels and diffs against a baseline PNG + # (matplotlib image_comparison, tol=4.0); the riscv64 image's font stack + # anti-aliases just enough differently to push RMS to 6.084 (gotcha 282). + # + # testHubScore's vendored-ARPACK non-convergence on musllinux only (not + # manylinux) is upstream's own known ARPACK starting-vector flake + # (igraph/python-igraph#379, #728), not riscv64-specific -- deselect on + # musllinux only (gotcha 286). + cibw-test-command: "cd {project} && pip install --prefer-binary \".[${{ matrix.libc == 'musllinux' && 'test-musl' || 'test' }}]\" && python -m pytest -v tests --deselect tests/drawing/matplotlib/test_graph.py::GraphTestRunner::test_labels ${{ matrix.libc == 'musllinux' && '--deselect tests/test_atlas.py::GraphAtlasTests::testHubScore' || '' }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: @@ -59,74 +120,14 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} libc: [manylinux, musllinux] - env: IGRAPH_VERSION: ${{ matrix.version }} - steps: - - name: Checkout python-igraph ${{ env.IGRAPH_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: igraph/python-igraph - ref: ${{ env.IGRAPH_VERSION }} - submodules: true - # fetch-depth: 0 also governs the vendor/source/igraph submodule clone - # depth (gotcha 268): a shallow submodule has no tags for the C core's - # CMake git_describe() version detection, and it has no IGRAPH_VERSION - # file either since it isn't a release tarball. - fetch-depth: 0 - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch python-igraph source - run: git apply python-wheels/patches/igraph/${{ env.IGRAPH_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # setup.py's bdist_wheel_abi3 always tags the wheel cp39-abi3 (gotcha 34), - # so build on that floor and let cibuildwheel reuse+retest the same wheel - # on cp312-cp314 (gotcha 96). No free-threaded wheel exists upstream either - # (their own CIBW_SKIP: cp314t-*, since Py_LIMITED_API can't target it). - CIBW_BUILD: >- - cp39-${{ matrix.libc }}_riscv64 cp312-${{ matrix.libc }}_riscv64 - cp313-${{ matrix.libc }}_riscv64 cp314-${{ matrix.libc }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_BUILD_LINUX: | - if command -v apk > /dev/null; then - apk add flex bison libxml2-dev zlib-dev cairo-dev - elif command -v yum > /dev/null; then - yum install -y flex bison libxml2-devel zlib-devel cairo-devel - fi - pip install -U cmake pip setuptools wheel - python setup.py build_c_core - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_ENVIRONMENT_PASS_LINUX: PYTEST_TIMEOUT - PYTEST_TIMEOUT: 60 - # numpy/scipy/pandas/matplotlib/Pillow (upstream's `test` extra) have no - # riscv64 wheel below cp312 on our registry; `test-musl` needs none of - # them, so only the manylinux cp39 leg loses test coverage. - CIBW_TEST_SKIP: cp39-manylinux_riscv64 - # test_labels renders vertex labels and diffs against a baseline PNG - # (matplotlib image_comparison, tol=4.0); the riscv64 image's font stack - # anti-aliases just enough differently to push RMS to 6.084 (gotcha 282). - # - # testHubScore's vendored-ARPACK non-convergence on musllinux only (not - # manylinux) is upstream's own known ARPACK starting-vector flake - # (igraph/python-igraph#379, #728), not riscv64-specific -- deselect on - # musllinux only (gotcha 286). - CIBW_TEST_COMMAND: >- - cd {project} && - pip install --prefer-binary ".[${{ matrix.libc == 'musllinux' && 'test-musl' || 'test' }}]" && - python -m pytest -v tests --deselect tests/drawing/matplotlib/test_graph.py::GraphTestRunner::test_labels - ${{ matrix.libc == 'musllinux' && '--deselect tests/test_atlas.py::GraphAtlasTests::testHubScore' || '' }} + name: igraph-${{ env.IGRAPH_VERSION }}-cp39-abi3-${{ matrix.libc }}_riscv64 + path: wheelhouse - name: Check the wheel is abi3 and carries the compiled extension + LICENSE run: | @@ -141,12 +142,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: igraph-${{ env.IGRAPH_VERSION }}-cp39-abi3-${{ matrix.libc }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -182,7 +177,7 @@ jobs: publish: name: Publish igraph ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ijson.yml b/.github/workflows/build-ijson.yml index 72c6d56812dd..ed952a4ee826 100644 --- a/.github/workflows/build-ijson.yml +++ b/.github/workflows/build-ijson.yml @@ -49,35 +49,39 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build ijson ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ijson" + version: "${{ matrix.version }}" + repository: "ICRAR/ijson" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "true" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # cffi (a test requirement below 3.13) has no riscv64 wheel on PyPI. + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: IJSON_VERSION: ${{ matrix.version }} - steps: - - name: Checkout ijson v${{ env.IJSON_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ICRAR/ijson - ref: v${{ env.IJSON_VERSION }} - # cextern/yajl is a submodule; upstream's before-all builds it. - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cffi (a test requirement below 3.13) has no riscv64 wheel on PyPI. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + name: ijson-${{ env.IJSON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the yajl2_c extension made it into the wheel run: | @@ -90,15 +94,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ijson-${{ env.IJSON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish ijson ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-img2table.yml b/.github/workflows/build-img2table.yml index d580fb87f1af..41e8060f5167 100644 --- a/.github/workflows/build-img2table.yml +++ b/.github/workflows/build-img2table.yml @@ -48,38 +48,41 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build img2table ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "img2table" + version: "${{ matrix.version }}" + repository: "xavctn/img2table" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build-frontend: "build" + # numpy and opencv-contrib-python have riscv64 wheels only on our registry; only-binary stops a PyPI sdist from winning. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,opencv-contrib-python SETUPTOOLS_SCM_PRETEND_VERSION_FOR_IMG2TABLE=${{ matrix.version }}" + cibw-test-command: "python {project}/.github/scripts/wheel_test.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: IMG2TABLE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout img2table ${{ env.IMG2TABLE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: xavctn/img2table - ref: ${{ env.IMG2TABLE_VERSION }} - persist-credentials: false - - - name: Build and test wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BUILD_FRONTEND: build - # numpy and opencv-contrib-python have riscv64 wheels only on our registry; only-binary stops a PyPI sdist from winning. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,opencv-contrib-python - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_IMG2TABLE=${{ env.IMG2TABLE_VERSION }} - CIBW_TEST_COMMAND: python {project}/.github/scripts/wheel_test.py + name: img2table-${{ env.IMG2TABLE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -92,16 +95,9 @@ jobs: assert licences == {"LICENSE.txt"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: img2table-${{ env.IMG2TABLE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish img2table ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-imgui-bundle.yml b/.github/workflows/build-imgui-bundle.yml index e147a2d3c675..272e5c54872a 100644 --- a/.github/workflows/build-imgui-bundle.yml +++ b/.github/workflows/build-imgui-bundle.yml @@ -78,17 +78,7 @@ jobs: # table (CLAUDE.md gotcha 107), which for *-musllinux* sets CMAKE_ARGS to # disable the OpenGL2 backend (musl's loader has no lazy binding - see # pyproject.toml) - repeat it here for musllinux legs only. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,cmake,ninja - PIP_CONSTRAINT=/nanobind-constraint.txt - PIP_BUILD_CONSTRAINT=/nanobind-constraint.txt - UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - UV_INDEX_STRATEGY=unsafe-best-match - UV_ONLY_BINARY=numpy,cmake,ninja - UV_CONSTRAINT=/nanobind-constraint.txt - UV_BUILD_CONSTRAINT=/nanobind-constraint.txt - ${{ matrix.platform == 'musllinux' && 'CMAKE_ARGS=-DIMGUI_BUNDLE_PYTHON_DISABLE_OPENGL2=ON' || '' }} + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,cmake,ninja PIP_CONSTRAINT=/nanobind-constraint.txt PIP_BUILD_CONSTRAINT=/nanobind-constraint.txt UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ UV_INDEX_STRATEGY=unsafe-best-match UV_ONLY_BINARY=numpy,cmake,ninja UV_CONSTRAINT=/nanobind-constraint.txt UV_BUILD_CONSTRAINT=/nanobind-constraint.txt ${{ matrix.platform == 'musllinux' && 'CMAKE_ARGS=-DIMGUI_BUNDLE_PYTHON_DISABLE_OPENGL2=ON' || '' }}" # Upstream's test-requires (pytest, pytest-asyncio, numpy) needs numpy, which # has no riscv64 musllinux wheel in our registry (manylinux_riscv64 only) - # skip the test-install/test-command on musllinux legs, keeping the build. diff --git a/.github/workflows/build-immutables.yml b/.github/workflows/build-immutables.yml index 0358ac78dc14..508e8b95d99f 100644 --- a/.github/workflows/build-immutables.yml +++ b/.github/workflows/build-immutables.yml @@ -62,7 +62,7 @@ jobs: # Upstream's own "test" extra pins mypy~=1.4, which has no riscv64 wheel # anywhere; the suite doesn't need it since IMMU_SKIP_MYPY_TESTS skips it. cibw-test-extras: '' - cibw-environment: IMMU_SKIP_MYPY_TESTS=1 + cibw-environment-linux: IMMU_SKIP_MYPY_TESTS=1 cibw-test-command: >- python -c "from immutables._map import Map as m; assert m.__module__ == 'immutables._map'" && python {project}/tests/__init__.py diff --git a/.github/workflows/build-implicit.yml b/.github/workflows/build-implicit.yml index b2b37eb8dc91..7c46ffc93ff1 100644 --- a/.github/workflows/build-implicit.yml +++ b/.github/workflows/build-implicit.yml @@ -48,59 +48,62 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build implicit ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "implicit" + version: "${{ matrix.version }}" + repository: "benfred/implicit" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/implicit/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,cython" + # Upstream's pyproject.toml sets repair-wheel-command="" globally, only + # to avoid auditwheel vendoring CUDA libraries on manylinux_x86_64 (see + # ci/install_cuda_13.sh, gated to that arch alone). No CUDA toolkit is + # present on riscv64 - CMakeLists.txt's find_package(CUDAToolkit) simply + # skips the GPU extension - so run the normal auditwheel repair here to + # properly vendor libgomp (CMake links OpenMP automatically when found). + cibw-repair-wheel-command: "auditwheel repair -w {dest_dir} {wheel}" + cibw-test-requires: "pytest" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy" + cibw-test-command: "python -c \"import implicit.gpu; assert not implicit.gpu.HAS_CUDA\" && python -m pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: IMPLICIT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout implicit v${{ env.IMPLICIT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: benfred/implicit - ref: v${{ env.IMPLICIT_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # libgomp's dynamic and guided schedules segfault on the riscv64 runners - # (riseproject-dev/python-wheels#617, same defect as patches/lightgbm/4.7.0/0002-*); - # static is unaffected. - - name: Patch implicit source - run: git apply python-wheels/patches/implicit/${{ env.IMPLICIT_VERSION }}/00*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,cython - # Upstream's pyproject.toml sets repair-wheel-command="" globally, only - # to avoid auditwheel vendoring CUDA libraries on manylinux_x86_64 (see - # ci/install_cuda_13.sh, gated to that arch alone). No CUDA toolkit is - # present on riscv64 - CMakeLists.txt's find_package(CUDAToolkit) simply - # skips the GPU extension - so run the normal auditwheel repair here to - # properly vendor libgomp (CMake links OpenMP automatically when found). - CIBW_REPAIR_WHEEL_COMMAND: auditwheel repair -w {dest_dir} {wheel} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - CIBW_TEST_COMMAND: >- - python -c "import implicit.gpu; assert not implicit.gpu.HAS_CUDA" && - python -m pytest {project}/tests + name: implicit-${{ env.IMPLICIT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -115,12 +118,6 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: implicit-${{ env.IMPLICIT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -157,7 +154,7 @@ jobs: publish: name: Publish implicit ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-indexed-bzip2.yml b/.github/workflows/build-indexed-bzip2.yml index ab3f46a3ddf2..8736f529f1b2 100644 --- a/.github/workflows/build-indexed-bzip2.yml +++ b/.github/workflows/build-indexed-bzip2.yml @@ -51,51 +51,58 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build indexed-bzip2 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "indexed-bzip2" + version: "${{ matrix.version }}" + repository: "mxmlnkn/indexed_bzip2" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/indexed-bzip2/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-package-dir: "python/indexed_bzip2" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,cython" + cibw-test-requires: "numpy" + cibw-test-environment: "CI=true" + # testGIL.py only tests rapidgzip, which has no riscv64 wheel. + cibw-test-command: "python3 -X dev -u {project}/src/tests/testPythonWrappers.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: INDEXED_BZIP2_VERSION: ${{ matrix.version }} - steps: - - name: Checkout indexed_bzip2 v${{ env.INDEXED_BZIP2_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: mxmlnkn/indexed_bzip2 - ref: v${{ env.INDEXED_BZIP2_VERSION }} - # src/external/cxxopts (statically compiled into the extension via - # the ibzip2 CLI it bundles) is a submodule. - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch indexed_bzip2 source - run: git apply python-wheels/patches/indexed-bzip2/${{ env.INDEXED_BZIP2_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - package-dir: python/indexed_bzip2 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_LINUX: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,cython - CIBW_TEST_REQUIRES: numpy - CIBW_TEST_ENVIRONMENT: CI=true - # testGIL.py only tests rapidgzip, which has no riscv64 wheel. - CIBW_TEST_COMMAND: python3 -X dev -u {project}/src/tests/testPythonWrappers.py + name: indexed-bzip2-${{ env.INDEXED_BZIP2_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel carries the cxxopts license run: | @@ -108,15 +115,9 @@ jobs: raise SystemExit(f"error: cxxopts license missing from {sys.argv[1]}: {licenses}") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: indexed-bzip2-${{ env.INDEXED_BZIP2_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish indexed-bzip2 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-indexed-zstd.yml b/.github/workflows/build-indexed-zstd.yml index 0617a8e1fb1e..6098aad44490 100644 --- a/.github/workflows/build-indexed-zstd.yml +++ b/.github/workflows/build-indexed-zstd.yml @@ -65,7 +65,7 @@ jobs: dnf install -y libzstd-devel cmake && cmake -S {package}/indexed_zstd/libzstd-seek -B {package}/indexed_zstd/libzstd-seek/build -DBUILD_TESTS=ON && cmake --build {package}/indexed_zstd/libzstd-seek/build --target gen_seekable - cibw-environment-linux: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=cython + cibw-environment-linux: "PIP_ONLY_BINARY=cython" cibw-test-requires: pytest # test-sources are staged from the host checkout (gotcha 104), so the # gen_seekable that before_all built inside the container's /project is diff --git a/.github/workflows/build-infomap.yml b/.github/workflows/build-infomap.yml index 083186de3e1e..199a06c5dbf9 100644 --- a/.github/workflows/build-infomap.yml +++ b/.github/workflows/build-infomap.yml @@ -50,41 +50,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build infomap ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "infomap" + version: "${{ matrix.version }}" + repository: "mapequation/infomap" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/infomap/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-command: "python -c \"from infomap import Infomap; print(Infomap(silent=True).num_top_modules)\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: INFOMAP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout infomap v${{ env.INFOMAP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: mapequation/infomap - ref: v${{ env.INFOMAP_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch infomap source - run: git apply python-wheels/patches/infomap/${{ env.INFOMAP_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_COMMAND: >- - python -c "from infomap import Infomap; print(Infomap(silent=True).num_top_modules)" + name: infomap-${{ env.INFOMAP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel carries the compiled extension + every LICENSE run: | @@ -98,12 +109,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: infomap-${{ env.INFOMAP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -139,7 +144,7 @@ jobs: publish: name: Publish infomap ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-intbitset.yml b/.github/workflows/build-intbitset.yml index 9bcda504c833..18539ca2cd39 100644 --- a/.github/workflows/build-intbitset.yml +++ b/.github/workflows/build-intbitset.yml @@ -49,41 +49,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build intbitset ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "intbitset" + version: "${{ matrix.version }}" + repository: "inveniosoftware-contrib/intbitset" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/intbitset/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pytest pytest-xdist" + cibw-test-command: "pytest {package}/tests -n4" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: INTBITSET_VERSION: ${{ matrix.version }} - steps: - - name: Checkout intbitset ${{ env.INTBITSET_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: inveniosoftware-contrib/intbitset - ref: v${{ env.INTBITSET_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch intbitset source - run: git apply python-wheels/patches/intbitset/${{ env.INTBITSET_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pytest pytest-xdist - CIBW_TEST_COMMAND: pytest {package}/tests -n4 + name: intbitset-${{ env.INTBITSET_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extension made it into the wheel run: | @@ -95,15 +105,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: intbitset-${{ env.INTBITSET_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish intbitset ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-iree-base-compiler.yml b/.github/workflows/build-iree-base-compiler.yml index 2a63b83113c9..9764199a4b91 100644 --- a/.github/workflows/build-iree-base-compiler.yml +++ b/.github/workflows/build-iree-base-compiler.yml @@ -48,6 +48,64 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build iree-base-compiler ${{ matrix.version }} cp312-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "iree-base-compiler" + version: "${{ matrix.version }}" + repository: "iree-org/iree" + ref: "v${{ matrix.version }}" + artifact-tag: "cp312-abi3-manylinux_riscv64" + timeout-minutes: 2880 + checkout-submodules: "recursive" + pre-build: |- + export IREE_BASE_COMPILER_VERSION='${{ matrix.version }}' + cat > compiler/version_local.json < compiler/version_local.json <- - IREE_ENABLE_LLD=ON - IREE_TARGET_BACKEND_ROCM=OFF - IREE_TARGET_BACKEND_CUDA=OFF - CMAKE_BUILD_PARALLEL_LEVEL=3 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CFLAGS=-mno-relax - CXXFLAGS=-mno-relax - CIBW_TEST_COMMAND: python -m iree.compiler._package_test + name: iree-base-compiler-${{ env.IREE_BASE_COMPILER_VERSION }}-cp312-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel licences run: | @@ -126,15 +134,9 @@ jobs: assert licences == {"LICENSE", "LICENSE.llvm", "LICENSE.stablehlo", "LICENSE.torch-mlir"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: iree-base-compiler-${{ env.IREE_BASE_COMPILER_VERSION }}-cp312-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish iree-base-compiler ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-isal.yml b/.github/workflows/build-isal.yml index 921c7b7f8084..82988d189f7b 100644 --- a/.github/workflows/build-isal.yml +++ b/.github/workflows/build-isal.yml @@ -58,7 +58,7 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 checkout-submodules: true cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: CFLAGS="-O3 -DNDEBUG" + cibw-environment-linux: CFLAGS="-O3 -DNDEBUG" cibw-test-requires: pytest # Mirrors upstream's own deploy-job CIBW_TEST_COMMAND_LINUX. cibw-test-command: >- diff --git a/.github/workflows/build-jellyfish.yml b/.github/workflows/build-jellyfish.yml index 0979584a85c7..4782ddc9087e 100644 --- a/.github/workflows/build-jellyfish.yml +++ b/.github/workflows/build-jellyfish.yml @@ -49,46 +49,49 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build jellyfish ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "jellyfish" + version: "${{ matrix.version }}" + repository: "jamesturk/jellyfish" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + # musllinux is out of reach: rustup publishes rust-std but no rustc/cargo + # host toolchain for riscv64gc-unknown-linux-musl. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # jellyfish ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + # The suite opens testdata/*.csv relative to the working directory, so + # stage it beside tests/ at its original path. + cibw-test-sources: "tests testdata" + cibw-test-command: "python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: JELLYFISH_VERSION: ${{ matrix.version }} - steps: - # PyPI records the Codeberg repository, but upstream's releases and CI live - # on this GitHub mirror; the v1.2.1 tree matches the released sdist. - - name: Checkout jellyfish ${{ env.JELLYFISH_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: jamesturk/jellyfish - ref: v${{ env.JELLYFISH_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # musllinux is out of reach: rustup publishes rust-std but no rustc/cargo - # host toolchain for riscv64gc-unknown-linux-musl. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # jellyfish ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | - sh -s -- -y --profile minimal - CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"' - CIBW_TEST_REQUIRES: pytest - # The suite opens testdata/*.csv relative to the working directory, so - # stage it beside tests/ at its original path. - CIBW_TEST_SOURCES: tests testdata - CIBW_TEST_COMMAND: python -m pytest tests + name: jellyfish-${{ env.JELLYFISH_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension module made it into the wheel run: | @@ -101,15 +104,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: jellyfish-${{ env.JELLYFISH_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish jellyfish ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-jenkspy.yml b/.github/workflows/build-jenkspy.yml index d49b15a99913..09749e3f51e2 100644 --- a/.github/workflows/build-jenkspy.yml +++ b/.github/workflows/build-jenkspy.yml @@ -48,36 +48,40 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build jenkspy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "jenkspy" + version: "${{ matrix.version }}" + repository: "mthh/jenkspy" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-build: "pip install numpy cython" + # numpy has no riscv64 wheel on public PyPI. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-command: "python {package}/tests/test_jenks.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: JENKSPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout jenkspy ${{ env.JENKSPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: mthh/jenkspy - ref: ${{ env.JENKSPY_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_BUILD: pip install numpy cython - # numpy has no riscv64 wheel on public PyPI. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_COMMAND: python {package}/tests/test_jenks.py + name: jenkspy-${{ env.JENKSPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -90,15 +94,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: jenkspy-${{ env.JENKSPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish jenkspy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-jina.yml b/.github/workflows/build-jina.yml index a8e879f12627..d99531228782 100644 --- a/.github/workflows/build-jina.yml +++ b/.github/workflows/build-jina.yml @@ -52,6 +52,49 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build jina ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "jina" + version: "${{ matrix.version }}" + repository: "jina-ai/jina" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + timeout-minutes: 180 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/jina/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + cibw-before-all-linux: "curl -sSfL https://go.dev/dl/go1.26.8.linux-riscv64.tar.gz | tar -zx -C /usr/local/" + # jraft.go's `#cgo pkg-config: python3` needs the target interpreter's python3.pc. + # docarray pulls in orjson>=3.8.2 with no upper bound; pip's default resolves + # the newest orjson (3.13.0), which this registry only ships for cp312+, and + # falls back to building orjson's sdist from source -- which fails outright + # (no rustup riscv64 target). PIP_ONLY_BINARY keeps pip off that sdist path so + # it backtracks to 3.11.9, the newest version this registry publishes for + # cp310/cp311. + cibw-environment-linux: "PATH=\"/usr/local/go/bin:$PATH\" PKG_CONFIG_PATH=\"$(python -c 'import sysconfig; print(sysconfig.get_config_var(\"LIBPC\"))')\" PIP_ONLY_BINARY=orjson" + # jina-hubble-sdk imports pkg_resources at module level; the test venv has no + # setuptools and setuptools 82 removed pkg_resources (gotchas 29/361). + cibw-test-requires: "setuptools<82" + cibw-test-command: "python -c \"import jina; import jraft\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: @@ -60,50 +103,12 @@ jobs: include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: JINA_VERSION: ${{ matrix.version }} - steps: - - name: Checkout jina ${{ env.JINA_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: jina-ai/jina - ref: v${{ env.JINA_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch jina source - run: git apply python-wheels/patches/jina/${{ env.JINA_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - curl -sSfL https://go.dev/dl/go${{ env.GO_VERSION }}.linux-riscv64.tar.gz - | tar -zx -C /usr/local/ - # jraft.go's `#cgo pkg-config: python3` needs the target interpreter's python3.pc. - # docarray pulls in orjson>=3.8.2 with no upper bound; pip's default resolves - # the newest orjson (3.13.0), which this registry only ships for cp312+, and - # falls back to building orjson's sdist from source -- which fails outright - # (no rustup riscv64 target). PIP_ONLY_BINARY keeps pip off that sdist path so - # it backtracks to 3.11.9, the newest version this registry publishes for - # cp310/cp311. - CIBW_ENVIRONMENT_LINUX: >- - PATH="/usr/local/go/bin:$PATH" - PKG_CONFIG_PATH="$(python -c 'import sysconfig; print(sysconfig.get_config_var("LIBPC"))')" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=orjson - # jina-hubble-sdk imports pkg_resources at module level; the test venv has no - # setuptools and setuptools 82 removed pkg_resources (gotchas 29/361). - CIBW_TEST_REQUIRES: setuptools<82 - CIBW_TEST_COMMAND: python -c "import jina; import jraft" + name: jina-${{ env.JINA_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extension run: | @@ -114,15 +119,9 @@ jobs: assert sos == ["jraft.abi3.so"], names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: jina-${{ env.JINA_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish jina ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-joulescope.yml b/.github/workflows/build-joulescope.yml index c72556c5b014..508ec2640e21 100644 --- a/.github/workflows/build-joulescope.yml +++ b/.github/workflows/build-joulescope.yml @@ -49,41 +49,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build joulescope ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "joulescope" + version: "${{ matrix.version }}" + repository: "jetperch/pyjoulescope" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a build-time requirement (declared in [build-system]); pyjls, + # pyjoulescope_driver and pymonocypher are runtime deps with their own + # compiled riscv64 wheels on our registry. Only our registry has any of + # these four for riscv64; only-binary keeps pip from falling back to an + # sdist build for them. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,pyjls,pyjoulescope_driver,pymonocypher" + cibw-test-requires: "pytest" + cibw-test-command: "pytest --pyargs joulescope" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: JOULESCOPE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyjoulescope v${{ env.JOULESCOPE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: jetperch/pyjoulescope - ref: v${{ env.JOULESCOPE_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build-time requirement (declared in [build-system]); pyjls, - # pyjoulescope_driver and pymonocypher are runtime deps with their own - # compiled riscv64 wheels on our registry. Only our registry has any of - # these four for riscv64; only-binary keeps pip from falling back to an - # sdist build for them. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pyjls,pyjoulescope_driver,pymonocypher - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest --pyargs joulescope + name: joulescope-${{ env.JOULESCOPE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -96,16 +100,9 @@ jobs: assert licences == {"LICENSE.txt"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: joulescope-${{ env.JOULESCOPE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish joulescope ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-jpype1.yml b/.github/workflows/build-jpype1.yml index 3d6b3f603f1d..4e0db390567a 100644 --- a/.github/workflows/build-jpype1.yml +++ b/.github/workflows/build-jpype1.yml @@ -50,59 +50,50 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build JPype1 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "jpype1" + version: "${{ matrix.version }}" + repository: "jpype-project/jpype" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream builds against JDK 11; Rocky 10 only packages JDK 21. + cibw-environment-linux: "JAVA_HOME=/usr/lib/jvm/java-21-openjdk" + # The ivy resolve is upstream's own `.azure/scripts/ivy.yml` stage; it stages the + # JDBC drivers the DBAPI tests load from `lib/`. sqlite-jdbc is bumped off + # upstream's 3.27.2.1 pin because that release bundles no riscv64 native library. + cibw-before-all-linux: "dnf -y install java-21-openjdk-devel ant && cd {project} && sed -i 's/\"sqlite-jdbc\" rev=\"[^\"]*\"/\"sqlite-jdbc\" rev=\"3.46.1.3\"/' ivy.xml && curl -sSL --create-dirs -o lib/ivy-2.5.3.jar https://repo1.maven.org/maven2/org/apache/ivy/ivy/2.5.3/ivy-2.5.3.jar && java -jar lib/ivy-2.5.3.jar -ivy ivy.xml -retrieve 'lib/[artifact]-[revision](-[classifier]).[ext]'" + # test-requirements.txt minus pyinstaller: it publishes no riscv64 wheel and + # nothing under test/ imports it (upstream exercises it in a separate step). + cibw-test-requires: "pytest numpy typing_extensions jedi==0.18.0" + # Upstream's own invocation; `cd` first so jpype resolves to the installed wheel + # rather than the checkout. The deselected four assert `lastrowid`, which the + # newer sqlite-jdbc no longer reports through `getGeneratedKeys`; paths are + # relative to the pytest rootdir (the checkout), not to the cwd. + cibw-test-command: "cd {project}/test && python -m pytest -v jpypetest --checkjni --deselect test/jpypetest/test_sql_sqlite.py::CursorTestCase::test_fetchall --deselect test/jpypetest/test_sql_sqlite.py::CursorTestCase::test_fetchone --deselect test/jpypetest/test_sql_sqlite.py::CursorTestCase::test_lastrowid --deselect test/jpypetest/test_sql_sqlite.py::CursorTestCase::test_lastrowidMany" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: JPYPE1_VERSION: ${{ matrix.version }} - steps: - - name: Checkout JPype1 v${{ env.JPYPE1_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: jpype-project/jpype - ref: v${{ env.JPYPE1_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream builds against JDK 11; Rocky 10 only packages JDK 21. - CIBW_ENVIRONMENT: >- - JAVA_HOME=/usr/lib/jvm/java-21-openjdk - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # The ivy resolve is upstream's own `.azure/scripts/ivy.yml` stage; it stages the - # JDBC drivers the DBAPI tests load from `lib/`. sqlite-jdbc is bumped off - # upstream's 3.27.2.1 pin because that release bundles no riscv64 native library. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install java-21-openjdk-devel ant && - cd {project} && - sed -i 's/"sqlite-jdbc" rev="[^"]*"/"sqlite-jdbc" rev="3.46.1.3"/' ivy.xml && - curl -sSL --create-dirs -o lib/ivy-2.5.3.jar - https://repo1.maven.org/maven2/org/apache/ivy/ivy/2.5.3/ivy-2.5.3.jar && - java -jar lib/ivy-2.5.3.jar -ivy ivy.xml - -retrieve 'lib/[artifact]-[revision](-[classifier]).[ext]' - # test-requirements.txt minus pyinstaller: it publishes no riscv64 wheel and - # nothing under test/ imports it (upstream exercises it in a separate step). - CIBW_TEST_REQUIRES: pytest numpy typing_extensions jedi==0.18.0 - # Upstream's own invocation; `cd` first so jpype resolves to the installed wheel - # rather than the checkout. The deselected four assert `lastrowid`, which the - # newer sqlite-jdbc no longer reports through `getGeneratedKeys`; paths are - # relative to the pytest rootdir (the checkout), not to the cwd. - CIBW_TEST_COMMAND: >- - cd {project}/test && - python -m pytest -v jpypetest --checkjni - --deselect test/jpypetest/test_sql_sqlite.py::CursorTestCase::test_fetchall - --deselect test/jpypetest/test_sql_sqlite.py::CursorTestCase::test_fetchone - --deselect test/jpypetest/test_sql_sqlite.py::CursorTestCase::test_lastrowid - --deselect test/jpypetest/test_sql_sqlite.py::CursorTestCase::test_lastrowidMany + name: jpype1-${{ env.JPYPE1_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and the JAR made it into the wheel run: | @@ -115,15 +106,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: jpype1-${{ env.JPYPE1_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish JPype1 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-jxlpy.yml b/.github/workflows/build-jxlpy.yml index 72aa82d888d1..93bfd81deb11 100644 --- a/.github/workflows/build-jxlpy.yml +++ b/.github/workflows/build-jxlpy.yml @@ -51,97 +51,71 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build jxlpy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "jxlpy" + version: "${{ matrix.version }}" + repository: "olokelo/jxlpy" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-environment-linux: "LIBRARY_PATH=/usr/local/lib LD_LIBRARY_PATH=/usr/local/lib LIBJXL_TAG=v0.10.1" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py's extra_link_args is a bare `-ljxl -ljxl_threads` with no + # include_dirs/library_dirs, same as upstream's own CIBW_BEFORE_ALL: build + # libjxl from source and install it to the default /usr/local prefix. + # No `-march=`/SIMD flag is passed anywhere in this configure line, so + # highway (vendored, statically linked into libjxl.so) collapses to its + # portable EMU128/SCALAR baseline on riscv64 - same reasoning as + # pillow-jxl-plugin's CIBW_BEFORE_ALL_LINUX comment (gotchas 139/272/279/448). + # -DJPEGXL_ENABLE_EXAMPLES=OFF: the default-on examples/encode_oneshot + # aren't needed to build or install the libjxl.so/libjxl_threads.so + # that setup.py links against. + # -DCMAKE_POLICY_VERSION_MINIMUM=3.5: the image's CMake 4 rejects the + # third_party/sjpeg that v0.10.1 pins (cmake_minimum_required < 3.5; + # gotcha 207). + # + # `git clone --recursive` populates the submodules (incl. + # third_party/skcms) at whatever commit libjxl's *default* branch + # pins them to; `git checkout "$LIBJXL_TAG"` only moves the + # superproject tree - it does not re-sync already-checked-out + # submodules to what that tag pins them to (plain `git checkout` + # never does, with or without --recursive at clone time). Without + # the `git submodule update` below, the build links libjxl_cms.so + # against a skcms commit newer than v0.10.1 actually vendors, which + # restructured its internal namespacing - that produced an + # undefined symbol (skcms_private::baseline::run_program) at import + # time on riscv64 specifically because riscv64 takes skcms's + # generic/portable SIMD-less code path, the one path whose exact + # linkage shape changed between those two skcms commits. + cibw-before-all-linux: "git clone --recursive --shallow-submodules https://github.com/libjxl/libjxl.git /tmp/libjxl && cd /tmp/libjxl && git checkout \"$LIBJXL_TAG\" && git submodule update --init --recursive && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DJPEGXL_ENABLE_BENCHMARK=OFF -DJPEGXL_ENABLE_TOOLS=OFF -DJPEGXL_ENABLE_DEVTOOLS=OFF -DJPEGXL_ENABLE_EXAMPLES=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5 .. && cmake --build . -- -j$(nproc) && cmake --install . && cp ./third_party/brotli/*.so* /usr/local/lib && ldconfig && cat /tmp/libjxl/LICENSE /tmp/libjxl/PATENTS > {package}/LICENSE.libjxl && cp /tmp/libjxl/third_party/highway/LICENSE {package}/LICENSE.highway && cp /tmp/libjxl/third_party/brotli/LICENSE {package}/LICENSE.brotli && cp /tmp/libjxl/third_party/skcms/LICENSE {package}/LICENSE.skcms" + # No formal test suite upstream, only examples/*.py; exercise the same + # encode -> decode round trip as examples/encode_simple.py + + # examples/decode_simple.py through the installed wheel. + cibw-test-command: "python -c \"import jxlpy; print('jxlpy', jxlpy.__version__, 'libjxl', jxlpy._jxl_version); size = (64, 64); data = bytes([0, 188, 212] * (size[0] * size[1])); enc = jxlpy.JXLPyEncoder(quality=100, colorspace='RGB', size=size, effort=7); enc.add_frame(data); payload = enc.get_output(); assert len(payload) > 0, 'empty encoder output'; dec = jxlpy.JXLPyDecoder(payload); info = dec.get_info(); assert (info['xsize'], info['ysize']) == size, info; assert dec.get_colorspace() == 'RGB', dec.get_colorspace(); frame = dec.get_frame(); assert frame is not None and list(frame[:3]) == [0, 188, 212], frame; print('jxlpy OK') \"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: JXLPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout jxlpy v${{ env.JXLPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: olokelo/jxlpy - ref: ${{ env.JXLPY_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_PASS_LINUX: LIBJXL_TAG - # setup.py's extra_link_args is a bare `-ljxl -ljxl_threads` with no - # include_dirs/library_dirs, same as upstream's own CIBW_BEFORE_ALL: build - # libjxl from source and install it to the default /usr/local prefix. - # No `-march=`/SIMD flag is passed anywhere in this configure line, so - # highway (vendored, statically linked into libjxl.so) collapses to its - # portable EMU128/SCALAR baseline on riscv64 - same reasoning as - # pillow-jxl-plugin's CIBW_BEFORE_ALL_LINUX comment (gotchas 139/272/279/448). - # -DJPEGXL_ENABLE_EXAMPLES=OFF: the default-on examples/encode_oneshot - # aren't needed to build or install the libjxl.so/libjxl_threads.so - # that setup.py links against. - # -DCMAKE_POLICY_VERSION_MINIMUM=3.5: the image's CMake 4 rejects the - # third_party/sjpeg that v0.10.1 pins (cmake_minimum_required < 3.5; - # gotcha 207). - # - # `git clone --recursive` populates the submodules (incl. - # third_party/skcms) at whatever commit libjxl's *default* branch - # pins them to; `git checkout "$LIBJXL_TAG"` only moves the - # superproject tree - it does not re-sync already-checked-out - # submodules to what that tag pins them to (plain `git checkout` - # never does, with or without --recursive at clone time). Without - # the `git submodule update` below, the build links libjxl_cms.so - # against a skcms commit newer than v0.10.1 actually vendors, which - # restructured its internal namespacing - that produced an - # undefined symbol (skcms_private::baseline::run_program) at import - # time on riscv64 specifically because riscv64 takes skcms's - # generic/portable SIMD-less code path, the one path whose exact - # linkage shape changed between those two skcms commits. - CIBW_BEFORE_ALL_LINUX: >- - git clone --recursive --shallow-submodules https://github.com/libjxl/libjxl.git /tmp/libjxl && - cd /tmp/libjxl && - git checkout "$LIBJXL_TAG" && - git submodule update --init --recursive && - mkdir build && cd build && - cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF - -DJPEGXL_ENABLE_BENCHMARK=OFF -DJPEGXL_ENABLE_TOOLS=OFF -DJPEGXL_ENABLE_DEVTOOLS=OFF - -DJPEGXL_ENABLE_EXAMPLES=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5 .. && - cmake --build . -- -j$(nproc) && - cmake --install . && - cp ./third_party/brotli/*.so* /usr/local/lib && - ldconfig && - cat /tmp/libjxl/LICENSE /tmp/libjxl/PATENTS > {package}/LICENSE.libjxl && - cp /tmp/libjxl/third_party/highway/LICENSE {package}/LICENSE.highway && - cp /tmp/libjxl/third_party/brotli/LICENSE {package}/LICENSE.brotli && - cp /tmp/libjxl/third_party/skcms/LICENSE {package}/LICENSE.skcms - CIBW_ENVIRONMENT: LIBRARY_PATH=/usr/local/lib LD_LIBRARY_PATH=/usr/local/lib - # No formal test suite upstream, only examples/*.py; exercise the same - # encode -> decode round trip as examples/encode_simple.py + - # examples/decode_simple.py through the installed wheel. - CIBW_TEST_COMMAND: >- - python -c "import jxlpy; - print('jxlpy', jxlpy.__version__, 'libjxl', jxlpy._jxl_version); - size = (64, 64); - data = bytes([0, 188, 212] * (size[0] * size[1])); - enc = jxlpy.JXLPyEncoder(quality=100, colorspace='RGB', size=size, effort=7); - enc.add_frame(data); - payload = enc.get_output(); - assert len(payload) > 0, 'empty encoder output'; - dec = jxlpy.JXLPyDecoder(payload); - info = dec.get_info(); - assert (info['xsize'], info['ysize']) == size, info; - assert dec.get_colorspace() == 'RGB', dec.get_colorspace(); - frame = dec.get_frame(); - assert frame is not None and list(frame[:3]) == [0, 188, 212], frame; - print('jxlpy OK') - " + name: jxlpy-${{ env.JXLPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel contents run: | @@ -157,15 +131,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: jxlpy-${{ env.JXLPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish jxlpy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-kasa-crypt.yml b/.github/workflows/build-kasa-crypt.yml index cab89d725bb6..8cc7487a4b8c 100644 --- a/.github/workflows/build-kasa-crypt.yml +++ b/.github/workflows/build-kasa-crypt.yml @@ -60,7 +60,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 # Upstream's job-level REQUIRE_CYTHON never reaches the Linux build container. - cibw-environment: REQUIRE_CYTHON=1 + cibw-environment-linux: REQUIRE_CYTHON=1 cibw-test-sources: tests cibw-test-requires: 'pytest>=7,<9' # build_ext.py swallows compile errors and falls back to a pure-Python wheel. diff --git a/.github/workflows/build-keeper-mlkem.yml b/.github/workflows/build-keeper-mlkem.yml index 85ba7cea4fbf..112dfaad59e1 100644 --- a/.github/workflows/build-keeper-mlkem.yml +++ b/.github/workflows/build-keeper-mlkem.yml @@ -51,84 +51,107 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build keeper-mlkem ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "keeper-mlkem" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 30 + pre-build: |- + export MLKEM_VERSION='${{ matrix.version }}' + url="$(curl -sSfL "https://pypi.org/pypi/keeper-mlkem/${MLKEM_VERSION}/json" \ + | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" + curl -sSfL -o sdist.tar.gz "$url" + tar xzf sdist.tar.gz + test -f "keeper_mlkem-${MLKEM_VERSION}/pyproject.toml" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + mkdir -p tests + cat > tests/test_mlkem.py <<'PYTEST' + """Smoke tests for the riscv64 keeper-mlkem wheel. + + Upstream ships no test suite, so these exercise the compiled C extension + directly through a full ML-KEM key-gen/encaps/decaps round trip at each of + the three FIPS 203 parameter sets. + """ + + import mlkem.fastmath as fastmath + from mlkem import ML_KEM, MLKEM_512_PARAMETERS, MLKEM_768_PARAMETERS, MLKEM_1024_PARAMETERS + + + def test_extension_module_is_compiled(): + assert fastmath.__file__.endswith(".so"), fastmath.__file__ + + + def _roundtrip(parameters): + kem = ML_KEM(parameters) + encapsulation_key, decapsulation_key = kem.key_gen() + shared_secret, ciphertext = kem.encaps(encapsulation_key) + recovered_secret = kem.decaps(decapsulation_key, ciphertext) + assert shared_secret == recovered_secret + + + def test_roundtrip_mlkem_512(): + _roundtrip(MLKEM_512_PARAMETERS) + + + def test_roundtrip_mlkem_768(): + _roundtrip(MLKEM_768_PARAMETERS) + + + def test_roundtrip_mlkem_1024(): + _roundtrip(MLKEM_1024_PARAMETERS) + + + def test_decaps_implicit_rejection_on_tampered_ciphertext(): + kem = ML_KEM(MLKEM_768_PARAMETERS) + encapsulation_key, decapsulation_key = kem.key_gen() + shared_secret, ciphertext = kem.encaps(encapsulation_key) + tampered = bytes([ciphertext[0] ^ 0x01]) + ciphertext[1:] + rejected_secret = kem.decaps(decapsulation_key, tampered) + assert rejected_secret != shared_secret + PYTEST + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "keeper_mlkem-${{ matrix.version }}" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 30 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MLKEM_VERSION: ${{ matrix.version }} - steps: - - name: Fetch keeper-mlkem ${{ env.MLKEM_VERSION }} sdist - run: | - url="$(curl -sSfL "https://pypi.org/pypi/keeper-mlkem/${MLKEM_VERSION}/json" \ - | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" - curl -sSfL -o sdist.tar.gz "$url" - tar xzf sdist.tar.gz - test -f "keeper_mlkem-${MLKEM_VERSION}/pyproject.toml" - - - name: Stage smoke tests - run: | - mkdir -p tests - cat > tests/test_mlkem.py <<'PYTEST' - """Smoke tests for the riscv64 keeper-mlkem wheel. - - Upstream ships no test suite, so these exercise the compiled C extension - directly through a full ML-KEM key-gen/encaps/decaps round trip at each of - the three FIPS 203 parameter sets. - """ - - import mlkem.fastmath as fastmath - from mlkem import ML_KEM, MLKEM_512_PARAMETERS, MLKEM_768_PARAMETERS, MLKEM_1024_PARAMETERS - - - def test_extension_module_is_compiled(): - assert fastmath.__file__.endswith(".so"), fastmath.__file__ - - - def _roundtrip(parameters): - kem = ML_KEM(parameters) - encapsulation_key, decapsulation_key = kem.key_gen() - shared_secret, ciphertext = kem.encaps(encapsulation_key) - recovered_secret = kem.decaps(decapsulation_key, ciphertext) - assert shared_secret == recovered_secret - - - def test_roundtrip_mlkem_512(): - _roundtrip(MLKEM_512_PARAMETERS) - - - def test_roundtrip_mlkem_768(): - _roundtrip(MLKEM_768_PARAMETERS) - - - def test_roundtrip_mlkem_1024(): - _roundtrip(MLKEM_1024_PARAMETERS) - - - def test_decaps_implicit_rejection_on_tampered_ciphertext(): - kem = ML_KEM(MLKEM_768_PARAMETERS) - encapsulation_key, decapsulation_key = kem.key_gen() - shared_secret, ciphertext = kem.encaps(encapsulation_key) - tampered = bytes([ciphertext[0] ^ 0x01]) + ciphertext[1:] - rejected_secret = kem.decaps(decapsulation_key, tampered) - assert rejected_secret != shared_secret - PYTEST - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - package-dir: keeper_mlkem-${{ env.MLKEM_VERSION }} - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest -v tests + name: keeper-mlkem-${{ env.MLKEM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extension run: | @@ -140,15 +163,9 @@ jobs: print("extension:", sos[0]) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: keeper-mlkem-${{ env.MLKEM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish keeper-mlkem ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-keeper-pam-webrtc-rs.yml b/.github/workflows/build-keeper-pam-webrtc-rs.yml index 70882199d73b..aac5d1923292 100644 --- a/.github/workflows/build-keeper-pam-webrtc-rs.yml +++ b/.github/workflows/build-keeper-pam-webrtc-rs.yml @@ -60,78 +60,104 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build keeper-pam-webrtc-rs ${{ matrix.version }} cp39-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "keeper-pam-webrtc-rs" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 120 + pre-build: |- + export KEEPER_PAM_WEBRTC_RS_VERSION='${{ matrix.version }}' + url="$(curl -sSfL "https://pypi.org/pypi/keeper-pam-webrtc-rs/${KEEPER_PAM_WEBRTC_RS_VERSION}/json" \ + | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" + curl -sSfL -o sdist.tar.gz "$url" + tar xzf sdist.tar.gz + test -f "keeper_pam_webrtc_rs-${KEEPER_PAM_WEBRTC_RS_VERSION}/pyproject.toml" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + cd "keeper_pam_webrtc_rs-${KEEPER_PAM_WEBRTC_RS_VERSION}" + git apply ../python-wheels/patches/keeper-pam-webrtc-rs/${KEEPER_PAM_WEBRTC_RS_VERSION}/*.patch + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + mkdir -p tests + cat > tests/test_smoke.py <<'PYTEST' + """Smoke test for the riscv64 keeper-pam-webrtc-rs wheel. + + Upstream ships no Python test suite with the sdist; this exercises the + compiled PyO3 extension's documented entry points (README.md). + """ + + import keeper_pam_webrtc_rs + + + def test_extension_module_is_compiled(): + # __init__.py is a 3-line `from .keeper_pam_webrtc_rs import *` + # shim (confirmed against the real PyPI x86_64 wheel's layout); + # the compiled .so lives on that submodule, not on the package + # itself, whose own __file__ is always the pure-Python shim. + native = keeper_pam_webrtc_rs.keeper_pam_webrtc_rs + assert native.__file__.endswith(".so"), native.__file__ + + + def test_logger_and_registry(): + keeper_pam_webrtc_rs.initialize_logger("riscv64-smoke-test") + registry = keeper_pam_webrtc_rs.PyTubeRegistry() + assert registry is not None + PYTEST + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "keeper_pam_webrtc_rs-${{ matrix.version }}" + cibw-build: "cp39-manylinux_riscv64" + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: KEEPER_PAM_WEBRTC_RS_VERSION: ${{ matrix.version }} - steps: - - name: Fetch keeper-pam-webrtc-rs ${{ env.KEEPER_PAM_WEBRTC_RS_VERSION }} sdist - run: | - url="$(curl -sSfL "https://pypi.org/pypi/keeper-pam-webrtc-rs/${KEEPER_PAM_WEBRTC_RS_VERSION}/json" \ - | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" - curl -sSfL -o sdist.tar.gz "$url" - tar xzf sdist.tar.gz - test -f "keeper_pam_webrtc_rs-${KEEPER_PAM_WEBRTC_RS_VERSION}/pyproject.toml" - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch keeper-pam-webrtc-rs source - run: | - cd "keeper_pam_webrtc_rs-${KEEPER_PAM_WEBRTC_RS_VERSION}" - git apply ../python-wheels/patches/keeper-pam-webrtc-rs/${KEEPER_PAM_WEBRTC_RS_VERSION}/*.patch - - - name: Stage smoke test - run: | - mkdir -p tests - cat > tests/test_smoke.py <<'PYTEST' - """Smoke test for the riscv64 keeper-pam-webrtc-rs wheel. - - Upstream ships no Python test suite with the sdist; this exercises the - compiled PyO3 extension's documented entry points (README.md). - """ - - import keeper_pam_webrtc_rs - - - def test_extension_module_is_compiled(): - # __init__.py is a 3-line `from .keeper_pam_webrtc_rs import *` - # shim (confirmed against the real PyPI x86_64 wheel's layout); - # the compiled .so lives on that submodule, not on the package - # itself, whose own __file__ is always the pure-Python shim. - native = keeper_pam_webrtc_rs.keeper_pam_webrtc_rs - assert native.__file__.endswith(".so"), native.__file__ - - - def test_logger_and_registry(): - keeper_pam_webrtc_rs.initialize_logger("riscv64-smoke-test") - registry = keeper_pam_webrtc_rs.PyTubeRegistry() - assert registry is not None - PYTEST - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - package-dir: keeper_pam_webrtc_rs-${{ env.KEEPER_PAM_WEBRTC_RS_VERSION }} - only: cp39-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest -v tests + name: keeper-pam-webrtc-rs-${{ env.KEEPER_PAM_WEBRTC_RS_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extension and the licence run: | @@ -147,15 +173,9 @@ jobs: print(whl, "ok:", sos[0]) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: keeper-pam-webrtc-rs-${{ env.KEEPER_PAM_WEBRTC_RS_VERSION }}-cp39-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish keeper-pam-webrtc-rs ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-keystone-engine.yml b/.github/workflows/build-keystone-engine.yml index 14797cf6c288..5e87d6002447 100644 --- a/.github/workflows/build-keystone-engine.yml +++ b/.github/workflows/build-keystone-engine.yml @@ -63,81 +63,91 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build keystone-engine ${{ matrix.version }} py2.py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "keystone-engine" + version: "${{ matrix.version }}" + repository: "keystone-engine/keystone" + ref: "${{ matrix.version }}" + artifact-tag: "py2.py3-none-manylinux_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/keystone-engine/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "bindings/python" + cibw-build: "cp312-manylinux_riscv64" + # setup.py shells out to `cmake`/`make` directly (make-share.sh); neither is + # a declared build dep. Installed from the image's own package manager rather + # than pip: pypi.riseproject.dev lags PyPI's own latest cmake (gotcha 84), and + # this gives a cmake < 4, needed below. The vendored llvm/cmake/config.guess is + # stamped 2011, predates riscv64, and fails "unable to guess system type"; the + # automake package's copy already knows riscv64 (gotcha 138). + cibw-before-all-linux: |- + set -ex + dnf install -y cmake automake + cp /usr/share/automake-*/config.guess llvm/cmake/config.guess + # The image also carries a newer cmake (>= 4) ahead on PATH by default; that + # version hard-rejects CMakeLists.txt's `cmake_policy(SET CMP0051 OLD)` ("no + # longer supports it"), where the one just installed above (< 4) still can. + # Shadow only `cmake` via a dedicated PATH entry, not all of /usr/bin, so + # nothing else (notably `python`) resolves somewhere cibuildwheel doesn't + # expect. + mkdir -p /tmp/keystone-cmake + ln -sf /usr/bin/cmake /tmp/keystone-cmake/cmake + # CMAKE_POLICY_VERSION_MINIMUM=3.5 covers cmake_minimum_required(VERSION 2.8.7) + # the same way, should PATH resolution ever pick a >= 4 cmake up regardless. + cibw-environment-linux: "CMAKE_POLICY_VERSION_MINIMUM=3.5 PATH=/tmp/keystone-cmake:$PATH" + # Upstream's CI builds wheels but runs no tests at all. bindings/python/sample.py + # is the closest thing to a test upstream ships, but one of its own calls - + # b"add eax, 15h" with the default (non-RADIX16) syntax option - raises + # KS_ERR_ASM_INVALIDOPERAND independent of any target this build produces (a + # numeric-literal parsing quirk in the demo script, not riscv64-specific), so + # this inlines the rest of sample.py's calls instead of running it as-is. + cibw-test-command: |- + python -c " + import keystone as ks + + def asm(arch, mode, code): + encoding, count = ks.Ks(arch, mode).asm(code) + assert count > 0, (arch, mode, code) + + asm(ks.KS_ARCH_X86, ks.KS_MODE_64, b'add rax, rcx') + asm(ks.KS_ARCH_ARM, ks.KS_MODE_ARM, b'sub r1, r2, r5') + asm(ks.KS_ARCH_ARM64, ks.KS_MODE_LITTLE_ENDIAN, b'ldr w1, [sp, #0x8]') + asm(ks.KS_ARCH_HEXAGON, ks.KS_MODE_BIG_ENDIAN, b'v23.w=vavg(v11.w,v2.w):rnd') + asm(ks.KS_ARCH_MIPS, ks.KS_MODE_MIPS32, b'and \$9, \$6, \$7') + asm(ks.KS_ARCH_PPC, ks.KS_MODE_PPC32 + ks.KS_MODE_BIG_ENDIAN, b'add 1, 2, 3') + asm(ks.KS_ARCH_SPARC, ks.KS_MODE_SPARC32 + ks.KS_MODE_LITTLE_ENDIAN, b'add %g1, %g2, %g3') + asm(ks.KS_ARCH_SYSTEMZ, ks.KS_MODE_BIG_ENDIAN, b'a %r0, 4095(%r15,%r1)') + print('all asm ok') + " + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: KEYSTONE_ENGINE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout keystone ${{ env.KEYSTONE_ENGINE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: keystone-engine/keystone - ref: ${{ env.KEYSTONE_ENGINE_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Patch keystone source - run: git apply python-wheels/patches/keystone-engine/${{ env.KEYSTONE_ENGINE_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: bindings/python - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py shells out to `cmake`/`make` directly (make-share.sh); neither is - # a declared build dep. Installed from the image's own package manager rather - # than pip: pypi.riseproject.dev lags PyPI's own latest cmake (gotcha 84), and - # this gives a cmake < 4, needed below. The vendored llvm/cmake/config.guess is - # stamped 2011, predates riscv64, and fails "unable to guess system type"; the - # automake package's copy already knows riscv64 (gotcha 138). - CIBW_BEFORE_ALL_LINUX: | - set -ex - dnf install -y cmake automake - cp /usr/share/automake-*/config.guess llvm/cmake/config.guess - # The image also carries a newer cmake (>= 4) ahead on PATH by default; that - # version hard-rejects CMakeLists.txt's `cmake_policy(SET CMP0051 OLD)` ("no - # longer supports it"), where the one just installed above (< 4) still can. - # Shadow only `cmake` via a dedicated PATH entry, not all of /usr/bin, so - # nothing else (notably `python`) resolves somewhere cibuildwheel doesn't - # expect. - mkdir -p /tmp/keystone-cmake - ln -sf /usr/bin/cmake /tmp/keystone-cmake/cmake - # CMAKE_POLICY_VERSION_MINIMUM=3.5 covers cmake_minimum_required(VERSION 2.8.7) - # the same way, should PATH resolution ever pick a >= 4 cmake up regardless. - CIBW_ENVIRONMENT: CMAKE_POLICY_VERSION_MINIMUM=3.5 PATH=/tmp/keystone-cmake:$PATH - # Upstream's CI builds wheels but runs no tests at all. bindings/python/sample.py - # is the closest thing to a test upstream ships, but one of its own calls - - # b"add eax, 15h" with the default (non-RADIX16) syntax option - raises - # KS_ERR_ASM_INVALIDOPERAND independent of any target this build produces (a - # numeric-literal parsing quirk in the demo script, not riscv64-specific), so - # this inlines the rest of sample.py's calls instead of running it as-is. - CIBW_TEST_COMMAND: | - python -c " - import keystone as ks - - def asm(arch, mode, code): - encoding, count = ks.Ks(arch, mode).asm(code) - assert count > 0, (arch, mode, code) - - asm(ks.KS_ARCH_X86, ks.KS_MODE_64, b'add rax, rcx') - asm(ks.KS_ARCH_ARM, ks.KS_MODE_ARM, b'sub r1, r2, r5') - asm(ks.KS_ARCH_ARM64, ks.KS_MODE_LITTLE_ENDIAN, b'ldr w1, [sp, #0x8]') - asm(ks.KS_ARCH_HEXAGON, ks.KS_MODE_BIG_ENDIAN, b'v23.w=vavg(v11.w,v2.w):rnd') - asm(ks.KS_ARCH_MIPS, ks.KS_MODE_MIPS32, b'and \$9, \$6, \$7') - asm(ks.KS_ARCH_PPC, ks.KS_MODE_PPC32 + ks.KS_MODE_BIG_ENDIAN, b'add 1, 2, 3') - asm(ks.KS_ARCH_SPARC, ks.KS_MODE_SPARC32 + ks.KS_MODE_LITTLE_ENDIAN, b'add %g1, %g2, %g3') - asm(ks.KS_ARCH_SYSTEMZ, ks.KS_MODE_BIG_ENDIAN, b'a %r0, 4095(%r15,%r1)') - print('all asm ok') - " + name: keystone-engine-${{ env.KEYSTONE_ENGINE_VERSION }}-py2.py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries libkeystone and its licence run: | @@ -152,15 +162,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: keystone-engine-${{ env.KEYSTONE_ENGINE_VERSION }}-py2.py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish keystone-engine ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-kiss-icp.yml b/.github/workflows/build-kiss-icp.yml index a9f3bc7d1448..4d0efcd6a7f2 100644 --- a/.github/workflows/build-kiss-icp.yml +++ b/.github/workflows/build-kiss-icp.yml @@ -51,94 +51,101 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build kiss-icp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "kiss-icp" + version: "${{ matrix.version }}" + repository: "PRBonn/kiss-icp" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + set -euo pipefail + curl -fsSL -o LICENSE.oneTBB https://raw.githubusercontent.com/uxlfoundation/oneTBB/v2022.1.0/LICENSE.txt + curl -fsSL -o LICENSE.eigen https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 + curl -fsSL -o LICENSE.sophus https://raw.githubusercontent.com/strasdat/Sophus/1.24.6/LICENSE.txt + curl -fsSL -o LICENSE.robin-map https://raw.githubusercontent.com/Tessil/robin-map/v1.4.0/LICENSE + curl -fsSL -o LICENSE.pybind11 https://raw.githubusercontent.com/pybind/pybind11/v3.1.0/LICENSE + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + mkdir -p riscv64-tests + cat > riscv64-tests/test_riscv64_smoke.py <<'EOF' + import numpy as np + + from kiss_icp.config import load_config + from kiss_icp.kiss_icp import KissICP + from kiss_icp.pybind import kiss_icp_pybind + + + def _room(rng, n=4000): + faces = [] + for axis in range(3): + for wall in (-8.0, 8.0) if axis < 2 else (-1.5, 3.0): + pts = rng.uniform(-8.0, 8.0, size=(n, 3)) + pts[:, 2] = rng.uniform(-1.5, 3.0, size=n) if axis < 2 else pts[:, 2] + pts[:, axis] = wall + faces.append(pts) + return np.concatenate(faces) + + + def test_extension_is_compiled(): + assert kiss_icp_pybind.__file__.endswith(".so"), kiss_icp_pybind.__file__ + + + def test_registration_recovers_motion(): + rng = np.random.default_rng(0) + scene = _room(rng) + odometry = KissICP(load_config(None)) + motion = np.array([0.4, -0.2, 0.05]) + for step in range(4): + odometry.register_frame(scene - step * motion, np.array([])) + np.testing.assert_allclose(odometry.last_pose[:3, 3], 3 * motion, atol=0.05) + np.testing.assert_allclose(odometry.last_pose[:3, :3], np.eye(3), atol=0.01) + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "python/" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # scikit-build-core 1.0 rejects the release's `cmake.minimum-version` + # key; build-system.requires leaves it unpinned. + cibw-before-all: "echo 'scikit-build-core<1' > /skbuild-constraint.txt" + cibw-environment-linux: "PIP_CONSTRAINT=/skbuild-constraint.txt PIP_BUILD_CONSTRAINT=/skbuild-constraint.txt" + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + cibw-test-sources: "python/tests riscv64-tests" + cibw-test-requires: "pytest" + cibw-test-command: "kiss_icp_pipeline --version && python -m pytest -rA python/tests riscv64-tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: KISS_ICP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout kiss-icp v${{ env.KISS_ICP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: PRBonn/kiss-icp - ref: v${{ env.KISS_ICP_VERSION }} - persist-credentials: false - - # oneTBB, Eigen, Sophus, robin-map and pybind11 are fetched at configure - # time and compiled into the extension; upstream's wheel ships none of - # their licences, and its in-tree 3rdparty/*/LICENSE copies are not the - # pinned releases' own texts. - - name: Stage the vendored dependencies' licences - working-directory: python - run: | - set -euo pipefail - curl -fsSL -o LICENSE.oneTBB https://raw.githubusercontent.com/uxlfoundation/oneTBB/v2022.1.0/LICENSE.txt - curl -fsSL -o LICENSE.eigen https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 - curl -fsSL -o LICENSE.sophus https://raw.githubusercontent.com/strasdat/Sophus/1.24.6/LICENSE.txt - curl -fsSL -o LICENSE.robin-map https://raw.githubusercontent.com/Tessil/robin-map/v1.4.0/LICENSE - curl -fsSL -o LICENSE.pybind11 https://raw.githubusercontent.com/pybind/pybind11/v3.1.0/LICENSE - - - name: Stage the riscv64 smoke test - run: | - mkdir -p riscv64-tests - cat > riscv64-tests/test_riscv64_smoke.py <<'EOF' - import numpy as np - - from kiss_icp.config import load_config - from kiss_icp.kiss_icp import KissICP - from kiss_icp.pybind import kiss_icp_pybind - - - def _room(rng, n=4000): - faces = [] - for axis in range(3): - for wall in (-8.0, 8.0) if axis < 2 else (-1.5, 3.0): - pts = rng.uniform(-8.0, 8.0, size=(n, 3)) - pts[:, 2] = rng.uniform(-1.5, 3.0, size=n) if axis < 2 else pts[:, 2] - pts[:, axis] = wall - faces.append(pts) - return np.concatenate(faces) - - - def test_extension_is_compiled(): - assert kiss_icp_pybind.__file__.endswith(".so"), kiss_icp_pybind.__file__ - - - def test_registration_recovers_motion(): - rng = np.random.default_rng(0) - scene = _room(rng) - odometry = KissICP(load_config(None)) - motion = np.array([0.4, -0.2, 0.05]) - for step in range(4): - odometry.register_frame(scene - step * motion, np.array([])) - np.testing.assert_allclose(odometry.last_pose[:3, 3], 3 * motion, atol=0.05) - np.testing.assert_allclose(odometry.last_pose[:3, :3], np.eye(3), atol=0.01) - EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: python/ - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # scikit-build-core 1.0 rejects the release's `cmake.minimum-version` - # key; build-system.requires leaves it unpinned. - CIBW_BEFORE_ALL: echo 'scikit-build-core<1' > /skbuild-constraint.txt - CIBW_ENVIRONMENT: >- - PIP_CONSTRAINT=/skbuild-constraint.txt - PIP_BUILD_CONSTRAINT=/skbuild-constraint.txt - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy - CIBW_TEST_SOURCES: python/tests riscv64-tests - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: kiss_icp_pipeline --version && python -m pytest -rA python/tests riscv64-tests + name: kiss-icp-${{ env.KISS_ICP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -155,15 +162,9 @@ jobs: print(path, "->", sos) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: kiss-icp-${{ env.KISS_ICP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish kiss-icp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-kiwipiepy.yml b/.github/workflows/build-kiwipiepy.yml index f85519b64225..6d3689c18b0c 100644 --- a/.github/workflows/build-kiwipiepy.yml +++ b/.github/workflows/build-kiwipiepy.yml @@ -65,51 +65,56 @@ jobs: build: cp314t-manylinux_riscv64 limited-api: '' name: Build kiwipiepy ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "kiwipiepy" + version: "${{ matrix.version }}" + repository: "bab2min/kiwipiepy" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + checkout-submodules: "recursive" + cibw-build: "${{ matrix.build }}" + cibw-environment-linux: "USE_MIMALLOC=1 Py_LIMITED_API=\"${{ matrix.limited-api }}\"" + # numpy, a runtime dependency, has no cp39 riscv64 wheel on either index (gotcha 216). + cibw-test-skip: "cp39-*" + cibw-test-requires: "pytest" + # The tests read Kiwi/ and kiwipiepy/ files relative to the project root; + # plain pytest keeps the checkout's kiwipiepy/ off sys.path. The + # transformers_addon suite upstream loops over 35 transformers releases is left out. + # All six deselected tests fail identically on x86_64 with upstream's own wheel under + # KIWI_ARCH_TYPE=none, the non-SIMD path riscv64 selects (gotcha 589); the four added + # for 0.24.0 exercise new APIs (dialect normalization, split_into_forms/tokens, + # cong_functions) that hit the same generic-path divergence. + cibw-test-command: "cd {project} && pytest -svv test/test_kiwipiepy.py test/test_nogil_safety.py --deselect test/test_kiwipiepy.py::test_space_issue_189 --deselect test/test_kiwipiepy.py::test_template --deselect test/test_kiwipiepy.py::test_cong_functions --deselect test/test_kiwipiepy.py::test_dialect --deselect test/test_kiwipiepy.py::test_split_into_forms --deselect test/test_kiwipiepy.py::test_split_form_tokens" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + tag: [cp39-abi3, cp314t] + include: + # cp39 first: Py_LIMITED_API=1 makes setup.py tag cp39-abi3 whatever the + # build interpreter (gotcha 96); the later entries only re-test that wheel. + - tag: cp39-abi3 + build: >- + cp39-manylinux_riscv64 cp312-manylinux_riscv64 + cp313-manylinux_riscv64 cp314-manylinux_riscv64 + limited-api: '1' + - tag: cp314t + build: cp314t-manylinux_riscv64 + limited-api: '' env: KIWIPIEPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout kiwipiepy v${{ env.KIWIPIEPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: bab2min/kiwipiepy - ref: v${{ env.KIWIPIEPY_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - USE_MIMALLOC=1 - Py_LIMITED_API="${{ matrix.limited-api }}" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # numpy, a runtime dependency, has no cp39 riscv64 wheel on either index (gotcha 216). - CIBW_TEST_SKIP: cp39-* - CIBW_TEST_REQUIRES: pytest - # The tests read Kiwi/ and kiwipiepy/ files relative to the project root; - # plain pytest keeps the checkout's kiwipiepy/ off sys.path. The - # transformers_addon suite upstream loops over 35 transformers releases is left out. - # All six deselected tests fail identically on x86_64 with upstream's own wheel under - # KIWI_ARCH_TYPE=none, the non-SIMD path riscv64 selects (gotcha 589); the four added - # for 0.24.0 exercise new APIs (dialect normalization, split_into_forms/tokens, - # cong_functions) that hit the same generic-path divergence. - CIBW_TEST_COMMAND: >- - cd {project} && - pytest -svv test/test_kiwipiepy.py test/test_nogil_safety.py - --deselect test/test_kiwipiepy.py::test_space_issue_189 - --deselect test/test_kiwipiepy.py::test_template - --deselect test/test_kiwipiepy.py::test_cong_functions - --deselect test/test_kiwipiepy.py::test_dialect - --deselect test/test_kiwipiepy.py::test_split_into_forms - --deselect test/test_kiwipiepy.py::test_split_form_tokens + name: kiwipiepy-${{ env.KIWIPIEPY_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -132,15 +137,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: kiwipiepy-${{ env.KIWIPIEPY_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish kiwipiepy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-klayout.yml b/.github/workflows/build-klayout.yml index 2ecf00d1c8d4..7c176ac2a98a 100644 --- a/.github/workflows/build-klayout.yml +++ b/.github/workflows/build-klayout.yml @@ -50,6 +50,36 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build klayout ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + # All 12 legs compiling at once on the riscv64 fleet's shared/limited + # memory (gotcha 228) loses a runner mid-build or kills one before it + # starts; a few at a time (build-dcc-mcp-server.yml) stays well inside it. + max-parallel: 4 + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "klayout" + version: "${{ matrix.version }}" + repository: "klayout/klayout" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-before-all-linux: |- + if command -v dnf >/dev/null 2>&1; then + dnf install -y zlib-devel libcurl-devel expat-devel libpng-devel; + elif command -v apk >/dev/null 2>&1; then + apk add --no-cache curl-dev expat-dev zlib-dev libpng-dev; + fi + cibw-before-build-linux: "true" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: @@ -60,35 +90,14 @@ jobs: max-parallel: 4 matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: KLAYOUT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout klayout v${{ env.KLAYOUT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: klayout/klayout - ref: v${{ env.KLAYOUT_VERSION }} - persist-credentials: false - - # klayout's own before-all (ci-scripts/docker/docker_prepare.sh) detects - # CentOS via /etc/centos-release, which manylinux_2_39's Rocky Linux 10 - # base doesn't have; detect by package manager instead and use Rocky's - # package name (libcurl-devel, not curl-devel). - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - if command -v dnf >/dev/null 2>&1; then - dnf install -y zlib-devel libcurl-devel expat-devel libpng-devel; - elif command -v apk >/dev/null 2>&1; then - apk add --no-cache curl-dev expat-dev zlib-dev libpng-dev; - fi - CIBW_BEFORE_BUILD_LINUX: "true" + name: klayout-${{ env.KLAYOUT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -103,15 +112,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: klayout-${{ env.KLAYOUT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish klayout ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-lameenc.yml b/.github/workflows/build-lameenc.yml index b5a07b83579b..076dea62dc1b 100644 --- a/.github/workflows/build-lameenc.yml +++ b/.github/workflows/build-lameenc.yml @@ -52,67 +52,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build lameenc ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "lameenc" + version: "${{ matrix.version }}" + repository: "chrisstaite/lameenc" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/lameenc/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Replaces upstream's per-container build.sh, which loops every + # /opt/python/*/bin itself; cibuildwheel does that looping for us. + cibw-before-all-linux: "curl -fsSL https://sourceforge.net/projects/lame/files/lame/3.100/lame-3.100.tar.gz/download -o lame.tar.gz && echo \"ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e lame.tar.gz\" | sha256sum -c - && tar xzf lame.tar.gz && sed -i 's/0-9\\*0-9\\*/[0-9]*[0-9]*/g' lame-3.100/configure && cp {project}/fixed-libmp3lame.sym lame-3.100/include/libmp3lame.sym && cd lame-3.100 && cp /usr/share/automake-*/config.guess /usr/share/automake-*/config.sub . && ./configure \"CFLAGS=-fPIC -fno-fast-math\" LDFLAGS=-fPIC --prefix=/tmp/lame --enable-expopt --enable-nasm --disable-frontend --disable-decoder --disable-analyzer-hooks --disable-debug --disable-dependency-tracking && make && make install && cp COPYING {project}/LICENSE.lame" + cibw-build-frontend: "build; args: -C--build-option=--libdir=/tmp/lame/lib -C--build-option=--incdir=/tmp/lame/include/lame" + # `git apply` above dirties the tree, which renames the + # setuptools_scm version; pin it back to the tag. + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_LAMEENC=${{ matrix.version }}" + cibw-test-command: "python3 -c \"import lameenc; enc = lameenc.Encoder(); enc.set_bit_rate(128); enc.set_in_sample_rate(16000); enc.set_channels(1); enc.set_quality(2); data = enc.encode(b'\\x00\\x00' * 16000) + enc.flush(); assert len(data) > 0, 'no mp3 data produced'\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: LAMEENC_VERSION: ${{ matrix.version }} - steps: - - name: Checkout lameenc v${{ env.LAMEENC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: chrisstaite/lameenc - ref: v${{ env.LAMEENC_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Patch lameenc source - run: git apply python-wheels/patches/lameenc/${{ env.LAMEENC_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces upstream's per-container build.sh, which loops every - # /opt/python/*/bin itself; cibuildwheel does that looping for us. - CIBW_BEFORE_ALL_LINUX: >- - curl -fsSL - https://sourceforge.net/projects/lame/files/lame/${{ env.LAME_VERSION }}/lame-${{ env.LAME_VERSION }}.tar.gz/download - -o lame.tar.gz && - echo "${{ env.LAME_SHA256 }} lame.tar.gz" | sha256sum -c - && - tar xzf lame.tar.gz && - sed -i 's/0-9\*0-9\*/[0-9]*[0-9]*/g' lame-${{ env.LAME_VERSION }}/configure && - cp {project}/fixed-libmp3lame.sym lame-${{ env.LAME_VERSION }}/include/libmp3lame.sym && - cd lame-${{ env.LAME_VERSION }} && - cp /usr/share/automake-*/config.guess /usr/share/automake-*/config.sub . && - ./configure "CFLAGS=-fPIC -fno-fast-math" LDFLAGS=-fPIC --prefix=/tmp/lame - --enable-expopt --enable-nasm --disable-frontend --disable-decoder - --disable-analyzer-hooks --disable-debug --disable-dependency-tracking && - make && make install && - cp COPYING {project}/LICENSE.lame - CIBW_BUILD_FRONTEND: >- - build; args: -C--build-option=--libdir=/tmp/lame/lib - -C--build-option=--incdir=/tmp/lame/include/lame - # `git apply` above dirties the tree, which renames the - # setuptools_scm version; pin it back to the tag. - CIBW_ENVIRONMENT: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_LAMEENC=${{ env.LAMEENC_VERSION }} - CIBW_TEST_COMMAND: >- - python3 -c "import lameenc; enc = lameenc.Encoder(); enc.set_bit_rate(128); - enc.set_in_sample_rate(16000); enc.set_channels(1); enc.set_quality(2); - data = enc.encode(b'\x00\x00' * 16000) + enc.flush(); - assert len(data) > 0, 'no mp3 data produced'" + name: lameenc-${{ env.LAMEENC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and both licences run: | @@ -126,12 +116,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: lameenc-${{ env.LAMEENC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -161,7 +145,7 @@ jobs: publish: name: Publish lameenc ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-lap.yml b/.github/workflows/build-lap.yml index 57fd94e4ceb6..1f631e6eae40 100644 --- a/.github/workflows/build-lap.yml +++ b/.github/workflows/build-lap.yml @@ -47,37 +47,40 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build lap ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "lap" + version: "${{ matrix.version }}" + repository: "gatagat/lap" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest pytest-timeout" + cibw-test-command: "python -c \"import lap._lapjv as m; assert m.__file__.endswith('.so'), m.__file__\" && pytest -v --pyargs lap.tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: LAP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout lap v${{ env.LAP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: gatagat/lap - ref: v${{ env.LAP_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest pytest-timeout - CIBW_TEST_COMMAND: >- - python -c "import lap._lapjv as m; assert m.__file__.endswith('.so'), m.__file__" && - pytest -v --pyargs lap.tests + name: lap-${{ env.LAP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -91,16 +94,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: lap-${{ env.LAP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish lap ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-lapx.yml b/.github/workflows/build-lapx.yml index d9cffe2e46e5..194e8444c3cd 100644 --- a/.github/workflows/build-lapx.yml +++ b/.github/workflows/build-lapx.yml @@ -48,49 +48,50 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build lapx ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "lapx" + version: "${{ matrix.version }}" + repository: "rathaROG/lapx" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # From 0.11.0 setup.py builds the LAPJVR/LAPJVH solvers with Rust and + # refuses to build without cargo, so install the toolchain in-container. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + # numpy is a build-time (headers) and runtime dependency, scipy a test-only + # one; only our registry has either for riscv64. Only-binary keeps a newer + # PyPI release from winning the resolution and then compiling from sdist. + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" PIP_ONLY_BINARY=numpy,scipy" + cibw-test-requires: "pytest pytest-timeout scipy" + # tests/ has no __init__.py, so bare `pytest` never prepends the checkout + # root to sys.path[0] (gotcha 218) -- `import lap` resolves to the + # installed wheel, exactly like upstream's own `cd tests && pytest -v`. + # The import probe proves it: the checkout has no in-place .so to shadow with. + cibw-test-command: "python -c \"import lap._lapjv as m; assert m.__file__.endswith('.so'), m.__file__\" && cd {package}/tests && pytest -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: LAPX_VERSION: ${{ matrix.version }} - steps: - - name: Checkout lapx v${{ env.LAPX_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: rathaROG/lapx - ref: v${{ env.LAPX_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # From 0.11.0 setup.py builds the LAPJVR/LAPJVH solvers with Rust and - # refuses to build without cargo, so install the toolchain in-container. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - # numpy is a build-time (headers) and runtime dependency, scipy a test-only - # one; only our registry has either for riscv64. Only-binary keeps a newer - # PyPI release from winning the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - CIBW_TEST_REQUIRES: pytest pytest-timeout scipy - # tests/ has no __init__.py, so bare `pytest` never prepends the checkout - # root to sys.path[0] (gotcha 218) -- `import lap` resolves to the - # installed wheel, exactly like upstream's own `cd tests && pytest -v`. - # The import probe proves it: the checkout has no in-place .so to shadow with. - CIBW_TEST_COMMAND: >- - python -c "import lap._lapjv as m; assert m.__file__.endswith('.so'), m.__file__" && - cd {package}/tests && pytest -v + name: lapx-${{ env.LAPX_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -105,16 +106,9 @@ jobs: assert licences == {"LICENSE", "NOTICE", "THIRD_PARTY_NOTICES"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: lapx-${{ env.LAPX_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish lapx ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-lark-cython.yml b/.github/workflows/build-lark-cython.yml index b04ba821a8e2..c13833c8fe31 100644 --- a/.github/workflows/build-lark-cython.yml +++ b/.github/workflows/build-lark-cython.yml @@ -49,34 +49,38 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build lark-cython ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "lark-cython" + version: "${{ matrix.version }}" + repository: "lark-parser/lark_cython" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pytest" + cibw-test-command: "python -c \"import lark_cython; assert lark_cython.__file__\" && python -m pytest {project}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: LARK_CYTHON_VERSION: ${{ matrix.version }} - steps: - - name: Checkout lark-cython ${{ env.LARK_CYTHON_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: lark-parser/lark_cython - ref: ${{ env.LARK_CYTHON_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: >- - python -c "import lark_cython; assert lark_cython.__file__" && - python -m pytest {project} + name: lark-cython-${{ env.LARK_CYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -88,16 +92,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: lark-cython-${{ env.LARK_CYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish lark-cython ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-lazy-object-proxy.yml b/.github/workflows/build-lazy-object-proxy.yml index fd9fc02dabdf..51dc2576cb68 100644 --- a/.github/workflows/build-lazy-object-proxy.yml +++ b/.github/workflows/build-lazy-object-proxy.yml @@ -49,38 +49,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build lazy-object-proxy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "lazy-object-proxy" + version: "${{ matrix.version }}" + repository: "ionelmc/python-lazy-object-proxy" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setuptools_scm cannot see the tag history in a shallow checkout. + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_LAZY_OBJECT_PROXY=${{ matrix.version }}" + cibw-test-requires: "pytest pytest-benchmark" + # Upstream runs `tox --skip-pkg-install --direct-yolo -e py3XX-nocov`; tox-direct + # caps tox below 4, so run that env's own command instead. + cibw-test-command: "cd {project} && pytest -vv --ignore=src" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: LAZY_OBJECT_PROXY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout lazy-object-proxy v${{ env.LAZY_OBJECT_PROXY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ionelmc/python-lazy-object-proxy - ref: v${{ env.LAZY_OBJECT_PROXY_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setuptools_scm cannot see the tag history in a shallow checkout. - CIBW_ENVIRONMENT: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_LAZY_OBJECT_PROXY=${{ env.LAZY_OBJECT_PROXY_VERSION }} - CIBW_TEST_REQUIRES: pytest pytest-benchmark - # Upstream runs `tox --skip-pkg-install --direct-yolo -e py3XX-nocov`; tox-direct - # caps tox below 4, so run that env's own command instead. - CIBW_TEST_COMMAND: >- - cd {project} && - pytest -vv --ignore=src + name: lazy-object-proxy-${{ env.LAZY_OBJECT_PROXY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extension made it into the wheel run: | @@ -92,15 +96,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: lazy-object-proxy-${{ env.LAZY_OBJECT_PROXY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish lazy-object-proxy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-lcm.yml b/.github/workflows/build-lcm.yml index 7b1253b99a4e..e84d33065b4b 100644 --- a/.github/workflows/build-lcm.yml +++ b/.github/workflows/build-lcm.yml @@ -68,7 +68,6 @@ jobs: if command -v dnf > /dev/null; then dnf install -y -q glib2-devel java-21-openjdk-devel fi - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # _lcm has no Py_mod_gil slot, so cp314t's GIL-re-enable warning trips # upstream's filterwarnings=["error"] at collection time (gotcha 127). cibw-test-environment: PYTHON_GIL=1 diff --git a/.github/workflows/build-leidenalg.yml b/.github/workflows/build-leidenalg.yml index 7c1abdd16dbd..2fa6a10fa73f 100644 --- a/.github/workflows/build-leidenalg.yml +++ b/.github/workflows/build-leidenalg.yml @@ -50,6 +50,49 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build leidenalg ${{ matrix.version }} cp38-abi3-${{ matrix.libc }}_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + libc: [manylinux, musllinux] + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "leidenalg" + version: "${{ matrix.version }}" + repository: "vtraag/leidenalg" + ref: "${{ matrix.version }}" + artifact-tag: "cp38-abi3-${{ matrix.libc }}_riscv64" + timeout-minutes: 120 + checkout-fetch-depth: 0 + # setup.py's bdist_wheel_abi3 always tags the wheel cp38-abi3 (gotcha 34), so + # build on upstream's cp39 floor (their CIBW_PROJECT_REQUIRES_PYTHON, gotcha 96) + # and let cibuildwheel reuse+retest the same wheel on cp312-cp314 (gotcha 11). + # No free-threaded wheel exists upstream either (their own CIBW_SKIP: cp3??t-*, + # since Py_LIMITED_API can't target it). + cibw-build: "cp39-${{ matrix.libc }}_riscv64 cp312-${{ matrix.libc }}_riscv64 cp313-${{ matrix.libc }}_riscv64 cp314-${{ matrix.libc }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # The igraph C core and libleidenalg are cloned and compiled here, so their GPL + # notices only exist inside the container -- stage them where setuptools' default + # licence glob picks them up (gotcha 53). + cibw-before-build-linux: |- + if command -v apk > /dev/null; then + apk add flex bison zlib-dev + elif command -v yum > /dev/null; then + yum install -y flex bison zlib-devel + fi + pip install -U cmake wheel + scripts/build_igraph.sh + scripts/build_libleidenalg.sh + cp build-deps/src/igraph/COPYING LICENSE.igraph + cp build-deps/src/libleidenalg/LICENSE LICENSE.libleidenalg + cibw-environment-linux: "CFLAGS='-I/project/build-deps/install/include/ -L/project/build-deps/install/lib64/ -L/project/build-deps/install/lib/' LD_LIBRARY_PATH='/project/build-deps/install/lib64/:/project/build-deps/install/lib/'" + cibw-test-requires: "ddt" + cibw-test-command: "cd {project} && python -m unittest -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: @@ -57,53 +100,14 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} libc: [manylinux, musllinux] - env: LEIDENALG_VERSION: ${{ matrix.version }} - steps: - - name: Checkout leidenalg ${{ env.LEIDENALG_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: vtraag/leidenalg - ref: ${{ env.LEIDENALG_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - # setup.py's bdist_wheel_abi3 always tags the wheel cp38-abi3 (gotcha 34), so - # build on upstream's cp39 floor (their CIBW_PROJECT_REQUIRES_PYTHON, gotcha 96) - # and let cibuildwheel reuse+retest the same wheel on cp312-cp314 (gotcha 11). - # No free-threaded wheel exists upstream either (their own CIBW_SKIP: cp3??t-*, - # since Py_LIMITED_API can't target it). - CIBW_BUILD: >- - cp39-${{ matrix.libc }}_riscv64 cp312-${{ matrix.libc }}_riscv64 - cp313-${{ matrix.libc }}_riscv64 cp314-${{ matrix.libc }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # The igraph C core and libleidenalg are cloned and compiled here, so their GPL - # notices only exist inside the container -- stage them where setuptools' default - # licence glob picks them up (gotcha 53). - CIBW_BEFORE_BUILD_LINUX: | - if command -v apk > /dev/null; then - apk add flex bison zlib-dev - elif command -v yum > /dev/null; then - yum install -y flex bison zlib-devel - fi - pip install -U cmake wheel - scripts/build_igraph.sh - scripts/build_libleidenalg.sh - cp build-deps/src/igraph/COPYING LICENSE.igraph - cp build-deps/src/libleidenalg/LICENSE LICENSE.libleidenalg - CIBW_ENVIRONMENT: >- - CFLAGS='-I/project/build-deps/install/include/ -L/project/build-deps/install/lib64/ -L/project/build-deps/install/lib/' - LD_LIBRARY_PATH='/project/build-deps/install/lib64/:/project/build-deps/install/lib/' - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: ddt - CIBW_TEST_COMMAND: cd {project} && python -m unittest -v + name: leidenalg-${{ env.LEIDENALG_VERSION }}-cp38-abi3-${{ matrix.libc }}_riscv64 + path: wheelhouse - name: Check the wheel is abi3 and carries the compiled extension + licences run: | @@ -120,12 +124,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: leidenalg-${{ env.LEIDENALG_VERSION }}-cp38-abi3-${{ matrix.libc }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -161,7 +159,7 @@ jobs: publish: name: Publish leidenalg ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-lhafile.yml b/.github/workflows/build-lhafile.yml index e7df4acd032d..c8360feb4fc5 100644 --- a/.github/workflows/build-lhafile.yml +++ b/.github/workflows/build-lhafile.yml @@ -50,59 +50,67 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build lhafile ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "lhafile" + version: "${{ matrix.version }}" + repository: "FrodeSolheim/python-lhafile" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + cat > lhafile/tests/check_lhafile.py <<'EOF' + import glob, os, sys + import lhafile, lzhlib + + assert lzhlib.__file__.endswith(".so"), lzhlib.__file__ + seen = {} + for name in sorted(glob.glob(os.path.join(sys.argv[1], "*.lzh"))): + lha = lhafile.Lhafile(name) + for info in lha.infolist(): + if info.compress_type == b"-lhd-": + continue + if "_simple" in info.filename or "_complex" in info.filename: + data = lha.read(info.filename) + assert len(data) == info.file_size, (name, info.filename) + seen.setdefault(info.filename.replace("\\", "/"), set()).add(data) + assert len(seen) == 11, sorted(seen) + assert all(len(v) == 1 for v in seen.values()), [k for k, v in seen.items() if len(v) != 1] + assert seen["archive/01_simple/03_test.txt"] == {b"abbcccddddeeeeebccddd"} + print(len(seen), "members decode identically across lh0/lh5/lh6/lh7 archives") + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-test-sources: "lhafile/tests" + cibw-test-command: "python lhafile/tests/check_lhafile.py lhafile/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: LHAFILE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout lhafile v${{ env.LHAFILE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: FrodeSolheim/python-lhafile - ref: v${{ env.LHAFILE_VERSION }} - persist-credentials: false - - # Upstream runs no tests and its Python 2 era test_lhafile.py no longer runs on Python 3. - - name: Stage the archive decode check - run: | - cat > lhafile/tests/check_lhafile.py <<'EOF' - import glob, os, sys - import lhafile, lzhlib - - assert lzhlib.__file__.endswith(".so"), lzhlib.__file__ - seen = {} - for name in sorted(glob.glob(os.path.join(sys.argv[1], "*.lzh"))): - lha = lhafile.Lhafile(name) - for info in lha.infolist(): - if info.compress_type == b"-lhd-": - continue - if "_simple" in info.filename or "_complex" in info.filename: - data = lha.read(info.filename) - assert len(data) == info.file_size, (name, info.filename) - seen.setdefault(info.filename.replace("\\", "/"), set()).add(data) - assert len(seen) == 11, sorted(seen) - assert all(len(v) == 1 for v in seen.values()), [k for k, v in seen.items() if len(v) != 1] - assert seen["archive/01_simple/03_test.txt"] == {b"abbcccddddeeeeebccddd"} - print(len(seen), "members decode identically across lh0/lh5/lh6/lh7 archives") - EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_SOURCES: lhafile/tests - CIBW_TEST_COMMAND: python lhafile/tests/check_lhafile.py lhafile/tests + name: lhafile-${{ env.LHAFILE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -116,15 +124,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: lhafile-${{ env.LHAFILE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish lhafile ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-libcoal.yml b/.github/workflows/build-libcoal.yml index 2f4646118aa6..d456459e87c2 100644 --- a/.github/workflows/build-libcoal.yml +++ b/.github/workflows/build-libcoal.yml @@ -48,41 +48,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build libcoal ${{ matrix.version }} manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "libcoal" + version: "${{ matrix.version }}" + repository: "cmake-wheel/libcoal" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 720 + checkout-submodules: "true" + # has-sitelib = false: the wheel holds no Python extension, so one + # py3-none wheel covers every interpreter. + cibw-build: "cp312-manylinux_riscv64" + # numpy's newest release has no riscv64 wheel; the registry's must win over its sdist. + cibw-environment-linux: "CMEEL_LOG_LEVEL=\"DEBUG\" CMEEL_JOBS=\"1\" CMEEL_TEST_JOBS=\"1\" CMEEL_RUN_TESTS=\"ON\" PIP_ONLY_BINARY=numpy" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 720 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: LIBCOAL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout libcoal v${{ env.LIBCOAL_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/libcoal - ref: v${{ env.LIBCOAL_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy's newest release has no riscv64 wheel; the registry's must win over its sdist. - CIBW_ENVIRONMENT: >- - CMEEL_LOG_LEVEL="DEBUG" CMEEL_JOBS="1" CMEEL_TEST_JOBS="1" CMEEL_RUN_TESTS="ON" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: libcoal-${{ env.LIBCOAL_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -111,15 +115,9 @@ jobs: prefix=$(python3 -c "import pathlib, sysconfig; print(pathlib.Path(sysconfig.get_paths()['purelib']) / 'cmeel.prefix')") python3 -c "import ctypes; ctypes.CDLL('$prefix/lib/libcoal.so')" - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: libcoal-${{ env.LIBCOAL_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish libcoal ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-libcst.yml b/.github/workflows/build-libcst.yml index 2d958802cb4e..024a7feb4549 100644 --- a/.github/workflows/build-libcst.yml +++ b/.github/workflows/build-libcst.yml @@ -65,10 +65,7 @@ jobs: # Repeats upstream's pyproject environment because CIBW_ENVIRONMENT # replaces it: cargo on PATH, and the local version scheme off so the # wheel carries the declared version rather than a setuptools_scm dev one. - cibw-environment: >- - PATH="$PATH:$HOME/.cargo/bin" - LIBCST_NO_LOCAL_SCHEME=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" LIBCST_NO_LOCAL_SCHEME=1" timeout-minutes: 90 publish: diff --git a/.github/workflows/build-libdatachannel-py.yml b/.github/workflows/build-libdatachannel-py.yml index 10f4a3c29ca3..ff3203c32d59 100644 --- a/.github/workflows/build-libdatachannel-py.yml +++ b/.github/workflows/build-libdatachannel-py.yml @@ -49,19 +49,49 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build libdatachannel-py ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "libdatachannel-py" + version: "${{ matrix.version }}" + repository: "shiguredo/libdatachannel-py" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply -v python-wheels/patches/libdatachannel-py/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-repair-wheel-command-linux: "auditwheel repair --strip --only-plat -w {dest_dir} {wheel}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: LIBDATACHANNEL_PY_VERSION: ${{ matrix.version }} UV_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/ UV_INDEX_STRATEGY: unsafe-best-match UV_ONLY_BINARY: ':all:' - steps: - name: Checkout libdatachannel-py ${{ env.LIBDATACHANNEL_PY_VERSION }} uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -81,14 +111,12 @@ jobs: # Upstream runs `uv build --wheel` + `auditwheel repair --strip --only-plat` on a bare # Ubuntu runner; build in the manylinux image instead and keep the same repair flags. - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair --strip --only-plat -w {dest_dir} {wheel} + name: libdatachannel-py-${{ env.LIBDATACHANNEL_PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension run: | @@ -124,15 +152,9 @@ jobs: if: endsWith(matrix.python-version, 't') run: .venv-test/bin/python -c "import sys, libdatachannel; assert not sys._is_gil_enabled()" - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: libdatachannel-py-${{ env.LIBDATACHANNEL_PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish libdatachannel-py ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-libigl.yml b/.github/workflows/build-libigl.yml index 171b3d23d5fa..1b7a5ce1e3b9 100644 --- a/.github/workflows/build-libigl.yml +++ b/.github/workflows/build-libigl.yml @@ -51,79 +51,83 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build libigl ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "libigl" + version: "${{ matrix.version }}" + repository: "libigl/libigl-python-bindings" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + set -euo pipefail + curl -fsSL --retry 5 "https://raw.githubusercontent.com/wjakob/nanobind/v2.7.0/LICENSE" -o LICENSE.nanobind + { + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.README" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.BSD" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.LGPL" + } > LICENSE.eigen + curl -fsSL --retry 5 "https://raw.githubusercontent.com/CGAL/cgal/v6.0.1/LICENSE.md" -o LICENSE.cgal + curl -fsSL --retry 5 "https://raw.githubusercontent.com/boostorg/boost/boost-1.86.0/LICENSE_1_0.txt" -o LICENSE.boost + curl -fsSL --retry 5 "https://raw.githubusercontent.com/libigl/tetgen/e05aca7df74e3f531bc35733ed87d36d437266c5/LICENSE" -o LICENSE.tetgen + curl -fsSL --retry 5 "https://raw.githubusercontent.com/alecjacobson/spectra/bbdc521b70a733c52ebfc0ac1484c82e13c3d140/LICENSE" -o LICENSE.spectra + curl -fsSL --retry 5 "https://raw.githubusercontent.com/cemyuksel/cyCodeBase/e36f3cffca65eb12a8a071f0443128b7de6ed75d/LICENSE" -o LICENSE.cycodebase + # Triangle carries no LICENSE file; its copyright + redistribution + # notice lives in its README instead. + curl -fsSL --retry 5 "https://raw.githubusercontent.com/libigl/triangle/62f02db9ab4ff4b62d5ff82a77c8ea458c84c23a/README" | sed -n '9,47p' > LICENSE.triangle + # libigl-predicates carries no LICENSE file either; predicates.c's + # own header states it was placed in the public domain. + curl -fsSL --retry 5 "https://raw.githubusercontent.com/libigl/libigl-predicates/decb7bc1260e689cbe008109e3cc5d3a5a433aea/predicates.c" | sed -n '1,16p' > LICENSE.predicates + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/libigl/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Embree's CMake ISA detection only knows x86 (SSE2..AVX512) and ARM + # (NEON/NEON2X); it has no riscv64 support at all, so it's the one + # optional module disabled here (every other one -- CGAL, TetGen, + # Triangle, Spectra, predicates, cyCodeBase -- is portable C/C++). + # Clang matches upstream's own CHANGELOG.md-documented CI choice. + cibw-before-all-linux: "dnf install -y clang" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,cmake,ninja CMAKE_ARGS=-DLIBIGL_EMBREE=OFF CC=clang CXX=clang++" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: LIBIGL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout libigl-python-bindings ${{ env.LIBIGL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: libigl/libigl-python-bindings - ref: ${{ env.LIBIGL_VERSION }} - persist-credentials: false - - # CMakeLists.txt FetchContent-pulls nanobind/Eigen/libigl-core/CGAL/Boost/ - # TetGen/Triangle/Spectra/libigl-predicates/cyCodeBase and compiles them - # into the wheel; upstream's own wheel ships only its own LICENSE.MPL2/ - # LICENSE.GPL. Stage each dependency's own licence at the root for - # scikit-build-core's default wheel.license-files glob (see build-xatlas.yml). - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - curl -fsSL --retry 5 "https://raw.githubusercontent.com/wjakob/nanobind/v2.7.0/LICENSE" -o LICENSE.nanobind - { - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.README" - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2" - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.BSD" - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.LGPL" - } > LICENSE.eigen - curl -fsSL --retry 5 "https://raw.githubusercontent.com/CGAL/cgal/v6.0.1/LICENSE.md" -o LICENSE.cgal - curl -fsSL --retry 5 "https://raw.githubusercontent.com/boostorg/boost/boost-1.86.0/LICENSE_1_0.txt" -o LICENSE.boost - curl -fsSL --retry 5 "https://raw.githubusercontent.com/libigl/tetgen/e05aca7df74e3f531bc35733ed87d36d437266c5/LICENSE" -o LICENSE.tetgen - curl -fsSL --retry 5 "https://raw.githubusercontent.com/alecjacobson/spectra/bbdc521b70a733c52ebfc0ac1484c82e13c3d140/LICENSE" -o LICENSE.spectra - curl -fsSL --retry 5 "https://raw.githubusercontent.com/cemyuksel/cyCodeBase/e36f3cffca65eb12a8a071f0443128b7de6ed75d/LICENSE" -o LICENSE.cycodebase - # Triangle carries no LICENSE file; its copyright + redistribution - # notice lives in its README instead. - curl -fsSL --retry 5 "https://raw.githubusercontent.com/libigl/triangle/62f02db9ab4ff4b62d5ff82a77c8ea458c84c23a/README" | sed -n '9,47p' > LICENSE.triangle - # libigl-predicates carries no LICENSE file either; predicates.c's - # own header states it was placed in the public domain. - curl -fsSL --retry 5 "https://raw.githubusercontent.com/libigl/libigl-predicates/decb7bc1260e689cbe008109e3cc5d3a5a433aea/predicates.c" | sed -n '1,16p' > LICENSE.predicates - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/libigl/${{ env.LIBIGL_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Embree's CMake ISA detection only knows x86 (SSE2..AVX512) and ARM - # (NEON/NEON2X); it has no riscv64 support at all, so it's the one - # optional module disabled here (every other one -- CGAL, TetGen, - # Triangle, Spectra, predicates, cyCodeBase -- is portable C/C++). - # Clang matches upstream's own CHANGELOG.md-documented CI choice. - CIBW_BEFORE_ALL_LINUX: dnf install -y clang - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,cmake,ninja - CMAKE_ARGS=-DLIBIGL_EMBREE=OFF - CC=clang - CXX=clang++ + name: libigl-${{ env.LIBIGL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -143,15 +147,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: libigl-${{ env.LIBIGL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish libigl ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-libpinocchio.yml b/.github/workflows/build-libpinocchio.yml index 401f5956ad53..74b63e0091b9 100644 --- a/.github/workflows/build-libpinocchio.yml +++ b/.github/workflows/build-libpinocchio.yml @@ -47,37 +47,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build libpinocchio ${{ matrix.version }} manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "libpinocchio" + version: "${{ matrix.version }}" + repository: "cmake-wheel/libpinocchio" + ref: "v${{ matrix.version }}.c0" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 240 + checkout-submodules: "true" + # has-sitelib = false: the wheel holds no Python extension, so one + # py3-none wheel covers every interpreter. + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "CMEEL_LOG_LEVEL=DEBUG" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: LIBPINOCCHIO_VERSION: ${{ matrix.version }} - steps: - - name: Checkout libpinocchio v${{ env.LIBPINOCCHIO_VERSION }}.c0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/libpinocchio - ref: v${{ env.LIBPINOCCHIO_VERSION }}.c0 - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # has-sitelib = false: the wheel holds no Python extension, so one - # py3-none wheel covers every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMEEL_LOG_LEVEL=DEBUG PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" + name: libpinocchio-${{ env.LIBPINOCCHIO_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -104,15 +111,9 @@ jobs: prefix=$(python3 -c "import pathlib, sysconfig; print(pathlib.Path(sysconfig.get_paths()['purelib']) / 'cmeel.prefix')") python3 -c "import ctypes; ctypes.CDLL('$prefix/lib/libpinocchio_default.so')" - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: libpinocchio-${{ env.LIBPINOCCHIO_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish libpinocchio ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-libtorrent.yml b/.github/workflows/build-libtorrent.yml index 24acb54836f2..564bf9ece887 100644 --- a/.github/workflows/build-libtorrent.yml +++ b/.github/workflows/build-libtorrent.yml @@ -51,59 +51,61 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build libtorrent ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "libtorrent" + version: "${{ matrix.version }}" + repository: "arvidn/libtorrent" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + checkout-submodules: "recursive" + pre-build: |- + . tools/cibuildwheel/manylinux/openssl-version.sh + cp LICENSE bindings/python/ + cp deps/try_signal/LICENSE bindings/python/LICENSE.try_signal + cp deps/libdatachannel/LICENSE bindings/python/LICENSE.libdatachannel + cp deps/libdatachannel/deps/libjuice/LICENSE bindings/python/LICENSE.libjuice + cp deps/libdatachannel/deps/usrsctp/LICENSE.md bindings/python/LICENSE.usrsctp + cp deps/libdatachannel/deps/plog/LICENSE bindings/python/LICENSE.plog + curl -fsSL -o bindings/python/LICENSE.openssl \ + "https://raw.githubusercontent.com/openssl/openssl/${OPENSSL_ROOT}/LICENSE.txt" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # The image's OpenSSL 3.5 makes setup_openssl.sh skip its static build, and + # Rocky 10 ships no libssl.a, so build upstream's pinned OpenSSL here instead. + cibw-before-build-linux: "${{ matrix.platform == 'manylinux' && 'yum install -y perl-core && . {project}/tools/cibuildwheel/manylinux/openssl-version.sh && curl -fsSL -o /tmp/openssl.tar.gz \"$OPENSSL_DOWNLOAD_URL/$OPENSSL_ROOT.tar.gz\" && echo \"$OPENSSL_HASH /tmp/openssl.tar.gz\" | sha256sum -c && tar -xzf /tmp/openssl.tar.gz -C /tmp && cd /tmp/$OPENSSL_ROOT && ./Configure no-shared --prefix=/usr/local --libdir=lib && make -j\"$(nproc)\" build_sw && make install_sw' || '' }}" + # setup_ccache_on_manylinux.sh skips riscv64, so upstream's `ccache -s` has no ccache. + cibw-before-test-linux: "${{ matrix.platform == 'musllinux' && 'ccache -s' || '' }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: LIBTORRENT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout libtorrent v${{ env.LIBTORRENT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: arvidn/libtorrent - ref: v${{ env.LIBTORRENT_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Stage licences beside bindings/python/setup.py - # setup.py builds from bindings/python, so setuptools' default licence glob - # never sees the root LICENSE; upstream's wheel ships no licence at all. - run: | - . tools/cibuildwheel/manylinux/openssl-version.sh - cp LICENSE bindings/python/ - cp deps/try_signal/LICENSE bindings/python/LICENSE.try_signal - cp deps/libdatachannel/LICENSE bindings/python/LICENSE.libdatachannel - cp deps/libdatachannel/deps/libjuice/LICENSE bindings/python/LICENSE.libjuice - cp deps/libdatachannel/deps/usrsctp/LICENSE.md bindings/python/LICENSE.usrsctp - cp deps/libdatachannel/deps/plog/LICENSE bindings/python/LICENSE.plog - curl -fsSL -o bindings/python/LICENSE.openssl \ - "https://raw.githubusercontent.com/openssl/openssl/${OPENSSL_ROOT}/LICENSE.txt" - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # The image's OpenSSL 3.5 makes setup_openssl.sh skip its static build, and - # Rocky 10 ships no libssl.a, so build upstream's pinned OpenSSL here instead. - CIBW_BEFORE_BUILD_LINUX: >- - ${{ matrix.platform == 'manylinux' && 'yum install -y perl-core && - . {project}/tools/cibuildwheel/manylinux/openssl-version.sh && - curl -fsSL -o /tmp/openssl.tar.gz "$OPENSSL_DOWNLOAD_URL/$OPENSSL_ROOT.tar.gz" && - echo "$OPENSSL_HASH /tmp/openssl.tar.gz" | sha256sum -c && - tar -xzf /tmp/openssl.tar.gz -C /tmp && - cd /tmp/$OPENSSL_ROOT && - ./Configure no-shared --prefix=/usr/local --libdir=lib && - make -j"$(nproc)" build_sw && make install_sw' || '' }} - # setup_ccache_on_manylinux.sh skips riscv64, so upstream's `ccache -s` has no ccache. - CIBW_BEFORE_TEST_LINUX: ${{ matrix.platform == 'musllinux' && 'ccache -s' || '' }} + name: libtorrent-${{ env.LIBTORRENT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel carries the extension and the licences run: | @@ -120,12 +122,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: libtorrent-${{ env.LIBTORRENT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -160,7 +156,7 @@ jobs: publish: name: Publish libtorrent ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-libuuu.yml b/.github/workflows/build-libuuu.yml index f768a9594d4e..6c36db1e9fb1 100644 --- a/.github/workflows/build-libuuu.yml +++ b/.github/workflows/build-libuuu.yml @@ -51,131 +51,124 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build libuuu ${{ matrix.version }} py3-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: - LIBUUU_VERSION: ${{ matrix.version }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "libuuu" + version: "${{ matrix.version }}" + repository: "nxp-imx/mfgtools" + ref: "uuu_${{ matrix.version }}" + artifact-tag: "py3-manylinux_riscv64" + checkout-fetch-depth: 0 + pre-build: |- + if ! version=$(git describe --tags --long 2>/dev/null); then + echo "Error: No git tags found. Cannot determine version." + git tag -l + exit 1 + fi + echo "Found version: $version" - steps: - - name: Checkout mfgtools uuu_${{ env.LIBUUU_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: nxp-imx/mfgtools - ref: uuu_${{ env.LIBUUU_VERSION }} - fetch-depth: 0 - submodules: false - persist-credentials: false + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Validate git versioning - run: | - if ! version=$(git describe --tags --long 2>/dev/null); then - echo "Error: No git tags found. Cannot determine version." - git tag -l - exit 1 - fi - echo "Found version: $version" + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, in the package directory, the licence of every shared library + # auditwheel vendors out of the build image alongside libuuu.so. + # setuptools' default LICENSE* glob copies them into the wheel. + set -euo pipefail - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, in the package directory, the licence of every shared library - # auditwheel vendors out of the build image alongside libuuu.so. - # setuptools' default LICENSE* glob copies them into the wheel. - set -euo pipefail + package="${1:?usage: collect-licenses.sh }" + lib="${2:?usage: collect-licenses.sh }" - package="${1:?usage: collect-licenses.sh }" - lib="${2:?usage: collect-licenses.sh }" + # ldd is transitive, so libuuu.so alone covers its whole closure. + mapfile -t libs < <(ldd "$lib" | tr ' ' '\n' | grep '^/' | sort -u) - # ldd is transitive, so libuuu.so alone covers its whole closure. - mapfile -t libs < <(ldd "$lib" | tr ' ' '\n' | grep '^/' | sort -u) + # `rpm -qf` reports unowned files on stdout, so keep only bare package names. + # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist + # and are never vendored into the wheel. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' + ) - # `rpm -qf` reports unowned files on stdout, so keep only bare package names. - # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist - # and are never vendored into the wheel. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' - ) + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + # Some subpackages leave the licence to a sibling of the same source RPM. + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi - # Some subpackages leave the licence to a sibling of the same source RPM. - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi + # Others mark it %doc rather than %license, and the image installs no docs. + if [ -z "${files[0]:-}" ]; then + dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi - # Others mark it %doc rather than %license, and the image installs no docs. - if [ -z "${files[0]:-}" ]; then - dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$package/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$package/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$package/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$package/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done + ls -1 "$package"/LICENSE.* | sed "s|$package/||" + COLLECT_EOF - ls -1 "$package"/LICENSE.* | sed "s|$package/||" - COLLECT_EOF + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-environment-linux: "PIP_CONSTRAINT=/build-constraints.txt PIP_BUILD_CONSTRAINT=/build-constraints.txt TINYXML2_VERSION=10.0.0" + cibw-package-dir: "wrapper" + cibw-build: "cp39-manylinux_riscv64" + # Upstream's build_linux.sh builds the deps with vcpkg, which has no riscv64 binary + # cache; take them from the image instead, and build tinyxml2 (not in Rocky 10) static. + cibw-before-all-linux: "echo 'setuptools-scm<10.2' > /build-constraints.txt && dnf install -y ninja-build libusb1-devel bzip2-devel libzstd-devel openssl-devel zlib-devel && mkdir -p /tmp/tinyxml2 && curl -sSLf \"https://github.com/leethomason/tinyxml2/archive/refs/tags/${TINYXML2_VERSION}.tar.gz\" | tar -xz -C /tmp/tinyxml2 --strip-components=1 && cmake -S /tmp/tinyxml2 -B /tmp/tinyxml2/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dtinyxml2_BUILD_TESTING=OFF -DCMAKE_INSTALL_LIBDIR=lib && cmake --build /tmp/tinyxml2/build --target install && cd {package} && PKG_CONFIG_PATH=/usr/local/lib/pkgconfig cmake -B build -G Ninja && cmake --build build && mkdir -p libuuu/lib/linux/riscv64 && cp build/libuuu.so libuuu/lib/linux/riscv64/ && cp {project}/LICENSE LICENSE.mfgtools && cp /tmp/tinyxml2/LICENSE.txt LICENSE.tinyxml2 && bash {project}/collect-licenses.sh {package} build/libuuu.so" + # setuptools-scm 10.2.0 creates the egg-info before setuptools preloads the + # egg_info.writers entry points (pypa/pyproject-hooks#206). With the in-tree + # backend's backend-path = ["."], cp39's stdlib importlib.metadata then sees a + # nameless libuuu.egg-info and egg_info crashes. 1.5.243 was released with 9.2.2. + cibw-test-requires: "pytest" + cibw-test-sources: "wrapper/tests" + # test_get_platform_info asserts the architecture is one of upstream's four. + cibw-test-command: "pytest wrapper/tests -k \"not test_get_platform_info\"" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + env: + LIBUUU_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: wrapper - output-dir: wheelhouse/ - only: cp39-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_PASS_LINUX: TINYXML2_VERSION - # Upstream's build_linux.sh builds the deps with vcpkg, which has no riscv64 binary - # cache; take them from the image instead, and build tinyxml2 (not in Rocky 10) static. - CIBW_BEFORE_ALL_LINUX: >- - echo 'setuptools-scm<10.2' > /build-constraints.txt && - dnf install -y ninja-build libusb1-devel bzip2-devel libzstd-devel openssl-devel zlib-devel && - mkdir -p /tmp/tinyxml2 && - curl -sSLf "https://github.com/leethomason/tinyxml2/archive/refs/tags/${TINYXML2_VERSION}.tar.gz" - | tar -xz -C /tmp/tinyxml2 --strip-components=1 && - cmake -S /tmp/tinyxml2 -B /tmp/tinyxml2/build -G Ninja -DCMAKE_BUILD_TYPE=Release - -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -Dtinyxml2_BUILD_TESTING=OFF -DCMAKE_INSTALL_LIBDIR=lib && - cmake --build /tmp/tinyxml2/build --target install && - cd {package} && - PKG_CONFIG_PATH=/usr/local/lib/pkgconfig cmake -B build -G Ninja && - cmake --build build && - mkdir -p libuuu/lib/linux/riscv64 && - cp build/libuuu.so libuuu/lib/linux/riscv64/ && - cp {project}/LICENSE LICENSE.mfgtools && - cp /tmp/tinyxml2/LICENSE.txt LICENSE.tinyxml2 && - bash {project}/collect-licenses.sh {package} build/libuuu.so - # setuptools-scm 10.2.0 creates the egg-info before setuptools preloads the - # egg_info.writers entry points (pypa/pyproject-hooks#206). With the in-tree - # backend's backend-path = ["."], cp39's stdlib importlib.metadata then sees a - # nameless libuuu.egg-info and egg_info crashes. 1.5.243 was released with 9.2.2. - CIBW_ENVIRONMENT: >- - PIP_CONSTRAINT=/build-constraints.txt - PIP_BUILD_CONSTRAINT=/build-constraints.txt - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: wrapper/tests - # test_get_platform_info asserts the architecture is one of upstream's four. - CIBW_TEST_COMMAND: pytest wrapper/tests -k "not test_get_platform_info" + name: libuuu-${{ env.LIBUUU_VERSION }}-py3-manylinux_riscv64 + path: wheelhouse - name: Check the wheel bundles libuuu.so and the licences run: | @@ -212,12 +205,6 @@ jobs: done SCRIPT - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: libuuu-${{ env.LIBUUU_VERSION }}-py3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -253,7 +240,7 @@ jobs: publish: name: Publish libuuu ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-libvalkey.yml b/.github/workflows/build-libvalkey.yml index 4e5d9537bd52..c177d78c779e 100644 --- a/.github/workflows/build-libvalkey.yml +++ b/.github/workflows/build-libvalkey.yml @@ -50,45 +50,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build libvalkey ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "libvalkey" + version: "${{ matrix.version }}" + repository: "valkey-io/libvalkey-py" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/libvalkey/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import importlib.metadata as m; f = sorted(p.name for p in m.files('libvalkey') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'LICENSE.libvalkey'], f\" && python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: LIBVALKEY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout libvalkey v${{ env.LIBVALKEY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: valkey-io/libvalkey-py - ref: v${{ env.LIBVALKEY_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch libvalkey source - run: git apply python-wheels/patches/libvalkey/${{ env.LIBVALKEY_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import importlib.metadata as m; f = sorted(p.name for p in m.files('libvalkey') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'LICENSE.libvalkey'], f" - && python -m pytest tests + name: libvalkey-${{ env.LIBVALKEY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -100,15 +108,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: libvalkey-${{ env.LIBVALKEY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish libvalkey ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-liftover.yml b/.github/workflows/build-liftover.yml index 326ea689156f..aa1529067380 100644 --- a/.github/workflows/build-liftover.yml +++ b/.github/workflows/build-liftover.yml @@ -49,42 +49,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build liftover ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "liftover" + version: "${{ matrix.version }}" + repository: "jeremymcrae/liftover" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "true" + pre-build: |- + mkdir -p chain_cache + curl --fail --location --retry 5 --retry-all-errors --retry-delay 30 \ + -o chain_cache/hg19ToHg38.over.chain.gz \ + https://hgdownload.soe.ucsc.edu/goldenPath/hg19/liftOver/hg19ToHg38.over.chain.gz + gzip -t chain_cache/hg19ToHg38.over.chain.gz + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "LIFTOVER_TEST_CACHE=/project/chain_cache" + cibw-test-command: "python -m unittest discover -s {project}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: LIFTOVER_VERSION: ${{ matrix.version }} - steps: - - name: Checkout liftover v${{ env.LIFTOVER_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: jeremymcrae/liftover - ref: v${{ env.LIFTOVER_VERSION }} - submodules: true - persist-credentials: false - - - name: Fetch chain file for tests - run: | - mkdir -p chain_cache - curl --fail --location --retry 5 --retry-all-errors --retry-delay 30 \ - -o chain_cache/hg19ToHg38.over.chain.gz \ - https://hgdownload.soe.ucsc.edu/goldenPath/hg19/liftOver/hg19ToHg38.over.chain.gz - gzip -t chain_cache/hg19ToHg38.over.chain.gz - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_LINUX: LIFTOVER_TEST_CACHE=/project/chain_cache - CIBW_TEST_COMMAND: python -m unittest discover -s {project} + name: liftover-${{ env.LIFTOVER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension and licence run: | @@ -100,15 +110,9 @@ jobs: assert lic, names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: liftover-${{ env.LIFTOVER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish liftover ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-lightsim2grid.yml b/.github/workflows/build-lightsim2grid.yml index fea3d6f1f010..f2ed38a0f08b 100644 --- a/.github/workflows/build-lightsim2grid.yml +++ b/.github/workflows/build-lightsim2grid.yml @@ -65,7 +65,6 @@ jobs: # already present in the checkout -- the same path upstream's own # manylinux_build job relies on (no system libsuitesparse-dev installed # there either). - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # lightsim2grid.newtonpf (imported below) pulls in pandapower_compat, # which imports packaging/scipy unconditionally even though neither is # declared in the wheel's own [project.dependencies] (only numpy is). diff --git a/.github/workflows/build-ligo-skymap.yml b/.github/workflows/build-ligo-skymap.yml index dfd25c8522a3..0e0bc44244be 100644 --- a/.github/workflows/build-ligo-skymap.yml +++ b/.github/workflows/build-ligo-skymap.yml @@ -59,91 +59,72 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build ligo-skymap ${{ matrix.version }} cp311-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ligo-skymap" + version: "${{ matrix.version }}" + repository: "lpsinger/ligo.skymap" + ref: "v${{ matrix.version }}" + artifact-tag: "cp311-abi3-manylinux_riscv64" + timeout-minutes: 720 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply -v python-wheels/patches/ligo-skymap/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # One abi3 wheel, built on cp311 like upstream's, and re-tested on the + # newer interpreters via find_compatible_wheel. + cibw-build: "cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # astropy-healpix (a runtime dependency) has no cp311 riscv64 wheel on any index. + cibw-test-skip: "cp311-*" + # GSL 2.8's bundled config.guess predates riscv64. Upstream's wheels ship + # no licence text; the project's own live in licenses/, which the default + # licence glob does not reach. + cibw-before-all-linux: "curl -fsSL -o /tmp/gsl.tar.gz https://ftp.gnu.org/gnu/gsl/gsl-2.8.tar.gz && echo \"4427f6ce59dc14eabd6d31ef1fcac1849b4d7357faf48873aef642464ddf21cc9b500d516f08b410f02a2daa9a6ff30220f3995584b0a6ae2f73c522d1abb66b /tmp/gsl.tar.gz\" | sha512sum -c - && mkdir /tmp/gsl && tar xzf /tmp/gsl.tar.gz -C /tmp/gsl --strip-components 1 && cd /tmp/gsl && cp /usr/share/automake-*/config.guess /usr/share/automake-*/config.sub . && ./configure --prefix=/usr --libdir=/usr/lib64 CFLAGS=-O2 && make -j\"$(nproc)\" && make install && cp COPYING {project}/LICENSE.gsl && cp {project}/licenses/LICENSE.rst {project}/LICENSE.rst && cp {project}/licenses/CHEALPIX_LICENSE.rst {project}/LICENSE.chealpix.rst && cp {project}/licenses/NUMPY_LICENSE.rst {project}/LICENSE.numpy.rst && cp {project}/licenses/PTEMCEE_LICENSE.rst {project}/LICENSE.ptemcee.rst && cp {project}/licenses/TEMPLATE_LICENCE.rst {project}/LICENSE.template.rst" + # CFLAGS are upstream's aarch64 ones. The bundled chealpix is used because + # Rocky 10 has none for riscv64 (upstream sets LIGO_SKYMAP_USE_SYSTEM_CHEALPIX). + cibw-environment-linux: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION_FOR_LIGO_SKYMAP=${{ matrix.version }} CFLAGS=\"-Ofast -fno-finite-math-only -flto\"" + # The test extra minus figaro, which needs numba (no riscv64 build); + # dpgmm.py raises on import without it, so its doctests are skipped too. + cibw-test-requires: "astroquery pytest-astropy pytest-benchmark pytest-mpl pytest-rerunfailures" + # No --mpl: 24 baselines' legend/tick text mismatches on x86_64 too with the + # current matplotlib, so figures are drawn but not compared. The crossmatch + # doctest downloads the whole GLADE catalogue from VizieR. test_bayestar + # shells out to lalapps_inspinj (from the already-published lalsuite, not + # this package's own extension) to generate a synthetic injection, and that + # binary SIGSEGVs on this riscv64 image with these exact args; lalsuite's + # own test suite never exercises lalapps_inspinj, so this is a newly-found, + # pre-existing lalsuite/riscv64 issue outside this port's scope, not + # anything ligo.skymap.core itself does -- every other test (1491 passed) + # exercises the real compiled extension cleanly. + cibw-test-command: "pytest --pyargs ligo.skymap --doctest-plus --doctest-ufunc --omp-get-num-threads --durations=10 --ignore-glob='*/ligo/skymap/dpgmm.py' --deselect tool/tests/test_bayestar.py::test_bayestar -k 'not skymap.postprocess.crossmatch.crossmatch'" + cibw-test-environment: "OMP_NUM_THREADS=4 PIP_PREFER_BINARY=1" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 720 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: LIGO_SKYMAP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout ligo.skymap v${{ env.LIGO_SKYMAP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: lpsinger/ligo.skymap - ref: v${{ env.LIGO_SKYMAP_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply -v python-wheels/patches/ligo-skymap/${{ env.LIGO_SKYMAP_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # One abi3 wheel, built on cp311 like upstream's, and re-tested on the - # newer interpreters via find_compatible_wheel. - CIBW_BUILD: >- - cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - # astropy-healpix (a runtime dependency) has no cp311 riscv64 wheel on any index. - CIBW_TEST_SKIP: cp311-* - # GSL 2.8's bundled config.guess predates riscv64. Upstream's wheels ship - # no licence text; the project's own live in licenses/, which the default - # licence glob does not reach. - CIBW_BEFORE_ALL_LINUX: >- - curl -fsSL -o /tmp/gsl.tar.gz ${{ env.GSL_URL }} && - echo "${{ env.GSL_SHA512 }} /tmp/gsl.tar.gz" | sha512sum -c - && - mkdir /tmp/gsl && - tar xzf /tmp/gsl.tar.gz -C /tmp/gsl --strip-components 1 && - cd /tmp/gsl && - cp /usr/share/automake-*/config.guess /usr/share/automake-*/config.sub . && - ./configure --prefix=/usr --libdir=/usr/lib64 CFLAGS=-O2 && - make -j"$(nproc)" && - make install && - cp COPYING {project}/LICENSE.gsl && - cp {project}/licenses/LICENSE.rst {project}/LICENSE.rst && - cp {project}/licenses/CHEALPIX_LICENSE.rst {project}/LICENSE.chealpix.rst && - cp {project}/licenses/NUMPY_LICENSE.rst {project}/LICENSE.numpy.rst && - cp {project}/licenses/PTEMCEE_LICENSE.rst {project}/LICENSE.ptemcee.rst && - cp {project}/licenses/TEMPLATE_LICENCE.rst {project}/LICENSE.template.rst - # CFLAGS are upstream's aarch64 ones. The bundled chealpix is used because - # Rocky 10 has none for riscv64 (upstream sets LIGO_SKYMAP_USE_SYSTEM_CHEALPIX). - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_LIGO_SKYMAP=${{ env.LIGO_SKYMAP_VERSION }} - CFLAGS="-Ofast -fno-finite-math-only -flto" - # The test extra minus figaro, which needs numba (no riscv64 build); - # dpgmm.py raises on import without it, so its doctests are skipped too. - CIBW_TEST_REQUIRES: >- - astroquery pytest-astropy pytest-benchmark pytest-mpl pytest-rerunfailures - # No --mpl: 24 baselines' legend/tick text mismatches on x86_64 too with the - # current matplotlib, so figures are drawn but not compared. The crossmatch - # doctest downloads the whole GLADE catalogue from VizieR. test_bayestar - # shells out to lalapps_inspinj (from the already-published lalsuite, not - # this package's own extension) to generate a synthetic injection, and that - # binary SIGSEGVs on this riscv64 image with these exact args; lalsuite's - # own test suite never exercises lalapps_inspinj, so this is a newly-found, - # pre-existing lalsuite/riscv64 issue outside this port's scope, not - # anything ligo.skymap.core itself does -- every other test (1491 passed) - # exercises the real compiled extension cleanly. - CIBW_TEST_COMMAND: >- - pytest --pyargs ligo.skymap --doctest-plus --doctest-ufunc - --omp-get-num-threads --durations=10 - --ignore-glob='*/ligo/skymap/dpgmm.py' - --deselect tool/tests/test_bayestar.py::test_bayestar - -k 'not skymap.postprocess.crossmatch.crossmatch' - CIBW_TEST_ENVIRONMENT: >- - OMP_NUM_THREADS=4 - PIP_PREFER_BINARY=1 + name: ligo-skymap-${{ env.LIGO_SKYMAP_VERSION }}-cp311-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -164,13 +145,6 @@ jobs: "LICENSE.template.rst"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ligo-skymap-${{ env.LIGO_SKYMAP_VERSION }}-cp311-abi3-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -214,7 +188,7 @@ jobs: publish: name: Publish ligo-skymap ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-lilcom.yml b/.github/workflows/build-lilcom.yml index 25e0f7dfa2ce..6c1b74fd0f41 100644 --- a/.github/workflows/build-lilcom.yml +++ b/.github/workflows/build-lilcom.yml @@ -58,7 +58,6 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-command: >- python3 -c "import lilcom_extension; assert lilcom_extension.__file__.endswith('.so'), lilcom_extension.__file__" && python3 {package}/test/test_header.py && diff --git a/.github/workflows/build-line-profiler.yml b/.github/workflows/build-line-profiler.yml index dac5dafafd8b..186791b47fca 100644 --- a/.github/workflows/build-line-profiler.yml +++ b/.github/workflows/build-line-profiler.yml @@ -62,7 +62,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 # Cython has no public riscv64 wheel; ours is in the registry. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-command: >- python -c "import line_profiler._line_profiler as m; assert m.__file__.endswith('.so'), m.__file__" && diff --git a/.github/workflows/build-linearmodels.yml b/.github/workflows/build-linearmodels.yml index eddbeb06fc02..935cf846e468 100644 --- a/.github/workflows/build-linearmodels.yml +++ b/.github/workflows/build-linearmodels.yml @@ -48,6 +48,31 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build linearmodels ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "linearmodels" + version: "${{ matrix.version }}" + repository: "bashtage/linearmodels" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy/scipy/pandas/statsmodels only resolve for riscv64 from our registry; + # only-binary keeps a newer PyPI sdist from winning resolution. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,pandas,statsmodels" + cibw-test-requires: "pytest>=9,<10 pytest-xdist xarray" + cibw-test-command: "python -c \"import linearmodels; linearmodels.test(['-n','auto','--skip-slow'])\"" + cibw-repair-wheel-command-linux: "auditwheel repair --strip -w {dest_dir} {wheel}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv # 120 was cut off at ~73% of the pytest run on cp312/cp313, hence 360. timeout-minutes: 360 @@ -55,34 +80,14 @@ jobs: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: LINEARMODELS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout linearmodels v${{ env.LINEARMODELS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: bashtage/linearmodels - ref: v${{ env.LINEARMODELS_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy/scipy/pandas/statsmodels only resolve for riscv64 from our registry; - # only-binary keeps a newer PyPI sdist from winning resolution. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas,statsmodels - CIBW_TEST_REQUIRES: pytest>=9,<10 pytest-xdist xarray - CIBW_TEST_COMMAND: python -c "import linearmodels; linearmodels.test(['-n','auto','--skip-slow'])" - CIBW_REPAIR_WHEEL_COMMAND_LINUX: 'auditwheel repair --strip -w {dest_dir} {wheel}' + name: linearmodels-${{ env.LINEARMODELS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -95,16 +100,9 @@ jobs: assert licences == {"LICENSE.md"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: linearmodels-${{ env.LINEARMODELS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish linearmodels ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-livekit-blingfire.yml b/.github/workflows/build-livekit-blingfire.yml index 075f65932a74..54afea36a6ba 100644 --- a/.github/workflows/build-livekit-blingfire.yml +++ b/.github/workflows/build-livekit-blingfire.yml @@ -53,47 +53,50 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build livekit-blingfire ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "livekit-blingfire" + version: "${{ matrix.version }}" + repository: "livekit/agents" + ref: "3bea770e545b7aa02c2c34cf8f8d8022e5fbd1ed" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + cp LICENSE livekit-plugins/livekit-blingfire/LICENSE + curl -fsSL --retry 5 "https://raw.githubusercontent.com/microsoft/BlingFire/master/LICENSE" -o livekit-plugins/livekit-blingfire/LICENSE.blingfire + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "livekit-plugins/livekit-blingfire" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # {project} is the checkout root (monorepo) with package-dir set; + # test_import.py lives under {package} instead (gotcha 5). + cibw-test-command: "python3 {package}/test_import.py && python3 -c \"import lk_blingfire as m; assert m.__file__.endswith('.so'), m.__file__\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 - strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: LIVEKIT_BLINGFIRE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout livekit/agents @ ${{ env.LIVEKIT_BLINGFIRE_REF }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: livekit/agents - ref: ${{ env.LIVEKIT_BLINGFIRE_REF }} - persist-credentials: false - - # CMakeLists.txt FetchContent-pulls microsoft/BlingFire and statically - # links it; upstream's own wheel ships neither its own LICENSE nor - # BlingFire's. Stage both at package-dir root for setuptools' default - # LICEN[CS]E* glob to pick up. - - name: Stage the upstream LICENSE files - run: | - cp LICENSE livekit-plugins/livekit-blingfire/LICENSE - curl -fsSL --retry 5 "https://raw.githubusercontent.com/microsoft/BlingFire/master/LICENSE" -o livekit-plugins/livekit-blingfire/LICENSE.blingfire - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: livekit-plugins/livekit-blingfire - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - output-dir: wheelhouse/ - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # {project} is the checkout root (monorepo) with package-dir set; - # test_import.py lives under {package} instead (gotcha 5). - CIBW_TEST_COMMAND: >- - python3 {package}/test_import.py && - python3 -c "import lk_blingfire as m; assert m.__file__.endswith('.so'), m.__file__" + name: livekit-blingfire-${{ env.LIVEKIT_BLINGFIRE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -108,15 +111,9 @@ jobs: assert licences == {"LICENSE", "LICENSE.blingfire"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: livekit-blingfire-${{ env.LIVEKIT_BLINGFIRE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish livekit-blingfire ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-lmdb.yml b/.github/workflows/build-lmdb.yml index cee58378b68b..428946429dea 100644 --- a/.github/workflows/build-lmdb.yml +++ b/.github/workflows/build-lmdb.yml @@ -59,7 +59,6 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # cffi is a build requirement and has no riscv64 wheel on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # lmdb/__init__.py silently falls back to the pure-Python cffi binding # when the compiled extension is missing. cibw-test-environment: LMDB_FORCE_CPYTHON=1 diff --git a/.github/workflows/build-lmnr-claude-code-proxy.yml b/.github/workflows/build-lmnr-claude-code-proxy.yml index ec5f48b12c00..9033d52004fb 100644 --- a/.github/workflows/build-lmnr-claude-code-proxy.yml +++ b/.github/workflows/build-lmnr-claude-code-proxy.yml @@ -52,168 +52,188 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build lmnr-claude-code-proxy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "lmnr-claude-code-proxy" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 300 + pre-build: |- + export PROXY_VERSION='${{ matrix.version }}' + url="$(curl -sSfL "https://pypi.org/pypi/lmnr-claude-code-proxy/${PROXY_VERSION}/json" \ + | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" + curl -sSfL -o sdist.tar.gz "$url" + # Extracted rather than passed to cibuildwheel as a tarball: for a + # tarball package-dir cibuildwheel chdirs into its own extraction temp + # dir, and CIBW_TEST_SOURCES resolves against that cwd, so the staged + # tests below would be invisible. + tar xzf sdist.tar.gz + test -f "lmnr_claude_code_proxy-${PROXY_VERSION}/pyproject.toml" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + mkdir -p tests + cat > tests/test_proxy.py <<'PYTEST' + """Smoke tests for the riscv64 lmnr-claude-code-proxy wheel. + + Upstream ships no test suite, so these exercise the compiled PyO3 + extension end to end: start the Rust proxy, drive its internal + endpoints and forward a request through it to a local upstream. + """ + + import http.server + import importlib + import socket + import threading + import time + + import httpx + import pytest + + from lmnr_claude_code_proxy import ProxyServer + + + def test_extension_module_is_compiled(): + ext = importlib.import_module("lmnr_claude_code_proxy.lmnr_claude_code_proxy") + assert ext.__file__.endswith(".so"), ext.__file__ + # 0.2.0 dropped the bare `stop` binding; `stop_with_timeout` is + # the only stop entry point left (present in older versions too). + for name in ("run", "stop_with_timeout"): + assert callable(getattr(ext, name)), name + + + def _free_port(): + with socket.socket() as sock: + sock.bind(("127.0.0.1", 0)) + return sock.getsockname()[1] + + + class _UpstreamHandler(http.server.BaseHTTPRequestHandler): + protocol_version = "HTTP/1.1" + + def do_GET(self): # noqa: N802 - http.server API + body = b'{"upstream":"ok"}' + self.send_response(200) + self.send_header("Content-Type", "application/json") + self.send_header("Content-Length", str(len(body))) + self.end_headers() + self.wfile.write(body) + + def log_message(self, *args): + pass + + + @pytest.fixture + def upstream(): + server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), _UpstreamHandler) + threading.Thread(target=server.serve_forever, daemon=True).start() + try: + yield f"http://127.0.0.1:{server.server_address[1]}" + finally: + server.shutdown() + server.server_close() + + + @pytest.fixture + def proxy(upstream): + port = _free_port() + server = ProxyServer(port=port) + server.run_server(upstream) + assert server.is_running + deadline = time.monotonic() + 60 + while time.monotonic() < deadline: + try: + httpx.get(f"http://127.0.0.1:{port}/lmnr-internal/health", timeout=5.0) + break + except httpx.HTTPError: + time.sleep(0.1) + else: + pytest.fail("proxy server never became reachable") + try: + yield server, port + finally: + server.stop_server() + assert not server.is_running + + + def test_health_endpoint(proxy): + _, port = proxy + response = httpx.get(f"http://127.0.0.1:{port}/lmnr-internal/health", timeout=10.0) + assert response.status_code == 200 + assert response.json() == {"status": "ok"} + + + def test_set_current_trace(proxy): + server, _ = proxy + server.set_current_trace( + trace_id="01234567-89ab-cdef-0123-456789abcdef", + span_id="fedcba98-7654-3210-fedc-ba9876543210", + project_api_key="not-a-real-key", + span_path=["riscv64", "smoke"], + ) + + + def test_span_context_rejects_invalid_json(proxy): + _, port = proxy + response = httpx.post( + f"http://127.0.0.1:{port}/lmnr-internal/span-context", + content=b"not json", + timeout=10.0, + ) + assert response.status_code == 400 + + + def test_request_is_forwarded_upstream(proxy): + _, port = proxy + response = httpx.get(f"http://127.0.0.1:{port}/anything", timeout=30.0) + assert response.status_code == 200 + assert response.json() == {"upstream": "ok"} + PYTEST + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "lmnr_claude_code_proxy-${{ matrix.version }}" + # musllinux is dropped: rustup.rs ships no riscv64 musl host toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # No [tool.cibuildwheel] table upstream, so the Rust toolchain the + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 300 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PROXY_VERSION: ${{ matrix.version }} - steps: - - name: Fetch lmnr-claude-code-proxy ${{ env.PROXY_VERSION }} sdist - run: | - url="$(curl -sSfL "https://pypi.org/pypi/lmnr-claude-code-proxy/${PROXY_VERSION}/json" \ - | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" - curl -sSfL -o sdist.tar.gz "$url" - # Extracted rather than passed to cibuildwheel as a tarball: for a - # tarball package-dir cibuildwheel chdirs into its own extraction temp - # dir, and CIBW_TEST_SOURCES resolves against that cwd, so the staged - # tests below would be invisible. - tar xzf sdist.tar.gz - test -f "lmnr_claude_code_proxy-${PROXY_VERSION}/pyproject.toml" - - - name: Stage smoke tests - run: | - mkdir -p tests - cat > tests/test_proxy.py <<'PYTEST' - """Smoke tests for the riscv64 lmnr-claude-code-proxy wheel. - - Upstream ships no test suite, so these exercise the compiled PyO3 - extension end to end: start the Rust proxy, drive its internal - endpoints and forward a request through it to a local upstream. - """ - - import http.server - import importlib - import socket - import threading - import time - - import httpx - import pytest - - from lmnr_claude_code_proxy import ProxyServer - - - def test_extension_module_is_compiled(): - ext = importlib.import_module("lmnr_claude_code_proxy.lmnr_claude_code_proxy") - assert ext.__file__.endswith(".so"), ext.__file__ - # 0.2.0 dropped the bare `stop` binding; `stop_with_timeout` is - # the only stop entry point left (present in older versions too). - for name in ("run", "stop_with_timeout"): - assert callable(getattr(ext, name)), name - - - def _free_port(): - with socket.socket() as sock: - sock.bind(("127.0.0.1", 0)) - return sock.getsockname()[1] - - - class _UpstreamHandler(http.server.BaseHTTPRequestHandler): - protocol_version = "HTTP/1.1" - - def do_GET(self): # noqa: N802 - http.server API - body = b'{"upstream":"ok"}' - self.send_response(200) - self.send_header("Content-Type", "application/json") - self.send_header("Content-Length", str(len(body))) - self.end_headers() - self.wfile.write(body) - - def log_message(self, *args): - pass - - - @pytest.fixture - def upstream(): - server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), _UpstreamHandler) - threading.Thread(target=server.serve_forever, daemon=True).start() - try: - yield f"http://127.0.0.1:{server.server_address[1]}" - finally: - server.shutdown() - server.server_close() - - - @pytest.fixture - def proxy(upstream): - port = _free_port() - server = ProxyServer(port=port) - server.run_server(upstream) - assert server.is_running - deadline = time.monotonic() + 60 - while time.monotonic() < deadline: - try: - httpx.get(f"http://127.0.0.1:{port}/lmnr-internal/health", timeout=5.0) - break - except httpx.HTTPError: - time.sleep(0.1) - else: - pytest.fail("proxy server never became reachable") - try: - yield server, port - finally: - server.stop_server() - assert not server.is_running - - - def test_health_endpoint(proxy): - _, port = proxy - response = httpx.get(f"http://127.0.0.1:{port}/lmnr-internal/health", timeout=10.0) - assert response.status_code == 200 - assert response.json() == {"status": "ok"} - - - def test_set_current_trace(proxy): - server, _ = proxy - server.set_current_trace( - trace_id="01234567-89ab-cdef-0123-456789abcdef", - span_id="fedcba98-7654-3210-fedc-ba9876543210", - project_api_key="not-a-real-key", - span_path=["riscv64", "smoke"], - ) - - - def test_span_context_rejects_invalid_json(proxy): - _, port = proxy - response = httpx.post( - f"http://127.0.0.1:{port}/lmnr-internal/span-context", - content=b"not json", - timeout=10.0, - ) - assert response.status_code == 400 - - - def test_request_is_forwarded_upstream(proxy): - _, port = proxy - response = httpx.get(f"http://127.0.0.1:{port}/anything", timeout=30.0) - assert response.status_code == 200 - assert response.json() == {"upstream": "ok"} - PYTEST - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - package-dir: lmnr_claude_code_proxy-${{ env.PROXY_VERSION }} - # musllinux is dropped: rustup.rs ships no riscv64 musl host toolchain. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # No [tool.cibuildwheel] table upstream, so the Rust toolchain the - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest -v tests + name: lmnr-claude-code-proxy-${{ env.PROXY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extension run: | @@ -225,15 +245,9 @@ jobs: print("extension:", sos[0]) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: lmnr-claude-code-proxy-${{ env.PROXY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish lmnr-claude-code-proxy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-loudness.yml b/.github/workflows/build-loudness.yml index d3655932aab8..b681182e5380 100644 --- a/.github/workflows/build-loudness.yml +++ b/.github/workflows/build-loudness.yml @@ -59,10 +59,7 @@ jobs: checkout-submodules: recursive cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # Ship the licences of the compiled-in gcem/thread-pool headers and the libebur128 code libloudness derives from. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - SKBUILD_WHEEL_LICENSE_FILES="LICENSE;vendor/gcem/LICENSE;vendor/gcem/NOTICE.txt;vendor/thread-pool/LICENSE.txt;doc/license/libebur128.txt" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy SKBUILD_WHEEL_LICENSE_FILES=\"LICENSE;vendor/gcem/LICENSE;vendor/gcem/NOTICE.txt;vendor/thread-pool/LICENSE.txt;doc/license/libebur128.txt\"" cibw-test-requires: numpy pytest soundfile cibw-test-command: pytest {project}/tests timeout-minutes: 60 diff --git a/.github/workflows/build-lru-dict.yml b/.github/workflows/build-lru-dict.yml index c1c3c9613c27..45054c31c868 100644 --- a/.github/workflows/build-lru-dict.yml +++ b/.github/workflows/build-lru-dict.yml @@ -53,30 +53,37 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build lru-dict ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "lru-dict" + version: "${{ matrix.version }}" + repository: "amitdev/lru-dict" + ref: "5dcddb167a66777bc641361bfa1ae02cd94a7cb5" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: LRU_DICT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout lru-dict ${{ env.LRU_DICT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: amitdev/lru-dict - ref: ${{ env.LRU_DICT_REF }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + name: lru-dict-${{ env.LRU_DICT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extension made it into the wheel run: | @@ -88,15 +95,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: lru-dict-${{ env.LRU_DICT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish lru-dict ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-lzallright.yml b/.github/workflows/build-lzallright.yml index fe908e35b7b6..a4f05107100d 100644 --- a/.github/workflows/build-lzallright.yml +++ b/.github/workflows/build-lzallright.yml @@ -49,6 +49,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build lzallright ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # pyo3/abi3-py38 is on unconditionally ([tool.maturin] features in + # pyproject.toml), so one abi3 wheel serves every GIL-ful interpreter; + # pyo3 disables abi3 under Py_GIL_DISABLED, giving the free-threaded + # build its own wheel. cp38 itself isn't in the riscv64 image (floor + # cp39); cp313t is dropped too (image ships no cp313t) -- cp314t + # substitutes for upstream's cp313-cp313t, same shape as build-primp.yml. + - tag: cp38-abi3 + # Built on cp39 -- the oldest interpreter the riscv64 image has -- + # and re-tested on the newer ones via find_compatible_wheel. + build: >- + cp39-manylinux_riscv64 cp310-manylinux_riscv64 + cp311-manylinux_riscv64 cp312-manylinux_riscv64 + cp313-manylinux_riscv64 cp314-manylinux_riscv64 + - tag: cp314t + build: cp314t-manylinux_riscv64 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "lzallright" + version: "${{ matrix.version }}" + repository: "vlaci/lzallright" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: 90 + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.build }}" + # lzallright ships no [tool.cibuildwheel]: install the Rust toolchain + # its maturin backend needs, plus the static C++ runtime lzokay-sys's + # build.rs links (libstdc++-static is CRB-only, per gotcha 77). + cibw-before-all-linux: |- + set -euo pipefail + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + dnf -y --enablerepo=crb install libstdc++-static + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + # tests/test_python.py's `lorem` fixture reads benches/lorem.txt via + # request.session.path; with test-sources set, cwd is already the + # copied test root, so a bare invocation (no path arg, matching + # upstream's own `pytest`) keeps pytest's rootdir there too. + cibw-test-sources: "tests benches/lorem.txt" + cibw-test-command: "python -m pytest -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: @@ -71,41 +121,14 @@ jobs: cp313-manylinux_riscv64 cp314-manylinux_riscv64 - tag: cp314t build: cp314t-manylinux_riscv64 - env: LZALLRIGHT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout lzallright v${{ env.LZALLRIGHT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: vlaci/lzallright - ref: v${{ env.LZALLRIGHT_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # lzallright ships no [tool.cibuildwheel]: install the Rust toolchain - # its maturin backend needs, plus the static C++ runtime lzokay-sys's - # build.rs links (libstdc++-static is CRB-only, per gotcha 77). - CIBW_BEFORE_ALL_LINUX: | - set -euo pipefail - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - dnf -y --enablerepo=crb install libstdc++-static - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_REQUIRES: pytest - # tests/test_python.py's `lorem` fixture reads benches/lorem.txt via - # request.session.path; with test-sources set, cwd is already the - # copied test root, so a bare invocation (no path arg, matching - # upstream's own `pytest`) keeps pytest's rootdir there too. - CIBW_TEST_SOURCES: tests benches/lorem.txt - CIBW_TEST_COMMAND: python -m pytest -v + name: lzallright-${{ env.LZALLRIGHT_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check the extension module made it into the wheel run: | @@ -118,15 +141,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: lzallright-${{ env.LZALLRIGHT_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish lzallright ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-mahotas.yml b/.github/workflows/build-mahotas.yml index 29ee5d8a05c8..7106bfbaa4f8 100644 --- a/.github/workflows/build-mahotas.yml +++ b/.github/workflows/build-mahotas.yml @@ -50,53 +50,60 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build mahotas ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "mahotas" + version: "${{ matrix.version }}" + repository: "luispedro/mahotas" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/mahotas/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a build-time requirement (headers, via pyproject.toml's + # build-system.requires) and an implicit runtime one too (the + # compiled extensions call numpy's C API at import time). Only our + # registry has it for riscv64; only-binary keeps a newer PyPI + # release from winning the resolution and compiling from sdist. + # This variable replaces upstream's own [tool.cibuildwheel] + # environment = {PIP_PREFER_BINARY = "1"}, so restate it: the + # [tests] extras (scipy, matplotlib, pillow, kiwisolver) otherwise + # resolve to PyPI releases newer than our riscv64 wheels and get + # built from sdist (gotcha 354). + cibw-environment-linux: "PIP_ONLY_BINARY=numpy PIP_PREFER_BINARY=1" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MAHOTAS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout mahotas ${{ env.MAHOTAS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: luispedro/mahotas - ref: v${{ env.MAHOTAS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/mahotas/${{ env.MAHOTAS_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build-time requirement (headers, via pyproject.toml's - # build-system.requires) and an implicit runtime one too (the - # compiled extensions call numpy's C API at import time). Only our - # registry has it for riscv64; only-binary keeps a newer PyPI - # release from winning the resolution and compiling from sdist. - # This variable replaces upstream's own [tool.cibuildwheel] - # environment = {PIP_PREFER_BINARY = "1"}, so restate it: the - # [tests] extras (scipy, matplotlib, pillow, kiwisolver) otherwise - # resolve to PyPI releases newer than our riscv64 wheels and get - # built from sdist (gotcha 354). - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - PIP_PREFER_BINARY=1 + name: mahotas-${{ env.MAHOTAS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -112,16 +119,9 @@ jobs: assert any(n.endswith(".dist-info/COPYING") for n in names), names EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: mahotas-${{ env.MAHOTAS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish mahotas ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-manifold3d.yml b/.github/workflows/build-manifold3d.yml index b8b07058aebd..322574fc825f 100644 --- a/.github/workflows/build-manifold3d.yml +++ b/.github/workflows/build-manifold3d.yml @@ -53,43 +53,49 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build manifold3d ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "manifold3d" + version: "${{ matrix.version }}" + repository: "elalish/manifold" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + curl -fsSL --retry 5 "https://raw.githubusercontent.com/oneapi-src/oneTBB/v2022.3.0/LICENSE.txt" -o LICENSE.onetbb + curl -fsSL --retry 5 "https://raw.githubusercontent.com/AngusJohnson/Clipper2/46f639177fe418f9689e8ddb74f08a870c71f5b4/LICENSE" -o LICENSE.clipper2 + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy has no riscv64 wheel on public PyPI; keep pip on our registry's copy. + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MANIFOLD3D_VERSION: ${{ matrix.version }} - steps: - - name: Checkout manifold v${{ env.MANIFOLD3D_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: elalish/manifold - ref: v${{ env.MANIFOLD3D_VERSION }} - persist-credentials: false - - # oneTBB (Apache-2.0) and Clipper2 (BSL-1.0) are fetched from source and - # statically linked in (BUILD_SHARED_LIBS=OFF); upstream's own wheel ships - # neither licence, so stage them at the root for scikit-build-core's - # default LICEN[CS]E* glob to pick up (gotcha 32/44). - - name: Stage the vendored oneTBB and Clipper2 licences - run: | - curl -fsSL --retry 5 "https://raw.githubusercontent.com/oneapi-src/oneTBB/${{ env.ONETBB_TAG }}/LICENSE.txt" -o LICENSE.onetbb - curl -fsSL --retry 5 "https://raw.githubusercontent.com/AngusJohnson/Clipper2/${{ env.CLIPPER2_SHA }}/LICENSE" -o LICENSE.clipper2 - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # numpy has no riscv64 wheel on public PyPI; keep pip on our registry's copy. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy + name: manifold3d-${{ env.MANIFOLD3D_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -104,15 +110,9 @@ jobs: assert licences == {"LICENSE", "AUTHORS", "LICENSE.onetbb", "LICENSE.clipper2"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: manifold3d-${{ env.MANIFOLD3D_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish manifold3d ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-mapbox-earcut.yml b/.github/workflows/build-mapbox-earcut.yml index 49b8cf7ab626..2383b79cf0e6 100644 --- a/.github/workflows/build-mapbox-earcut.yml +++ b/.github/workflows/build-mapbox-earcut.yml @@ -58,7 +58,6 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # numpy has no riscv64 wheel on public PyPI; keep pip on our registry's copy. cibw-test-environment: PIP_ONLY_BINARY=numpy cibw-test-requires: pytest diff --git a/.github/workflows/build-mappy.yml b/.github/workflows/build-mappy.yml index a3b4de952800..9ac65e7a56b2 100644 --- a/.github/workflows/build-mappy.yml +++ b/.github/workflows/build-mappy.yml @@ -51,86 +51,96 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build mappy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "mappy" + version: "${{ matrix.version }}" + repository: "lh3/minimap2" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "lib/simde" + git init -q "lib/simde" + git -C "lib/simde" remote add origin "${GITHUB_SERVER_URL}/simd-everywhere/simde.git" + git -C "lib/simde" fetch -q --no-tags --depth=1 origin "v0.8.2" + git -C "lib/simde" checkout -q --detach FETCH_HEAD + + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/mappy/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cp lib/simde/COPYING COPYING.simde + cat > test/check_mappy.py <<'EOF' + import hashlib, sys + import mappy as mp + + t = sys.argv[1] + cases = [ + (None, "MT-human.fa", "MT-orang.fa"), + ("asm5", "MT-human.fa", "MT-orang.fa"), + ("asm20", "MT-human.fa", "MT-orang.fa"), + ("map-ont", "MT-human.fa", "MT-orang.fa"), + ("splice", "x3s-ref.fa", "x3s-qry.fa"), + (None, "t-inv.fa", "q-inv.fa"), + (None, "t2.fa", "q2.fa"), + ("sr", "MT-human.fa", "MT-orang.fa"), + ] + out = [] + for preset, ref, qry in cases: + aligner = mp.Aligner(f"{t}/{ref}", preset=preset, extra_flags=0x4000000 if preset == "splice" else 0) + assert aligner, (preset, ref) + for name, seq, qual in mp.fastx_read(f"{t}/{qry}"): + for h in aligner.map(seq, cs=True, MD=True): + out.append(f"{preset}\t{name}\t{h}\t{h.mapq}\t{h.NM}\t{h.cs}\t{h.MD}\t{h.trans_strand}") + print("\n".join(out)) + first = next(line for line in out if line.startswith("None\tMT_orang\t")).split("\t") + assert first[2:12] == ["0", "16025", "+", "MT_human", "16569", "576", "16569", "13773", "16095", "60"], first[:12] + digest = hashlib.sha256("\n".join(out).encode()).hexdigest() + # Hits of the stock x86_64 (-msse4.1) build: the SIMDe kernels must match them bit for bit. + assert (len(out), digest) == (26, "1ff204f96b69812c7538a8960a85f63a965d70fbcddbd932a12bc7d047c8a848"), (len(out), digest) + print(len(out), "hits match x86_64") + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-sources: "test" + cibw-test-command: "minimap2.py -c test/MT-human.fa test/MT-orang.fa && python test/check_mappy.py test" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MAPPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout minimap2 v${{ env.MAPPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: lh3/minimap2 - ref: v${{ env.MAPPY_VERSION }} - persist-credentials: false - - # .gitmodules declares SIMDe at lib/simde but the tree no longer commits it. - - name: Checkout SIMDe - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: simd-everywhere/simde - ref: v0.8.2 - path: lib/simde - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/mappy/${{ env.MAPPY_VERSION }}/*.patch - - - name: Stage SIMDe licence and the mapping check - run: | - cp lib/simde/COPYING COPYING.simde - cat > test/check_mappy.py <<'EOF' - import hashlib, sys - import mappy as mp - - t = sys.argv[1] - cases = [ - (None, "MT-human.fa", "MT-orang.fa"), - ("asm5", "MT-human.fa", "MT-orang.fa"), - ("asm20", "MT-human.fa", "MT-orang.fa"), - ("map-ont", "MT-human.fa", "MT-orang.fa"), - ("splice", "x3s-ref.fa", "x3s-qry.fa"), - (None, "t-inv.fa", "q-inv.fa"), - (None, "t2.fa", "q2.fa"), - ("sr", "MT-human.fa", "MT-orang.fa"), - ] - out = [] - for preset, ref, qry in cases: - aligner = mp.Aligner(f"{t}/{ref}", preset=preset, extra_flags=0x4000000 if preset == "splice" else 0) - assert aligner, (preset, ref) - for name, seq, qual in mp.fastx_read(f"{t}/{qry}"): - for h in aligner.map(seq, cs=True, MD=True): - out.append(f"{preset}\t{name}\t{h}\t{h.mapq}\t{h.NM}\t{h.cs}\t{h.MD}\t{h.trans_strand}") - print("\n".join(out)) - first = next(line for line in out if line.startswith("None\tMT_orang\t")).split("\t") - assert first[2:12] == ["0", "16025", "+", "MT_human", "16569", "576", "16569", "13773", "16095", "60"], first[:12] - digest = hashlib.sha256("\n".join(out).encode()).hexdigest() - # Hits of the stock x86_64 (-msse4.1) build: the SIMDe kernels must match them bit for bit. - assert (len(out), digest) == (26, "1ff204f96b69812c7538a8960a85f63a965d70fbcddbd932a12bc7d047c8a848"), (len(out), digest) - print(len(out), "hits match x86_64") - EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_SOURCES: test - CIBW_TEST_COMMAND: minimap2.py -c test/MT-human.fa test/MT-orang.fa && python test/check_mappy.py test + name: mappy-${{ env.MAPPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -145,15 +155,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: mappy-${{ env.MAPPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish mappy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-marisa-trie.yml b/.github/workflows/build-marisa-trie.yml index 40ce93e2422e..3a71a21427b2 100644 --- a/.github/workflows/build-marisa-trie.yml +++ b/.github/workflows/build-marisa-trie.yml @@ -51,7 +51,6 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build marisa-trie ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: @@ -67,33 +66,49 @@ jobs: - python: "cp314t" parallel_test: " && python -m pytest tests --parallel-threads 4" + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "marisa-trie" + version: "${{ matrix.version }}" + repository: "pytries/marisa-trie" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + checkout-submodules: "true" + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + # hypothesis has no riscv64 wheel on public PyPI + # nh3 (readme_renderer) has no free-threaded riscv64 wheel; keep pip off + # its Rust sdist so it falls back to the bleach-based readme_renderer + cibw-test-environment: "PIP_ONLY_BINARY=nh3" + cibw-test-extras: "test" + cibw-test-sources: "tests pyproject.toml" + cibw-test-command: "python -m pytest tests${{ matrix.parallel_test }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: + - "cp312" + - "cp313" + - "cp314" + - "cp314t" + include: + # Upstream runs the suite a second time under pytest-run-parallel on + # free-threaded interpreters. + - python: "cp314t" + parallel_test: " && python -m pytest tests --parallel-threads 4" env: MARISA_TRIE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout marisa-trie ${{ env.MARISA_TRIE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pytries/marisa-trie - ref: ${{ env.MARISA_TRIE_VERSION }} - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # hypothesis has no riscv64 wheel on public PyPI - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # nh3 (readme_renderer) has no free-threaded riscv64 wheel; keep pip off - # its Rust sdist so it falls back to the bleach-based readme_renderer - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=nh3 - CIBW_TEST_EXTRAS: test - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_COMMAND: python -m pytest tests${{ matrix.parallel_test }} + name: marisa-trie-${{ env.MARISA_TRIE_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Check the C extension made it into the wheel run: | @@ -105,15 +120,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: marisa-trie-${{ env.MARISA_TRIE_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish marisa-trie ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-materialyoucolor.yml b/.github/workflows/build-materialyoucolor.yml index a147e87633d1..8690a119bd9b 100644 --- a/.github/workflows/build-materialyoucolor.yml +++ b/.github/workflows/build-materialyoucolor.yml @@ -49,52 +49,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build materialyoucolor ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "materialyoucolor" + version: "${{ matrix.version }}" + repository: "T-Dynamos/materialyoucolor-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "recursive" + pre-build: |- + set -euo pipefail + curl -fsSL --retry 5 "https://raw.githubusercontent.com/material-foundation/material-color-utilities/5b3618b16fdc3825e21d5679bafd144662088ea1/LICENSE" -o LICENSE.material-color-utilities + sed -n '/^This software is available under 2 licenses/,$p' materialyoucolor/quantize/stb_image.h > LICENSE.stb + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Unpinned pillow otherwise resolves PyPI's newest sdist, which is ahead of our + # registry's riscv64 wheels and cannot build (no libjpeg headers in the image). + cibw-test-environment: "PIP_ONLY_BINARY=pillow" + cibw-before-test: "pip install -r {project}/requirements.txt -r {project}/requirements-dev.txt" + cibw-test-command: "python -c \"from PIL import Image; Image.new('RGB', (128, 128), (70, 120, 180)).save('test_image.jpg')\" && python {project}/tests/test_all.py --image test_image.jpg --quality 1 --method pillow --tonal-spot && python {project}/tests/test_all.py --image test_image.jpg --quality 1 --method cpp --tonal-spot" + cibw-before-build: "pip install setuptools wheel pybind11" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: MATERIALYOUCOLOR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout materialyoucolor-python v${{ env.MATERIALYOUCOLOR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: T-Dynamos/materialyoucolor-python - ref: v${{ env.MATERIALYOUCOLOR_VERSION }} - submodules: recursive - persist-credentials: false - - # The quantizer is Google's material-color-utilities C++ (Apache-2.0) plus - # stb_image.h (MIT or public domain); upstream's wheel ships only its own - # LICENSE. Stage both at the root for setuptools' default license_files glob. - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - curl -fsSL --retry 5 "https://raw.githubusercontent.com/material-foundation/material-color-utilities/5b3618b16fdc3825e21d5679bafd144662088ea1/LICENSE" -o LICENSE.material-color-utilities - sed -n '/^This software is available under 2 licenses/,$p' materialyoucolor/quantize/stb_image.h > LICENSE.stb - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Unpinned pillow otherwise resolves PyPI's newest sdist, which is ahead of our - # registry's riscv64 wheels and cannot build (no libjpeg headers in the image). - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=pillow - CIBW_BEFORE_TEST: > - pip install -r {project}/requirements.txt -r {project}/requirements-dev.txt - CIBW_TEST_COMMAND: > - python -c "from PIL import Image; Image.new('RGB', (128, 128), (70, 120, 180)).save('test_image.jpg')" && - python {project}/tests/test_all.py --image test_image.jpg --quality 1 --method pillow --tonal-spot && - python {project}/tests/test_all.py --image test_image.jpg --quality 1 --method cpp --tonal-spot - CIBW_BEFORE_BUILD: > - pip install setuptools wheel pybind11 + name: materialyoucolor-${{ env.MATERIALYOUCOLOR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -109,15 +109,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: materialyoucolor-${{ env.MATERIALYOUCOLOR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish materialyoucolor ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-matrix-synapse.yml b/.github/workflows/build-matrix-synapse.yml index 59c8b3fae798..191958fc10bd 100644 --- a/.github/workflows/build-matrix-synapse.yml +++ b/.github/workflows/build-matrix-synapse.yml @@ -55,47 +55,44 @@ jobs: version: ${{ fromJSON(needs.setup.outputs.versions) }} platform: [manylinux, musllinux] name: Build matrix-synapse ${{ matrix.version }} cp310-abi3-${{ matrix.platform }}_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "matrix-synapse" + version: "${{ matrix.version }}" + repository: "element-hq/synapse" + ref: "v${{ matrix.version }}" + artifact-tag: "cp310-abi3-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + # pyo3's abi3-py310 feature: built once on cp310, re-tested on the + # newer interpreters. pp311 is dropped: PyPy has no riscv64 port. + cibw-build: "cp310-${{ matrix.platform }}_riscv64 cp312-${{ matrix.platform }}_riscv64 cp313-${{ matrix.platform }}_riscv64 cp314-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # cryptography, bcrypt, ijson and zope.interface have riscv64 wheels + # from cp312 only. + cibw-test-skip: "cp310-* *musl*" + cibw-test-extras: "test" + cibw-test-sources: "tests" + cibw-test-command: "python -c 'from synapse.synapse_rust import sum_as_string; print(sum_as_string(1, 2))' && python -m twisted.trial -j2 tests.test_rust tests.synapse_rust tests.push tests.events tests.api tests.storage.test_event_federation tests.storage.test_redaction tests.handlers.test_deactivate_account tests.rest.client.test_rendezvous tests.rest.client.test_msc4388_rendezvous" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + platform: [manylinux, musllinux] env: MATRIX_SYNAPSE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout synapse v${{ env.MATRIX_SYNAPSE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: element-hq/synapse - ref: v${{ env.MATRIX_SYNAPSE_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - # pyo3's abi3-py310 feature: built once on cp310, re-tested on the - # newer interpreters. pp311 is dropped: PyPy has no riscv64 port. - CIBW_BUILD: >- - cp310-${{ matrix.platform }}_riscv64 cp312-${{ matrix.platform }}_riscv64 - cp313-${{ matrix.platform }}_riscv64 cp314-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # cryptography, bcrypt, ijson and zope.interface have riscv64 wheels - # from cp312 only. - CIBW_TEST_SKIP: cp310-* *musl* - CIBW_TEST_EXTRAS: test - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c 'from synapse.synapse_rust import sum_as_string; print(sum_as_string(1, 2))' && - python -m twisted.trial -j2 - tests.test_rust tests.synapse_rust tests.push tests.events tests.api - tests.storage.test_event_federation tests.storage.test_redaction - tests.handlers.test_deactivate_account - tests.rest.client.test_rendezvous tests.rest.client.test_msc4388_rendezvous + name: matrix-synapse-${{ env.MATRIX_SYNAPSE_VERSION }}-cp310-abi3-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -108,15 +105,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: matrix-synapse-${{ env.MATRIX_SYNAPSE_VERSION }}-cp310-abi3-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish matrix-synapse ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-mdanalysis.yml b/.github/workflows/build-mdanalysis.yml index a4368704d576..a70609c74939 100644 --- a/.github/workflows/build-mdanalysis.yml +++ b/.github/workflows/build-mdanalysis.yml @@ -51,55 +51,64 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build mdanalysis ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "mdanalysis" + version: "${{ matrix.version }}" + repository: "MDAnalysis/mdanalysis" + ref: "release-${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 300 + checkout-fetch-depth: 0 + pre-build: |- + export MDANALYSIS_VERSION='${{ matrix.version }}' + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + patches="$PWD/python-wheels/patches/mdanalysis/${MDANALYSIS_VERSION}" + if [ -d "$patches" ]; then + git apply -v "$patches"/*.patch + fi + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "package" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,matplotlib,contourpy,kiwisolver,pillow,fonttools,msgpack,hypothesis" + # Upstream's wheel job runs no tests; run the suite of its sdist install check + # against the wheel, with MDAnalysisTests installed from the same checkout. + cibw-before-test: "pip install --no-deps {project}/testsuite" + cibw-test-requires: "pytest hypothesis pytest-xdist pytest-timeout" + cibw-test-command: "python -m pytest --timeout=200 -n logical --pyargs MDAnalysisTests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 300 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MDANALYSIS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout mdanalysis ${{ env.MDANALYSIS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: MDAnalysis/mdanalysis - ref: release-${{ env.MDANALYSIS_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # Only some versions need patching, so a missing directory is not an error. - - name: Apply patches - run: | - patches="$PWD/python-wheels/patches/mdanalysis/${MDANALYSIS_VERSION}" - if [ -d "$patches" ]; then - git apply -v "$patches"/*.patch - fi - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: package - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,matplotlib,contourpy,kiwisolver,pillow,fonttools,msgpack,hypothesis - # Upstream's wheel job runs no tests; run the suite of its sdist install check - # against the wheel, with MDAnalysisTests installed from the same checkout. - CIBW_BEFORE_TEST: pip install --no-deps {project}/testsuite - CIBW_TEST_REQUIRES: pytest hypothesis pytest-xdist pytest-timeout - CIBW_TEST_COMMAND: python -m pytest --timeout=200 -n logical --pyargs MDAnalysisTests + name: mdanalysis-${{ env.MDANALYSIS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the licences and the compiled extensions run: | @@ -120,13 +129,6 @@ jobs: assert any(n.startswith("mdanalysis.libs/libgomp") for n in names), [n for n in names if ".libs/" in n] EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: mdanalysis-${{ env.MDANALYSIS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -160,7 +162,7 @@ jobs: publish: name: Publish mdanalysis ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-mdtraj.yml b/.github/workflows/build-mdtraj.yml index f4fbcf46351a..a23fa32048bb 100644 --- a/.github/workflows/build-mdtraj.yml +++ b/.github/workflows/build-mdtraj.yml @@ -51,69 +51,73 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build mdtraj ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "mdtraj" + version: "${{ matrix.version }}" + repository: "mdtraj/mdtraj" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-fetch-depth: 0 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/mdtraj/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,pandas,pyarrow,tables,blosc2,numexpr,ndindex,msgpack,pydantic-core,netcdf4,cftime" + # Upstream's wheel job only smoke-tests; also run its CI suite against the wheel, + # with its conda test env minus openmm (no riscv64 build; those tests skip). + cibw-test-extras: "all" + # pyparsing 3.3.3 rewrote infix_notation as a shunting-yard parser that takes the + # first operator in op_list order without backtracking. mdtraj sorts its operators + # alphabetically, so '>' wins over '>=' and test_binary_selection_operator fails on + # 'name >= 1' on every arch (x86_64 too, with upstream's PyPI wheel); 3.3.2 passes + # (gotchas 355, 583). Upstream leaves pyparsing unpinned. + cibw-test-requires: "gsd>=2.8 pyparsing<3.3.3" + cibw-test-sources: "tests pyproject.toml" + # Deselected for riscv64 rounding at a histogram bin edge (gotcha 304), not a wrong + # result: test_compare_rdf_t_master compares to a reference file that matches the + # x86 SSE distance kernel bit for bit. riscv64 builds the scalar vectorize_generic.h + # kernel, and GCC contracts its float32 multiply-adds to fmadd.s, so a few pair + # distances land across a 0.005 nm bin edge: 18/20000 elements off, as 9 adjacent-bin + # pairs (e.g. [20,32]/[20,33]). On x86_64, + # building with -D__NO_INTRINSICS -mfma -ffp-contract=fast gives the same 18 + # elements with the same values; without -mfma it passes; and mdtraj's own numpy + # path (opt=False) misses this reference file at 10 elements. + cibw-test-command: "python -c \"import mdtraj; print(mdtraj.__version__)\" && mdconvert -h && mdinspect -h && pytest -n logical --durations=10 tests/ -r fE --color=yes --deselect tests/test_rdf.py::test_compare_rdf_t_master" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MDTRAJ_VERSION: ${{ matrix.version }} - steps: - - name: Checkout mdtraj ${{ env.MDTRAJ_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: mdtraj/mdtraj - ref: ${{ env.MDTRAJ_VERSION }} - fetch-depth: 0 # versioneer derives the version from `git describe` - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/mdtraj/${{ env.MDTRAJ_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas,pyarrow,tables,blosc2,numexpr,ndindex,msgpack,pydantic-core,netcdf4,cftime - # Upstream's wheel job only smoke-tests; also run its CI suite against the wheel, - # with its conda test env minus openmm (no riscv64 build; those tests skip). - CIBW_TEST_EXTRAS: all - # pyparsing 3.3.3 rewrote infix_notation as a shunting-yard parser that takes the - # first operator in op_list order without backtracking. mdtraj sorts its operators - # alphabetically, so '>' wins over '>=' and test_binary_selection_operator fails on - # 'name >= 1' on every arch (x86_64 too, with upstream's PyPI wheel); 3.3.2 passes - # (gotchas 355, 583). Upstream leaves pyparsing unpinned. - CIBW_TEST_REQUIRES: 'gsd>=2.8 pyparsing<3.3.3' - CIBW_TEST_SOURCES: tests pyproject.toml - # Deselected for riscv64 rounding at a histogram bin edge (gotcha 304), not a wrong - # result: test_compare_rdf_t_master compares to a reference file that matches the - # x86 SSE distance kernel bit for bit. riscv64 builds the scalar vectorize_generic.h - # kernel, and GCC contracts its float32 multiply-adds to fmadd.s, so a few pair - # distances land across a 0.005 nm bin edge: 18/20000 elements off, as 9 adjacent-bin - # pairs (e.g. [20,32]/[20,33]). On x86_64, - # building with -D__NO_INTRINSICS -mfma -ffp-contract=fast gives the same 18 - # elements with the same values; without -mfma it passes; and mdtraj's own numpy - # path (opt=False) misses this reference file at 10 elements. - CIBW_TEST_COMMAND: >- - python -c "import mdtraj; print(mdtraj.__version__)" && - mdconvert -h && - mdinspect -h && - pytest -n logical --durations=10 tests/ -r fE --color=yes - --deselect tests/test_rdf.py::test_compare_rdf_t_master + name: mdtraj-${{ env.MDTRAJ_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the licences and the compiled extensions run: | @@ -131,13 +135,6 @@ jobs: assert any(n.startswith("mdtraj.libs/libgomp") for n in names), [n for n in names if ".libs/" in n] EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: mdtraj-${{ env.MDTRAJ_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -171,7 +168,7 @@ jobs: publish: name: Publish mdtraj ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-memory-allocator.yml b/.github/workflows/build-memory-allocator.yml index e23e483dae28..7d125e02f271 100644 --- a/.github/workflows/build-memory-allocator.yml +++ b/.github/workflows/build-memory-allocator.yml @@ -58,43 +58,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build memory-allocator ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "memory-allocator" + version: "${{ matrix.version }}" + repository: "sagemath/memory_allocator" + ref: "${{ matrix.version == '0.2.0' && '879b51b922d0ef31ef7bbc6c9d287f600a20bfbd' || format('v{0}', matrix.version) }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 30 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/memory-allocator/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 30 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MEMORY_ALLOCATOR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout memory_allocator ${{ matrix.version }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: sagemath/memory_allocator - ref: ${{ matrix.version == '0.2.0' && env.MEMORY_ALLOCATOR_REF || format('v{0}', matrix.version) }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # pyproject.toml declares `license` but no `license-files`, and - # meson-python's build backend has no default LICENSE glob, so every - # wheel upstream publishes ships with none. See - # patches/memory-allocator/0.2.0 for details. - - name: Patch memory_allocator source - run: git apply python-wheels/patches/memory-allocator/${{ env.MEMORY_ALLOCATOR_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} + name: memory-allocator-${{ env.MEMORY_ALLOCATOR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extensions and LICENSE made it into the wheel run: | @@ -108,15 +117,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: memory-allocator-${{ env.MEMORY_ALLOCATOR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish memory-allocator ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-memray.yml b/.github/workflows/build-memray.yml index 35b8d05c13be..ccb81620bdc5 100644 --- a/.github/workflows/build-memray.yml +++ b/.github/workflows/build-memray.yml @@ -49,129 +49,132 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build memray ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "memray" + version: "${{ matrix.version }}" + repository: "bloomberg/memray" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/memray/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of everything that ends up inside the + # wheel: the libunwind built by before-all, memray's vendored libbacktrace, and + # every shared library auditwheel vendors out of the build image. + # scikit-build-core's default LICEN[CS]E* glob copies them into the wheel. + set -euo pipefail + + project="${1:?usage: collect-licenses.sh }" + unwind_src="${2:?usage: collect-licenses.sh }" + + cp "$unwind_src/COPYING" "$project/LICENSE.libunwind" + cp "$project/src/vendor/libbacktrace/LICENSE" "$project/LICENSE.libbacktrace" + + roots=(/usr/lib64/libunwind.so /usr/lib64/liblz4.so /usr/lib64/libdebuginfod.so) + + # ldd is transitive, so memray's direct link dependencies cover the whole + # closure; ldd does not list the roots themselves, so resolve those too. + mapfile -t libs < <( + { + ldd "${roots[@]}" | tr ' ' '\n' | grep '^/' + readlink -f "${roots[@]}" + } | sort -u + ) + + # `rpm -qf` reports unowned files on stdout, so keep only bare package names. + # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist and + # are never vendored into the wheel. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' + ) + + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + + # Some subpackages leave the licence to a sibling of the same source RPM. + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi + + # Others mark it %doc rather than %license, and the image installs no docs. + if [ -z "${files[0]:-}" ]; then + dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi + + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done + + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Replaces upstream's before-all: Rocky 10 already ships curl 8, zstd 1.5 + # and elfutils 0.194, which upstream has to build from source on + # AlmaLinux 8. libunwind is the one dependency RHEL 10 dropped, and + # manylinux enables no EPEL on riscv64, so build it from source. + # Rocky's extras repo is unused here and its mirrorlist flakes. + cibw-before-all-linux: "dnf -y --disablerepo=extras install lz4-devel elfutils-debuginfod-client-devel && cd /tmp && curl -fsSLO https://github.com/libunwind/libunwind/releases/download/v1.8.3/libunwind-1.8.3.tar.gz && tar xf libunwind-1.8.3.tar.gz && cd libunwind-1.8.3 && ./configure --prefix=/usr --libdir=/usr/lib64 --disable-documentation --disable-tests --disable-minidebuginfo --disable-zlibdebuginfo && make -j\"$(nproc)\" install && bash {project}/collect-licenses.sh {project} /tmp/libunwind-1.8.3" + cibw-test-extras: "test" + cibw-test-command: "python -um pytest --log-cli-level=DEBUG -s --showlocals -vvv {package}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MEMRAY_VERSION: ${{ matrix.version }} - steps: - # Upstream builds an sdist and unpacks it over a separately-uploaded copy of - # `tests/` (the sdist excludes it). A plain checkout is the same tree. - - name: Checkout memray v${{ env.MEMRAY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: bloomberg/memray - ref: v${{ env.MEMRAY_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch memray source - run: git apply python-wheels/patches/memray/${{ env.MEMRAY_VERSION }}/00*.patch - - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of everything that ends up inside the - # wheel: the libunwind built by before-all, memray's vendored libbacktrace, and - # every shared library auditwheel vendors out of the build image. - # scikit-build-core's default LICEN[CS]E* glob copies them into the wheel. - set -euo pipefail - - project="${1:?usage: collect-licenses.sh }" - unwind_src="${2:?usage: collect-licenses.sh }" - - cp "$unwind_src/COPYING" "$project/LICENSE.libunwind" - cp "$project/src/vendor/libbacktrace/LICENSE" "$project/LICENSE.libbacktrace" - - roots=(/usr/lib64/libunwind.so /usr/lib64/liblz4.so /usr/lib64/libdebuginfod.so) - - # ldd is transitive, so memray's direct link dependencies cover the whole - # closure; ldd does not list the roots themselves, so resolve those too. - mapfile -t libs < <( - { - ldd "${roots[@]}" | tr ' ' '\n' | grep '^/' - readlink -f "${roots[@]}" - } | sort -u - ) - - # `rpm -qf` reports unowned files on stdout, so keep only bare package names. - # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist and - # are never vendored into the wheel. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' - ) - - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - - # Some subpackages leave the licence to a sibling of the same source RPM. - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi - - # Others mark it %doc rather than %license, and the image installs no docs. - if [ -z "${files[0]:-}" ]; then - dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi - - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done - - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces upstream's before-all: Rocky 10 already ships curl 8, zstd 1.5 - # and elfutils 0.194, which upstream has to build from source on - # AlmaLinux 8. libunwind is the one dependency RHEL 10 dropped, and - # manylinux enables no EPEL on riscv64, so build it from source. - # Rocky's extras repo is unused here and its mirrorlist flakes. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y --disablerepo=extras install lz4-devel elfutils-debuginfod-client-devel && - cd /tmp && - curl -fsSLO https://github.com/libunwind/libunwind/releases/download/v${{ env.LIBUNWIND_VERSION }}/libunwind-${{ env.LIBUNWIND_VERSION }}.tar.gz && - tar xf libunwind-${{ env.LIBUNWIND_VERSION }}.tar.gz && - cd libunwind-${{ env.LIBUNWIND_VERSION }} && - ./configure --prefix=/usr --libdir=/usr/lib64 --disable-documentation - --disable-tests --disable-minidebuginfo --disable-zlibdebuginfo && - make -j"$(nproc)" install && - bash {project}/collect-licenses.sh - {project} /tmp/libunwind-${{ env.LIBUNWIND_VERSION }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_EXTRAS: test - CIBW_TEST_COMMAND: python -um pytest --log-cli-level=DEBUG -s --showlocals -vvv {package}/tests + name: memray-${{ env.MEMRAY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extensions run: | @@ -187,12 +190,6 @@ jobs: assert {"LICENSE", "LICENSE.libunwind", "LICENSE.libbacktrace"} <= set(lic), lic EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: memray-${{ env.MEMRAY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -230,7 +227,7 @@ jobs: publish: name: Publish memray ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-miniaudio.yml b/.github/workflows/build-miniaudio.yml index 81ce46212569..612f4b6fcd29 100644 --- a/.github/workflows/build-miniaudio.yml +++ b/.github/workflows/build-miniaudio.yml @@ -60,7 +60,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # cffi has no riscv64 wheel on PyPI; needed both to build (build-system.requires) # and to import the extension (runtime dependency). - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-requires: pytest cibw-test-sources: tests cibw-test-command: pytest -v tests diff --git a/.github/workflows/build-mink.yml b/.github/workflows/build-mink.yml index 377b4abdd2ba..dbe13d0f5eb2 100644 --- a/.github/workflows/build-mink.yml +++ b/.github/workflows/build-mink.yml @@ -61,9 +61,7 @@ jobs: # build[uv] needs a host uv for the audit step, which the riscv runner lacks (gotcha 13). cibw-build-frontend: build # numpy (build + runtime) and the compiled runtime deps only have riscv64 wheels on our registry. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,mujoco,glfw + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,mujoco,glfw" # daqp pinned to upstream's uv.lock version, built from sdist: daqp 0.9.x (our registry's # only riscv64 build) rejects mink's no-task QP (H = 1e-12*I) as nonconvex on every arch (gotcha 583). cibw-test-requires: pytest robot_descriptions absl-py daqp==0.8.5 diff --git a/.github/workflows/build-mitsuba.yml b/.github/workflows/build-mitsuba.yml index 62a347af0794..276c057977da 100644 --- a/.github/workflows/build-mitsuba.yml +++ b/.github/workflows/build-mitsuba.yml @@ -51,53 +51,61 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build mitsuba ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "mitsuba" + version: "${{ matrix.version }}" + repository: "mitsuba-renderer/mitsuba3" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply -v python-wheels/patches/mitsuba/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # nasm only feeds libjpeg-turbo's x86 SIMD, and is in Rocky 10's CRB. + cibw-before-all: "yum install -y libatomic" + # drjit's LLVM backend needs x86 FMA or NEON and shuts down on riscv64, + # and there is no CUDA, so only the scalar variants can run; Embree is + # x86/NEON-only; MI_NATIVE_FLAGS otherwise defaults to -march=haswell. + # Scalar-only variants leave MI_ENABLE_JIT/AUTODIFF off, which drops drjit-core/-extra + # from libmitsuba's --no-undefined link although integrator.cpp still calls into them. + cibw-config-settings: "cmake.args=-DMI_DEFAULT_VARIANTS=scalar_rgb,scalar_spectral,scalar_spectral_polarized;-DMI_ENABLE_EMBREE=OFF;-DMI_NATIVE_FLAGS=;-DMI_ENABLE_JIT=ON;-DMI_ENABLE_AUTODIFF=ON" + cibw-repair-wheel-command: "pip install 'wheel>=0.40'; new_whl_name=$(python -m wheel tags --platform-tag manylinux_2_39_riscv64 {wheel} | tail -1 | cat); cp $(dirname {wheel})/$new_whl_name {dest_dir}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MITSUBA_VERSION: ${{ matrix.version }} - steps: - - name: Checkout mitsuba v${{ env.MITSUBA_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: mitsuba-renderer/mitsuba3 - ref: v${{ env.MITSUBA_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Patch mitsuba source - run: git apply -v python-wheels/patches/mitsuba/${{ env.MITSUBA_VERSION }}/00*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # nasm only feeds libjpeg-turbo's x86 SIMD, and is in Rocky 10's CRB. - CIBW_BEFORE_ALL: yum install -y libatomic - # drjit's LLVM backend needs x86 FMA or NEON and shuts down on riscv64, - # and there is no CUDA, so only the scalar variants can run; Embree is - # x86/NEON-only; MI_NATIVE_FLAGS otherwise defaults to -march=haswell. - # Scalar-only variants leave MI_ENABLE_JIT/AUTODIFF off, which drops drjit-core/-extra - # from libmitsuba's --no-undefined link although integrator.cpp still calls into them. - CIBW_CONFIG_SETTINGS: >- - cmake.args=-DMI_DEFAULT_VARIANTS=scalar_rgb,scalar_spectral,scalar_spectral_polarized;-DMI_ENABLE_EMBREE=OFF;-DMI_NATIVE_FLAGS=;-DMI_ENABLE_JIT=ON;-DMI_ENABLE_AUTODIFF=ON - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_REPAIR_WHEEL_COMMAND: >- - pip install 'wheel>=0.40'; - new_whl_name=$(python -m wheel tags --platform-tag manylinux_2_39_riscv64 {wheel} | tail -1 | cat); - cp $(dirname {wheel})/$new_whl_name {dest_dir} + name: mitsuba-${{ env.MITSUBA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -125,15 +133,9 @@ jobs: }, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: mitsuba-${{ env.MITSUBA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish mitsuba ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-mmcif.yml b/.github/workflows/build-mmcif.yml index ea9e4d669b66..b9ec838ba3bb 100644 --- a/.github/workflows/build-mmcif.yml +++ b/.github/workflows/build-mmcif.yml @@ -59,47 +59,59 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build mmcif ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "mmcif" + version: "${{ matrix.version }}" + repository: "rcsb/py-mmcif" + ref: "${{ fromJSON('{\"1.1.1\": \"5e030c223d93e0311a9133672d1c35992b271281\", \"1.2.0\": \"00959209d210539a0ea86451767b3d1e93bb5c00\", \"1.2.1\": \"e2637adf54fc46acfdf6d3bec027a18caa0c87f0\"}')[matrix.version] }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "recursive" + pre-build: |- + export MMCIF_VERSION='${{ matrix.version }}' + grep -qx "__version__ = \"${MMCIF_VERSION}\"" mmcif/__init__.py + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/mmcif/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MMCIF_VERSION: ${{ matrix.version }} - steps: - - name: Checkout py-mmcif ${{ env.MMCIF_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: rcsb/py-mmcif - ref: ${{ fromJSON(env.MMCIF_REFS)[env.MMCIF_VERSION] }} - # The C++ core (parser, tables, regex) and pybind11 are git submodules; - # the released sdist bundles them (README's own clone instructions use - # --recurse-submodules). - submodules: recursive - persist-credentials: false - - - name: Check the checkout is the requested version - run: grep -qx "__version__ = \"${MMCIF_VERSION}\"" mmcif/__init__.py - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch mmcif source - run: git apply python-wheels/patches/mmcif/${{ env.MMCIF_VERSION }}/*.patch - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + name: mmcif-${{ env.MMCIF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -112,15 +124,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: mmcif-${{ env.MMCIF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish mmcif ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-mocpy.yml b/.github/workflows/build-mocpy.yml index 58b8bc7773d2..b5b1e527b144 100644 --- a/.github/workflows/build-mocpy.yml +++ b/.github/workflows/build-mocpy.yml @@ -61,9 +61,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-before-all-linux: >- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - cibw-environment-linux: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" # MPLBACKEND stands in for upstream's root conftest.py, which only selects Agg. cibw-test-environment: >- PIP_ONLY_BINARY=:all: diff --git a/.github/workflows/build-moderngl.yml b/.github/workflows/build-moderngl.yml index 332b1783055a..9f9b3b5ccc97 100644 --- a/.github/workflows/build-moderngl.yml +++ b/.github/workflows/build-moderngl.yml @@ -49,41 +49,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build moderngl ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "moderngl" + version: "${{ matrix.version }}" + repository: "moderngl/moderngl" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-environment-linux: "LIBGL_ALWAYS_SOFTWARE=1" + # Upstream's own pytest suite (tests/, via a standalone EGL context - + # see tests/conftest.py) needs numpy/scipy/PyOpenGL, which have no + # musllinux riscv64 wheel on either PyPI or our registry, so musllinux + # gets the lighter EGL-context smoke test instead of the full suite. + # test_local.py asserts the tests dir sits next to an editable install + # (upstream's own Containerfile runs `setup.py build_ext --inplace` + # first); it never holds for a wheel installed into its own venv. + cibw-test-requires: "${{ matrix.platform == 'manylinux' && 'pytest numpy scipy PyOpenGL' || '' }}" + cibw-test-command: "${{ matrix.platform == 'manylinux' && 'python -m pytest {project}/tests -v -k \"not test_local\"' || 'python3 -c ''from glcontext import egl; import moderngl; ctx = moderngl.create_context(standalone=True, context=egl.create_context(glversion=330, mode=\"standalone\")); print(ctx.info); ctx.release()''' }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MODERNGL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout moderngl ${{ env.MODERNGL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: moderngl/moderngl - ref: ${{ env.MODERNGL_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ LIBGL_ALWAYS_SOFTWARE=1 - # Upstream's own pytest suite (tests/, via a standalone EGL context - - # see tests/conftest.py) needs numpy/scipy/PyOpenGL, which have no - # musllinux riscv64 wheel on either PyPI or our registry, so musllinux - # gets the lighter EGL-context smoke test instead of the full suite. - # test_local.py asserts the tests dir sits next to an editable install - # (upstream's own Containerfile runs `setup.py build_ext --inplace` - # first); it never holds for a wheel installed into its own venv. - CIBW_TEST_REQUIRES: ${{ matrix.platform == 'manylinux' && 'pytest numpy scipy PyOpenGL' || '' }} - CIBW_TEST_COMMAND: ${{ matrix.platform == 'manylinux' && 'python -m pytest {project}/tests -v -k "not test_local"' || 'python3 -c ''from glcontext import egl; import moderngl; ctx = moderngl.create_context(standalone=True, context=egl.create_context(glversion=330, mode="standalone")); print(ctx.info); ctx.release()''' }} + name: moderngl-${{ env.MODERNGL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the compiled extension made it into the wheel run: | @@ -95,15 +102,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: moderngl-${{ env.MODERNGL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish moderngl ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-molbloom.yml b/.github/workflows/build-molbloom.yml index 07fbc25e1089..a0b82519cdf0 100644 --- a/.github/workflows/build-molbloom.yml +++ b/.github/workflows/build-molbloom.yml @@ -59,7 +59,6 @@ jobs: artifact-tag: manylinux_riscv64 cibw-build: "cp311-* cp312-* cp313-*" cibw-skip: "*-musllinux_*" - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # molbloom imports rdkit at module import time; rdkit's own riscv64 # wheels on our registry only go back to cp312 (same floor as numpy # and Pillow, rdkit's own runtime deps), so cp311 builds but isn't tested. diff --git a/.github/workflows/build-monotonic-alignment-search.yml b/.github/workflows/build-monotonic-alignment-search.yml index be4d92aea4d4..bad3281369c0 100644 --- a/.github/workflows/build-monotonic-alignment-search.yml +++ b/.github/workflows/build-monotonic-alignment-search.yml @@ -58,7 +58,7 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" # torch (the test-only `cpu` extra) has no riscv64 musllinux wheel on # our registry, so musllinux is dropped too. cibw-test-requires: pytest numpy torch diff --git a/.github/workflows/build-moocore.yml b/.github/workflows/build-moocore.yml index 899edf717120..ab17a44a7b03 100644 --- a/.github/workflows/build-moocore.yml +++ b/.github/workflows/build-moocore.yml @@ -68,9 +68,7 @@ jobs: # cffi, numpy and pandas have no riscv64 wheel on PyPI; PIP_ONLY_BINARY # keeps pip on our registry's builds instead of a newer sourceless # PyPI release, which would otherwise be built from sdist (gotcha 30). - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=cffi,numpy,pandas + cibw-environment-linux: "PIP_ONLY_BINARY=cffi,numpy,pandas" timeout-minutes: 60 publish: diff --git a/.github/workflows/build-mpi4py.yml b/.github/workflows/build-mpi4py.yml index 00ebcd3b675b..fd82167a22e1 100644 --- a/.github/workflows/build-mpi4py.yml +++ b/.github/workflows/build-mpi4py.yml @@ -55,80 +55,80 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build mpi4py ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "mpi4py" + version: "${{ matrix.version }}" + repository: "mpi4py/mpi4py" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + cat > riscv64-repair.sh <<'EOF' + #!/bin/bash + set -euo pipefail + wheel="$1" + dest_dir="$2" + tmpdir=$(mktemp -d) + trap 'rm -rf "$tmpdir"' EXIT + unzip -q "$wheel" -d "$tmpdir" + so=$(find "$tmpdir/mpi4py" -name 'MPI.*.so') + args=() + for lib in $(ldd "$so" | awk '{print $1}' | grep -E '^lib(mpi|open-pal|open-rte|event|hwloc|pmix|fabric)' | sort -u); do + args+=(--exclude "$lib") + done + auditwheel repair "${args[@]}" -w "$dest_dir" "$wheel" + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Matches upstream's own ci-test.yml "Configure hostname" step: without a resolvable + # hostname, Open MPI's out-of-band TCP setup for a multi-process run can hang. + cibw-before-all-linux: "dnf -y install openmpi-devel && echo \"127.0.0.1 $(hostname)\" >> /etc/hosts" + cibw-environment-linux: "PATH=\"/usr/lib64/openmpi/bin:$PATH\" LD_LIBRARY_PATH=\"/usr/lib64/openmpi/lib:${LD_LIBRARY_PATH:-}\"" + # Open MPI compiles its MCA components statically into libmpi/libopen-pal on this + # image (no lib/openmpi/*.so plugin tree), so excluding the whole chain here and + # requiring the target system's own Open MPI is safe - a partial vendor would + # otherwise ship a libmpi.so with no matching runtime. + cibw-repair-wheel-command-linux: "bash {project}/riscv64-repair.sh {wheel} {dest_dir}" + # The manylinux container runs as root, which Open MPI's mpiexec refuses by default. + cibw-test-environment-linux: "OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1" + cibw-test-sources: "test" + # Dynamic process management (MPI_Comm_spawn, used by test_spawn/test_dynproc and + # mpi4py.futures' pool in test_util_pool) hangs PRTE's resource mapper in this + # container ("prte-rmaps-base:all-available-resources-used", then no progress) - + # deselect those modules; `timeout` turns any other hang into a fast failure + # instead of riding out the job timeout. `--oversubscribe` is needed because the + # riscv64 CI runner exposes fewer slots than the `-n 2` run requests, and PRTE + # refuses to oversubscribe by default. + cibw-test-command: "python -m mpi4py --prefix && python -m mpi4py --mpi-library && timeout 600 mpiexec --oversubscribe -n 1 python test/main.py -v -e spawn -e dynproc -e util_pool && timeout 600 mpiexec --oversubscribe -n 2 python test/main.py -v -f -e spawn -e dynproc -e util_pool" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MPI4PY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout mpi4py ${{ env.MPI4PY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: mpi4py/mpi4py - ref: ${{ env.MPI4PY_VERSION }} - persist-credentials: false - - - name: Write repair script - run: | - cat > riscv64-repair.sh <<'EOF' - #!/bin/bash - set -euo pipefail - wheel="$1" - dest_dir="$2" - tmpdir=$(mktemp -d) - trap 'rm -rf "$tmpdir"' EXIT - unzip -q "$wheel" -d "$tmpdir" - so=$(find "$tmpdir/mpi4py" -name 'MPI.*.so') - args=() - for lib in $(ldd "$so" | awk '{print $1}' | grep -E '^lib(mpi|open-pal|open-rte|event|hwloc|pmix|fabric)' | sort -u); do - args+=(--exclude "$lib") - done - auditwheel repair "${args[@]}" -w "$dest_dir" "$wheel" - EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: . - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Matches upstream's own ci-test.yml "Configure hostname" step: without a resolvable - # hostname, Open MPI's out-of-band TCP setup for a multi-process run can hang. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install openmpi-devel && - echo "127.0.0.1 $(hostname)" >> /etc/hosts - CIBW_ENVIRONMENT_LINUX: >- - PATH="/usr/lib64/openmpi/bin:$PATH" - LD_LIBRARY_PATH="/usr/lib64/openmpi/lib:${LD_LIBRARY_PATH:-}" - # Open MPI compiles its MCA components statically into libmpi/libopen-pal on this - # image (no lib/openmpi/*.so plugin tree), so excluding the whole chain here and - # requiring the target system's own Open MPI is safe - a partial vendor would - # otherwise ship a libmpi.so with no matching runtime. - CIBW_REPAIR_WHEEL_COMMAND_LINUX: bash {project}/riscv64-repair.sh {wheel} {dest_dir} - # The manylinux container runs as root, which Open MPI's mpiexec refuses by default. - CIBW_TEST_ENVIRONMENT_LINUX: >- - OMPI_ALLOW_RUN_AS_ROOT=1 - OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 - CIBW_TEST_SOURCES: test - # Dynamic process management (MPI_Comm_spawn, used by test_spawn/test_dynproc and - # mpi4py.futures' pool in test_util_pool) hangs PRTE's resource mapper in this - # container ("prte-rmaps-base:all-available-resources-used", then no progress) - - # deselect those modules; `timeout` turns any other hang into a fast failure - # instead of riding out the job timeout. `--oversubscribe` is needed because the - # riscv64 CI runner exposes fewer slots than the `-n 2` run requests, and PRTE - # refuses to oversubscribe by default. - CIBW_TEST_COMMAND: >- - python -m mpi4py --prefix && - python -m mpi4py --mpi-library && - timeout 600 mpiexec --oversubscribe -n 1 python test/main.py -v -e spawn -e dynproc -e util_pool && - timeout 600 mpiexec --oversubscribe -n 2 python test/main.py -v -f -e spawn -e dynproc -e util_pool + name: mpi4py-${{ env.MPI4PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel links Open MPI instead of vendoring it run: | @@ -141,15 +141,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: mpi4py-${{ env.MPI4PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish mpi4py ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-mplcairo.yml b/.github/workflows/build-mplcairo.yml index 45150c055a13..0d57788e73f0 100644 --- a/.github/workflows/build-mplcairo.yml +++ b/.github/workflows/build-mplcairo.yml @@ -49,62 +49,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build mplcairo ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "mplcairo" + version: "${{ matrix.version }}" + repository: "anntzer/mplcairo" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # MPLCAIRO_NO_PYCAIRO stays unset: upstream's manylinux script only sets it + # after copying Arch's py3cairo.h into /usr/include by hand, and nothing here + # ships that header. pycairo (no Linux wheel on any arch) is a posix build + # requirement in pyproject.toml, so the isolated build env builds it from its + # sdist against cairo-devel and setup.py takes the header from + # cairo.get_include(). freetype-devel/fontconfig-devel ship in Rocky's own + # repos (no EPEL/CRB needed); Raqm's header is auto-downloaded by setup.py when + # no raqm.pc is found, matching upstream's non-manylinux-script fallback path. + cibw-before-build-linux: "dnf install -y cairo-devel freetype-devel fontconfig-devel" + # PyPI can be a release ahead of the riscv64 wheels on pypi.riseproject.dev + # with an sdist only (matplotlib 3.11.2 vs 3.11.1), so the compiled test + # dependencies are held to wheels; pycairo has no wheel and stays buildable. + cibw-environment-linux: "PIP_ONLY_BINARY=matplotlib,numpy,pillow,contourpy,kiwisolver,fonttools" + cibw-test-requires: "pillow" + # gotcha 247: the opening quote must share a line with the first statement - + # on its own line, the folded ">-" scalar joins it with a leading space before + # "import", which cp3.9-3.13 reject with IndentationError (cp3.14+ tolerates it). + cibw-test-command: "python -c \"import matplotlib; matplotlib.use('module://mplcairo.base'); import matplotlib.pyplot as plt; plt.plot([1, 2, 3]); plt.savefig('test.png'); import os; assert os.path.getsize('test.png') > 0; import mplcairo; print(mplcairo.get_versions())\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MPLCAIRO_VERSION: ${{ matrix.version }} - steps: - - name: Checkout mplcairo v${{ env.MPLCAIRO_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: anntzer/mplcairo - ref: v${{ env.MPLCAIRO_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # MPLCAIRO_NO_PYCAIRO stays unset: upstream's manylinux script only sets it - # after copying Arch's py3cairo.h into /usr/include by hand, and nothing here - # ships that header. pycairo (no Linux wheel on any arch) is a posix build - # requirement in pyproject.toml, so the isolated build env builds it from its - # sdist against cairo-devel and setup.py takes the header from - # cairo.get_include(). freetype-devel/fontconfig-devel ship in Rocky's own - # repos (no EPEL/CRB needed); Raqm's header is auto-downloaded by setup.py when - # no raqm.pc is found, matching upstream's non-manylinux-script fallback path. - CIBW_BEFORE_BUILD_LINUX: >- - dnf install -y cairo-devel freetype-devel fontconfig-devel - # PyPI can be a release ahead of the riscv64 wheels on pypi.riseproject.dev - # with an sdist only (matplotlib 3.11.2 vs 3.11.1), so the compiled test - # dependencies are held to wheels; pycairo has no wheel and stays buildable. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=matplotlib,numpy,pillow,contourpy,kiwisolver,fonttools - CIBW_TEST_REQUIRES: pillow - # gotcha 247: the opening quote must share a line with the first statement - - # on its own line, the folded ">-" scalar joins it with a leading space before - # "import", which cp3.9-3.13 reject with IndentationError (cp3.14+ tolerates it). - CIBW_TEST_COMMAND: >- - python -c "import matplotlib; matplotlib.use('module://mplcairo.base'); - import matplotlib.pyplot as plt; - plt.plot([1, 2, 3]); - plt.savefig('test.png'); - import os; assert os.path.getsize('test.png') > 0; - import mplcairo; print(mplcairo.get_versions())" + name: mplcairo-${{ env.MPLCAIRO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - # _mplcairo links only libc/libm/libstdc++/libgcc_s: its cairo and FreeType - # symbols are resolved at runtime from pycairo's extension and the libcairo it - # links (mplcairo/__init__.py loads it RTLD_GLOBAL), so auditwheel grafts - # nothing and there are no third-party licence texts to ship. - name: Check the wheel ships the extension and vendors no libraries run: | python3 - wheelhouse/*.whl <<'EOF' @@ -116,15 +111,9 @@ jobs: assert any(n.endswith(".dist-info/licenses/LICENSE.txt") for n in names), names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: mplcairo-${{ env.MPLCAIRO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish mplcairo ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-mrml.yml b/.github/workflows/build-mrml.yml index 31fbf672a6b1..c88d81d64eef 100644 --- a/.github/workflows/build-mrml.yml +++ b/.github/workflows/build-mrml.yml @@ -49,53 +49,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build mrml ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "mrml" + version: "${{ matrix.version }}" + repository: "jdrouet/mrml" + ref: "mrml-python-v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + cp LICENSE packages/mrml-python/LICENSE + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "packages/mrml-python" + # musllinux is out of reach: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # packages/mrml-python ships no [tool.cibuildwheel], so the Rust toolchain + # its maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "packages/mrml-python/tests packages/mrml-python/resources" + # test_http_loader_success(_allow_everything) and + # test_concurrent_http_loader fetch a live gist.githubusercontent.com + # fixture; every other test is self-contained. + cibw-test-command: "cd packages/mrml-python && python -m pytest tests --deselect tests/test_loader.py::test_http_loader_success --deselect tests/test_loader.py::test_http_loader_success_allow_everything --deselect tests/test_thread_safety.py::test_concurrent_http_loader" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MRML_VERSION: ${{ matrix.version }} - steps: - - name: Checkout mrml mrml-python-v${{ env.MRML_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: jdrouet/mrml - ref: mrml-python-v${{ env.MRML_VERSION }} - persist-credentials: false - - - name: Stage the licence beside mrml-python's pyproject.toml - # maturin globs LICEN[CS]E* relative to the pyproject directory, which is - # packages/mrml-python here -- upstream's own published wheels carry none. - run: cp LICENSE packages/mrml-python/LICENSE - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: packages/mrml-python - output-dir: wheelhouse/ - env: - # musllinux is out of reach: rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # packages/mrml-python ships no [tool.cibuildwheel], so the Rust toolchain - # its maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: packages/mrml-python/tests packages/mrml-python/resources - # test_http_loader_success(_allow_everything) and - # test_concurrent_http_loader fetch a live gist.githubusercontent.com - # fixture; every other test is self-contained. - CIBW_TEST_COMMAND: >- - cd packages/mrml-python && - python -m pytest tests --deselect tests/test_loader.py::test_http_loader_success - --deselect tests/test_loader.py::test_http_loader_success_allow_everything - --deselect tests/test_thread_safety.py::test_concurrent_http_loader + name: mrml-${{ env.MRML_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and licence made it into the wheel run: | @@ -108,15 +112,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: mrml-${{ env.MRML_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish mrml ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-multimark.yml b/.github/workflows/build-multimark.yml index 25934f29b6b2..b3e0e93d7714 100644 --- a/.github/workflows/build-multimark.yml +++ b/.github/workflows/build-multimark.yml @@ -64,7 +64,6 @@ jobs: # cffi, both a build-time and a runtime dependency, has a riscv64 # wheel on our registry for manylinux only; musllinux builds it from # sdist against the libffi-dev installed above. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-requires: pytest cibw-test-command: python -m pytest {project}/tests -x timeout-minutes: 60 diff --git a/.github/workflows/build-mwparserfromhell.yml b/.github/workflows/build-mwparserfromhell.yml index 4c4c3b3e20f4..2696f42e2823 100644 --- a/.github/workflows/build-mwparserfromhell.yml +++ b/.github/workflows/build-mwparserfromhell.yml @@ -65,9 +65,7 @@ jobs: # [tool.cibuildwheel] environment table, so WITH_EXTENSION=1 (which # selects the C tokenizer) has to be repeated here; PIP_EXTRA_INDEX_URL # is added so the `dev` test-group's psutil resolves for riscv64. - cibw-environment: >- - WITH_EXTENSION=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "WITH_EXTENSION=1" timeout-minutes: 60 publish: diff --git a/.github/workflows/build-mypy.yml b/.github/workflows/build-mypy.yml index 82895a0ee1db..8652416bf328 100644 --- a/.github/workflows/build-mypy.yml +++ b/.github/workflows/build-mypy.yml @@ -64,7 +64,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build-frontend: build # MYPY_USE_MYPYC=1 is the mypyc opt-in; without it setup.py silently ships a pure-Python wheel. Opt/debug levels match upstream's release build. - cibw-environment: >- + cibw-environment-linux: >- MYPY_USE_MYPYC=1 MYPYC_OPT_LEVEL=3 MYPYC_DEBUG_LEVEL=0 diff --git a/.github/workflows/build-mysql-connector-python.yml b/.github/workflows/build-mysql-connector-python.yml index 54651adc9474..7a0a9d240bc7 100644 --- a/.github/workflows/build-mysql-connector-python.yml +++ b/.github/workflows/build-mysql-connector-python.yml @@ -49,69 +49,70 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build mysql-connector-python ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "mysql-connector-python" + version: "${{ matrix.version }}" + repository: "mysql/mysql-connector-python" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply -v python-wheels/patches/mysql-connector-python/${{ matrix.version }}/*.patch + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "mysql-connector-python" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Oracle publishes no riscv64 MySQL C API build, so the extension links + # Rocky 10's libmysqlclient (auditwheel then vendors it into the wheel) + # instead of the static one Oracle's own wheels bundle. + cibw-before-all-linux: "dnf -y install mysql8.4-devel" + # Without MYSQL_CAPI setup.py silently drops the C extension; SKIP_VENDOR + # turns off bundling the auth plugins, which mysql8.4-devel does not ship. + # EXTRA_LINK_ARGS is needed because upstream only puts the MySQL library + # path on the link line when it finds a static libmysqlclient.a to copy. + cibw-environment-linux: "MYSQL_CAPI=/usr SKIP_VENDOR=1 EXTRA_LINK_ARGS=-L/usr/lib64/mysql" + # Clear them again for the test phase, or unittests.py's in-tree rebuild + # would shadow the wheel's extension with one it just compiled. + cibw-test-environment: "MYSQL_CAPI= SKIP_VENDOR= EXTRA_LINK_ARGS=" + # unittests.py bootstraps its own server; the container's capability + # bounding set makes mysqld's cap_sys_nice file capability unexecutable. + cibw-before-test-linux: "dnf -y install mysql8.4-server mysql8.4 libcap && setcap -r /usr/libexec/mysqld" + cibw-test-requires: "setuptools wheel" + cibw-test-command: "cd {package} && python -c \"import _mysql_connector as m; assert 'site-packages' in m.__file__, m.__file__; print(m.__file__, m.MySQL().get_client_info())\" && python -c \"import importlib.metadata as md; n={p.name for p in md.files('mysql-connector-python') if '.dist-info/licenses/' in str(p)}; assert n == {'LICENSE.txt', 'LICENSE.zstd'}, n\" && python unittests.py --with-mysql=/usr --with-mysql-share=/usr/share/mysql --verbosity=1 --test-regex '^cext_'" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: MYSQL_CONNECTOR_PYTHON_VERSION: ${{ matrix.version }} - steps: - - name: Checkout mysql-connector-python ${{ env.MYSQL_CONNECTOR_PYTHON_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: mysql/mysql-connector-python - ref: ${{ env.MYSQL_CONNECTOR_PYTHON_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: | - git apply -v python-wheels/patches/mysql-connector-python/${{ env.MYSQL_CONNECTOR_PYTHON_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: mysql-connector-python - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Oracle publishes no riscv64 MySQL C API build, so the extension links - # Rocky 10's libmysqlclient (auditwheel then vendors it into the wheel) - # instead of the static one Oracle's own wheels bundle. - CIBW_BEFORE_ALL_LINUX: dnf -y install mysql8.4-devel - # Without MYSQL_CAPI setup.py silently drops the C extension; SKIP_VENDOR - # turns off bundling the auth plugins, which mysql8.4-devel does not ship. - # EXTRA_LINK_ARGS is needed because upstream only puts the MySQL library - # path on the link line when it finds a static libmysqlclient.a to copy. - CIBW_ENVIRONMENT: MYSQL_CAPI=/usr SKIP_VENDOR=1 EXTRA_LINK_ARGS=-L/usr/lib64/mysql - # Clear them again for the test phase, or unittests.py's in-tree rebuild - # would shadow the wheel's extension with one it just compiled. - CIBW_TEST_ENVIRONMENT: MYSQL_CAPI= SKIP_VENDOR= EXTRA_LINK_ARGS= - # unittests.py bootstraps its own server; the container's capability - # bounding set makes mysqld's cap_sys_nice file capability unexecutable. - CIBW_BEFORE_TEST_LINUX: >- - dnf -y install mysql8.4-server mysql8.4 libcap && - setcap -r /usr/libexec/mysqld - CIBW_TEST_REQUIRES: setuptools wheel - CIBW_TEST_COMMAND: >- - cd {package} && - python -c "import _mysql_connector as m; assert 'site-packages' in m.__file__, m.__file__; - print(m.__file__, m.MySQL().get_client_info())" && - python -c "import importlib.metadata as md; - n={p.name for p in md.files('mysql-connector-python') if '.dist-info/licenses/' in str(p)}; - assert n == {'LICENSE.txt', 'LICENSE.zstd'}, n" && - python unittests.py --with-mysql=/usr --with-mysql-share=/usr/share/mysql - --verbosity=1 --test-regex '^cext_' + name: mysql-connector-python-${{ env.MYSQL_CONNECTOR_PYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extension made it into the wheel run: | @@ -124,12 +125,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: mysql-connector-python-${{ env.MYSQL_CONNECTOR_PYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -165,7 +160,7 @@ jobs: publish: name: Publish mysql-connector-python ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-mysql-mimic.yml b/.github/workflows/build-mysql-mimic.yml index f43c841384a5..0a0770038bd8 100644 --- a/.github/workflows/build-mysql-mimic.yml +++ b/.github/workflows/build-mysql-mimic.yml @@ -59,7 +59,6 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 checkout-fetch-depth: 0 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-requires: aiomysql mysql-connector-python freezegun greenlet pytest pytest-asyncio sqlalchemy cibw-test-sources: tests tools # Upstream's wheel check, plus the pytest suite its tests.yml runs from a checkout. diff --git a/.github/workflows/build-nagisa.yml b/.github/workflows/build-nagisa.yml index 08aa49c02513..f675a94fcfb0 100644 --- a/.github/workflows/build-nagisa.yml +++ b/.github/workflows/build-nagisa.yml @@ -63,9 +63,7 @@ jobs: artifact-tag: manylinux_riscv64 cibw-build: 'cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64' cibw-skip: '*-musllinux_*' - cibw-environment: >- - PIP_USE_PEP517=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PIP_USE_PEP517=1" cibw-test-environment: PIP_PREFER_BINARY=1 timeout-minutes: 180 diff --git a/.github/workflows/build-navconfig.yml b/.github/workflows/build-navconfig.yml index ec53c7b61aa0..3db00c0e1659 100644 --- a/.github/workflows/build-navconfig.yml +++ b/.github/workflows/build-navconfig.yml @@ -62,9 +62,7 @@ jobs: ref: ${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=orjson,cryptography,pycryptodomex,uvloop,pytomlpp + cibw-environment-linux: "PIP_ONLY_BINARY=orjson,cryptography,pycryptodomex,uvloop,pytomlpp" cibw-test-sources: tests cibw-test-requires: "pytest>=9.0.3 pytest-asyncio>=0.21.0 uvloop>=0.22.1" # kardex env create scaffolds env/etc/.../ so Kardex can bootstrap at diff --git a/.github/workflows/build-navigator-api.yml b/.github/workflows/build-navigator-api.yml index 4facb5f14c85..965d2824baf4 100644 --- a/.github/workflows/build-navigator-api.yml +++ b/.github/workflows/build-navigator-api.yml @@ -46,35 +46,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build navigator-api ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "navigator-api" + version: "${{ matrix.version }}" + repository: "phenobarbital/navigator" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pytest" + cibw-test-command: "python -c \"import navigator, navigator.types, navigator.utils.types; assert navigator.types.__file__.endswith('.so'), f'navigator.types not compiled -> {navigator.types.__file__}'; assert navigator.utils.types.__file__.endswith('.so'), f'navigator.utils.types not compiled -> {navigator.utils.types.__file__}'; print('OK - Navigator test passed:', navigator.version()); print('OK - Compiled extensions verified:', navigator.types.__file__, navigator.utils.types.__file__)\"" + # As upstream does for cp314: runtime deps (navconfig, navigator-auth, asyncdb, python-datamodel) have no riscv64 wheels yet. + cibw-test-skip: "*" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: NAVIGATOR_API_VERSION: ${{ matrix.version }} - steps: - - name: Checkout navigator ${{ env.NAVIGATOR_API_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: phenobarbital/navigator - ref: ${{ env.NAVIGATOR_API_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: python -c "import navigator, navigator.types, navigator.utils.types; assert navigator.types.__file__.endswith('.so'), f'navigator.types not compiled -> {navigator.types.__file__}'; assert navigator.utils.types.__file__.endswith('.so'), f'navigator.utils.types not compiled -> {navigator.utils.types.__file__}'; print('OK - Navigator test passed:', navigator.version()); print('OK - Compiled extensions verified:', navigator.types.__file__, navigator.utils.types.__file__)" - # As upstream does for cp314: runtime deps (navconfig, navigator-auth, asyncdb, python-datamodel) have no riscv64 wheels yet. - CIBW_TEST_SKIP: "*" + name: navigator-api-${{ env.NAVIGATOR_API_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify compiled extensions are present in the wheel env: @@ -107,15 +114,9 @@ jobs: print(f"OK: {wheel_path}: required extensions present ({platform_tag})") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: navigator-api-${{ env.NAVIGATOR_API_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish navigator-api ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-navigator-auth.yml b/.github/workflows/build-navigator-auth.yml index 5e94e3f9fc20..4825461796a9 100644 --- a/.github/workflows/build-navigator-auth.yml +++ b/.github/workflows/build-navigator-auth.yml @@ -46,32 +46,41 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build navigator-auth ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "navigator-auth" + version: "${{ matrix.version }}" + repository: "phenobarbital/navigator-auth" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-output-dir: "dist" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-build: "curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal && pip install cython setuptools-rust" + cibw-environment-linux: "PATH=$HOME/.cargo/bin:$PATH" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: NAVIGATOR_AUTH_VERSION: ${{ matrix.version }} - steps: - - name: Checkout navigator-auth ${{ env.NAVIGATOR_AUTH_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: phenobarbital/navigator-auth - ref: ${{ env.NAVIGATOR_AUTH_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: dist - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_BEFORE_BUILD: "curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal && pip install cython setuptools-rust" - CIBW_ENVIRONMENT: 'PATH=$HOME/.cargo/bin:$PATH' + name: navigator-auth-${{ env.NAVIGATOR_AUTH_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: dist - name: Verify wheel tags and compiled extensions env: @@ -106,15 +115,9 @@ jobs: assert found_cpython_tags == {os.environ["EXPECTED_CPYTHON_TAG"]}, found_cpython_tags EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: navigator-auth-${{ env.NAVIGATOR_AUTH_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: dist/*.whl - if-no-files-found: error - publish: name: Publish navigator-auth ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ncls.yml b/.github/workflows/build-ncls.yml index 49590c731510..e3c64dede202 100644 --- a/.github/workflows/build-ncls.yml +++ b/.github/workflows/build-ncls.yml @@ -66,7 +66,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # numpy (a runtime dep) ships no riscv64 wheel on public PyPI; ours is what # the test env installs. PIP_ONLY_BINARY keeps pip from building it from source. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" cibw-test-requires: pytest # tests/ shadows the installed wheel's compiled ncls.src.* submodules with the # checkout's pure-Cython-source package if run from the checkout root. diff --git a/.github/workflows/build-ncompress.yml b/.github/workflows/build-ncompress.yml index 34cfb9959034..0c416dc57b5f 100644 --- a/.github/workflows/build-ncompress.yml +++ b/.github/workflows/build-ncompress.yml @@ -52,42 +52,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build ncompress ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ncompress" + version: "${{ matrix.version }}" + repository: "valgur/ncompress" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/ncompress/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: NCOMPRESS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout ncompress v${{ env.NCOMPRESS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: valgur/ncompress - ref: v${{ env.NCOMPRESS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - # pyproject.toml's build-system.requires floors scikit-build-core at - # >=0.4.3 with no upper bound; 0.8+ removed cmake.minimum-version outright, - # so an isolated build always fails on any architecture. - - name: Patch ncompress source - run: git apply python-wheels/patches/ncompress/${{ env.NCOMPRESS_VERSION }}/00*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} + name: ncompress-${{ env.NCOMPRESS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -102,15 +111,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ncompress-${{ env.NCOMPRESS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish ncompress ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-netcdf4.yml b/.github/workflows/build-netcdf4.yml index c9cd4b005b7d..1d4735ecc0c2 100644 --- a/.github/workflows/build-netcdf4.yml +++ b/.github/workflows/build-netcdf4.yml @@ -59,141 +59,143 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build netCDF4 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "netcdf4" + version: "${{ matrix.version }}" + repository: "Unidata/netcdf4-python" + ref: "v${{ matrix.version }}rel" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 600 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/netcdf4/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Mirrors Unidata/netcdf4-python-manylinux's install_libs.sh. curl is + # built from source there and here so the wheel bundles curl's small + # closure rather than Rocky's krb5/openldap/libssh one. OpenSSL, zstd, + # bzip2 and zlib come from the distro: they are only built from source + # upstream because AlmaLinux 8 ships them too old, and Rocky 10 already + # carries a newer OpenSSL than the version upstream pins. + # NETCDF_PLUGIN_INSTALL is the current spelling of the option upstream + # still passes as ENABLE_PLUGIN_INSTALL, which netcdf-c 4.10 ignores. + cibw-before-all-linux: |- + set -ex + dnf -y install zlib-devel bzip2-devel libzstd-devel openssl-devel + mkdir -p /tmp/curl /tmp/libaec /tmp/blosc /tmp/hdf5 /tmp/netcdf + + curl -fsSL "https://curl.se/download/curl-$CURL_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/curl + cd /tmp/curl + ./configure --prefix=/usr/local --disable-ldap --with-openssl --without-zstd --without-libpsl + make -j "$(nproc)" + make install + ldconfig + + curl -fsSL "https://github.com/Deutsches-Klimarechenzentrum/libaec/releases/download/v$LIBAEC_VERSION/libaec-$LIBAEC_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/libaec + cmake -S /tmp/libaec -B /tmp/libaec/build \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_INSTALL_PREFIX=/usr/local \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D BUILD_STATIC_LIBS=OFF \ + -D BUILD_TESTING=OFF + cmake --build /tmp/libaec/build -j "$(nproc)" + cmake --install /tmp/libaec/build + ldconfig + + curl -fsSL "https://github.com/Blosc/c-blosc/archive/refs/tags/v$BLOSC_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/blosc + cmake -S /tmp/blosc -B /tmp/blosc/build \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_INSTALL_PREFIX=/usr/local \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D CMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -D PREFER_EXTERNAL_ZSTD=ON \ + -D BUILD_TESTS=OFF \ + -D BUILD_BENCHMARKS=OFF \ + -D BUILD_FUZZERS=OFF + cmake --build /tmp/blosc/build -j "$(nproc)" + cmake --install /tmp/blosc/build + ldconfig + + curl -fsSL "https://github.com/HDFGroup/hdf5/archive/refs/tags/$HDF5_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/hdf5 + cmake -S /tmp/hdf5 -B /tmp/hdf5/build \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_INSTALL_PREFIX=/usr/local \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D BUILD_TESTING=OFF \ + -D BUILD_STATIC_LIBS=OFF \ + -D HDF5_BUILD_EXAMPLES=OFF \ + -D HDF5_BUILD_TOOLS=OFF \ + -D HDF5_BUILD_UTILS=OFF \ + -D HDF5_ALLOW_EXTERNAL_SUPPORT:STRING=NO \ + -D HDF5_ENABLE_ZLIB_SUPPORT=ON \ + -D HDF5_ENABLE_SZIP_SUPPORT=ON + cmake --build /tmp/hdf5/build -j "$(nproc)" + cmake --install /tmp/hdf5/build + ldconfig + + curl -fsSL "https://github.com/Unidata/netcdf-c/archive/refs/tags/v$NETCDF_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/netcdf + cmake -S /tmp/netcdf -B /tmp/netcdf/build \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_INSTALL_PREFIX=/usr/local \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D NETCDF_ENABLE_NETCDF_4=on \ + -D NETCDF_ENABLE_HDF5=on \ + -D NETCDF_ENABLE_DAP=on \ + -D NETCDF_ENABLE_TESTS=off \ + -D NETCDF_PLUGIN_INSTALL=ON \ + -D BUILD_SHARED_LIBS=on + cmake --build /tmp/netcdf/build -j "$(nproc)" --target install + ldconfig + + cp /usr/share/licenses/openssl-libs/LICENSE.txt "{project}/LICENSE.openssl" + cp /tmp/curl/COPYING "{project}/LICENSE.curl" + cp /tmp/libaec/LICENSE.txt "{project}/LICENSE.libaec" + cp /tmp/blosc/LICENSE.txt "{project}/LICENSE.c-blosc" + cp /tmp/hdf5/LICENSE "{project}/LICENSE.hdf5" + cp /tmp/netcdf/COPYRIGHT "{project}/LICENSE.netcdf-c" + cp /usr/share/licenses/libzstd/LICENSE "{project}/LICENSE.zstd" + cp /usr/share/licenses/bzip2-libs/LICENSE "{project}/LICENSE.bzip2" + # NETCDF_PLUGIN_DIR is upstream's [[tool.cibuildwheel.overrides]] value + # for Linux, which this variable replaces wholesale. The tag is fetched + # shallow, so setuptools_scm cannot describe the version. + cibw-environment-linux: "NETCDF_PLUGIN_DIR=/usr/local/hdf5/lib/plugin/ SETUPTOOLS_SCM_PRETEND_VERSION_FOR_NETCDF4=${{ matrix.version }} CURL_VERSION=8.14.1 LIBAEC_VERSION=1.1.4 BLOSC_VERSION=1.21.6 HDF5_VERSION=2.2.0 NETCDF_VERSION=4.10.1 PIP_ONLY_BINARY=numpy,cftime" + # test_dap reads live OPeNDAP servers, which answer with a malformed + # DDS often enough to be useless as a wheel test (it fails on aarch64 + # too). NO_NET is upstream's own switch for it. + cibw-test-environment: "NO_NET=1" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 600 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: NETCDF4_VERSION: ${{ matrix.version }} - steps: - - name: Checkout netcdf4-python ${{ env.NETCDF4_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Unidata/netcdf4-python - ref: v${{ env.NETCDF4_VERSION }}rel - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch netcdf4-python source - run: git apply python-wheels/patches/netcdf4/${{ env.NETCDF4_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Mirrors Unidata/netcdf4-python-manylinux's install_libs.sh. curl is - # built from source there and here so the wheel bundles curl's small - # closure rather than Rocky's krb5/openldap/libssh one. OpenSSL, zstd, - # bzip2 and zlib come from the distro: they are only built from source - # upstream because AlmaLinux 8 ships them too old, and Rocky 10 already - # carries a newer OpenSSL than the version upstream pins. - # NETCDF_PLUGIN_INSTALL is the current spelling of the option upstream - # still passes as ENABLE_PLUGIN_INSTALL, which netcdf-c 4.10 ignores. - CIBW_BEFORE_ALL_LINUX: | - set -ex - dnf -y install zlib-devel bzip2-devel libzstd-devel openssl-devel - mkdir -p /tmp/curl /tmp/libaec /tmp/blosc /tmp/hdf5 /tmp/netcdf - - curl -fsSL "https://curl.se/download/curl-$CURL_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/curl - cd /tmp/curl - ./configure --prefix=/usr/local --disable-ldap --with-openssl --without-zstd --without-libpsl - make -j "$(nproc)" - make install - ldconfig - - curl -fsSL "https://github.com/Deutsches-Klimarechenzentrum/libaec/releases/download/v$LIBAEC_VERSION/libaec-$LIBAEC_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/libaec - cmake -S /tmp/libaec -B /tmp/libaec/build \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_INSTALL_PREFIX=/usr/local \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D BUILD_STATIC_LIBS=OFF \ - -D BUILD_TESTING=OFF - cmake --build /tmp/libaec/build -j "$(nproc)" - cmake --install /tmp/libaec/build - ldconfig - - curl -fsSL "https://github.com/Blosc/c-blosc/archive/refs/tags/v$BLOSC_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/blosc - cmake -S /tmp/blosc -B /tmp/blosc/build \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_INSTALL_PREFIX=/usr/local \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D CMAKE_POLICY_VERSION_MINIMUM=3.5 \ - -D PREFER_EXTERNAL_ZSTD=ON \ - -D BUILD_TESTS=OFF \ - -D BUILD_BENCHMARKS=OFF \ - -D BUILD_FUZZERS=OFF - cmake --build /tmp/blosc/build -j "$(nproc)" - cmake --install /tmp/blosc/build - ldconfig - - curl -fsSL "https://github.com/HDFGroup/hdf5/archive/refs/tags/$HDF5_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/hdf5 - cmake -S /tmp/hdf5 -B /tmp/hdf5/build \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_INSTALL_PREFIX=/usr/local \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D BUILD_TESTING=OFF \ - -D BUILD_STATIC_LIBS=OFF \ - -D HDF5_BUILD_EXAMPLES=OFF \ - -D HDF5_BUILD_TOOLS=OFF \ - -D HDF5_BUILD_UTILS=OFF \ - -D HDF5_ALLOW_EXTERNAL_SUPPORT:STRING=NO \ - -D HDF5_ENABLE_ZLIB_SUPPORT=ON \ - -D HDF5_ENABLE_SZIP_SUPPORT=ON - cmake --build /tmp/hdf5/build -j "$(nproc)" - cmake --install /tmp/hdf5/build - ldconfig - - curl -fsSL "https://github.com/Unidata/netcdf-c/archive/refs/tags/v$NETCDF_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/netcdf - cmake -S /tmp/netcdf -B /tmp/netcdf/build \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_INSTALL_PREFIX=/usr/local \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D NETCDF_ENABLE_NETCDF_4=on \ - -D NETCDF_ENABLE_HDF5=on \ - -D NETCDF_ENABLE_DAP=on \ - -D NETCDF_ENABLE_TESTS=off \ - -D NETCDF_PLUGIN_INSTALL=ON \ - -D BUILD_SHARED_LIBS=on - cmake --build /tmp/netcdf/build -j "$(nproc)" --target install - ldconfig - - cp /usr/share/licenses/openssl-libs/LICENSE.txt "{project}/LICENSE.openssl" - cp /tmp/curl/COPYING "{project}/LICENSE.curl" - cp /tmp/libaec/LICENSE.txt "{project}/LICENSE.libaec" - cp /tmp/blosc/LICENSE.txt "{project}/LICENSE.c-blosc" - cp /tmp/hdf5/LICENSE "{project}/LICENSE.hdf5" - cp /tmp/netcdf/COPYRIGHT "{project}/LICENSE.netcdf-c" - cp /usr/share/licenses/libzstd/LICENSE "{project}/LICENSE.zstd" - cp /usr/share/licenses/bzip2-libs/LICENSE "{project}/LICENSE.bzip2" - # NETCDF_PLUGIN_DIR is upstream's [[tool.cibuildwheel.overrides]] value - # for Linux, which this variable replaces wholesale. The tag is fetched - # shallow, so setuptools_scm cannot describe the version. - CIBW_ENVIRONMENT: >- - NETCDF_PLUGIN_DIR=/usr/local/hdf5/lib/plugin/ - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_NETCDF4=${{ env.NETCDF4_VERSION }} - CURL_VERSION=${{ env.CURL_VERSION }} - LIBAEC_VERSION=${{ env.LIBAEC_VERSION }} - BLOSC_VERSION=${{ env.BLOSC_VERSION }} - HDF5_VERSION=${{ env.HDF5_VERSION }} - NETCDF_VERSION=${{ env.NETCDF_VERSION }} - PIP_ONLY_BINARY=numpy,cftime - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # test_dap reads live OPeNDAP servers, which answer with a malformed - # DDS often enough to be useless as a wheel test (it fails on aarch64 - # too). NO_NET is upstream's own switch for it. - CIBW_TEST_ENVIRONMENT: NO_NET=1 + name: netcdf4-${{ env.NETCDF4_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension, the plugins and the licences run: | @@ -224,15 +226,9 @@ jobs: }, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: netcdf4-${{ env.NETCDF4_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish netCDF4 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-netifaces-plus.yml b/.github/workflows/build-netifaces-plus.yml index fff09a628be0..1262d4542869 100644 --- a/.github/workflows/build-netifaces-plus.yml +++ b/.github/workflows/build-netifaces-plus.yml @@ -49,36 +49,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build netifaces-plus ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "netifaces-plus" + version: "${{ matrix.version }}" + repository: "tsukumijima/netifaces-plus" + ref: '' + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + echo "NETIFACES_PLUS_TAG=release_${NETIFACES_PLUS_VERSION//./_}" >> "$GITHUB_ENV" + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + git fetch -q --no-tags origin "${NETIFACES_PLUS_TAG}" + git checkout -q --detach FETCH_HEAD + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-sources: "test.py" + cibw-test-command: "python test.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: NETIFACES_PLUS_VERSION: ${{ matrix.version }} - steps: - # netifaces-plus tags releases as release_X_Y_Z, not the PyPI version (gotcha 274). - - name: Determine upstream git tag - run: echo "NETIFACES_PLUS_TAG=release_${NETIFACES_PLUS_VERSION//./_}" >> "$GITHUB_ENV" - - - name: Checkout netifaces-plus ${{ env.NETIFACES_PLUS_TAG }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: tsukumijima/netifaces-plus - ref: ${{ env.NETIFACES_PLUS_TAG }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_SOURCES: test.py - CIBW_TEST_COMMAND: python test.py + name: netifaces-plus-${{ env.NETIFACES_PLUS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extension made it into the wheel run: | @@ -90,15 +102,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: netifaces-plus-${{ env.NETIFACES_PLUS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish netifaces-plus ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-netifaces.yml b/.github/workflows/build-netifaces.yml index 4e63e5a44ce1..0bd9176db13e 100644 --- a/.github/workflows/build-netifaces.yml +++ b/.github/workflows/build-netifaces.yml @@ -50,36 +50,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build netifaces ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "netifaces" + version: "${{ matrix.version }}" + repository: "al45tair/netifaces" + ref: '' + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + echo "NETIFACES_TAG=release_${NETIFACES_VERSION//./_}" >> "$GITHUB_ENV" + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + git fetch -q --no-tags origin "${NETIFACES_TAG}" + git checkout -q --detach FETCH_HEAD + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-sources: "test.py" + cibw-test-command: "python test.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: NETIFACES_VERSION: ${{ matrix.version }} - steps: - # netifaces tags releases as release_X_Y_Z, not the PyPI version. - - name: Determine upstream git tag - run: echo "NETIFACES_TAG=release_${NETIFACES_VERSION//./_}" >> "$GITHUB_ENV" - - - name: Checkout netifaces ${{ env.NETIFACES_TAG }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: al45tair/netifaces - ref: ${{ env.NETIFACES_TAG }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_SOURCES: test.py - CIBW_TEST_COMMAND: python test.py + name: netifaces-${{ env.NETIFACES_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extension made it into the wheel run: | @@ -91,15 +103,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: netifaces-${{ env.NETIFACES_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish netifaces ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-newrelic.yml b/.github/workflows/build-newrelic.yml index bb043bf23cdf..95502eb5831f 100644 --- a/.github/workflows/build-newrelic.yml +++ b/.github/workflows/build-newrelic.yml @@ -62,7 +62,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # setup.py catches every build_ext error and falls back to a pure-Python # wheel; this makes a compile failure fatal instead. - cibw-environment: NEW_RELIC_EXTENSIONS=true + cibw-environment-linux: NEW_RELIC_EXTENSIONS=true cibw-test-requires: pytest certifi WebTest cibw-test-command: >- python -c "import newrelic.core._thread_utilization as t, newrelic.packages.wrapt._wrappers as w; diff --git a/.github/workflows/build-ngt.yml b/.github/workflows/build-ngt.yml index b2f8b23c4bff..ccefdde7d57a 100644 --- a/.github/workflows/build-ngt.yml +++ b/.github/workflows/build-ngt.yml @@ -55,79 +55,67 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build ngt ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ngt" + version: "${{ matrix.version }}" + repository: "yahoojapan/NGT" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/ngt/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + mkdir -p python/ngt-src + cp -r CMakeLists.txt LICENSE README.md VERSION bin lib samples utils python/ngt-src/ + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "python" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "dnf -y install cmake blas-devel lapack-devel && cd {package} && cmake -S ngt-src -B build-ci -DCMAKE_BUILD_TYPE=Release -DNGT_AVX_DISABLED=ON -DNGT_MARCH_NATIVE_DISABLED=ON && cmake --build build-ci --parallel $(nproc) && cp build-ci/lib/NGT/libngt.a . && cp build-ci/lib/NGT/defines.h build-ci/lib/NGT/version_defs.h ngt-src/lib/NGT/" + cibw-environment-linux: "NGT_STATIC_LIBRARY_PATH=libngt.a NGT_INCLUDE_DIR=ngt-src/lib NGT_BUILD_STATIC=1 PIP_ONLY_BINARY=numpy" + # Upstream ships no pytest suite for the Python bindings (only a + # demo script with hardcoded relative paths to its sample + # dataset); synthesize a round-trip create/insert/search smoke test. + cibw-test-command: "python3 -c \"import ngtpy, random; ngtpy.create(path=b'/tmp/ngt-smoke-index', dimension=16, distance_type='L2'); idx = ngtpy.Index(b'/tmp/ngt-smoke-index'); vecs = [[random.random() for _ in range(16)] for _ in range(200)]; idx.batch_insert(vecs); idx.save(); results = idx.search(vecs[0], size=5); assert len(results) == 5, results; assert results[0][0] == 0, results; print('ngt smoke test ok')\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: NGT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout NGT v${{ env.NGT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: yahoojapan/NGT - ref: v${{ env.NGT_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/ngt/${{ env.NGT_VERSION }}/*.patch - - # python/pyproject.toml's own [tool.cibuildwheel.linux] before-all - # expects an `ngt-src/` checkout staged next to the package (comment: - # "ngt-src/ is staged next to the package") - upstream's own tooling - # does this outside of what's committed to the repo. - - name: Stage the NGT core checkout next to the Python package - run: | - mkdir -p python/ngt-src - cp -r CMakeLists.txt LICENSE README.md VERSION bin lib samples utils python/ngt-src/ - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: python - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install cmake blas-devel lapack-devel && - cd {package} && - cmake -S ngt-src -B build-ci -DCMAKE_BUILD_TYPE=Release - -DNGT_AVX_DISABLED=ON -DNGT_MARCH_NATIVE_DISABLED=ON && - cmake --build build-ci --parallel $(nproc) && - cp build-ci/lib/NGT/libngt.a . && - cp build-ci/lib/NGT/defines.h build-ci/lib/NGT/version_defs.h ngt-src/lib/NGT/ - CIBW_ENVIRONMENT_LINUX: >- - NGT_STATIC_LIBRARY_PATH=libngt.a - NGT_INCLUDE_DIR=ngt-src/lib - NGT_BUILD_STATIC=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - # Upstream ships no pytest suite for the Python bindings (only a - # demo script with hardcoded relative paths to its sample - # dataset); synthesize a round-trip create/insert/search smoke test. - CIBW_TEST_COMMAND: >- - python3 -c "import ngtpy, random; - ngtpy.create(path=b'/tmp/ngt-smoke-index', dimension=16, distance_type='L2'); - idx = ngtpy.Index(b'/tmp/ngt-smoke-index'); - vecs = [[random.random() for _ in range(16)] for _ in range(200)]; - idx.batch_insert(vecs); - idx.save(); - results = idx.search(vecs[0], size=5); - assert len(results) == 5, results; - assert results[0][0] == 0, results; - print('ngt smoke test ok')" + name: ngt-${{ env.NGT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -139,12 +127,6 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ngt-${{ env.NGT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -180,7 +162,7 @@ jobs: publish: name: Publish ngt ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-nlopt.yml b/.github/workflows/build-nlopt.yml index 45ced5fa004e..3e4af663e95c 100644 --- a/.github/workflows/build-nlopt.yml +++ b/.github/workflows/build-nlopt.yml @@ -62,9 +62,7 @@ jobs: # numpy has no riscv64 wheel on public PyPI; PIP_ONLY_BINARY keeps pip # from source-building it (both here and when the built wheel's own # numpy>=2,<3 requirement is installed for CIBW_TEST_COMMAND). - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" cibw-test-command: python {project}/extern/nlopt/test/t_python.py timeout-minutes: 60 diff --git a/.github/workflows/build-nmslib.yml b/.github/workflows/build-nmslib.yml index cd637ced0d6f..9cb8e8ce044d 100644 --- a/.github/workflows/build-nmslib.yml +++ b/.github/workflows/build-nmslib.yml @@ -56,44 +56,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build nmslib ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "nmslib" + version: "${{ matrix.version }}" + repository: "nmslib/nmslib" + ref: "799c8c0b5fd36fa40542ab0972038f19b2488641" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-package-dir: "python_bindings" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py appends -march=native unless CFLAGS already names an + # arch flag (the same override upstream's own build_linux_wheels/ + # deploy.sh passes per target arch: -march=armv8-a for aarch64, + # -msse2 for x86_64) - rv64gc is this repo's portable riscv64 + # baseline. numpy and scipy have no riscv64 wheels on public PyPI. + cibw-environment-linux: "CFLAGS=-march=rv64gc PIP_ONLY_BINARY=numpy,scipy" + cibw-test-requires: "pytest psutil" + cibw-test-sources: "python_bindings/tests" + cibw-test-command: "python -m pytest -q -ra python_bindings/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: NMSLIB_VERSION: ${{ matrix.version }} - steps: - - name: Checkout nmslib ${{ env.NMSLIB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: nmslib/nmslib - ref: ${{ env.NMSLIB_REF }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: python_bindings - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py appends -march=native unless CFLAGS already names an - # arch flag (the same override upstream's own build_linux_wheels/ - # deploy.sh passes per target arch: -march=armv8-a for aarch64, - # -msse2 for x86_64) - rv64gc is this repo's portable riscv64 - # baseline. numpy and scipy have no riscv64 wheels on public PyPI. - CIBW_ENVIRONMENT: >- - CFLAGS=-march=rv64gc - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - CIBW_TEST_REQUIRES: pytest psutil - CIBW_TEST_SOURCES: python_bindings/tests - CIBW_TEST_COMMAND: python -m pytest -q -ra python_bindings/tests + name: nmslib-${{ env.NMSLIB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel is a compiled extension module run: | @@ -105,12 +109,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: nmslib-${{ env.NMSLIB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -146,7 +144,7 @@ jobs: publish: name: Publish nmslib ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-numexpr.yml b/.github/workflows/build-numexpr.yml index d769579344b6..6955cd4d9a82 100644 --- a/.github/workflows/build-numexpr.yml +++ b/.github/workflows/build-numexpr.yml @@ -60,8 +60,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # numpy has no riscv64 wheel on public PyPI; both the build backend and # the test venv resolve it from our registry. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - publish: name: Publish numexpr ${{ matrix.version }} needs: [setup, build_wheels] diff --git a/.github/workflows/build-numpy-financial.yml b/.github/workflows/build-numpy-financial.yml index 8a62cec369a6..9521e4277b08 100644 --- a/.github/workflows/build-numpy-financial.yml +++ b/.github/workflows/build-numpy-financial.yml @@ -50,46 +50,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build numpy-financial ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "numpy-financial" + version: "${{ matrix.version }}" + repository: "numpy/numpy-financial" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-fetch-depth: 0 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/numpy-financial/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + # Upstream's own test run (pythonpackage.yml: `spin test -- --doctest-modules`) against the installed wheel. + cibw-test-extras: "test" + cibw-test-command: "python -m pytest --pyargs numpy_financial --doctest-modules" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: NUMPY_FINANCIAL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout numpy-financial ${{ env.NUMPY_FINANCIAL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: numpy/numpy-financial - ref: v${{ env.NUMPY_FINANCIAL_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/numpy-financial/${{ env.NUMPY_FINANCIAL_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - # Upstream's own test run (pythonpackage.yml: `spin test -- --doctest-modules`) against the installed wheel. - CIBW_TEST_EXTRAS: test - CIBW_TEST_COMMAND: python -m pytest --pyargs numpy_financial --doctest-modules + name: numpy-financial-${{ env.NUMPY_FINANCIAL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -102,16 +111,9 @@ jobs: assert licences == {"LICENSE.txt"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: numpy-financial-${{ env.NUMPY_FINANCIAL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish numpy-financial ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-numpy-minmax.yml b/.github/workflows/build-numpy-minmax.yml index 10acfb1393e3..eb01672b581b 100644 --- a/.github/workflows/build-numpy-minmax.yml +++ b/.github/workflows/build-numpy-minmax.yml @@ -61,9 +61,7 @@ jobs: # numpy is both a build (test) and runtime requirement, and only our registry # has it for riscv64; only-binary keeps a newer PyPI release from winning the # resolution and then compiling from sdist. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" timeout-minutes: 60 publish: diff --git a/.github/workflows/build-numpy-quaternion.yml b/.github/workflows/build-numpy-quaternion.yml index a20b84672baa..9a7a12f62732 100644 --- a/.github/workflows/build-numpy-quaternion.yml +++ b/.github/workflows/build-numpy-quaternion.yml @@ -48,39 +48,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build numpy-quaternion ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "numpy-quaternion" + version: "${{ matrix.version }}" + repository: "moble/quaternion" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy and scipy are both build/runtime requirements, and only our registry + # has them for riscv64; only-binary keeps a newer PyPI release from winning + # the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy" + cibw-test-requires: "pytest pytest-cov" + cibw-test-command: "pytest {project}/tests --durations=0" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: NUMPY_QUATERNION_VERSION: ${{ matrix.version }} - steps: - - name: Checkout numpy-quaternion v${{ env.NUMPY_QUATERNION_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: moble/quaternion - ref: v${{ env.NUMPY_QUATERNION_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy and scipy are both build/runtime requirements, and only our registry - # has them for riscv64; only-binary keeps a newer PyPI release from winning - # the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - CIBW_TEST_REQUIRES: pytest pytest-cov - CIBW_TEST_COMMAND: pytest {project}/tests --durations=0 + name: numpy-quaternion-${{ env.NUMPY_QUATERNION_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -93,16 +98,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: numpy-quaternion-${{ env.NUMPY_QUATERNION_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish numpy-quaternion ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-numpy-rms.yml b/.github/workflows/build-numpy-rms.yml index 3c7f6823e67b..3e639f5abd95 100644 --- a/.github/workflows/build-numpy-rms.yml +++ b/.github/workflows/build-numpy-rms.yml @@ -48,42 +48,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build numpy-rms ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "numpy-rms" + version: "${{ matrix.version }}" + repository: "nomonosound/numpy-rms" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a hard build/test requirement; only our registry has it for + # riscv64, and only-binary keeps a newer PyPI sdist-only release from + # winning the resolution and trying (and hanging) to build from source. + # setuptools_scm can't see the tag from this shallow checkout, so the + # version has to be pinned explicitly (gotcha 3). + cibw-environment-linux: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION_FOR_NUMPY_RMS=${{ matrix.version }}" + cibw-test-requires: "cffi pytest pytest-benchmark" + cibw-test-command: "pytest {project}/tests --durations=0" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: NUMPY_RMS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout numpy-rms ${{ env.NUMPY_RMS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: nomonosound/numpy-rms - ref: ${{ env.NUMPY_RMS_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a hard build/test requirement; only our registry has it for - # riscv64, and only-binary keeps a newer PyPI sdist-only release from - # winning the resolution and trying (and hanging) to build from source. - # setuptools_scm can't see the tag from this shallow checkout, so the - # version has to be pinned explicitly (gotcha 3). - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_NUMPY_RMS=${{ env.NUMPY_RMS_VERSION }} - CIBW_TEST_REQUIRES: cffi pytest pytest-benchmark - CIBW_TEST_COMMAND: pytest {project}/tests --durations=0 + name: numpy-rms-${{ env.NUMPY_RMS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -96,16 +99,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: numpy-rms-${{ env.NUMPY_RMS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish numpy-rms ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-nvtx.yml b/.github/workflows/build-nvtx.yml index a9228402cfb0..d456b6c562fe 100644 --- a/.github/workflows/build-nvtx.yml +++ b/.github/workflows/build-nvtx.yml @@ -65,7 +65,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # numpy, which upstream's test-command installs and uninstalls to # cover both paths, has riscv64 wheels only on our own registry. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ timeout-minutes: 120 publish: diff --git a/.github/workflows/build-obspy.yml b/.github/workflows/build-obspy.yml index 2ec521a238fd..1a9722ca9866 100644 --- a/.github/workflows/build-obspy.yml +++ b/.github/workflows/build-obspy.yml @@ -48,42 +48,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build obspy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "obspy" + version: "${{ matrix.version }}" + repository: "obspy/obspy" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Only our registry has riscv64 wheels for these; keep a newer PyPI sdist from winning. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,matplotlib,contourpy,kiwisolver,pillow,lxml,sqlalchemy,pyproj,shapely,cartopy,rpds-py" + # --no-report: do not upload results to upstream's tests.obspy.org report server. + # Network tests stay deselected (obspy-runtests' default). + cibw-test-command: "obspy-runtests --no-report" + cibw-test-extras: "tests" + # Optional deps outside the tests extra; without them 25 tests skip. + cibw-test-requires: "cartopy geographiclib pyshp jsonschema" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: OBSPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout obspy ${{ env.OBSPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: obspy/obspy - ref: ${{ env.OBSPY_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - name: Build and test wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Only our registry has riscv64 wheels for these; keep a newer PyPI sdist from winning. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,matplotlib,contourpy,kiwisolver,pillow,lxml,sqlalchemy,pyproj,shapely,cartopy,rpds-py - # --no-report: do not upload results to upstream's tests.obspy.org report server. - # Network tests stay deselected (obspy-runtests' default). - CIBW_TEST_COMMAND: obspy-runtests --no-report - CIBW_TEST_EXTRAS: tests - # Optional deps outside the tests extra; without them 25 tests skip. - CIBW_TEST_REQUIRES: cartopy geographiclib pyshp jsonschema + name: obspy-${{ env.OBSPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the licences and the compiled libraries run: | @@ -99,15 +104,9 @@ jobs: assert not any(".libs/" in n for n in names), [n for n in names if ".libs/" in n] EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: obspy-${{ env.OBSPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish obspy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-oneagent-sdk.yml b/.github/workflows/build-oneagent-sdk.yml index ce8763bc9588..4b3fae6cb37a 100644 --- a/.github/workflows/build-oneagent-sdk.yml +++ b/.github/workflows/build-oneagent-sdk.yml @@ -51,54 +51,55 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build oneagent-sdk ${{ matrix.version }} py2.py3-none-linux_riscv64 - runs-on: ubuntu-24.04-riscv + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "oneagent-sdk" + version: "${{ matrix.version }}" + repository: "Dynatrace/OneAgent-SDK-for-Python" + ref: '' + artifact-tag: "py2.py3-none-linux_riscv64" + pre-build: |- + base="${ONEAGENT_SDK_VERSION%.*.*}" + timestamp="${ONEAGENT_SDK_VERSION#"$base".}" + ref="v$base" + BUILD_TIMESTAMP="${timestamp/./-}" + export BUILD_TIMESTAMP + printf '%s\n' "BUILD_TIMESTAMP=$BUILD_TIMESTAMP" >> "$GITHUB_ENV" + + git fetch -q --no-tags origin "$ref" + git checkout -q --detach FETCH_HEAD + # setup.py forces a universal (py2.py3) tag, so one build serves + # every interpreter. + cibw-build: "cp312-manylinux_riscv64" + # DT_PYSDK_CSDK_PATH is intentionally left unset: it would point at + # Dynatrace's closed-source OneAgent SDK for C/C++, which has no + # riscv64 build. setup.py degrades gracefully without it, shipping + # a wheel with no native library; oneagent.initialize() then + # returns STATUS_STUB_LOAD_ERROR instead of crashing (its own + # documented no-op mode). + cibw-environment-linux: "BUILD_TIMESTAMP=$(python -c \"v='${{ matrix.version }}'; b='.'.join(v.split('.')[:-2]); print(v[len(b)+1:].replace('.', '-'))\")" + # There is no compiled extension to repair (no .so is bundled); + # auditwheel refuses a wheel with no ELF content at all. + cibw-repair-wheel-command: '' + cibw-test-requires: "pytest mock" + cibw-test-command: "python -c \"import oneagent; r = oneagent.initialize(); assert r.status == r.STATUS_STUB_LOAD_ERROR, r.status; oneagent.shutdown()\" && PYTHONPATH={project}/test-util-src:{project}/samples/basic-sdk-sample python -m pytest {project}/test -p testconfig -m \"not dependsnative\"" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: ONEAGENT_SDK_VERSION: ${{ matrix.version }} - steps: - # The wheel version carries Dynatrace's internal BUILD_TIMESTAMP suffix - # (setup.py's get_version_from_version_py()); the git tag is just the - # base version, so both are derived from matrix.version here. - - id: ver - run: | - base="${ONEAGENT_SDK_VERSION%.*.*}" - timestamp="${ONEAGENT_SDK_VERSION#"$base".}" - echo "ref=v$base" >> "$GITHUB_OUTPUT" - echo "timestamp=${timestamp/./-}" >> "$GITHUB_OUTPUT" - - - name: Checkout OneAgent-SDK-for-Python ${{ steps.ver.outputs.ref }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Dynatrace/OneAgent-SDK-for-Python - ref: ${{ steps.ver.outputs.ref }} - persist-credentials: false - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # setup.py forces a universal (py2.py3) tag, so one build serves - # every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # DT_PYSDK_CSDK_PATH is intentionally left unset: it would point at - # Dynatrace's closed-source OneAgent SDK for C/C++, which has no - # riscv64 build. setup.py degrades gracefully without it, shipping - # a wheel with no native library; oneagent.initialize() then - # returns STATUS_STUB_LOAD_ERROR instead of crashing (its own - # documented no-op mode). - CIBW_ENVIRONMENT: BUILD_TIMESTAMP=${{ steps.ver.outputs.timestamp }} - # There is no compiled extension to repair (no .so is bundled); - # auditwheel refuses a wheel with no ELF content at all. - CIBW_REPAIR_WHEEL_COMMAND: "" - CIBW_TEST_REQUIRES: pytest mock - CIBW_TEST_COMMAND: >- - python -c "import oneagent; r = oneagent.initialize(); assert r.status - == r.STATUS_STUB_LOAD_ERROR, r.status; oneagent.shutdown()" && - PYTHONPATH={project}/test-util-src:{project}/samples/basic-sdk-sample - python -m pytest {project}/test -p testconfig -m "not dependsnative" + name: oneagent-sdk-${{ env.ONEAGENT_SDK_VERSION }}-py2.py3-none-linux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -110,15 +111,9 @@ jobs: assert "oneagent/_impl/native/sdknulliface.py" in names, names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: oneagent-sdk-${{ env.ONEAGENT_SDK_VERSION }}-py2.py3-none-linux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish oneagent-sdk ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-onnxoptimizer.yml b/.github/workflows/build-onnxoptimizer.yml index 246486bbc2cc..49d037c26569 100644 --- a/.github/workflows/build-onnxoptimizer.yml +++ b/.github/workflows/build-onnxoptimizer.yml @@ -65,14 +65,7 @@ jobs: # CMakeLists.txt's cmake_minimum_required(3.22); upstream's # CIBW_BEFORE_ALL_LINUX pip-installs a newer one only for its older # manylinux_2_28 x86_64/aarch64 images. - cibw-environment: >- - CMAKE_ARGS=" - -DONNX_USE_PROTOBUF_SHARED_LIBS=OFF - -DProtobuf_USE_STATIC_LIBS=ON - -DONNX_USE_LITE_PROTO=ON - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - " - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "CMAKE_ARGS=\" -DONNX_USE_PROTOBUF_SHARED_LIBS=OFF -DProtobuf_USE_STATIC_LIBS=ON -DONNX_USE_LITE_PROTO=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \"" cibw-before-build-linux: pip install protobuf # Upstream's flake8p/mypy lint step and its onnxscript/torch/torchvision # installs cover optional test paths guarded by try/except in diff --git a/.github/workflows/build-onnxruntime-extensions.yml b/.github/workflows/build-onnxruntime-extensions.yml index d25c963b136a..62983545c81c 100644 --- a/.github/workflows/build-onnxruntime-extensions.yml +++ b/.github/workflows/build-onnxruntime-extensions.yml @@ -50,69 +50,73 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build onnxruntime-extensions ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - ONNXRUNTIME_EXTENSIONS_VERSION: ${{ matrix.version }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "onnxruntime-extensions" + version: "${{ matrix.version }}" + repository: "microsoft/onnxruntime-extensions" + ref: '' + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + export ONNXRUNTIME_EXTENSIONS_VERSION='${{ matrix.version }}' + case "${ONNXRUNTIME_EXTENSIONS_VERSION}" in + 0.15.2) ref=8599e104c73429bf9e267e215504e296607a2ae9 ;; + *) echo "no release commit known for ${ONNXRUNTIME_EXTENSIONS_VERSION}" >&2; exit 1 ;; + esac + BUILD_SOURCEBRANCHNAME="rel-${ONNXRUNTIME_EXTENSIONS_VERSION%.*}" + export BUILD_SOURCEBRANCHNAME + printf '%s\n' "BUILD_SOURCEBRANCHNAME=$BUILD_SOURCEBRANCHNAME" >> "$GITHUB_ENV" - steps: - # Upstream tags no 0.15.x release; each is cut from a rel-X.Y branch commit carrying the version in version.txt. - - id: ref - run: | - case "${ONNXRUNTIME_EXTENSIONS_VERSION}" in - 0.15.2) sha=8599e104c73429bf9e267e215504e296607a2ae9 ;; - *) echo "no release commit known for ${ONNXRUNTIME_EXTENSIONS_VERSION}" >&2; exit 1 ;; - esac - echo "sha=${sha}" >> "$GITHUB_OUTPUT" - echo "branch=rel-${ONNXRUNTIME_EXTENSIONS_VERSION%.*}" >> "$GITHUB_OUTPUT" + git fetch -q --no-tags origin "$ref" + git checkout -q --detach FETCH_HEAD - - name: Checkout onnxruntime-extensions ${{ env.ONNXRUNTIME_EXTENSIONS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: microsoft/onnxruntime-extensions - ref: ${{ steps.ref.outputs.sha }} - persist-credentials: false + cp ThirdPartyNotices.txt LICENSE.ThirdPartyNotices + curl -fsSL https://raw.githubusercontent.com/protocolbuffers/protobuf/v21.12/LICENSE -o LICENSE.protobuf + curl -fsSL https://raw.githubusercontent.com/pybind/pybind11/v2.12.0/LICENSE -o LICENSE.pybind11 + curl -fsSL https://raw.githubusercontent.com/davisking/dlib/v19.24.7/dlib/external/libpng/LICENSE -o LICENSE.libpng + curl -fsSL https://raw.githubusercontent.com/davisking/dlib/v19.24.7/dlib/external/libjpeg/README -o LICENSE.libjpeg + curl -fsSL https://raw.githubusercontent.com/davisking/dlib/v19.24.7/dlib/external/zlib/README -o LICENSE.zlib - # The extension statically links protobuf, pybind11 and dlib's libpng/libjpeg/zlib, which - # ThirdPartyNotices.txt does not cover, and the wheel ships neither. - - name: Add third-party licences - run: | - cp ThirdPartyNotices.txt LICENSE.ThirdPartyNotices - curl -fsSL https://raw.githubusercontent.com/protocolbuffers/protobuf/v21.12/LICENSE -o LICENSE.protobuf - curl -fsSL https://raw.githubusercontent.com/pybind/pybind11/v2.12.0/LICENSE -o LICENSE.pybind11 - curl -fsSL https://raw.githubusercontent.com/davisking/dlib/v19.24.7/dlib/external/libpng/LICENSE -o LICENSE.libpng - curl -fsSL https://raw.githubusercontent.com/davisking/dlib/v19.24.7/dlib/external/libjpeg/README -o LICENSE.libjpeg - curl -fsSL https://raw.githubusercontent.com/davisking/dlib/v19.24.7/dlib/external/zlib/README -o LICENSE.zlib + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # BUILD_SOURCEBRANCHNAME is what upstream's release pipeline sets; without it setup.py + # appends + to the version of a commit that is not a rel-* branch tip. + cibw-environment-linux: |- + ONNXRUNTIME_EXTENSIONS_VERSION=${{ matrix.version }} + OCOS_ENABLE_AZURE=0 BUILD_SOURCEBRANCHNAME=rel-${ONNXRUNTIME_EXTENSIONS_VERSION%.*} + cibw-test-requires: "pytest onnx onnxruntime" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,onnx,onnxruntime,ml_dtypes" + # The test modules that need nothing beyond onnx/onnxruntime; the rest import + # torch, transformers or tensorflow, which have no riscv64 wheels. + cibw-test-command: "cd {project}/test && python -m pytest test_audio_codec.py test_audio_signal.py test_blingfire_sentencebreaker.py test_masked_fill.py test_pyops.py test_segment_extraction.py test_string_concat.py test_string_ecma_regex.py test_string_length.py test_string_mapping.py test_string_ops.py test_string_to_vector.py test_vector_to_string.py --verbose" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 360 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + ONNXRUNTIME_EXTENSIONS_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # BUILD_SOURCEBRANCHNAME is what upstream's release pipeline sets; without it setup.py - # appends + to the version of a commit that is not a rel-* branch tip. - CIBW_ENVIRONMENT: >- - OCOS_ENABLE_AZURE=0 - BUILD_SOURCEBRANCHNAME=${{ steps.ref.outputs.branch }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest onnx onnxruntime - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,onnx,onnxruntime,ml_dtypes - # The test modules that need nothing beyond onnx/onnxruntime; the rest import - # torch, transformers or tensorflow, which have no riscv64 wheels. - CIBW_TEST_COMMAND: >- - cd {project}/test && python -m pytest - test_audio_codec.py test_audio_signal.py test_blingfire_sentencebreaker.py - test_masked_fill.py test_pyops.py test_segment_extraction.py - test_string_concat.py test_string_ecma_regex.py test_string_length.py - test_string_mapping.py test_string_ops.py test_string_to_vector.py - test_vector_to_string.py --verbose + name: onnxruntime-extensions-${{ env.ONNXRUNTIME_EXTENSIONS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -130,16 +134,9 @@ jobs: "LICENSE.zlib"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: onnxruntime-extensions-${{ env.ONNXRUNTIME_EXTENSIONS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish onnxruntime-extensions ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-opencc.yml b/.github/workflows/build-opencc.yml index 539638a51fd2..788949dcdf9e 100644 --- a/.github/workflows/build-opencc.yml +++ b/.github/workflows/build-opencc.yml @@ -63,7 +63,7 @@ jobs: # unset, which is unreliable in a shallow checkout; pin it explicitly # the same way upstream's own CI does (get_version_info() strips a # single leading "v"). - cibw-environment: VERSION=v${{ matrix.version }} + cibw-environment-linux: VERSION=v${{ matrix.version }} cibw-test-requires: pytest cibw-test-command: pytest {project}/python/tests timeout-minutes: 60 diff --git a/.github/workflows/build-openskill.yml b/.github/workflows/build-openskill.yml index 17f94364f56f..0f02adcaec3e 100644 --- a/.github/workflows/build-openskill.yml +++ b/.github/workflows/build-openskill.yml @@ -48,34 +48,41 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build openskill ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "openskill" + version: "${{ matrix.version }}" + repository: "vivekjoshy/openskill.py" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "USE_MYPYC=1" + cibw-test-requires: "pytest~=9.0" + cibw-test-command: "pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: OPENSKILL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout openskill.py ${{ env.OPENSKILL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: vivekjoshy/openskill.py - ref: v${{ env.OPENSKILL_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: USE_MYPYC=1 - CIBW_TEST_REQUIRES: pytest~=9.0 - CIBW_TEST_COMMAND: pytest {project}/tests + name: openskill-${{ env.OPENSKILL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel is mypyc-compiled, not the universal fallback run: | @@ -87,15 +94,9 @@ jobs: assert any(".dist-info/licenses/LICENSE" in n for n in names), names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: openskill-${{ env.OPENSKILL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish openskill ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-opentype-sanitizer.yml b/.github/workflows/build-opentype-sanitizer.yml index 645495a97566..e2ecad5be0bf 100644 --- a/.github/workflows/build-opentype-sanitizer.yml +++ b/.github/workflows/build-opentype-sanitizer.yml @@ -73,7 +73,7 @@ jobs: cibw-build-frontend: "pip" # setuptools 81 dropped mkpath()'s dry_run keyword, which setup.py's download command still passes (gotcha 256). cibw-before-all-linux: "echo 'setuptools<81' > /setuptools-constraint.txt" - cibw-environment: >- + cibw-environment-linux: >- PIP_CONSTRAINT=/setuptools-constraint.txt PIP_BUILD_CONSTRAINT=/setuptools-constraint.txt # One py2.py3-none wheel is built on cp312 and reused on every other interpreter. diff --git a/.github/workflows/build-oracledb.yml b/.github/workflows/build-oracledb.yml index 5377474264d0..1d8f2de4969c 100644 --- a/.github/workflows/build-oracledb.yml +++ b/.github/workflows/build-oracledb.yml @@ -51,46 +51,46 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build oracledb ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "oracledb" + version: "${{ matrix.version }}" + repository: "oracle/python-oracledb" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "true" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PYO_COMPILE_ARGS=-g0" + # Test phase only, so it can't starve the build backend (cython builds from sdist). + cibw-test-environment: "PIP_ONLY_BINARY=:all: PYO_TEST_MAIN_PASSWORD=unused" + cibw-test-requires: "pytest numpy pandas" + cibw-test-sources: "tests" + # Upstream's suite needs a live Oracle Database, which has no riscv64 build. + # These five modules pass without one; test_misc_1009 is the only test in + # them that opens a connection. + cibw-test-command: "python -m pytest -k \"not test_misc_1009\" tests/misc/test_1000_module.py tests/data_types/test_1200_types.py tests/misc/test_1300_connect_params.py tests/misc/test_1400_pool_params.py tests/misc/test_1500_tnsnames.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: ORACLEDB_VERSION: ${{ matrix.version }} - steps: - - name: Checkout python-oracledb v${{ env.ORACLEDB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: oracle/python-oracledb - ref: v${{ env.ORACLEDB_VERSION }} - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PYO_COMPILE_ARGS=-g0 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Test phase only, so it can't starve the build backend (cython builds from sdist). - CIBW_TEST_ENVIRONMENT: 'PIP_ONLY_BINARY=:all: PYO_TEST_MAIN_PASSWORD=unused' - CIBW_TEST_REQUIRES: pytest numpy pandas - CIBW_TEST_SOURCES: tests - # Upstream's suite needs a live Oracle Database, which has no riscv64 build. - # These five modules pass without one; test_misc_1009 is the only test in - # them that opens a connection. - CIBW_TEST_COMMAND: >- - python -m pytest -k "not test_misc_1009" - tests/misc/test_1000_module.py tests/data_types/test_1200_types.py - tests/misc/test_1300_connect_params.py tests/misc/test_1400_pool_params.py - tests/misc/test_1500_tnsnames.py + name: oracledb-${{ env.ORACLEDB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension modules made it into the wheel run: | @@ -107,15 +107,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: oracledb-${{ env.ORACLEDB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish oracledb ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-orange3.yml b/.github/workflows/build-orange3.yml index 0e551926d370..bcbfb2c261b8 100644 --- a/.github/workflows/build-orange3.yml +++ b/.github/workflows/build-orange3.yml @@ -60,9 +60,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # Only our registry has these for riscv64; only-binary keeps pip from # winning the resolution with a newer PyPI sdist and compiling it. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn,matplotlib,bottleneck,opentsne,xgboost,pyyaml + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn,matplotlib,bottleneck,opentsne,xgboost,pyyaml" # Orange.widgets and everything it pulls in (Orange.canvas, # Orange.misc's embedder helpers) need a Qt binding; PyQt5/PyQt6 are # both parked with no riscv64 build (docs/packages has neither), so diff --git a/.github/workflows/build-ormsgpack.yml b/.github/workflows/build-ormsgpack.yml index 788866aa31be..bc981881e0f0 100644 --- a/.github/workflows/build-ormsgpack.yml +++ b/.github/workflows/build-ormsgpack.yml @@ -50,48 +50,50 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build ormsgpack ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ormsgpack" + version: "${{ matrix.version }}" + repository: "ormsgpack/ormsgpack" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + # musllinux is out of reach: rustup publishes rust-std but no rustc/cargo + # host toolchain for riscv64gc-unknown-linux-musl. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # ormsgpack ships no [tool.cibuildwheel], so the Rust toolchain its maturin + # backend needs is installed in-container here, pinned to the stable + # release of upstream's rust-toolchain.toml (the nightly `unstable-simd` feature is gone). + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.98.0" + # numpy has no riscv64 wheel on public PyPI, so it resolves from our registry. + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-environment: "PIP_ONLY_BINARY=:all:" + cibw-test-requires: "msgpack pendulum pydantic pytest python-dateutil pytz tzdata numpy" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ORMSGPACK_VERSION: ${{ matrix.version }} - steps: - - name: Checkout ormsgpack ${{ env.ORMSGPACK_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ormsgpack/ormsgpack - ref: ${{ env.ORMSGPACK_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # musllinux is out of reach: rustup publishes rust-std but no rustc/cargo - # host toolchain for riscv64gc-unknown-linux-musl. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # ormsgpack ships no [tool.cibuildwheel], so the Rust toolchain its maturin - # backend needs is installed in-container here, pinned to the stable - # release of upstream's rust-toolchain.toml (the nightly `unstable-simd` feature is gone). - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | - sh -s -- -y --profile minimal --default-toolchain ${{ env.RUST_TOOLCHAIN }} - # numpy has no riscv64 wheel on public PyPI, so it resolves from our registry. - CIBW_ENVIRONMENT: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: 'PIP_ONLY_BINARY=:all:' - CIBW_TEST_REQUIRES: >- - msgpack pendulum pydantic pytest python-dateutil pytz tzdata numpy - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest tests + name: ormsgpack-${{ env.ORMSGPACK_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension module made it into the wheel run: | @@ -104,15 +106,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ormsgpack-${{ env.ORMSGPACK_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish ormsgpack ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-oxapy.yml b/.github/workflows/build-oxapy.yml index f5c5797ebf2b..fa33bdcf1f8c 100644 --- a/.github/workflows/build-oxapy.yml +++ b/.github/workflows/build-oxapy.yml @@ -62,9 +62,7 @@ jobs: cibw-before-all-linux: >- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal - cibw-environment-linux: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" cibw-test-environment: PIP_ONLY_BINARY=orjson cibw-test-requires: pytest requests cibw-test-sources: tests diff --git a/.github/workflows/build-oxbow.yml b/.github/workflows/build-oxbow.yml index 95fe3fa7aa39..893e4ef805e5 100644 --- a/.github/workflows/build-oxbow.yml +++ b/.github/workflows/build-oxbow.yml @@ -49,54 +49,59 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build oxbow ${{ matrix.version }} cp312-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "oxbow" + version: "${{ matrix.version }}" + repository: "abdenlab/oxbow" + ref: "py-oxbow@v${{ matrix.version }}" + artifact-tag: "cp312-abi3-manylinux_riscv64" + timeout-minutes: 120 + pre-build: |- + cp LICENSE-MIT LICENSE-APACHE py-oxbow/ + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "py-oxbow" + # abi3-py39 is fixed in py-oxbow/Cargo.toml, so one build serves + # every interpreter; built on cp312 (the oldest in our matrix) and + # re-tested on the newer ones via find_compatible_wheel. No + # cp314t: pyo3's abi3 feature predates PEP 703 free-threading. + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # oxbow ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,arro3-core,duckdb" + cibw-test-requires: "pytest pytest-manifest cloudpickle debugpy dask[dataframe] duckdb" + cibw-test-sources: "py-oxbow/tests fixtures" + # tests/data links to ../../fixtures; PYTHONPATH=.. serves `from tests.utils` as upstream's editable install does. + cibw-test-command: "cd py-oxbow/tests && PYTHONPATH=.. python -m pytest -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: OXBOW_VERSION: ${{ matrix.version }} - steps: - - name: Checkout oxbow py-oxbow@v${{ env.OXBOW_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: abdenlab/oxbow - ref: py-oxbow@v${{ env.OXBOW_VERSION }} - persist-credentials: false - - - name: Stage the licences beside oxbow's pyproject.toml - # maturin globs LICEN[CS]E* relative to the pyproject directory, which - # in this monorepo is py-oxbow/ -- so upstream's published wheels - # carry no licence text at all (gotcha 146). - run: cp LICENSE-MIT LICENSE-APACHE py-oxbow/ - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: py-oxbow - output-dir: wheelhouse/ - env: - # abi3-py39 is fixed in py-oxbow/Cargo.toml, so one build serves - # every interpreter; built on cp312 (the oldest in our matrix) and - # re-tested on the newer ones via find_compatible_wheel. No - # cp314t: pyo3's abi3 feature predates PEP 703 free-threading. - CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # oxbow ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,arro3-core,duckdb - CIBW_TEST_REQUIRES: pytest pytest-manifest cloudpickle debugpy dask[dataframe] duckdb - CIBW_TEST_SOURCES: py-oxbow/tests fixtures - # tests/data links to ../../fixtures; PYTHONPATH=.. serves `from tests.utils` as upstream's editable install does. - CIBW_TEST_COMMAND: cd py-oxbow/tests && PYTHONPATH=.. python -m pytest -v + name: oxbow-${{ env.OXBOW_VERSION }}-cp312-abi3-manylinux_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension and licences run: | @@ -112,15 +117,9 @@ jobs: assert {"LICENSE-MIT", "LICENSE-APACHE"} <= set(lic), lic EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: oxbow-${{ env.OXBOW_VERSION }}-cp312-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish oxbow ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-packingsolver.yml b/.github/workflows/build-packingsolver.yml index 83ed13240a70..b4dda555287f 100644 --- a/.github/workflows/build-packingsolver.yml +++ b/.github/workflows/build-packingsolver.yml @@ -62,91 +62,101 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build packingsolver ${{ matrix.version }} cp312-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "packingsolver" + version: "${{ matrix.version }}" + repository: "fontanf/packingsolver" + ref: "ce7b22fa9e4af4b552da1043fa57330a0939f823" + artifact-tag: "cp312-abi3-manylinux_riscv64" + timeout-minutes: 180 + pre-build: |- + export PACKINGSOLVER_VERSION='${{ matrix.version }}' + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/packingsolver/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + printf '__version__ = "%s"\n' "$PACKINGSOLVER_VERSION" > python/packingsolver/_version.py + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + set -euxo pipefail + curl -fsSL --retry 5 "https://raw.githubusercontent.com/wjakob/nanobind/v3.1.0/LICENSE" -o LICENSE.nanobind + curl -fsSL --retry 5 "https://raw.githubusercontent.com/ERGO-Code/HiGHS/v1.13.1/LICENSE.txt" -o LICENSE.highs + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/optimizationtools/7e29ad3e2dab11a44887fbcc9382188c5d0ead12/LICENSE" -o LICENSE.optimizationtools + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/shape/8e13e55a854260d4ef83a703d32da208d5f81c5e/LICENSE" -o LICENSE.shape + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/mathoptsolverscmake/358904e29889b129ec2f733866abd8d18f7a4978/LICENSE" -o LICENSE.mathoptsolverscmake + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/knapsacksolver/af3ed6894fe7235735ce98b69fc34dcebfbf6f23/LICENSE" -o LICENSE.knapsacksolver + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/multiplechoicesubsetsumsolver/68a23a3c66aeb935d31d0b67d2947f95b67628a8/LICENSE" -o LICENSE.multiplechoicesubsetsumsolver + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/subsetsumsolver/7c9576ac3f9ba7a34103f95943cef12b2d2945cb/LICENSE" -o LICENSE.subsetsumsolver + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/treesearchsolver/b7254420989dd804144d16b898f323f1d606dda4/LICENSE" -o LICENSE.treesearchsolver + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/localsearchsolver/237395a1fb7b5e1e586a1d3bcb22a38ec958616f/LICENSE" -o LICENSE.localsearchsolver + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/columngenerationsolver/091ee511c51352076974e62c85aed046f83e401a/LICENSE" -o LICENSE.columngenerationsolver + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-manylinux_riscv64" + # extern/CMakeLists.txt FetchContent_Declare(... GIT_REPOSITORY ...) + # clones nine sibling repos into the build tree as root inside the + # container; git refuses that ownership by default (gotcha 117). + cibw-before-build-linux: "git config --global --add safe.directory \"*\"" + # test_feasible[rectangle(guillotine)-BinPacking/Feasibility] packs one + # 6x6 item into a 10x10 bin and asserts `not output.is_proven_infeasible`. + # On riscv64 only, those four parametrizations come back proven + # infeasible (box/boxstacks/irregular and the Knapsack/ + # VariableSizedBinPacking objectives all pass). rectangle::optimize() + # relaxes to a 1D instance keyed on exact bin/item area (100 and 36 - + # integers, nothing rounds there) and hands it to the full + # onedimensional::optimize() exact solve (a FetchContent-built HiGHS) + # under "the relaxation is infeasible => so is the real instance"; a + # floating-point tolerance misfire inside that vendored solve, crossing + # a primal-feasibility epsilon differently under riscv64's rv64gc + # FMA-by-default baseline, is architecture divergence, not a wrong + # build (CLAUDE.md gotcha 699, extending gotcha 504's class from a + # discrete count to a boolean). Deselect the four cases via `-k`, not + # `--deselect` (gotcha 14/283's path-mismatch trap isn't limited to a + # staged `{package}` copy). `BinPacking` alone would also match + # `VariableSizedBinPacking`/`BinPackingWithLeftovers`, which still + # pass - exclude them explicitly rather than widen the deselect list. + cibw-test-command: "pytest {project}/python/tests -k \"not (test_feasible and rectangle and (Feasibility or (BinPacking and not Variable and not Leftovers)))\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: PACKINGSOLVER_VERSION: ${{ matrix.version }} - steps: - - name: Checkout packingsolver ${{ env.PACKINGSOLVER_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: fontanf/packingsolver - ref: ${{ env.PACKINGSOLVER_REF }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Patch packingsolver source - run: git apply python-wheels/patches/packingsolver/${{ env.PACKINGSOLVER_VERSION }}/00*.patch - - # The pinned commit's _version.py holds the placeholder "0.1.0"; - # upstream's python.yml overwrites it with the release version before - # building (scikit-build-core reads the version from that file via the - # regex provider). Without this the wheel ships as 0.1.0. - - name: Set packingsolver version - run: printf '__version__ = "%s"\n' "$PACKINGSOLVER_VERSION" > python/packingsolver/_version.py - - # extern/CMakeLists.txt FetchContent-pulls nanobind, HiGHS and eight of - # the author's own solver libraries at build time and statically links - # all of them into the one extension module; none of their licences - # ship in upstream's own wheel. Stage them at the root for the LICENSE* - # glob the patch above adds. - - name: Stage vendored dependency licences - run: | - set -euxo pipefail - curl -fsSL --retry 5 "https://raw.githubusercontent.com/wjakob/nanobind/v3.1.0/LICENSE" -o LICENSE.nanobind - curl -fsSL --retry 5 "https://raw.githubusercontent.com/ERGO-Code/HiGHS/v1.13.1/LICENSE.txt" -o LICENSE.highs - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/optimizationtools/7e29ad3e2dab11a44887fbcc9382188c5d0ead12/LICENSE" -o LICENSE.optimizationtools - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/shape/8e13e55a854260d4ef83a703d32da208d5f81c5e/LICENSE" -o LICENSE.shape - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/mathoptsolverscmake/358904e29889b129ec2f733866abd8d18f7a4978/LICENSE" -o LICENSE.mathoptsolverscmake - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/knapsacksolver/af3ed6894fe7235735ce98b69fc34dcebfbf6f23/LICENSE" -o LICENSE.knapsacksolver - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/multiplechoicesubsetsumsolver/68a23a3c66aeb935d31d0b67d2947f95b67628a8/LICENSE" -o LICENSE.multiplechoicesubsetsumsolver - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/subsetsumsolver/7c9576ac3f9ba7a34103f95943cef12b2d2945cb/LICENSE" -o LICENSE.subsetsumsolver - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/treesearchsolver/b7254420989dd804144d16b898f323f1d606dda4/LICENSE" -o LICENSE.treesearchsolver - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/localsearchsolver/237395a1fb7b5e1e586a1d3bcb22a38ec958616f/LICENSE" -o LICENSE.localsearchsolver - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fontanf/columngenerationsolver/091ee511c51352076974e62c85aed046f83e401a/LICENSE" -o LICENSE.columngenerationsolver - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: cp312-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # extern/CMakeLists.txt FetchContent_Declare(... GIT_REPOSITORY ...) - # clones nine sibling repos into the build tree as root inside the - # container; git refuses that ownership by default (gotcha 117). - CIBW_BEFORE_BUILD_LINUX: git config --global --add safe.directory "*" - # test_feasible[rectangle(guillotine)-BinPacking/Feasibility] packs one - # 6x6 item into a 10x10 bin and asserts `not output.is_proven_infeasible`. - # On riscv64 only, those four parametrizations come back proven - # infeasible (box/boxstacks/irregular and the Knapsack/ - # VariableSizedBinPacking objectives all pass). rectangle::optimize() - # relaxes to a 1D instance keyed on exact bin/item area (100 and 36 - - # integers, nothing rounds there) and hands it to the full - # onedimensional::optimize() exact solve (a FetchContent-built HiGHS) - # under "the relaxation is infeasible => so is the real instance"; a - # floating-point tolerance misfire inside that vendored solve, crossing - # a primal-feasibility epsilon differently under riscv64's rv64gc - # FMA-by-default baseline, is architecture divergence, not a wrong - # build (CLAUDE.md gotcha 699, extending gotcha 504's class from a - # discrete count to a boolean). Deselect the four cases via `-k`, not - # `--deselect` (gotcha 14/283's path-mismatch trap isn't limited to a - # staged `{package}` copy). `BinPacking` alone would also match - # `VariableSizedBinPacking`/`BinPackingWithLeftovers`, which still - # pass - exclude them explicitly rather than widen the deselect list. - CIBW_TEST_COMMAND: >- - pytest {project}/python/tests - -k "not (test_feasible and rectangle and (Feasibility or - (BinPacking and not Variable and not Leftovers)))" + name: packingsolver-${{ env.PACKINGSOLVER_VERSION }}-cp312-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -166,15 +176,9 @@ jobs: assert licences == expected, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: packingsolver-${{ env.PACKINGSOLVER_VERSION }}-cp312-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish packingsolver ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pcapy-ng.yml b/.github/workflows/build-pcapy-ng.yml index 8a7fc098bc4b..9e0f403bdc7f 100644 --- a/.github/workflows/build-pcapy-ng.yml +++ b/.github/workflows/build-pcapy-ng.yml @@ -50,118 +50,125 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pcapy-ng ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pcapy-ng" + version: "${{ matrix.version }}" + repository: "stamparm/pcapy-ng" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of every shared library + # auditwheel vendors out of the build image alongside libpcap. + # setuptools' default LICENSE* glob copies them into the wheel. + set -euo pipefail + + project="${1:?usage: collect-licenses.sh }" + + if command -v apk > /dev/null; then + # Alpine's libpcap links nothing but musl and ships no licence file, + # so take it from the matching upstream release tag. + mapfile -t deps < <(ldd /usr/lib/libpcap.so | tr ' ' '\n' | grep '^/' | grep -v '/ld-musl-' || true) + [ -z "${deps[0]:-}" ] || { echo "unexpected libpcap dependencies: ${deps[*]}" >&2; exit 1; } + version=$(basename "$(readlink -f /usr/lib/libpcap.so)" | sed 's/^libpcap\.so\.//') + curl -fsSL --retry 5 -o "$project/LICENSE.libpcap.LICENSE" \ + "https://raw.githubusercontent.com/the-tcpdump-group/libpcap/libpcap-${version}/LICENSE" + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + exit 0 + fi + + # ldd is transitive, so libpcap alone covers its whole closure; + # ldd does not list the root itself, so resolve that too. + mapfile -t libs < <( + { + ldd /usr/lib64/libpcap.so | tr ' ' '\n' | grep '^/' + readlink -f /usr/lib64/libpcap.so + } | sort -u + ) + + # `rpm -qf` reports unowned files on stdout, so keep only bare package names. + # glibc and the gcc runtime are on auditwheel's manylinux allowlist and + # are never vendored into the wheel. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc)$' + ) + + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + + # Some subpackages leave the licence to a sibling of the same source RPM. + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi + + # Or to the uninstalled main package named after it (libibverbs -> rdma-core). + if [ -z "${files[0]:-}" ]; then + base=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg" | sed -E 's/-[^-]+-[^-]+\.src\.rpm$//') + if [ "$base" != "$pkg" ]; then + dnf -y --disablerepo=extras install "$base" >/dev/null + mapfile -t files < <(rpm -q --licensefiles "$base" 2>/dev/null || true) + fi + fi + + # Others mark it %doc rather than %license, and the image installs no docs. + if [ -z "${files[0]:-}" ]; then + dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi + + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done + + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-before-all-linux: "(yum install -y libpcap-devel || dnf install -y libpcap-devel || true) && (apk add --no-cache libpcap-dev || true) && bash {project}/collect-licenses.sh {project}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PCAPY_NG_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pcapy-ng ${{ env.PCAPY_NG_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: stamparm/pcapy-ng - ref: ${{ env.PCAPY_NG_VERSION }} - persist-credentials: false - - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of every shared library - # auditwheel vendors out of the build image alongside libpcap. - # setuptools' default LICENSE* glob copies them into the wheel. - set -euo pipefail - - project="${1:?usage: collect-licenses.sh }" - - if command -v apk > /dev/null; then - # Alpine's libpcap links nothing but musl and ships no licence file, - # so take it from the matching upstream release tag. - mapfile -t deps < <(ldd /usr/lib/libpcap.so | tr ' ' '\n' | grep '^/' | grep -v '/ld-musl-' || true) - [ -z "${deps[0]:-}" ] || { echo "unexpected libpcap dependencies: ${deps[*]}" >&2; exit 1; } - version=$(basename "$(readlink -f /usr/lib/libpcap.so)" | sed 's/^libpcap\.so\.//') - curl -fsSL --retry 5 -o "$project/LICENSE.libpcap.LICENSE" \ - "https://raw.githubusercontent.com/the-tcpdump-group/libpcap/libpcap-${version}/LICENSE" - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - exit 0 - fi - - # ldd is transitive, so libpcap alone covers its whole closure; - # ldd does not list the root itself, so resolve that too. - mapfile -t libs < <( - { - ldd /usr/lib64/libpcap.so | tr ' ' '\n' | grep '^/' - readlink -f /usr/lib64/libpcap.so - } | sort -u - ) - - # `rpm -qf` reports unowned files on stdout, so keep only bare package names. - # glibc and the gcc runtime are on auditwheel's manylinux allowlist and - # are never vendored into the wheel. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc)$' - ) - - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - - # Some subpackages leave the licence to a sibling of the same source RPM. - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi - - # Or to the uninstalled main package named after it (libibverbs -> rdma-core). - if [ -z "${files[0]:-}" ]; then - base=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg" | sed -E 's/-[^-]+-[^-]+\.src\.rpm$//') - if [ "$base" != "$pkg" ]; then - dnf -y --disablerepo=extras install "$base" >/dev/null - mapfile -t files < <(rpm -q --licensefiles "$base" 2>/dev/null || true) - fi - fi - - # Others mark it %doc rather than %license, and the image installs no docs. - if [ -z "${files[0]:-}" ]; then - dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi - - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done - - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - (yum install -y libpcap-devel || dnf install -y libpcap-devel || true) && - (apk add --no-cache libpcap-dev || true) && - bash {project}/collect-licenses.sh {project} + name: pcapy-ng-${{ env.PCAPY_NG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the extension and every vendored library's licence run: | @@ -190,12 +197,6 @@ jobs: assert vendored <= have_pkgs, vendored - have_pkgs EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pcapy-ng-${{ env.PCAPY_NG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -231,7 +232,7 @@ jobs: publish: name: Publish pcapy-ng ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pedalboard.yml b/.github/workflows/build-pedalboard.yml index d3fd715a588c..30616360cbe3 100644 --- a/.github/workflows/build-pedalboard.yml +++ b/.github/workflows/build-pedalboard.yml @@ -50,136 +50,146 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pedalboard ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 420 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - PEDALBOARD_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout pedalboard v${{ env.PEDALBOARD_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: spotify/pedalboard - ref: v${{ env.PEDALBOARD_VERSION }} - submodules: recursive - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pedalboard" + version: "${{ matrix.version }}" + repository: "spotify/pedalboard" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 420 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + git apply python-wheels/patches/pedalboard/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Patch pedalboard source - run: git apply python-wheels/patches/pedalboard/${{ env.PEDALBOARD_VERSION }}/*.patch + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of everything that ends up inside + # the wheel: the libraries pedalboard compiles into pedalboard_native, and + # every shared library auditwheel vendors out of the build image. + # scikit-build-core's default LICEN[CS]E* glob copies them into the wheel. + set -euo pipefail - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of everything that ends up inside - # the wheel: the libraries pedalboard compiles into pedalboard_native, and - # every shared library auditwheel vendors out of the build image. - # scikit-build-core's default LICEN[CS]E* glob copies them into the wheel. - set -euo pipefail + project="${1:?usage: collect-licenses.sh }" + cd "$project" - project="${1:?usage: collect-licenses.sh }" - cd "$project" + cp JUCE/LICENSE.md LICENSE.JUCE + cp vendors/fftw3/COPYING LICENSE.fftw3 + cp vendors/lame/COPYING LICENSE.lame + cp vendors/libgsm/COPYRIGHT LICENSE.libgsm + cp vendors/pybind11/LICENSE LICENSE.pybind11 + cp vendors/rubberband/COPYING LICENSE.rubberband - cp JUCE/LICENSE.md LICENSE.JUCE - cp vendors/fftw3/COPYING LICENSE.fftw3 - cp vendors/lame/COPYING LICENSE.lame - cp vendors/libgsm/COPYRIGHT LICENSE.libgsm - cp vendors/pybind11/LICENSE LICENSE.pybind11 - cp vendors/rubberband/COPYING LICENSE.rubberband + roots=(/usr/lib64/libasound.so /usr/lib64/libfreetype.so) - roots=(/usr/lib64/libasound.so /usr/lib64/libfreetype.so) + # ldd is transitive, so the two libraries pedalboard links cover the whole + # closure; ldd does not list the roots themselves, so resolve those too. + mapfile -t libs < <( + { + ldd "${roots[@]}" | tr ' ' '\n' | grep '^/' + readlink -f "${roots[@]}" + } | sort -u + ) - # ldd is transitive, so the two libraries pedalboard links cover the whole - # closure; ldd does not list the roots themselves, so resolve those too. - mapfile -t libs < <( - { - ldd "${roots[@]}" | tr ' ' '\n' | grep '^/' - readlink -f "${roots[@]}" - } | sort -u - ) + # `rpm -qf` reports unowned files on stdout, so keep only bare package names. + # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist and + # are never vendored into the wheel. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' + ) - # `rpm -qf` reports unowned files on stdout, so keep only bare package names. - # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist and - # are never vendored into the wheel. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' - ) + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + # Some subpackages leave the licence to a sibling of the same source RPM. + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi - # Some subpackages leave the licence to a sibling of the same source RPM. - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi + # Others mark it %doc rather than %license, and the image installs no docs. + if [ -z "${files[0]:-}" ]; then + dnf -y reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi - # Others mark it %doc rather than %license, and the image installs no docs. - if [ -z "${files[0]:-}" ]; then - dnf -y reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done + ls -1 LICENSE.* + COLLECT_EOF - ls -1 LICENSE.* - COLLECT_EOF + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-build-linux: "bash {project}/collect-licenses.sh {project}" + # Upstream's repair command pip-installs auditwheel-symbols, a Rust tool + # with no riscv64 wheel, before every repair. + cibw-repair-wheel-command-linux: "auditwheel repair -w {dest_dir} {wheel}" + # Upstream skips its own manylinux tests (`test-skip` in pyproject.toml) + # because its build image predates the suite's glibc requirement. + cibw-test-skip: '' + cibw-test-requires: "pytest pytest-mock numpy tqdm psutil mido mutagen" + cibw-test-sources: "tests" + # test_type_hints needs mypy and pyright, neither of which runs on riscv64. + # The other two modules load tests/plugins/effect/Linux/CHOWTapeModel.vst3 + # while being imported, and that VST3 bundle ships an x86_64 binary only. + # test_linux_wheel_cpu_compatibility (new in 0.9.26) tests upstream's x86_64 + # AVX-boundary CI harness under scripts/, which CIBW_TEST_SOURCES doesn't stage. + # The deselected test asserts threaded reads beat serial ones, a timing + # race that also fails on macOS against upstream's own wheel. + cibw-test-command: "python -m pytest tests --ignore=tests/test_type_hints.py --ignore=tests/test_external_plugins.py --ignore=tests/test_memory_leaks.py --ignore=tests/test_linux_wheel_cpu_compatibility.py -k \"not test_read_from_bytes_io_memoryview_without_gil\"" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 420 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + PEDALBOARD_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_BUILD_LINUX: bash {project}/collect-licenses.sh {project} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream's repair command pip-installs auditwheel-symbols, a Rust tool - # with no riscv64 wheel, before every repair. - CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair -w {dest_dir} {wheel} - # Upstream skips its own manylinux tests (`test-skip` in pyproject.toml) - # because its build image predates the suite's glibc requirement. - CIBW_TEST_SKIP: '' - CIBW_TEST_REQUIRES: pytest pytest-mock numpy tqdm psutil mido mutagen - CIBW_TEST_SOURCES: tests - # test_type_hints needs mypy and pyright, neither of which runs on riscv64. - # The other two modules load tests/plugins/effect/Linux/CHOWTapeModel.vst3 - # while being imported, and that VST3 bundle ships an x86_64 binary only. - # test_linux_wheel_cpu_compatibility (new in 0.9.26) tests upstream's x86_64 - # AVX-boundary CI harness under scripts/, which CIBW_TEST_SOURCES doesn't stage. - # The deselected test asserts threaded reads beat serial ones, a timing - # race that also fails on macOS against upstream's own wheel. - CIBW_TEST_COMMAND: >- - python -m pytest tests --ignore=tests/test_type_hints.py - --ignore=tests/test_external_plugins.py --ignore=tests/test_memory_leaks.py - --ignore=tests/test_linux_wheel_cpu_compatibility.py - -k "not test_read_from_bytes_io_memoryview_without_gil" + name: pedalboard-${{ env.PEDALBOARD_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the extension and the bundled licences run: | @@ -196,12 +206,6 @@ jobs: assert expected <= set(lic) - {""}, sorted(expected - set(lic)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pedalboard-${{ env.PEDALBOARD_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -237,7 +241,7 @@ jobs: publish: name: Publish pedalboard ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-persistence.yml b/.github/workflows/build-persistence.yml index 234f669448b0..ae9833409298 100644 --- a/.github/workflows/build-persistence.yml +++ b/.github/workflows/build-persistence.yml @@ -59,7 +59,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # ExtensionClass and persistent, Persistence's two deps, have no # riscv64 wheel on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test cibw-test-environment: ZOPE_INTERFACE_STRICT_IRO=1 # Upstream's two test steps: with and without the C extension. diff --git a/.github/workflows/build-persistent.yml b/.github/workflows/build-persistent.yml index 947ac814070f..af064a45d09d 100644 --- a/.github/workflows/build-persistent.yml +++ b/.github/workflows/build-persistent.yml @@ -59,7 +59,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # cffi and zope.interface, needed to build and to import the extension, # have no riscv64 wheel on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test cibw-test-environment: ZOPE_INTERFACE_STRICT_IRO=1 # Upstream's two test steps (with and without the C extensions). diff --git a/.github/workflows/build-pglast.yml b/.github/workflows/build-pglast.yml index 35691a363b5c..1542970ef510 100644 --- a/.github/workflows/build-pglast.yml +++ b/.github/workflows/build-pglast.yml @@ -49,40 +49,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pglast ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pglast" + version: "${{ matrix.version }}" + repository: "lelit/pglast" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "true" + pre-build: |- + cp libpg_query/LICENSE LICENSE.libpg_query + cp libpg_query/src/postgres/COPYRIGHT LICENSE.postgres + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "coverage pycparser pytest pytest-cov" + cibw-test-command: "py.test {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PGLAST_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pglast ${{ env.PGLAST_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: lelit/pglast - ref: v${{ env.PGLAST_VERSION }} - submodules: true - persist-credentials: false - - # The extension statically links libpg_query, which bundles the PostgreSQL - # parser; upstream ships neither licence in the wheel. - - name: Stage the licences of the statically linked sources - run: | - cp libpg_query/LICENSE LICENSE.libpg_query - cp libpg_query/src/postgres/COPYRIGHT LICENSE.postgres - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: coverage pycparser pytest pytest-cov - CIBW_TEST_COMMAND: py.test {project}/tests + name: pglast-${{ env.PGLAST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and the licences made it into the wheel run: | @@ -98,15 +106,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pglast-${{ env.PGLAST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pglast ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pgparse.yml b/.github/workflows/build-pgparse.yml index dbae4ed73b78..1d4ac2f417b6 100644 --- a/.github/workflows/build-pgparse.yml +++ b/.github/workflows/build-pgparse.yml @@ -53,54 +53,63 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build pgparse ${{ matrix.version }} cp311-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pgparse" + version: "${{ matrix.version }}" + repository: "gmr/pgparse" + ref: "${{ matrix.version }}" + artifact-tag: "cp311-abi3-manylinux_riscv64" + timeout-minutes: 90 + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pgparse/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cp libpg_query/LICENSE LICENSE.libpg_query + cp libpg_query/src/postgres/COPYRIGHT LICENSE.postgres + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # Py_LIMITED_API is hardcoded to 0x030B0000 in pyproject.toml, so the + # wheel must be built on cp311, its floor interpreter (gotcha 96); the + # later entries build nothing, they re-test the one wheel. + cibw-build: "cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + cibw-before-all: "make -C libpg_query" + cibw-config-settings: "--build-option=--py-limited-api=cp311" + cibw-test-requires: "pytest" + cibw-test-command: "python -m pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: PGPARSE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pgparse ${{ env.PGPARSE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: gmr/pgparse - ref: ${{ env.PGPARSE_VERSION }} - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pgparse source - run: git apply python-wheels/patches/pgparse/${{ env.PGPARSE_VERSION }}/00*.patch - - # The extension statically links libpg_query, which bundles the PostgreSQL - # parser; upstream ships neither licence in the wheel. - - name: Stage the licences of the statically linked sources - run: | - cp libpg_query/LICENSE LICENSE.libpg_query - cp libpg_query/src/postgres/COPYRIGHT LICENSE.postgres - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - # Py_LIMITED_API is hardcoded to 0x030B0000 in pyproject.toml, so the - # wheel must be built on cp311, its floor interpreter (gotcha 96); the - # later entries build nothing, they re-test the one wheel. - CIBW_BUILD: >- - cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL: make -C libpg_query - CIBW_CONFIG_SETTINGS: --build-option=--py-limited-api=cp311 - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: python -m pytest {project}/tests + name: pgparse-${{ env.PGPARSE_VERSION }}-cp311-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension and the licences made it into the wheel run: | @@ -115,15 +124,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pgparse-${{ env.PGPARSE_VERSION }}-cp311-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pgparse ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pgserver.yml b/.github/workflows/build-pgserver.yml index 996dc530c69e..343cfabca1ae 100644 --- a/.github/workflows/build-pgserver.yml +++ b/.github/workflows/build-pgserver.yml @@ -49,6 +49,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pgserver ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + # The test extra's psycopg2-binary publishes no free-threaded wheel for any platform (gotcha 149). + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pgserver" + version: "${{ matrix.version }}" + repository: "orm011/pgserver" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pgserver/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # initdb/postgres are non-PIE; keep their base above vm.mmap_min_addr once auditwheel's patchelf prepends a segment (gotcha 595). + cibw-environment-linux: "LDFLAGS=\"-Wl,-Ttext-segment=0x200000\"" + cibw-test-skip: "${{ case(endsWith(matrix.python, 't'), '*', '') }}" + # sqlalchemy-utils 0.42.1 (latest) still imports the removed + # sqlalchemy.orm.attributes.ScalarAttributeImpl, so pgserver's unpinned + # `sqlalchemy>=2` test extra resolves to a broken combo now that sqlalchemy 2.1 + # is out; cap it to the last 2.0.x release so the test extra and this pin resolve + # together (gotcha 55/215 pattern for a test-only dependency drift). + cibw-test-requires: "sqlalchemy<2.1" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: @@ -56,45 +97,14 @@ jobs: matrix: # The test extra's psycopg2-binary publishes no free-threaded wheel for any platform (gotcha 149). include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PGSERVER_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pgserver v${{ env.PGSERVER_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: orm011/pgserver - ref: v${{ env.PGSERVER_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pgserver source - run: git apply python-wheels/patches/pgserver/${{ env.PGSERVER_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # initdb/postgres are non-PIE; keep their base above vm.mmap_min_addr once auditwheel's patchelf prepends a segment (gotcha 595). - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - LDFLAGS="-Wl,-Ttext-segment=0x200000" - CIBW_TEST_SKIP: ${{ case(endsWith(matrix.python, 't'), '*', '') }} - # sqlalchemy-utils 0.42.1 (latest) still imports the removed - # sqlalchemy.orm.attributes.ScalarAttributeImpl, so pgserver's unpinned - # `sqlalchemy>=2` test extra resolves to a broken combo now that sqlalchemy 2.1 - # is out; cap it to the last 2.0.x release so the test extra and this pin resolve - # together (gotcha 55/215 pattern for a test-only dependency drift). - CIBW_TEST_REQUIRES: "sqlalchemy<2.1" + name: pgserver-${{ env.PGSERVER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled postgres server, pgvector and their licences run: | @@ -114,15 +124,9 @@ jobs: "wheel-check/pgserver/pginstall/bin/$exe" --version done - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pgserver-${{ env.PGSERVER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pgserver ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-phik.yml b/.github/workflows/build-phik.yml index f994a9be534a..101096d39bfc 100644 --- a/.github/workflows/build-phik.yml +++ b/.github/workflows/build-phik.yml @@ -59,7 +59,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # scikit-build-core fetches cmake/ninja from PyPI when missing on PATH, # and pybind11's headers need pip to resolve. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test # numpy/scipy/pandas/matplotlib/pillow have riscv64 wheels only on our registry, # which lags Pillow's public-PyPI releases; unpinned, pip resolves the newest diff --git a/.github/workflows/build-phono3py.yml b/.github/workflows/build-phono3py.yml index 2b2cc48d8c5b..e50c444d3092 100644 --- a/.github/workflows/build-phono3py.yml +++ b/.github/workflows/build-phono3py.yml @@ -53,57 +53,60 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build phono3py ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "phono3py" + version: "${{ matrix.version }}" + repository: "phonopy/phono3py" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply -v python-wheels/patches/phono3py/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # phonors (a runtime dependency of phonopy) has no riscv64 wheel for every + # interpreter; its sdist needs cargo, as upstream's test job also builds it. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal" + # The patched tree is dirty, which setuptools_scm would turn into a + # post-release version (gotcha 31); pin it instead. + cibw-environment-linux: "PATH=$HOME/.cargo/bin:$PATH SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PHONO3PY=${{ matrix.version }} PIP_ONLY_BINARY=numpy,scipy,h5py,matplotlib,contourpy,kiwisolver,pillow,spglib,pyyaml,phonopy" + cibw-test-requires: "pytest" + cibw-test-sources: "test" + cibw-test-command: "python -m pytest -v test" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PHONO3PY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout phono3py v${{ env.PHONO3PY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: phonopy/phono3py - ref: v${{ env.PHONO3PY_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # The riscv64 runners' libgomp faults on schedule(guided) (gotcha 166): the tests - # segfaulted inside imag_self_energy_with_g()'s guided loop. Move every guided - # loop under c/ to schedule(static). - - name: Patch phono3py - run: git apply -v python-wheels/patches/phono3py/${{ env.PHONO3PY_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # phonors (a runtime dependency of phonopy) has no riscv64 wheel for every - # interpreter; its sdist needs cargo, as upstream's test job also builds it. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal - # The patched tree is dirty, which setuptools_scm would turn into a - # post-release version (gotcha 31); pin it instead. - CIBW_ENVIRONMENT_LINUX: >- - PATH=$HOME/.cargo/bin:$PATH - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PHONO3PY=${{ env.PHONO3PY_VERSION }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,h5py,matplotlib,contourpy,kiwisolver,pillow,spglib,pyyaml,phonopy - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: test - CIBW_TEST_COMMAND: python -m pytest -v test + name: phono3py-${{ env.PHONO3PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -116,15 +119,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: phono3py-${{ env.PHONO3PY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish phono3py ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-phonopy.yml b/.github/workflows/build-phonopy.yml index 560521f6ae23..9df05c561ba2 100644 --- a/.github/workflows/build-phonopy.yml +++ b/.github/workflows/build-phonopy.yml @@ -51,56 +51,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build phonopy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "phonopy" + version: "${{ matrix.version }}" + repository: "phonopy/phonopy" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # phonors (a runtime dependency) has no riscv64 wheel; its sdist needs cargo, + # as upstream's test job also builds it from source. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal" + cibw-environment-linux: "PATH=$HOME/.cargo/bin:$PATH PIP_ONLY_BINARY=numpy,scipy,h5py,matplotlib,contourpy,kiwisolver,pillow,spglib,pyyaml" + # phonopy 4.4.0 declares an unbounded `phonors>=0.3.0` but calls + # `phonors.grid_index_from_address`, which phonors 0.5.0 replaced with + # `grid_indices_from_addresses` (phonopy 4.7.0 moved to the new API and + # raised its floor to `phonors>=0.5.0`). Install the last compatible phonors + # before the wheel so its unbounded requirement is already satisfied. + cibw-before-test: "pip install \"phonors>=0.3.0,<0.5\"" + cibw-test-requires: "pytest ase" + cibw-test-sources: "test" + # 4.8.3's C-vs-Rust thermal-properties test compares at rtol=1e-10, but the C + # path's zero-point energy counts every mode with f > 0 while the Rust path + # counts only f > cutoff (1e-5 THz). The Gamma acoustic modes are eigenvalue + # noise (~1e-7 THz) that lands between the two, so the gap depends on that + # noise: 5.6e-11 with upstream's x86_64 wheel, 1.2e-10 on riscv64. + cibw-test-command: "python -m pytest test --deselect test/phonon/test_thermal_properties.py::test_thermal_properties_at_low_temperature_c_matches_python" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PHONOPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout phonopy v${{ env.PHONOPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: phonopy/phonopy - ref: v${{ env.PHONOPY_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # phonors (a runtime dependency) has no riscv64 wheel; its sdist needs cargo, - # as upstream's test job also builds it from source. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal - CIBW_ENVIRONMENT_LINUX: >- - PATH=$HOME/.cargo/bin:$PATH - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,h5py,matplotlib,contourpy,kiwisolver,pillow,spglib,pyyaml - # phonopy 4.4.0 declares an unbounded `phonors>=0.3.0` but calls - # `phonors.grid_index_from_address`, which phonors 0.5.0 replaced with - # `grid_indices_from_addresses` (phonopy 4.7.0 moved to the new API and - # raised its floor to `phonors>=0.5.0`). Install the last compatible phonors - # before the wheel so its unbounded requirement is already satisfied. - CIBW_BEFORE_TEST: pip install "phonors>=0.3.0,<0.5" - CIBW_TEST_REQUIRES: pytest ase - CIBW_TEST_SOURCES: test - # 4.8.3's C-vs-Rust thermal-properties test compares at rtol=1e-10, but the C - # path's zero-point energy counts every mode with f > 0 while the Rust path - # counts only f > cutoff (1e-5 THz). The Gamma acoustic modes are eigenvalue - # noise (~1e-7 THz) that lands between the two, so the gap depends on that - # noise: 5.6e-11 with upstream's x86_64 wheel, 1.2e-10 on riscv64. - CIBW_TEST_COMMAND: >- - python -m pytest test - --deselect test/phonon/test_thermal_properties.py::test_thermal_properties_at_low_temperature_c_matches_python + name: phonopy-${{ env.PHONOPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -113,15 +114,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: phonopy-${{ env.PHONOPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish phonopy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-photutils.yml b/.github/workflows/build-photutils.yml index 29757547db65..f905af4c4378 100644 --- a/.github/workflows/build-photutils.yml +++ b/.github/workflows/build-photutils.yml @@ -54,35 +54,37 @@ jobs: matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} name: Build photutils ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "photutils" + version: "${{ matrix.version }}" + repository: "astropy/photutils" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PHOTUTILS=${{ matrix.version }}" + cibw-test-extras: "test" + cibw-test-command: "pytest -p no:warnings --pyargs photutils" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy,astropy,pyerfa,pyyaml,hypothesis" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 - + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PHOTUTILS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout photutils ${{ env.PHOTUTILS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: astropy/photutils - ref: ${{ env.PHOTUTILS_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PHOTUTILS=${{ env.PHOTUTILS_VERSION }} - CIBW_TEST_EXTRAS: test - CIBW_TEST_COMMAND: pytest -p no:warnings --pyargs photutils - CIBW_TEST_ENVIRONMENT: >- - PIP_ONLY_BINARY=numpy,scipy,astropy,pyerfa,pyyaml,hypothesis + name: photutils-${{ env.PHOTUTILS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -100,16 +102,9 @@ jobs: assert licences == {"LICENSE.rst"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: photutils-${{ env.PHOTUTILS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish photutils ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pi-heif.yml b/.github/workflows/build-pi-heif.yml index 74ad02496ddd..0ea6e2a68e90 100644 --- a/.github/workflows/build-pi-heif.yml +++ b/.github/workflows/build-pi-heif.yml @@ -55,58 +55,69 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pi-heif ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - PI_HEIF_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout pillow_heif v${{ env.PI_HEIF_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: bigcat88/pillow_heif - ref: v${{ env.PI_HEIF_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pi_heif" + version: "${{ matrix.version }}" + repository: "bigcat88/pillow_heif" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Patch pillow_heif source - run: git apply python-wheels/patches/pi-heif/${{ env.PI_HEIF_VERSION }}/*.patch + git apply python-wheels/patches/pi-heif/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Transform to Pi-Heif - run: | - cp -r -v ./pi-heif/* . - python3 .github/transform_to-pi_heif.py + cp -r -v ./pi-heif/* . + python3 .github/transform_to-pi_heif.py - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream installs `cmake==3.31.6` from PyPI, which ships no riscv64 wheel; the + # image already provides cmake 4.4.2. + cibw-before-all-linux: |- + set -e + yum makecache && yum install -y libjpeg-turbo-devel lcms2-devel zlib-devel + export BUILD_DIR=/tmp/ph_build_stuff + python3 {package}/libheif/build_libs.py + # PH_LIGHT_ACTION=1 (upstream's own wheels-pi_heif.yml flag) makes build_libs.py + # skip x265 (see libheif/build_libs.py) and is also read at test time by + # tests/basic_test.py::test_light_build. Pillow ships no riscv64 wheel on public + # PyPI; ours is what the test env installs. + cibw-environment-linux: "PH_LIGHT_ACTION=1" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + PI_HEIF_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream installs `cmake==3.31.6` from PyPI, which ships no riscv64 wheel; the - # image already provides cmake 4.4.2. - CIBW_BEFORE_ALL_LINUX: | - set -e - yum makecache && yum install -y libjpeg-turbo-devel lcms2-devel zlib-devel - export BUILD_DIR=/tmp/ph_build_stuff - python3 {package}/libheif/build_libs.py - # PH_LIGHT_ACTION=1 (upstream's own wheels-pi_heif.yml flag) makes build_libs.py - # skip x265 (see libheif/build_libs.py) and is also read at test time by - # tests/basic_test.py::test_light_build. Pillow ships no riscv64 wheel on public - # PyPI; ours is what the test env installs. - CIBW_ENVIRONMENT: >- - PH_LIGHT_ACTION=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + name: pi_heif-${{ env.PI_HEIF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel contents run: | @@ -122,15 +133,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pi_heif-${{ env.PI_HEIF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pi-heif ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-picows.yml b/.github/workflows/build-picows.yml index c6f73ac1633e..c31eab4a3248 100644 --- a/.github/workflows/build-picows.yml +++ b/.github/workflows/build-picows.yml @@ -60,7 +60,7 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 - cibw-environment-linux: CFLAGS="$CFLAGS -O2 -g0 -DNDEBUG" PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "CFLAGS=\"$CFLAGS -O2 -g0 -DNDEBUG\"" cibw-test-requires: >- pytest pytest-asyncio async_timeout tiny-proxy websockets ${{ matrix.platform == 'manylinux' && 'uvloop' || '' }} diff --git a/.github/workflows/build-pillow-avif-plugin.yml b/.github/workflows/build-pillow-avif-plugin.yml index 2063c7bd24e7..9b475d339b42 100644 --- a/.github/workflows/build-pillow-avif-plugin.yml +++ b/.github/workflows/build-pillow-avif-plugin.yml @@ -50,72 +50,77 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pillow-avif-plugin ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pillow-avif-plugin" + version: "${{ matrix.version }}" + repository: "fdintino/pillow-avif-plugin" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's own before-all builds libavif through multi-build/multibuild, + # whose ccache/sccache/nasm helpers all fetch architecture-specific prebuilt + # binaries with no riscv64 release. This replicates the CMake invocation from + # wheelbuild/config.sh's build_libavif directly instead. rav1e is dropped: it's + # one of two interchangeable AV1 encoders (aom, kept, is the other), so pulling + # in a whole Rust toolchain to duplicate encode support isn't worth it -- the + # test suite already skips rav1e-specific cases via skip_unless_avif_encoder. + # ENABLE_RVV=0: aom's av1.cmake unconditionally adds the highbd RVV convolve + # sources to the RVV object library (unlike its x86/NEON equivalents, which + # gate their highbd files on CONFIG_AV1_HIGHBITDEPTH); with highbitdepth off + # those files call undeclared _c fallbacks. Upstream bug, still present on aom + # main; see gotcha 271. + cibw-before-all-linux: |- + set -e + python3 -m pip install ninja meson + mkdir -p libavif-1.4.2 + curl -sL https://github.com/AOMediaCodec/libavif/archive/v1.4.2.tar.gz \ + | tar --strip-components=1 -C libavif-1.4.2 -xzf - + cmake -S libavif-1.4.2 -B libavif-1.4.2/build -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_C_VISIBILITY_PRESET=hidden \ + -DCMAKE_CXX_VISIBILITY_PRESET=hidden \ + -DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--strip-all,-z,relro,-z,now" \ + -DAVIF_LIBSHARPYUV=LOCAL \ + -DAVIF_LIBYUV=LOCAL \ + -DAVIF_CODEC_AOM=LOCAL \ + -DAVIF_CODEC_AOM_DECODE=OFF \ + -DAVIF_CODEC_DAV1D=LOCAL \ + -DCONFIG_AV1_HIGHBITDEPTH=0 \ + -DENABLE_RVV=0 + cmake --build libavif-1.4.2/build + cmake --install libavif-1.4.2/build --strip + for f in {package}/wheelbuild/dependency_licenses/*.txt; do + { printf '\n\n----\n\n%s\n\n' "$(basename "$f" .txt)"; cat "$f"; } >> {package}/LICENSE + done + printf '\n\n' >> {package}/LICENSE + cat {package}/wheelbuild/dependency_licenses/PATENTS >> {package}/LICENSE + # Pillow ships no riscv64 wheel on public PyPI; ours is what the test env installs. + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PILLOW_AVIF_PLUGIN_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pillow-avif-plugin v${{ env.PILLOW_AVIF_PLUGIN_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: fdintino/pillow-avif-plugin - ref: v${{ env.PILLOW_AVIF_PLUGIN_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's own before-all builds libavif through multi-build/multibuild, - # whose ccache/sccache/nasm helpers all fetch architecture-specific prebuilt - # binaries with no riscv64 release. This replicates the CMake invocation from - # wheelbuild/config.sh's build_libavif directly instead. rav1e is dropped: it's - # one of two interchangeable AV1 encoders (aom, kept, is the other), so pulling - # in a whole Rust toolchain to duplicate encode support isn't worth it -- the - # test suite already skips rav1e-specific cases via skip_unless_avif_encoder. - # ENABLE_RVV=0: aom's av1.cmake unconditionally adds the highbd RVV convolve - # sources to the RVV object library (unlike its x86/NEON equivalents, which - # gate their highbd files on CONFIG_AV1_HIGHBITDEPTH); with highbitdepth off - # those files call undeclared _c fallbacks. Upstream bug, still present on aom - # main; see gotcha 271. - CIBW_BEFORE_ALL_LINUX: | - set -e - python3 -m pip install ninja meson - mkdir -p libavif-${{ env.LIBAVIF_VERSION }} - curl -sL https://github.com/AOMediaCodec/libavif/archive/v${{ env.LIBAVIF_VERSION }}.tar.gz \ - | tar --strip-components=1 -C libavif-${{ env.LIBAVIF_VERSION }} -xzf - - cmake -S libavif-${{ env.LIBAVIF_VERSION }} -B libavif-${{ env.LIBAVIF_VERSION }}/build -G Ninja \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=ON \ - -DCMAKE_C_VISIBILITY_PRESET=hidden \ - -DCMAKE_CXX_VISIBILITY_PRESET=hidden \ - -DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--strip-all,-z,relro,-z,now" \ - -DAVIF_LIBSHARPYUV=LOCAL \ - -DAVIF_LIBYUV=LOCAL \ - -DAVIF_CODEC_AOM=LOCAL \ - -DAVIF_CODEC_AOM_DECODE=OFF \ - -DAVIF_CODEC_DAV1D=LOCAL \ - -DCONFIG_AV1_HIGHBITDEPTH=0 \ - -DENABLE_RVV=0 - cmake --build libavif-${{ env.LIBAVIF_VERSION }}/build - cmake --install libavif-${{ env.LIBAVIF_VERSION }}/build --strip - for f in {package}/wheelbuild/dependency_licenses/*.txt; do - { printf '\n\n----\n\n%s\n\n' "$(basename "$f" .txt)"; cat "$f"; } >> {package}/LICENSE - done - printf '\n\n' >> {package}/LICENSE - cat {package}/wheelbuild/dependency_licenses/PATENTS >> {package}/LICENSE - # Pillow ships no riscv64 wheel on public PyPI; ours is what the test env installs. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + name: pillow-avif-plugin-${{ env.PILLOW_AVIF_PLUGIN_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel contents run: | @@ -131,15 +136,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pillow-avif-plugin-${{ env.PILLOW_AVIF_PLUGIN_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pillow-avif-plugin ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pillow-heif.yml b/.github/workflows/build-pillow-heif.yml index 142fe131341f..8f3f0592af10 100644 --- a/.github/workflows/build-pillow-heif.yml +++ b/.github/workflows/build-pillow-heif.yml @@ -49,45 +49,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pillow-heif ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pillow_heif" + version: "${{ matrix.version }}" + repository: "bigcat88/pillow_heif" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream installs `cmake==3.31.6` from PyPI, which ships no riscv64 wheel; the + # image already provides cmake 4.4.2. The `cp` lines add the licences of the three + # libraries the wheel bundles, which upstream only references by URL. + cibw-before-all-linux: |- + set -e + yum makecache && yum install -y libjpeg-turbo-devel lcms2-devel zlib-devel + export BUILD_DIR=/tmp/ph_build_stuff + python3 {package}/libheif/build_libs.py + for lib in x265 libde265 libheif; do + cp "$BUILD_DIR/$lib/COPYING" "{package}/LICENSE.$lib" + done + # Pillow ships no riscv64 wheel on public PyPI; ours is what the test env installs. + cibw-environment-linux: "PH_RELEASE_TESTS=1" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PILLOW_HEIF_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pillow_heif v${{ env.PILLOW_HEIF_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: bigcat88/pillow_heif - ref: v${{ env.PILLOW_HEIF_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream installs `cmake==3.31.6` from PyPI, which ships no riscv64 wheel; the - # image already provides cmake 4.4.2. The `cp` lines add the licences of the three - # libraries the wheel bundles, which upstream only references by URL. - CIBW_BEFORE_ALL_LINUX: | - set -e - yum makecache && yum install -y libjpeg-turbo-devel lcms2-devel zlib-devel - export BUILD_DIR=/tmp/ph_build_stuff - python3 {package}/libheif/build_libs.py - for lib in x265 libde265 libheif; do - cp "$BUILD_DIR/$lib/COPYING" "{package}/LICENSE.$lib" - done - # Pillow ships no riscv64 wheel on public PyPI; ours is what the test env installs. - CIBW_ENVIRONMENT: >- - PH_RELEASE_TESTS=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + name: pillow_heif-${{ env.PILLOW_HEIF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel contents run: | @@ -106,15 +109,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pillow_heif-${{ env.PILLOW_HEIF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pillow-heif ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pillow-jxl-plugin.yml b/.github/workflows/build-pillow-jxl-plugin.yml index 604bf071a76f..b92adee4de67 100644 --- a/.github/workflows/build-pillow-jxl-plugin.yml +++ b/.github/workflows/build-pillow-jxl-plugin.yml @@ -49,74 +49,71 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pillow-jxl-plugin ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pillow-jxl-plugin" + version: "${{ matrix.version }}" + repository: "Isotr0py/pillow-jpegxl-plugin" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pillow-jxl-plugin/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # [tool.maturin] already has `features = [..., "vendored"]`, which + # builds libjxl/highway/brotli from source via jpegxl-src's CMake + # invocation - no MATURIN_PEP517_ARGS needed. `cargo metadata + # --features vendored` unpacks jpegxl-src (an optional dependency + # gated by that feature) so its bundled licences can be staged here + # for the widened `license-files` glob to pick up. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && export PATH=\"$PATH:$HOME/.cargo/bin\" && cargo metadata --manifest-path {package}/Cargo.toml --features vendored --format-version=1 >/dev/null && JXL_SRC=\"$(find \"$HOME/.cargo/registry/src\" -maxdepth 2 -type d -name 'jpegxl-src-*' | head -1)\" && cp \"$JXL_SRC/libjxl/LICENSE\" {package}/LICENSE.libjxl && cp \"$JXL_SRC/libjxl/PATENTS\" {package}/PATENTS.libjxl && cp \"$JXL_SRC/libjxl/third_party/highway/LICENSE\" {package}/LICENSE.highway && cp \"$JXL_SRC/libjxl/third_party/brotli/LICENSE\" {package}/LICENSE.brotli && cp \"$JXL_SRC/libjxl/third_party/skcms/LICENSE\" {package}/LICENSE.skcms" + # PIP_ONLY_BINARY=pillow: cp310/cp311 only have an 11.3.0/12.2.0 + # riscv64 Pillow wheel on our registry (Pillow 12.0+ dropped + # cp310, 12.3.0 dropped cp311); without this, pip's resolver + # prefers the newest Pillow sdist visible on the combined + # index over the older prebuilt wheel, and that sdist then + # fails to build for lack of libjpeg headers in the test venv. + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" PIP_ONLY_BINARY=pillow" + cibw-test-requires: "pytest numpy" + cibw-test-sources: "test" + # test/test_plugin.py's OpenEXR/pyexiv2-gated tests are patched to + # pytest.importorskip: pyexiv2 has no riscv64 wheel on our registry + # at all, and OpenEXR has none for cp310/cp311. + cibw-test-command: "python -c \"import pillow_jxl; from pillow_jxl import JpegXLImagePlugin\" && python -m pytest test/test_plugin.py -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PILLOW_JXL_PLUGIN_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pillow-jxl-plugin v${{ env.PILLOW_JXL_PLUGIN_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Isotr0py/pillow-jpegxl-plugin - ref: v${{ env.PILLOW_JXL_PLUGIN_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pillow-jxl-plugin source - run: git apply python-wheels/patches/pillow-jxl-plugin/${{ env.PILLOW_JXL_PLUGIN_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # [tool.maturin] already has `features = [..., "vendored"]`, which - # builds libjxl/highway/brotli from source via jpegxl-src's CMake - # invocation - no MATURIN_PEP517_ARGS needed. `cargo metadata - # --features vendored` unpacks jpegxl-src (an optional dependency - # gated by that feature) so its bundled licences can be staged here - # for the widened `license-files` glob to pick up. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && - export PATH="$PATH:$HOME/.cargo/bin" && - cargo metadata --manifest-path {package}/Cargo.toml --features vendored --format-version=1 >/dev/null && - JXL_SRC="$(find "$HOME/.cargo/registry/src" -maxdepth 2 -type d -name 'jpegxl-src-*' | head -1)" && - cp "$JXL_SRC/libjxl/LICENSE" {package}/LICENSE.libjxl && - cp "$JXL_SRC/libjxl/PATENTS" {package}/PATENTS.libjxl && - cp "$JXL_SRC/libjxl/third_party/highway/LICENSE" {package}/LICENSE.highway && - cp "$JXL_SRC/libjxl/third_party/brotli/LICENSE" {package}/LICENSE.brotli && - cp "$JXL_SRC/libjxl/third_party/skcms/LICENSE" {package}/LICENSE.skcms - # PIP_ONLY_BINARY=pillow: cp310/cp311 only have an 11.3.0/12.2.0 - # riscv64 Pillow wheel on our registry (Pillow 12.0+ dropped - # cp310, 12.3.0 dropped cp311); without this, pip's resolver - # prefers the newest Pillow sdist visible on the combined - # index over the older prebuilt wheel, and that sdist then - # fails to build for lack of libjpeg headers in the test venv. - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=pillow - CIBW_TEST_REQUIRES: pytest numpy - CIBW_TEST_SOURCES: test - # test/test_plugin.py's OpenEXR/pyexiv2-gated tests are patched to - # pytest.importorskip: pyexiv2 has no riscv64 wheel on our registry - # at all, and OpenEXR has none for cp310/cp311. - CIBW_TEST_COMMAND: >- - python -c "import pillow_jxl; from pillow_jxl import JpegXLImagePlugin" && - python -m pytest test/test_plugin.py -v + name: pillow-jxl-plugin-${{ env.PILLOW_JXL_PLUGIN_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel contents run: | @@ -132,15 +129,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pillow-jxl-plugin-${{ env.PILLOW_JXL_PLUGIN_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pillow-jxl-plugin ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-piper-tts.yml b/.github/workflows/build-piper-tts.yml index e9ddfc060f07..bb251c4cad1a 100644 --- a/.github/workflows/build-piper-tts.yml +++ b/.github/workflows/build-piper-tts.yml @@ -57,58 +57,71 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build piper-tts ${{ matrix.version }} cp39-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "piper-tts" + version: "${{ matrix.version }}" + repository: "OHF-voice/piper1-gpl" + ref: "v${{ matrix.version }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 240 + pre-build: |- + export ESPEAK_NG_REF=724808c5a83f9ef95fdd0db886ba7ba537ff224a + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply -v python-wheels/patches/piper-tts/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + set -euo pipefail + base="https://raw.githubusercontent.com/espeak-ng/espeak-ng/${ESPEAK_NG_REF}" + curl -fsSL --retry 5 "$base/COPYING" -o COPYING.espeak-ng + curl -fsSL --retry 5 "$base/COPYING.APACHE" -o COPYING.espeak-ng.APACHE + curl -fsSL --retry 5 "$base/COPYING.BSD2" -o COPYING.espeak-ng.BSD2 + curl -fsSL --retry 5 "$base/COPYING.UCD" -o COPYING.espeak-ng.UCD + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # Upstream builds cp39-* only, and the wheel is cp39-abi3 (setup.cfg's + # py_limited_api); cp312-cp314 reuse that wheel and only re-run the tests, + # which need onnxruntime - our riscv64 onnxruntime wheels start at cp312. + # No cp314t: py_limited_api rules out a free-threaded build, and upstream + # publishes no free-threaded wheel either. + cibw-build: "cp39-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + cibw-test-skip: "cp39-manylinux_riscv64" + # Upstream runs `pytest {project}/tests`; staging the suite and its ini + # keeps that working now that cibuildwheel takes test-sources instead. + cibw-test-sources: "tests pytest.ini" + cibw-test-requires: "pytest" + cibw-test-command: "python -m pytest -vv tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: PIPER_TTS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout piper1-gpl v${{ env.PIPER_TTS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: OHF-voice/piper1-gpl - ref: v${{ env.PIPER_TTS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply -v python-wheels/patches/piper-tts/${{ env.PIPER_TTS_VERSION }}/*.patch - - # The patch above widens setup.py's license_files to licenses/*, so these - # reach dist-info/licenses/ with the licences upstream already ships there. - - name: Stage the eSpeak NG licences - working-directory: licenses - run: | - set -euo pipefail - base="https://raw.githubusercontent.com/espeak-ng/espeak-ng/${ESPEAK_NG_REF}" - curl -fsSL --retry 5 "$base/COPYING" -o COPYING.espeak-ng - curl -fsSL --retry 5 "$base/COPYING.APACHE" -o COPYING.espeak-ng.APACHE - curl -fsSL --retry 5 "$base/COPYING.BSD2" -o COPYING.espeak-ng.BSD2 - curl -fsSL --retry 5 "$base/COPYING.UCD" -o COPYING.espeak-ng.UCD - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - # Upstream builds cp39-* only, and the wheel is cp39-abi3 (setup.cfg's - # py_limited_api); cp312-cp314 reuse that wheel and only re-run the tests, - # which need onnxruntime - our riscv64 onnxruntime wheels start at cp312. - # No cp314t: py_limited_api rules out a free-threaded build, and upstream - # publishes no free-threaded wheel either. - CIBW_BUILD: cp39-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_TEST_SKIP: cp39-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream runs `pytest {project}/tests`; staging the suite and its ini - # keeps that working now that cibuildwheel takes test-sources instead. - CIBW_TEST_SOURCES: tests pytest.ini - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: python -m pytest -vv tests + name: piper-tts-${{ env.PIPER_TTS_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension, the eSpeak NG data and the licences made it into the wheel run: | @@ -130,12 +143,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: piper-tts-${{ env.PIPER_TTS_VERSION }}-cp39-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -178,7 +185,7 @@ jobs: publish: name: Publish piper-tts ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-piqp.yml b/.github/workflows/build-piqp.yml index fb66c40afe5d..2ab693889db5 100644 --- a/.github/workflows/build-piqp.yml +++ b/.github/workflows/build-piqp.yml @@ -49,39 +49,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build piqp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "piqp" + version: "${{ matrix.version }}" + repository: "predict-epfl/piqp" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Only ci/install_eigen.sh, not the full ci/install_all_deps_linux.sh: + # BUILD_WITH_BLASFEO stays OFF here (CIBW_ENVIRONMENT_LINUX below sets + # no CMAKE_ARGS, same as upstream's own non-x86_64/aarch64 case), so + # building blasfeo's GENERIC target would be wasted work. + cibw-before-all-linux: "bash ci/install_eigen.sh" + # PyPI's newer numpy/scipy sdists would otherwise outrank our riscv64 wheels. + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PIQP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout piqp v${{ env.PIQP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: predict-epfl/piqp - ref: v${{ env.PIQP_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Only ci/install_eigen.sh, not the full ci/install_all_deps_linux.sh: - # BUILD_WITH_BLASFEO stays OFF here (CIBW_ENVIRONMENT_LINUX below sets - # no CMAKE_ARGS, same as upstream's own non-x86_64/aarch64 case), so - # building blasfeo's GENERIC target would be wasted work. - CIBW_BEFORE_ALL_LINUX: bash ci/install_eigen.sh - CIBW_ENVIRONMENT_LINUX: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # PyPI's newer numpy/scipy sdists would otherwise outrank our riscv64 wheels. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,scipy + name: piqp-${{ env.PIQP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extension run: | @@ -94,15 +100,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: piqp-${{ env.PIQP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish piqp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pixeltable-pgserver.yml b/.github/workflows/build-pixeltable-pgserver.yml index ce5ceb1adb84..f1acb52c792a 100644 --- a/.github/workflows/build-pixeltable-pgserver.yml +++ b/.github/workflows/build-pixeltable-pgserver.yml @@ -49,72 +49,75 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pixeltable-pgserver ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pixeltable-pgserver" + version: "${{ matrix.version }}" + repository: "pixeltable/pixeltable-pgserver" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 300 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pixeltable-pgserver/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's [tool.cibuildwheel.linux] before-all plus `perl`: the PG18 tarball no + # longer ships the generated catalog headers, so genbki.pl runs and needs FindBin, + # which the image's minimal perl-interpreter lacks (gotcha 46). + cibw-before-all-linux: "yum install -y flex bison readline-devel perl && make" + # initdb/postgres are non-PIE; keep their base above vm.mmap_min_addr once auditwheel's patchelf prepends a segment (gotcha 595). + cibw-environment-linux: "LDFLAGS=\"-Wl,-Ttext-segment=0x200000\"" + # Upstream's pyproject.toml pins setuptools==73.0.1, which predates PEP 639 -- + # it has no dist-info/licenses/ concept at all, so the default LICENSE*/COPYING* + # glob that LICENSE.postgresql/LICENSE.pgvector/LICENSE.readline/LICENSE.ncurses + # rely on (gotcha 44) is a no-op and the wheel ships no licence files whatsoever. + # setuptools 77.0.3 is the earliest release with that default glob; preinstall it + # and build with pip's `--no-build-isolation` (gotcha 76) so the preinstalled + # version is actually used instead of the isolated env re-resolving the pin. + cibw-build-frontend: "pip; args: --no-build-isolation" + # auditwheel grafts the image's libreadline/libtinfo (psql links them); ship their licence texts. + # setup.py's only real purpose is a dummy cffi_modules extension + # (src/pixeltable_pgserver/_build.py, an FFI().set_source() with empty C source) that + # exists purely to make setuptools tag the wheel as platform-specific -- the actual + # postgres/pgvector binaries are built by `make` in before-all. `cffi` isn't in + # pyproject.toml's [build-system] requires (upstream relies on a legacy + # `setup_requires=["cffi"]` that PEP 517/--no-build-isolation doesn't honour), so + # without preinstalling it setuptools silently skips cffi_modules and ships a pure + # py3-none-any wheel, which cibuildwheel then refuses outright. + cibw-before-build: "pip install \"setuptools>=77.0.3\" \"wheel==0.44.0\" cffi; for p in readline ncurses-libs; do srpm=$(rpm -q --qf '%{SOURCERPM}' $p); f=$(rpm -qa --qf '%{SOURCERPM} %{NAME}\\n' | awk -v s=$srpm '$1==s{print $2}' | xargs rpm -q --licensefiles | grep -m1 -E '/(COPYING|LICENSE)[^/]*$'); cp -v \"$f\" {project}/LICENSE.${p%-libs}; done" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 300 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PIXELTABLE_PGSERVER_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pixeltable-pgserver v${{ env.PIXELTABLE_PGSERVER_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pixeltable/pixeltable-pgserver - ref: v${{ env.PIXELTABLE_PGSERVER_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Patch pixeltable-pgserver source - run: git apply python-wheels/patches/pixeltable-pgserver/${{ env.PIXELTABLE_PGSERVER_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's [tool.cibuildwheel.linux] before-all plus `perl`: the PG18 tarball no - # longer ships the generated catalog headers, so genbki.pl runs and needs FindBin, - # which the image's minimal perl-interpreter lacks (gotcha 46). - CIBW_BEFORE_ALL_LINUX: yum install -y flex bison readline-devel perl && make - # initdb/postgres are non-PIE; keep their base above vm.mmap_min_addr once auditwheel's patchelf prepends a segment (gotcha 595). - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - LDFLAGS="-Wl,-Ttext-segment=0x200000" - # Upstream's pyproject.toml pins setuptools==73.0.1, which predates PEP 639 -- - # it has no dist-info/licenses/ concept at all, so the default LICENSE*/COPYING* - # glob that LICENSE.postgresql/LICENSE.pgvector/LICENSE.readline/LICENSE.ncurses - # rely on (gotcha 44) is a no-op and the wheel ships no licence files whatsoever. - # setuptools 77.0.3 is the earliest release with that default glob; preinstall it - # and build with pip's `--no-build-isolation` (gotcha 76) so the preinstalled - # version is actually used instead of the isolated env re-resolving the pin. - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - # auditwheel grafts the image's libreadline/libtinfo (psql links them); ship their licence texts. - # setup.py's only real purpose is a dummy cffi_modules extension - # (src/pixeltable_pgserver/_build.py, an FFI().set_source() with empty C source) that - # exists purely to make setuptools tag the wheel as platform-specific -- the actual - # postgres/pgvector binaries are built by `make` in before-all. `cffi` isn't in - # pyproject.toml's [build-system] requires (upstream relies on a legacy - # `setup_requires=["cffi"]` that PEP 517/--no-build-isolation doesn't honour), so - # without preinstalling it setuptools silently skips cffi_modules and ships a pure - # py3-none-any wheel, which cibuildwheel then refuses outright. - CIBW_BEFORE_BUILD: >- - pip install "setuptools>=77.0.3" "wheel==0.44.0" cffi; - for p in readline ncurses-libs; do - srpm=$(rpm -q --qf '%{SOURCERPM}' $p); - f=$(rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | awk -v s=$srpm '$1==s{print $2}' | xargs rpm -q --licensefiles | grep -m1 -E '/(COPYING|LICENSE)[^/]*$'); - cp -v "$f" {project}/LICENSE.${p%-libs}; - done + name: pixeltable-pgserver-${{ env.PIXELTABLE_PGSERVER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships both postgres servers, pgvector and their licences run: | @@ -141,12 +144,6 @@ jobs: done done - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pixeltable-pgserver-${{ env.PIXELTABLE_PGSERVER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -180,7 +177,7 @@ jobs: publish: name: Publish pixeltable-pgserver ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-planegcs.yml b/.github/workflows/build-planegcs.yml index 6d85f828a12d..67a682777fc5 100644 --- a/.github/workflows/build-planegcs.yml +++ b/.github/workflows/build-planegcs.yml @@ -50,42 +50,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build planegcs ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "planegcs" + version: "${{ matrix.version }}" + repository: "spookylukey/planegcs" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + curl -sSfL -o LICENSE.eigen https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 + curl -sSfL -o LICENSE.boost https://www.boost.org/LICENSE_1_0.txt + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Replaces upstream's [tool.cibuildwheel.linux.environment], so it repeats it. + cibw-environment-linux: "CMAKE_PREFIX_PATH=/opt/eigen3-installed" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PLANEGCS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout planegcs v${{ env.PLANEGCS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: spookylukey/planegcs - ref: v${{ env.PLANEGCS_VERSION }} - persist-credentials: false - - # The extension compiles in Eigen (MPL-2.0) and Boost (BSL-1.0) headers; the - # default LICEN[CS]E* glob picks these up next to upstream's own LICENSE. - - name: Stage third-party licences - run: | - curl -sSfL -o LICENSE.eigen https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 - curl -sSfL -o LICENSE.boost https://www.boost.org/LICENSE_1_0.txt - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces upstream's [tool.cibuildwheel.linux.environment], so it repeats it. - CIBW_ENVIRONMENT: >- - CMAKE_PREFIX_PATH=/opt/eigen3-installed - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + name: planegcs-${{ env.PLANEGCS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension module and licences made it into the wheel run: | @@ -100,15 +106,9 @@ jobs: print('OK:', sys.argv[1], sos, lic) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: planegcs-${{ env.PLANEGCS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish planegcs ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-playa-pdf.yml b/.github/workflows/build-playa-pdf.yml index a2c2939efa08..7c7e14a06134 100644 --- a/.github/workflows/build-playa-pdf.yml +++ b/.github/workflows/build-playa-pdf.yml @@ -64,9 +64,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build-frontend: "build; args: --no-isolation" cibw-before-build: pip install "hatchling>=1.27.0" hatch-vcs hatch-mypyc "mypy==1.19.1" cryptography - cibw-environment: >- - HATCH_BUILD_HOOK_ENABLE_MYPYC=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "HATCH_BUILD_HOOK_ENABLE_MYPYC=1" cibw-test-sources: tests samples pyproject.toml cibw-test-requires: pytest cryptography pdfminer.six cibw-test-command: >- diff --git a/.github/workflows/build-plotext.yml b/.github/workflows/build-plotext.yml index 83fbfa32442f..b4e59caef216 100644 --- a/.github/workflows/build-plotext.yml +++ b/.github/workflows/build-plotext.yml @@ -52,35 +52,37 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build plotext ${{ matrix.version }} py3-none-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "plotext" + version: "${{ matrix.version }}" + repository: "piccolomo/plotext" + ref: "${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + # setup.py's wheel_of_this_system.get_tag() tags the wheel py3-none-: the + # C++ kernel it compiles is loaded by ctypes, not tied to any interpreter, so one + # build serves every Python. + cibw-build: "cp312-manylinux_riscv64" + # Mirrors upstream's own windows.yml unit-test invocation (the Linux wheels.yml + # job only runs pyproject.toml's one-line import smoke test). + cibw-test-command: "python -m unittest plotext._tests.primitives plotext._tests.plots plotext._tests.dates plotext._tests.fixed_bugs plotext._tests.hashes plotext.prettydoc._tests.docs plotext.prettydoc._tests.hashes -v" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: PLOTEXT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout plotext ${{ env.PLOTEXT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: piccolomo/plotext - ref: ${{ env.PLOTEXT_VERSION }} - persist-credentials: false - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # setup.py's wheel_of_this_system.get_tag() tags the wheel py3-none-: the - # C++ kernel it compiles is loaded by ctypes, not tied to any interpreter, so one - # build serves every Python. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Mirrors upstream's own windows.yml unit-test invocation (the Linux wheels.yml - # job only runs pyproject.toml's one-line import smoke test). - CIBW_TEST_COMMAND: >- - python -m unittest plotext._tests.primitives plotext._tests.plots - plotext._tests.dates plotext._tests.fixed_bugs plotext._tests.hashes - plotext.prettydoc._tests.docs plotext.prettydoc._tests.hashes -v + name: plotext-${{ env.PLOTEXT_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries a riscv64 kernel.so run: | @@ -96,15 +98,9 @@ jobs: EOF file kernel_check/plotext/_kernel/cpp/kernel.so | tee /dev/stderr | grep -q 'RISC-V' - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: plotext-${{ env.PLOTEXT_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish plotext ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-plyvel.yml b/.github/workflows/build-plyvel.yml index 9743fd9dc1e5..c140ced711cd 100644 --- a/.github/workflows/build-plyvel.yml +++ b/.github/workflows/build-plyvel.yml @@ -53,71 +53,58 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build plyvel ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "plyvel" + version: "${{ matrix.version }}" + repository: "wbolster/plyvel" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "LIBRARY_PATH=/usr/local/lib LD_LIBRARY_PATH=/usr/local/lib LEVELDB_VERSION=1.22 SNAPPY_VERSION=1.1.9" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py links a system `leveldb`, which upstream's own manylinux Docker + # image builds from source via cmake (install-snappy.sh/install-leveldb.sh); + # reproduce that here since neither lib ships in the riscv64 image. The sed + # matches upstream's 1.1.9-0001-fix-inlining-failure.patch (newer GCC + # rejects always_inline across TUs); -DSNAPPY_BUILD_TESTS=OFF skips the + # googletest/benchmark submodules that patch's checkout also needs. + # CMAKE_POLICY_VERSION_MINIMUM works around snappy 1.1.9's + # cmake_minimum_required(3.1), which CMake 4 refuses outright (gotcha 207). + cibw-before-all-linux: "curl -sSLf \"https://github.com/google/snappy/archive/refs/tags/${SNAPPY_VERSION}.tar.gz\" | tar -xz -C /tmp && sed -i '/#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))/s/.*/#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE/' /tmp/snappy-${SNAPPY_VERSION}/snappy-stubs-internal.h && cmake -S /tmp/snappy-${SNAPPY_VERSION} -B /tmp/snappy-${SNAPPY_VERSION}/build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_POLICY_VERSION_MINIMUM=3.5 && cmake --build /tmp/snappy-${SNAPPY_VERSION}/build --parallel --target install && curl -sSLf \"https://github.com/google/leveldb/archive/refs/tags/${LEVELDB_VERSION}.tar.gz\" | tar -xz -C /tmp && cmake -S /tmp/leveldb-${LEVELDB_VERSION} -B /tmp/leveldb-${LEVELDB_VERSION}/build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DLEVELDB_BUILD_TESTS=OFF -DLEVELDB_BUILD_BENCHMARKS=OFF -DCMAKE_INSTALL_LIBDIR=lib && cmake --build /tmp/leveldb-${LEVELDB_VERSION}/build --parallel --target install && ldconfig && cp /tmp/snappy-${SNAPPY_VERSION}/COPYING {project}/LICENSE.snappy && cp /tmp/leveldb-${LEVELDB_VERSION}/LICENSE {project}/LICENSE.leveldb" + # setup.py's sources are the .cpp Cython already generated upstream; make + # cython (upstream's own cibuildwheel-before-build.sh step) regenerates them. + cibw-before-build: "pip install cython && make cython" + cibw-repair-wheel-command: "auditwheel repair --strip -w {dest_dir} {wheel}" + # test/ is a package (test/__init__.py) sitting next to plyvel/ at the repo + # root, so running pytest from {project} would import the source tree + # instead of the wheel (gotcha 25); stage just the test suite instead. + cibw-test-requires: "pytest" + cibw-test-sources: "test setup.cfg" + # The test phase runs as root, which never sees the permission error + # test_open_read_only_dir asserts (gotcha 39); deselect it. + cibw-test-command: "pytest test --deselect test/test_plyvel.py::test_open_read_only_dir" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PLYVEL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout plyvel ${{ env.PLYVEL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: wbolster/plyvel - ref: ${{ env.PLYVEL_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_PASS_LINUX: LEVELDB_VERSION SNAPPY_VERSION - # setup.py links a system `leveldb`, which upstream's own manylinux Docker - # image builds from source via cmake (install-snappy.sh/install-leveldb.sh); - # reproduce that here since neither lib ships in the riscv64 image. The sed - # matches upstream's 1.1.9-0001-fix-inlining-failure.patch (newer GCC - # rejects always_inline across TUs); -DSNAPPY_BUILD_TESTS=OFF skips the - # googletest/benchmark submodules that patch's checkout also needs. - # CMAKE_POLICY_VERSION_MINIMUM works around snappy 1.1.9's - # cmake_minimum_required(3.1), which CMake 4 refuses outright (gotcha 207). - CIBW_BEFORE_ALL_LINUX: >- - curl -sSLf "https://github.com/google/snappy/archive/refs/tags/${SNAPPY_VERSION}.tar.gz" - | tar -xz -C /tmp && - sed -i '/#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))/s/.*/#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE/' - /tmp/snappy-${SNAPPY_VERSION}/snappy-stubs-internal.h && - cmake -S /tmp/snappy-${SNAPPY_VERSION} -B /tmp/snappy-${SNAPPY_VERSION}/build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF -DCMAKE_INSTALL_LIBDIR=lib - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 && - cmake --build /tmp/snappy-${SNAPPY_VERSION}/build --parallel --target install && - curl -sSLf "https://github.com/google/leveldb/archive/refs/tags/${LEVELDB_VERSION}.tar.gz" - | tar -xz -C /tmp && - cmake -S /tmp/leveldb-${LEVELDB_VERSION} -B /tmp/leveldb-${LEVELDB_VERSION}/build - -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DLEVELDB_BUILD_TESTS=OFF -DLEVELDB_BUILD_BENCHMARKS=OFF -DCMAKE_INSTALL_LIBDIR=lib && - cmake --build /tmp/leveldb-${LEVELDB_VERSION}/build --parallel --target install && - ldconfig && - cp /tmp/snappy-${SNAPPY_VERSION}/COPYING {project}/LICENSE.snappy && - cp /tmp/leveldb-${LEVELDB_VERSION}/LICENSE {project}/LICENSE.leveldb - CIBW_ENVIRONMENT: LIBRARY_PATH=/usr/local/lib LD_LIBRARY_PATH=/usr/local/lib - # setup.py's sources are the .cpp Cython already generated upstream; make - # cython (upstream's own cibuildwheel-before-build.sh step) regenerates them. - CIBW_BEFORE_BUILD: pip install cython && make cython - CIBW_REPAIR_WHEEL_COMMAND: auditwheel repair --strip -w {dest_dir} {wheel} - # test/ is a package (test/__init__.py) sitting next to plyvel/ at the repo - # root, so running pytest from {project} would import the source tree - # instead of the wheel (gotcha 25); stage just the test suite instead. - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: test setup.cfg - # The test phase runs as root, which never sees the permission error - # test_open_read_only_dir asserts (gotcha 39); deselect it. - CIBW_TEST_COMMAND: pytest test --deselect test/test_plyvel.py::test_open_read_only_dir + name: plyvel-${{ env.PLYVEL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and licences made it into the wheel run: | @@ -132,15 +119,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: plyvel-${{ env.PLYVEL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish plyvel ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pmdarima.yml b/.github/workflows/build-pmdarima.yml index d7a586a9ab30..eb55cd360bd3 100644 --- a/.github/workflows/build-pmdarima.yml +++ b/.github/workflows/build-pmdarima.yml @@ -59,10 +59,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # build_tools/get_tag.py only reads the version off GITHUB_REF when it looks # like a tag ref; the container starts with no env, so it's set explicitly. - cibw-environment: >- - GITHUB_REF=refs/tags/v${{ matrix.version }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn,statsmodels + cibw-environment-linux: "GITHUB_REF=refs/tags/v${{ matrix.version }} PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn,statsmodels" cibw-before-test: pip install .[test] # test_max_dur/test_subsequent_contexts time a 0.5s early-termination window # and flake under CI load; pipeline6's True-True-X0 case hits a genuine 2.1.1 diff --git a/.github/workflows/build-pocketsphinx.yml b/.github/workflows/build-pocketsphinx.yml index 0d09e1490368..72d2a7216e01 100644 --- a/.github/workflows/build-pocketsphinx.yml +++ b/.github/workflows/build-pocketsphinx.yml @@ -51,46 +51,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pocketsphinx ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pocketsphinx" + version: "${{ matrix.version }}" + repository: "cmusphinx/pocketsphinx" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + set -euo pipefail + sed -n '/Copyright (C) 1997 - 2002, Makoto Matsumoto/,/SUCH DAMAGE\./{s/^ //;p}' src/util/genrand.c > LICENSE.mt19937 + sed -n '/The author of this software is David M. Gay/,/PARTICULAR PURPOSE\./{s/^ \* \{0,1\}//;p}' src/util/dtoa.c > LICENSE.dtoa + sed -n '/Copyright (c) 2008 Beyond Access/,/SUCH DAMAGE\./{s/^ \* \{0,1\}//;p}' src/fe/yin.c > LICENSE.yin + for f in LICENSE.mt19937 LICENSE.dtoa LICENSE.yin; do + test "$(wc -l < "$f")" -gt 10 + done + head -n 3 LICENSE.mt19937 LICENSE.dtoa LICENSE.yin + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pytest memory_profiler" + cibw-test-command: "pytest {project}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: POCKETSPHINX_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pocketsphinx v${{ env.POCKETSPHINX_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmusphinx/pocketsphinx - ref: v${{ env.POCKETSPHINX_VERSION }} - persist-credentials: false - - # MT19937, dtoa and yin are compiled in, but upstream's LICENSE omits their notices. - - name: Stage the vendored sources' licences - run: | - set -euo pipefail - sed -n '/Copyright (C) 1997 - 2002, Makoto Matsumoto/,/SUCH DAMAGE\./{s/^ //;p}' src/util/genrand.c > LICENSE.mt19937 - sed -n '/The author of this software is David M. Gay/,/PARTICULAR PURPOSE\./{s/^ \* \{0,1\}//;p}' src/util/dtoa.c > LICENSE.dtoa - sed -n '/Copyright (c) 2008 Beyond Access/,/SUCH DAMAGE\./{s/^ \* \{0,1\}//;p}' src/fe/yin.c > LICENSE.yin - for f in LICENSE.mt19937 LICENSE.dtoa LICENSE.yin; do - test "$(wc -l < "$f")" -gt 10 - done - head -n 3 LICENSE.mt19937 LICENSE.dtoa LICENSE.yin - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest memory_profiler - CIBW_TEST_COMMAND: pytest {project} + name: pocketsphinx-${{ env.POCKETSPHINX_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -106,15 +115,9 @@ jobs: assert {"LICENSE", "LICENSE.dtoa", "LICENSE.mt19937", "LICENSE.yin"} <= licences, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pocketsphinx-${{ env.POCKETSPHINX_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pocketsphinx ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-point-cloud-utils.yml b/.github/workflows/build-point-cloud-utils.yml index d851441ef4b2..ee9c0f451868 100644 --- a/.github/workflows/build-point-cloud-utils.yml +++ b/.github/workflows/build-point-cloud-utils.yml @@ -51,88 +51,94 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build point-cloud-utils ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "point-cloud-utils" + version: "${{ matrix.version }}" + repository: "fwilliams/point-cloud-utils" + ref: '' + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + ref="v${POINT_CLOUD_UTILS_VERSION%.0}" + + git fetch -q --no-tags origin "$ref" + git checkout -q --detach FETCH_HEAD + + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/point-cloud-utils/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + set -euo pipefail + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/numpyeigen/master/LICENSE" -o LICENSE.numpyeigen + { + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.README" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.BSD" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.LGPL" + } > LICENSE.eigen + curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/v2.13.6/LICENSE" -o LICENSE.pybind11 + curl -fsSL --retry 5 "https://raw.githubusercontent.com/libigl/libigl/6868413/LICENSE.MPL2" -o LICENSE.igl + # tinyply carries no LICENSE file; tinyply.h's own header dedicates + # it to the public domain. + curl -fsSL --retry 5 "https://raw.githubusercontent.com/ddiakopoulos/tinyply/2.4/source/tinyply.h" | sed -n '1,16p' > LICENSE.tinyply + curl -fsSL --retry 5 "https://raw.githubusercontent.com/tinyobjloader/tinyobjloader/release/LICENSE" -o LICENSE.tinyobjloader + curl -fsSL --retry 5 "https://raw.githubusercontent.com/simd-everywhere/simde/dd0b662fd8cf4b1617dbbb4d08aa053e512b08e4/COPYING" -o COPYING.simde + curl -fsSL --retry 5 "https://raw.githubusercontent.com/AppledoreM/Manifold/28e335f8bfde0721f39fc439e362727c6ad47987/LICENSE.txt" -o LICENSE.manifold + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/geogram-pcu/main/LICENSE" -o LICENSE.geogram + # geogram's own third_party/{LM7,rply,zlib,gzstream,PoissonRecon} + # are compiled in unconditionally (aux_source_directories() outside + # any GEOGRAM_WITH_* option); HLBFGS is excluded by the patches. + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/geogram-pcu/main/src/lib/geogram/third_party/LM7/LICENSE_lgpl.txt" -o LICENSE.LM7 + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/geogram-pcu/main/src/lib/geogram/third_party/rply/LICENSE" -o LICENSE.rply + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/geogram-pcu/main/src/lib/geogram/third_party/zlib/LICENSE" -o LICENSE.geogram-zlib + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/geogram-pcu/main/src/lib/geogram/third_party/gzstream/COPYING.LIB" -o LICENSE.gzstream + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/geogram-pcu/main/src/lib/geogram/third_party/PoissonRecon/LICENSE.txt" -o LICENSE.poissonrecon + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,cmake" + cibw-test-sources: "tests data" + cibw-test-requires: "pytest" + # ray_mesh_intersection/RaySurfelIntersector need Embree, which the + # patches drop for riscv64 (no Embree ISA exists for it). + cibw-test-command: "pytest tests -k \"not test_ray_mesh_intersection and not test_ray_surfel_intersection\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: POINT_CLOUD_UTILS_VERSION: ${{ matrix.version }} - steps: - # setup.py hardcodes version="0.34.0" while the git tag is v0.34: the - # tag carries no patch component. - - id: tag - run: echo "ref=v${POINT_CLOUD_UTILS_VERSION%.0}" >> "$GITHUB_OUTPUT" - - - name: Checkout point-cloud-utils ${{ steps.tag.outputs.ref }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: fwilliams/point-cloud-utils - ref: ${{ steps.tag.outputs.ref }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/point-cloud-utils/${{ env.POINT_CLOUD_UTILS_VERSION }}/*.patch - - # numpyeigen, igl, tinyply, tinyobjloader, simde, manifold and geogram - # (plus eigen and pybind11, which numpyeigen itself pulls in) are - # download_dep()'d by CMake at build time, not vendored as submodules, - # so their own licences aren't in this checkout; stage each at the - # root for setuptools' default LICEN[CS]E*/COPYING* wheel.license-files - # glob to pick up. Embree is no longer one of them (see the patches). - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/numpyeigen/master/LICENSE" -o LICENSE.numpyeigen - { - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.README" - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2" - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.BSD" - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.LGPL" - } > LICENSE.eigen - curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/v2.13.6/LICENSE" -o LICENSE.pybind11 - curl -fsSL --retry 5 "https://raw.githubusercontent.com/libigl/libigl/6868413/LICENSE.MPL2" -o LICENSE.igl - # tinyply carries no LICENSE file; tinyply.h's own header dedicates - # it to the public domain. - curl -fsSL --retry 5 "https://raw.githubusercontent.com/ddiakopoulos/tinyply/2.4/source/tinyply.h" | sed -n '1,16p' > LICENSE.tinyply - curl -fsSL --retry 5 "https://raw.githubusercontent.com/tinyobjloader/tinyobjloader/release/LICENSE" -o LICENSE.tinyobjloader - curl -fsSL --retry 5 "https://raw.githubusercontent.com/simd-everywhere/simde/dd0b662fd8cf4b1617dbbb4d08aa053e512b08e4/COPYING" -o COPYING.simde - curl -fsSL --retry 5 "https://raw.githubusercontent.com/AppledoreM/Manifold/28e335f8bfde0721f39fc439e362727c6ad47987/LICENSE.txt" -o LICENSE.manifold - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/geogram-pcu/main/LICENSE" -o LICENSE.geogram - # geogram's own third_party/{LM7,rply,zlib,gzstream,PoissonRecon} - # are compiled in unconditionally (aux_source_directories() outside - # any GEOGRAM_WITH_* option); HLBFGS is excluded by the patches. - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/geogram-pcu/main/src/lib/geogram/third_party/LM7/LICENSE_lgpl.txt" -o LICENSE.LM7 - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/geogram-pcu/main/src/lib/geogram/third_party/rply/LICENSE" -o LICENSE.rply - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/geogram-pcu/main/src/lib/geogram/third_party/zlib/LICENSE" -o LICENSE.geogram-zlib - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/geogram-pcu/main/src/lib/geogram/third_party/gzstream/COPYING.LIB" -o LICENSE.gzstream - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fwilliams/geogram-pcu/main/src/lib/geogram/third_party/PoissonRecon/LICENSE.txt" -o LICENSE.poissonrecon - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,cmake - CIBW_TEST_SOURCES: tests data - CIBW_TEST_REQUIRES: pytest - # ray_mesh_intersection/RaySurfelIntersector need Embree, which the - # patches drop for riscv64 (no Embree ISA exists for it). - CIBW_TEST_COMMAND: >- - pytest tests -k "not test_ray_mesh_intersection and not test_ray_surfel_intersection" + name: point-cloud-utils-${{ env.POINT_CLOUD_UTILS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -153,12 +159,6 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: point-cloud-utils-${{ env.POINT_CLOUD_UTILS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -191,7 +191,7 @@ jobs: publish: name: Publish point-cloud-utils 0.34.0 - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-polars-ols.yml b/.github/workflows/build-polars-ols.yml index fe66f501da75..152f3ff6fab5 100644 --- a/.github/workflows/build-polars-ols.yml +++ b/.github/workflows/build-polars-ols.yml @@ -54,68 +54,72 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build polars-ols ${{ matrix.version }} cp38-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "polars-ols" + version: "${{ matrix.version }}" + repository: "azmyrajab/polars_ols" + ref: "v${{ matrix.version }}" + artifact-tag: "cp38-abi3-manylinux_riscv64" + timeout-minutes: 360 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" sparse-checkout init --cone + git -C "python-wheels" sparse-checkout set "patches/polars-ols" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply -v python-wheels/patches/polars-ols/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # abi3-py38 gives one wheel, built on cp312 and re-tested on cp313. cp314: + # statsmodels has no riscv64 cp314 wheel; cp314t: pyo3 0.21 has no free-threading. + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64" + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain nightly-2024-08-25" + # gotcha 76: pyproject.toml's build-system.requires pins an unused "polars" + # (maturin builds the Rust polars crate from crates.io, never imports the + # Python package), which resolves to polars-runtime-32 and falls back to a + # from-source build needing a newer Rust than RUST_TOOLCHAIN. Skip resolving + # build-system.requires entirely instead of patching the pin. + cibw-before-build-linux: "pip install \"maturin>=1.0,<2.0\"" + cibw-build-frontend: "pip; args: --no-build-isolation" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" RUSTUP_TOOLCHAIN=nightly-2024-08-25 RUSTFLAGS=\"-Dwarnings\"" + # gotcha 67: PyPI's newer numpy/pandas sdists outrun the registry; pandas 3.1.0 fails to compile on riscv64. + cibw-test-environment: "PIP_ONLY_BINARY=numpy,pandas,pyarrow,scipy,statsmodels,scikit-learn,polars-runtime-32" + # tests/requirements-test.txt, minus maturin/pyperf; the 0.3.5 suite calls + # Expr.flatten, removed in polars 2.0. + cibw-test-requires: "polars[pandas,pyarrow]<2 numpy pytest statsmodels scikit-learn" + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import polars_ols._polars_ols as m; assert m.__file__.endswith('.so'), m.__file__\" && python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: POLARS_OLS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout polars_ols v${{ env.POLARS_OLS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: azmyrajab/polars_ols - ref: v${{ env.POLARS_OLS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - sparse-checkout: patches/polars-ols - persist-credentials: false - - - name: Apply patches - run: git apply -v python-wheels/patches/polars-ols/${{ env.POLARS_OLS_VERSION }}/*.patch - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # abi3-py38 gives one wheel, built on cp312 and re-tested on cp313. cp314: - # statsmodels has no riscv64 cp314 wheel; cp314t: pyo3 0.21 has no free-threading. - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | - sh -s -- -y --profile minimal --default-toolchain ${{ env.RUST_TOOLCHAIN }} - # gotcha 76: pyproject.toml's build-system.requires pins an unused "polars" - # (maturin builds the Rust polars crate from crates.io, never imports the - # Python package), which resolves to polars-runtime-32 and falls back to a - # from-source build needing a newer Rust than RUST_TOOLCHAIN. Skip resolving - # build-system.requires entirely instead of patching the pin. - CIBW_BEFORE_BUILD_LINUX: pip install "maturin>=1.0,<2.0" - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - RUSTUP_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - RUSTFLAGS="-Dwarnings" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # gotcha 67: PyPI's newer numpy/pandas sdists outrun the registry; pandas 3.1.0 fails to compile on riscv64. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,pandas,pyarrow,scipy,statsmodels,scikit-learn,polars-runtime-32 - # tests/requirements-test.txt, minus maturin/pyperf; the 0.3.5 suite calls - # Expr.flatten, removed in polars 2.0. - CIBW_TEST_REQUIRES: polars[pandas,pyarrow]<2 numpy pytest statsmodels scikit-learn - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import polars_ols._polars_ols as m; assert m.__file__.endswith('.so'), m.__file__" && - python -m pytest -v tests + name: polars-ols-${{ env.POLARS_OLS_VERSION }}-cp38-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the licence made it into the wheel run: | @@ -128,15 +132,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: polars-ols-${{ env.POLARS_OLS_VERSION }}-cp38-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish polars-ols ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-polyscope.yml b/.github/workflows/build-polyscope.yml index 37b366ffa80f..7677ae53f206 100644 --- a/.github/workflows/build-polyscope.yml +++ b/.github/workflows/build-polyscope.yml @@ -51,73 +51,80 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build polyscope ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - POLYSCOPE_VERSION: ${{ matrix.version }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "polyscope" + version: "${{ matrix.version }}" + repository: "nmwsharp/polyscope-py" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + set -euo pipefail + for attempt in 1 2 3 4 5; do + git -c protocol.version=2 submodule update --init --force --depth=1 --recursive && break + [ "$attempt" -lt 5 ] || exit 1 + sleep $((attempt * 30)) + done - steps: - - name: Checkout polyscope-py v${{ env.POLYSCOPE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: nmwsharp/polyscope-py - ref: v${{ env.POLYSCOPE_VERSION }} - persist-credentials: false + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - # deps/eigen comes from gitlab.com, which intermittently refuses fetches "due to load". - - name: Fetch submodules - run: | - set -euo pipefail - for attempt in 1 2 3 4 5; do - git -c protocol.version=2 submodule update --init --force --depth=1 --recursive && break - [ "$attempt" -lt 5 ] || exit 1 - sleep $((attempt * 30)) - done + set -euo pipefail + cp deps/polyscope/LICENSE LICENSE.polyscope + cp deps/nanobind/LICENSE LICENSE.nanobind + cp deps/nanobind/ext/robin_map/LICENSE LICENSE.robin-map + cp deps/eigen/COPYING.MPL2 LICENSE.eigen + cp deps/polyscope/deps/glfw/LICENSE.md LICENSE.glfw + cp deps/polyscope/deps/glad/LICENSE LICENSE.glad + cp deps/polyscope/deps/glm/copying.txt LICENSE.glm + cp deps/polyscope/deps/happly/LICENSE LICENSE.happly + cp deps/polyscope/deps/imgui/imgui/LICENSE.txt LICENSE.imgui + cp deps/polyscope/deps/imgui/implot/LICENSE LICENSE.implot + cp deps/polyscope/deps/imgui/ImGuizmo/LICENSE LICENSE.imguizmo + cp deps/polyscope/deps/json/LICENSE.MIT LICENSE.nlohmann-json + cp deps/polyscope/deps/IconFontCppHeaders/licence.txt LICENSE.iconfontcppheaders - # The extension statically links every library below; upstream's wheel ships - # only its own LICENSE. - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - cp deps/polyscope/LICENSE LICENSE.polyscope - cp deps/nanobind/LICENSE LICENSE.nanobind - cp deps/nanobind/ext/robin_map/LICENSE LICENSE.robin-map - cp deps/eigen/COPYING.MPL2 LICENSE.eigen - cp deps/polyscope/deps/glfw/LICENSE.md LICENSE.glfw - cp deps/polyscope/deps/glad/LICENSE LICENSE.glad - cp deps/polyscope/deps/glm/copying.txt LICENSE.glm - cp deps/polyscope/deps/happly/LICENSE LICENSE.happly - cp deps/polyscope/deps/imgui/imgui/LICENSE.txt LICENSE.imgui - cp deps/polyscope/deps/imgui/implot/LICENSE LICENSE.implot - cp deps/polyscope/deps/imgui/ImGuizmo/LICENSE LICENSE.imguizmo - cp deps/polyscope/deps/json/LICENSE.MIT LICENSE.nlohmann-json - cp deps/polyscope/deps/IconFontCppHeaders/licence.txt LICENSE.iconfontcppheaders + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-config-file: ".github/workflows/cibuildwheel_config.toml" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # Replaces the config file's environment table, whose CMAKE_ARGS lacks the leading '-'. + cibw-environment-linux: "CMAKE_ARGS=-DPOLYSCOPE_BACKEND_OPENGL3_EGL=ON SKBUILD_WHEEL_LICENSE_FILES=\"LICENSE*\" PIP_ONLY_BINARY=numpy" + cibw-test-sources: "test" + cibw-test-command: "python test/polyscope_test.py -v --backend=openGL_mock && python test/polyscope_test.py -v --backend=openGL3_egl" + # numpy has no riscv64 musllinux wheel in our registry. + cibw-test-skip: "*-musllinux*" - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 360 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + POLYSCOPE_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - config-file: .github/workflows/cibuildwheel_config.toml - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # Replaces the config file's environment table, whose CMAKE_ARGS lacks the leading '-'. - CIBW_ENVIRONMENT: >- - CMAKE_ARGS=-DPOLYSCOPE_BACKEND_OPENGL3_EGL=ON - SKBUILD_WHEEL_LICENSE_FILES="LICENSE*" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_SOURCES: test - CIBW_TEST_COMMAND: >- - python test/polyscope_test.py -v --backend=openGL_mock && - python test/polyscope_test.py -v --backend=openGL3_egl - # numpy has no riscv64 musllinux wheel in our registry. - CIBW_TEST_SKIP: "*-musllinux*" + name: polyscope-${{ env.POLYSCOPE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -134,15 +141,9 @@ jobs: assert licences == expected, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: polyscope-${{ env.POLYSCOPE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish polyscope ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-portablemc.yml b/.github/workflows/build-portablemc.yml index 1883857c87c8..3b87eea070c0 100644 --- a/.github/workflows/build-portablemc.yml +++ b/.github/workflows/build-portablemc.yml @@ -49,76 +49,83 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build portablemc ${{ matrix.version }} cp39-abi3-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 360 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: - PORTABLEMC_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout portablemc v${{ env.PORTABLEMC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: theorzr/portablemc - ref: v${{ env.PORTABLEMC_VERSION }} - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "portablemc" + version: "${{ matrix.version }}" + repository: "theorzr/portablemc" + ref: "v${{ matrix.version }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 360 + pre-build: |- + export PORTABLEMC_VERSION='${{ matrix.version }}' + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + patches="$PWD/python-wheels/patches/portablemc/${PORTABLEMC_VERSION}" + if [ -d "$patches" ]; then + git apply -v "$patches"/*.patch + fi - # Only some versions need patching, so a missing directory is not an error. - - name: Patch portablemc source - run: | - patches="$PWD/python-wheels/patches/portablemc/${PORTABLEMC_VERSION}" - if [ -d "$patches" ]; then - git apply -v "$patches"/*.patch - fi + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Stage the licence beside portablemc-py's pyproject.toml - # maturin globs LICEN[CS]E* relative to the pyproject directory, which - # in this workspace is portablemc-py/ -- so upstream's own released - # wheels carry no licence text at all, only the License-Expression - # metadata. - run: cp LICENSE portablemc-py/ + cp LICENSE portablemc-py/ + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "portablemc-py" + # pyo3's abi3-py39 feature is on unconditionally (portablemc-py/Cargo.toml), + # so one cp39-abi3 wheel serves every GIL-ful interpreter; upstream ships + # no free-threaded wheel because abi3 and Py_GIL_DISABLED only meet on + # 3.14+. cibuildwheel compiles once on cp39 -- the oldest interpreter the + # tag claims -- and re-tests that wheel on the newer ones. musllinux is + # dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "cp39-manylinux_riscv64 cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # portablemc ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # test-sources is resolved against cibuildwheel's cwd (the portablemc + # checkout root), not against package-dir (gotcha 104) -- the suite + # actually lives at portablemc-py/tests, not at a repo-root tests/. + # Its pyproject.toml isn't staged into test_cwd, so the "network" + # marker's own addopts deselection doesn't apply; -m "not network" + # reproduces it explicitly. + cibw-test-requires: "pytest" + cibw-test-sources: "portablemc-py/tests" + cibw-test-command: "python -m pytest -v -m \"not network\" portablemc-py/tests" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 360 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + env: + PORTABLEMC_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: portablemc-py - output-dir: wheelhouse/ - env: - # pyo3's abi3-py39 feature is on unconditionally (portablemc-py/Cargo.toml), - # so one cp39-abi3 wheel serves every GIL-ful interpreter; upstream ships - # no free-threaded wheel because abi3 and Py_GIL_DISABLED only meet on - # 3.14+. cibuildwheel compiles once on cp39 -- the oldest interpreter the - # tag claims -- and re-tests that wheel on the newer ones. musllinux is - # dropped: rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: >- - cp39-manylinux_riscv64 cp310-manylinux_riscv64 - cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # portablemc ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - # test-sources is resolved against cibuildwheel's cwd (the portablemc - # checkout root), not against package-dir (gotcha 104) -- the suite - # actually lives at portablemc-py/tests, not at a repo-root tests/. - # Its pyproject.toml isn't staged into test_cwd, so the "network" - # marker's own addopts deselection doesn't apply; -m "not network" - # reproduces it explicitly. - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: portablemc-py/tests - CIBW_TEST_COMMAND: python -m pytest -v -m "not network" portablemc-py/tests + name: portablemc-${{ env.PORTABLEMC_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension and licence made it into the wheel run: | @@ -131,15 +138,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: portablemc-${{ env.PORTABLEMC_VERSION }}-cp39-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish portablemc ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pot.yml b/.github/workflows/build-pot.yml index 6fd2715cde84..a31e0effed3b 100644 --- a/.github/workflows/build-pot.yml +++ b/.github/workflows/build-pot.yml @@ -50,6 +50,59 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pot ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + # test_BaseEstimator hits a real bug in ot.utils.BaseEstimator.get_params(): + # it saves/restores warnings.filters via a bare `.pop(0)` in a finally + # block, mutating process-global state with no protection. Under cp314t + # something about the surrounding tests' warnings-filter state leaves + # that list already empty by the time this runs, so the pop() raises + # IndexError instead of the test's own expected ValueError -- a fragile + # global-state pattern in POT's own code, not a riscv64 issue (same + # class of free-threading-exposed fragility as this session's asv port). + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pot" + version: "${{ matrix.version }}" + repository: "PythonOT/POT" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pot/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy/scipy are build- and run-time requirements; only our registry + # has them for riscv64, and only-binary keeps a newer PyPI release + # from winning the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy" + # ot/helpers/openmp_helpers.py (imported by test_helpers.py) itself + # imports setuptools.errors, which the test venv doesn't ship by + # default. + cibw-test-requires: "pytest setuptools" + # test/test_helpers.py does sys.path.append(os.path.join("ot", "helpers")) + # and imports openmp_helpers from there directly (not through the + # installed `ot` package) -- needs staging alongside test/ too. + cibw-test-sources: "test ot/helpers" + cibw-test-command: "python -m pytest --durations=20 -v test ${{ case(endsWith(matrix.python, 't'), '--deselect \"test/test_utils.py::test_BaseEstimator\"', '') }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv # 60m was too tight: cp314t's free-threaded build was still running tests # (no failures) when cancelled at exactly 60m, while cp312/313/314 finish @@ -68,49 +121,14 @@ jobs: # global-state pattern in POT's own code, not a riscv64 issue (same # class of free-threading-exposed fragility as this session's asv port). include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: POT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout POT ${{ env.POT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: PythonOT/POT - ref: ${{ env.POT_VERSION }} - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/pot/${{ env.POT_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy/scipy are build- and run-time requirements; only our registry - # has them for riscv64, and only-binary keeps a newer PyPI release - # from winning the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - # ot/helpers/openmp_helpers.py (imported by test_helpers.py) itself - # imports setuptools.errors, which the test venv doesn't ship by - # default. - CIBW_TEST_REQUIRES: pytest setuptools - # test/test_helpers.py does sys.path.append(os.path.join("ot", "helpers")) - # and imports openmp_helpers from there directly (not through the - # installed `ot` package) -- needs staging alongside test/ too. - CIBW_TEST_SOURCES: test ot/helpers - CIBW_TEST_COMMAND: python -m pytest --durations=20 -v test ${{ case(endsWith(matrix.python, 't'), '--deselect "test/test_utils.py::test_BaseEstimator"', '') }} + name: pot-${{ env.POT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -123,13 +141,6 @@ jobs: assert licences == {"LICENSE", "LICENSE.eigen-mpl2", "LICENSE.eigen-bsd"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pot-${{ env.POT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -165,7 +176,7 @@ jobs: publish: name: Publish pot ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-power-grid-model.yml b/.github/workflows/build-power-grid-model.yml index cfd2ba688d8b..907e444aa90d 100644 --- a/.github/workflows/build-power-grid-model.yml +++ b/.github/workflows/build-power-grid-model.yml @@ -50,63 +50,70 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build power-grid-model ${{ matrix.version }} py3-none-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "power-grid-model" + version: "${{ matrix.version }}" + repository: "PowerGridModel/power-grid-model" + ref: "v${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 600 + pre-build: |- + export PGM_VERSION='${{ matrix.version }}' + echo "$PGM_VERSION" > VERSION + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + set -euo pipefail + url=$(curl -fsSL https://pypi.org/pypi/pgm-build-deps/json | python3 -c 'import json, sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["filename"].endswith(".whl")))') + curl -fsSL "$url" -o "$RUNNER_TEMP/pgm_build_deps.whl" + python3 - "$RUNNER_TEMP/pgm_build_deps.whl" <<'EOF' + import sys, zipfile + z = zipfile.ZipFile(sys.argv[1]) + for dep in ("boost", "eigen", "msgpack", "nlohmann_json"): + name = next(n for n in z.namelist() if n.endswith(f".dist-info/licenses/LICENSES/{dep}")) + open(f"LICENSE.{dep}", "wb").write(z.read(name)) + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-extras: "uv" + cibw-build: "*-manylinux_riscv64" + cibw-archs-linux: "riscv64" + cibw-environment-linux: "CC=gcc CXX=g++ UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ UV_INDEX_STRATEGY=unsafe-best-match" + cibw-environment-pass-linux: "GITHUB_SHA GITHUB_REF GITHUB_RUN_NUMBER" + # source.i comes out 731.327591 vs 731.327592 (rel. 1.8e-9 against rtol=1e-9) in this one + # near-singular IEC 60909 case: FMA rounding, not a wrong result. + cibw-test-command: "pytest {package}/tests -k \"not (test_batch_validation and dummy-test-line-into-itself-asym-iec60909-batch)\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 600 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: PGM_VERSION: ${{ matrix.version }} - steps: - - name: Checkout power-grid-model v${{ env.PGM_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: PowerGridModel/power-grid-model - ref: v${{ env.PGM_VERSION }} - persist-credentials: false - - - name: Set PyPI Version - run: echo "$PGM_VERSION" > VERSION - - # Boost, Eigen, msgpack-cxx and nlohmann_json are compiled into the core library from - # pgm-build-deps; their notices are staged where scikit-build-core's licence glob finds them. - - name: Stage licences of the bundled header-only libraries - run: | - set -euo pipefail - url=$(curl -fsSL https://pypi.org/pypi/pgm-build-deps/json | python3 -c 'import json, sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["filename"].endswith(".whl")))') - curl -fsSL "$url" -o "$RUNNER_TEMP/pgm_build_deps.whl" - python3 - "$RUNNER_TEMP/pgm_build_deps.whl" <<'EOF' - import sys, zipfile - z = zipfile.ZipFile(sys.argv[1]) - for dep in ("boost", "eigen", "msgpack", "nlohmann_json"): - name = next(n for n in z.namelist() if n.endswith(f".dist-info/licenses/LICENSES/{dep}")) - open(f"LICENSE.{dep}", "wb").write(z.read(name)) - EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - extras: "uv" - env: - CIBW_ENVIRONMENT_PASS_LINUX: GITHUB_SHA GITHUB_REF GITHUB_RUN_NUMBER - CIBW_BUILD: "*-manylinux_riscv64" - CIBW_ARCHS_LINUX: riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_LINUX: >- - CC=gcc - CXX=g++ - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - UV_INDEX_STRATEGY=unsafe-best-match - # source.i comes out 731.327591 vs 731.327592 (rel. 1.8e-9 against rtol=1e-9) in this one - # near-singular IEC 60909 case: FMA rounding, not a wrong result. - CIBW_TEST_COMMAND: >- - pytest {package}/tests - -k "not (test_batch_validation and dummy-test-line-into-itself-asym-iec60909-batch)" + name: power-grid-model-${{ env.PGM_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled core and licences run: | @@ -123,15 +130,9 @@ jobs: print(sys.argv[1], "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: power-grid-model-${{ env.PGM_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish power-grid-model ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-preshed.yml b/.github/workflows/build-preshed.yml index fd88bacc5dcb..e43e92d47900 100644 --- a/.github/workflows/build-preshed.yml +++ b/.github/workflows/build-preshed.yml @@ -48,45 +48,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build preshed ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "preshed" + version: "${{ matrix.version }}" + repository: "explosion/preshed" + ref: "release-v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # cymem/murmurhash ship no riscv64 wheels; both build and test install them. + # Cython 3.3.0 routes a C-integer __setitem__ through sq_ass_item, whose + # Py_ssize_t index cannot hold PreshMap's uint64 keys; build-system.requires + # only floors Cython, so the pin has to be preinstalled. + cibw-before-build: "pip install \"cython<3.3.0\" setuptools \"cymem>=2.0.2,<2.1.0\" \"murmurhash>=0.28.0,<1.1.0\"" + cibw-build-frontend: "pip; args: --no-build-isolation" + # Upstream's tests.yml runs the suite bundled in the wheel; it never uses a key + # above 2**63, so the assertion below is what catches the Cython regression. + cibw-test-requires: "pytest" + cibw-test-command: "python -c \"from preshed.maps import PreshMap; m = PreshMap(); k = (1 << 63) + 12345; m[k] = 7; assert list(m) == [k], list(m); del m[k]\" && python -m pytest --pyargs preshed -Werror" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PRESHED_VERSION: ${{ matrix.version }} - steps: - - name: Checkout preshed ${{ env.PRESHED_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: explosion/preshed - ref: release-v${{ env.PRESHED_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cymem/murmurhash ship no riscv64 wheels; both build and test install them. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Cython 3.3.0 routes a C-integer __setitem__ through sq_ass_item, whose - # Py_ssize_t index cannot hold PreshMap's uint64 keys; build-system.requires - # only floors Cython, so the pin has to be preinstalled. - CIBW_BEFORE_BUILD: pip install "cython<3.3.0" setuptools "cymem>=2.0.2,<2.1.0" "murmurhash>=0.28.0,<1.1.0" - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - # Upstream's tests.yml runs the suite bundled in the wheel; it never uses a key - # above 2**63, so the assertion below is what catches the Cython regression. - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: >- - python -c "from preshed.maps import PreshMap; m = PreshMap(); - k = (1 << 63) + 12345; m[k] = 7; assert list(m) == [k], list(m); del m[k]" - && python -m pytest --pyargs preshed -Werror + name: preshed-${{ env.PRESHED_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extensions run: | @@ -100,15 +103,9 @@ jobs: print("\n".join(sos)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: preshed-${{ env.PRESHED_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish preshed ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-prody.yml b/.github/workflows/build-prody.yml index 5ec4af1e533f..084588b2562f 100644 --- a/.github/workflows/build-prody.yml +++ b/.github/workflows/build-prody.yml @@ -49,53 +49,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build prody ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "prody" + version: "${{ matrix.version }}" + repository: "prody/ProDy" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,biopython" + # pyproject.toml pins build-system.requires to setuptools<69/numpy<2.0, + # neither published for riscv64; --no-build-isolation skips that check + # and setup.py's own `import numpy` is satisfied by the preinstall. + # --no-build-isolation also means pip never installs build-system.requires + # itself (gotcha 23/76 shape), so setuptools/wheel must be preinstalled + # too, or `setuptools.build_meta` isn't importable at all (BackendUnavailable). + cibw-build-frontend: "pip; args: --no-build-isolation" + # hpb_Python*/hpb.so are x86_64-only prebuilts MANIFEST.in vendors into + # every wheel; dropping them leaves prody's own fallback (calcSASA() and + # calcHydrophobicOverlapingAreas() raise ImportError) instead of shipping + # binaries that can't load on this arch. + cibw-before-build: "pip install setuptools wheel numpy && rm -f prody/proteins/hpbmodule/hpb_Python*/hpb.so" + cibw-test-command: "python -c \"import importlib; [importlib.import_module(m) for m in ('prody.dynamics.rtbtools', 'prody.dynamics.smtools', 'prody.kdtree._CKDTree', 'prody.proteins.ccealign', 'prody.sequence.msaio', 'prody.sequence.msatools', 'prody.sequence.seqtools')]\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PRODY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout ProDy v${{ env.PRODY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: prody/ProDy - ref: v${{ env.PRODY_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,biopython - # pyproject.toml pins build-system.requires to setuptools<69/numpy<2.0, - # neither published for riscv64; --no-build-isolation skips that check - # and setup.py's own `import numpy` is satisfied by the preinstall. - # --no-build-isolation also means pip never installs build-system.requires - # itself (gotcha 23/76 shape), so setuptools/wheel must be preinstalled - # too, or `setuptools.build_meta` isn't importable at all (BackendUnavailable). - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - # hpb_Python*/hpb.so are x86_64-only prebuilts MANIFEST.in vendors into - # every wheel; dropping them leaves prody's own fallback (calcSASA() and - # calcHydrophobicOverlapingAreas() raise ImportError) instead of shipping - # binaries that can't load on this arch. - CIBW_BEFORE_BUILD: >- - pip install setuptools wheel numpy && - rm -f prody/proteins/hpbmodule/hpb_Python*/hpb.so - CIBW_TEST_COMMAND: >- - python -c "import importlib; [importlib.import_module(m) for m in - ('prody.dynamics.rtbtools', 'prody.dynamics.smtools', 'prody.kdtree._CKDTree', - 'prody.proteins.ccealign', 'prody.sequence.msaio', 'prody.sequence.msatools', - 'prody.sequence.seqtools')]" + name: prody-${{ env.PRODY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the licence and the compiled extensions run: | @@ -118,15 +116,9 @@ jobs: assert licences == {"LICENSE.rst"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: prody-${{ env.PRODY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish prody ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-proxsuite.yml b/.github/workflows/build-proxsuite.yml index 0d6705c0dd35..1f32468b82e1 100644 --- a/.github/workflows/build-proxsuite.yml +++ b/.github/workflows/build-proxsuite.yml @@ -50,53 +50,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build proxsuite ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "proxsuite" + version: "${{ matrix.version }}" + repository: "cmake-wheel/proxsuite" + ref: "v${{ matrix.version }}.c2" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/proxsuite/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy's newest release has no riscv64 wheel; the registry's must win over its sdist. + cibw-environment-linux: "CMEEL_LOG_LEVEL=\"DEBUG\" CMEEL_JOBS=\"1\" CMEEL_RUN_TESTS=\"false\" CMEEL_CMAKE_ARGS=\"-DBUILD_WITH_OPENMP_SUPPORT=ON\" PIP_ONLY_BINARY=numpy,scipy" + # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. + cibw-repair-wheel-command: '' + cibw-test-command: "cd {project}/test/src && for t in dense_qp_solve dense_qp_wrapper sparse_qp_solve sparse_qp_wrapper parallel_qp_solve serialization cvxpy; do echo \"$t.py\" && python \"$t.py\" || exit 1; done" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PROXSUITE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout proxsuite v${{ env.PROXSUITE_VERSION }}.c2 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cmake-wheel/proxsuite - ref: v${{ env.PROXSUITE_VERSION }}.c2 - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/proxsuite/${{ env.PROXSUITE_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy's newest release has no riscv64 wheel; the registry's must win over its sdist. - CIBW_ENVIRONMENT: >- - CMEEL_LOG_LEVEL="DEBUG" CMEEL_JOBS="1" CMEEL_RUN_TESTS="false" - CMEEL_CMAKE_ARGS="-DBUILD_WITH_OPENMP_SUPPORT=ON" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - # cmeel installs into a shared prefix with an $ORIGIN RPATH it sets itself. - CIBW_REPAIR_WHEEL_COMMAND: "" - CIBW_TEST_COMMAND: >- - cd {project}/test/src && - for t in dense_qp_solve dense_qp_wrapper sparse_qp_solve sparse_qp_wrapper - parallel_qp_solve serialization cvxpy; - do echo "$t.py" && python "$t.py" || exit 1; done + name: proxsuite-${{ env.PROXSUITE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -113,15 +116,9 @@ jobs: assert not any("pywrap_avx2" in n or "pywrap_avx512" in n for n in names), names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: proxsuite-${{ env.PROXSUITE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish proxsuite ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-psd-tools.yml b/.github/workflows/build-psd-tools.yml index 94ee93f6b8a6..ec28c818c2f6 100644 --- a/.github/workflows/build-psd-tools.yml +++ b/.github/workflows/build-psd-tools.yml @@ -72,7 +72,6 @@ jobs: # musllinux is dropped: numpy (a core runtime dependency) has no # musllinux riscv64 wheel on either PyPI or pypi.riseproject.dev. cibw-build: ${{ matrix.build }} - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # Upstream's cp313/cp314 repair-wheel-command pipx-installs abi3audit # itself, redundant with cibuildwheel's own abi3 audit and unavailable # in the riscv64 image. @@ -83,9 +82,7 @@ jobs: # Installing the wheel resolves numpy and Pillow; only our registry has riscv64 # wheels for them, so only-binary keeps a newer PyPI release (sdist only here) # from winning the resolution and compiling from source. - cibw-test-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,Pillow + cibw-test-environment: "PIP_ONLY_BINARY=numpy,Pillow" cibw-test-requires: pytest cibw-test-sources: tests/psd_tools/compression # --import-mode=importlib: Python 3.14 added a real stdlib diff --git a/.github/workflows/build-psygnal.yml b/.github/workflows/build-psygnal.yml index 856e68da9026..bbe9d6bf147f 100644 --- a/.github/workflows/build-psygnal.yml +++ b/.github/workflows/build-psygnal.yml @@ -69,10 +69,7 @@ jobs: "msgspec; python_version < '3.14'" # Restates upstream's [tool.cibuildwheel.environment], which this replaces. # only-binary keeps the compiled deps on the registry's riscv64 wheels. - cibw-environment: >- - HATCH_BUILD_HOOKS_ENABLE=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pydantic-core,msgspec + cibw-environment-linux: "HATCH_BUILD_HOOKS_ENABLE=1 PIP_ONLY_BINARY=numpy,pydantic-core,msgspec" # The mypyc hook is opt-in, and a failure to enable it yields a # pure-Python wheel under a manylinux tag. cibw-test-command: >- diff --git a/.github/workflows/build-pulsar-client.yml b/.github/workflows/build-pulsar-client.yml index 670d72d690b1..0bcc010043a7 100644 --- a/.github/workflows/build-pulsar-client.yml +++ b/.github/workflows/build-pulsar-client.yml @@ -54,131 +54,138 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pulsar-client ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pulsar-client" + version: "${{ matrix.version }}" + repository: "apache/pulsar-client-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of every shared library auditwheel + # vendors alongside libpulsar. setuptools' default LICENSE* glob copies them + # into the wheel. + set -euo pipefail + + project="${1:?usage: collect-licenses.sh }" + + # ldd is transitive, so the one linked library covers its whole closure. + # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist and + # are never vendored into the wheel. + mapfile -t libs < <(ldd /usr/local/lib/libpulsar.so | tr ' ' '\n' | grep '^/' | sort -u) + + # `rpm -qf` reports unowned files on stdout, so keep only bare package names. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' + ) + + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + + # Some subpackages leave the licence to a sibling of the same source RPM. + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi + + # Others mark it %doc rather than %license, and the image installs no docs. + if [ -z "${files[0]:-}" ]; then + dnf -y reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi + + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done + + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Rocky's zlib-ng ships a ZLIB CMake config pointing at a libz.a it does not + # install, so LegacyFindPackages.cmake's own find_library fallback is used. + cibw-before-all-linux: |- + set -ex + dnf -y install --enablerepo=crb boost-devel openssl-devel libcurl-devel \ + zlib-devel snappy-devel libzstd-devel protobuf-devel protobuf-compiler + cpp_version="$(awk '/^pulsar-cpp:/ {print $2}' {project}/dependencies.yaml)" + pybind11_version="$(awk '/^pybind11:/ {print $2}' {project}/dependencies.yaml)" + curl -fsSL "https://archive.apache.org/dist/pulsar/pulsar-client-cpp-$cpp_version/apache-pulsar-client-cpp-$cpp_version.tar.gz" | tar xz -C /tmp + cmake -S "/tmp/apache-pulsar-client-cpp-$cpp_version" -B /tmp/build-cpp \ + -D CMAKE_BUILD_TYPE=Release \ + -D BUILD_TESTS=OFF \ + -D BUILD_PERF_TOOLS=OFF \ + -D BUILD_DYNAMIC_LIB=ON \ + -D BUILD_STATIC_LIB=OFF \ + -D CMAKE_DISABLE_FIND_PACKAGE_zlib=ON + cmake --build /tmp/build-cpp -j "$(nproc)" --target install + echo /usr/local/lib > /etc/ld.so.conf.d/pulsar.conf + ldconfig + curl -fsSL "https://github.com/pybind/pybind11/archive/refs/tags/v$pybind11_version.tar.gz" | tar xz -C /tmp + rm -rf {project}/pybind11 + mv "/tmp/pybind11-$pybind11_version" {project}/pybind11 + bash {project}/collect-licenses.sh {project} + # setup.py ships a build_ext that only copies an already-compiled _pulsar.so, + # so the extension itself is built here, against this job's interpreter. + cibw-before-build-linux: |- + set -ex + rm -rf {package}/build + cmake -S {package} -B {package}/build -D CMAKE_BUILD_TYPE=Release -D Python3_EXECUTABLE="$(which python)" + cmake --build {package}/build -j "$(nproc)" + mv {package}/build/lib_pulsar.so {package}/ + cibw-test-extras: "avro,protobuf" + cibw-test-requires: "pytest requests" + cibw-test-sources: "tests/schema_test.py" + # Every test file upstream runs needs a live Pulsar cluster, and the + # apachepulsar/pulsar image its test service starts has no riscv64 build, so + # this runs the suite's one broker-free class plus upstream's own wheel check + # (pkg/test-wheel.sh) widened to exercise libpulsar's client lifecycle and its + # connection-error path. + cibw-test-command: "python -c \"import pulsar, logging; c = pulsar.Client('pulsar://localhost:6650', logger=logging.getLogger('t')); c.close()\" && python -c \"import pulsar, pytest; c = pulsar.Client('pulsar://127.0.0.1:1', connection_timeout_ms=2000, operation_timeout_seconds=2); pytest.raises(pulsar.PulsarException, c.create_producer, 'topic')\" && pytest -v tests/schema_test.py::ProtobufNativeSchemaTest" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PULSAR_CLIENT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pulsar-client-python v${{ env.PULSAR_CLIENT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: apache/pulsar-client-python - ref: v${{ env.PULSAR_CLIENT_VERSION }} - persist-credentials: false - - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of every shared library auditwheel - # vendors alongside libpulsar. setuptools' default LICENSE* glob copies them - # into the wheel. - set -euo pipefail - - project="${1:?usage: collect-licenses.sh }" - - # ldd is transitive, so the one linked library covers its whole closure. - # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist and - # are never vendored into the wheel. - mapfile -t libs < <(ldd /usr/local/lib/libpulsar.so | tr ' ' '\n' | grep '^/' | sort -u) - - # `rpm -qf` reports unowned files on stdout, so keep only bare package names. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' - ) - - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - - # Some subpackages leave the licence to a sibling of the same source RPM. - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi - - # Others mark it %doc rather than %license, and the image installs no docs. - if [ -z "${files[0]:-}" ]; then - dnf -y reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi - - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done - - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Rocky's zlib-ng ships a ZLIB CMake config pointing at a libz.a it does not - # install, so LegacyFindPackages.cmake's own find_library fallback is used. - CIBW_BEFORE_ALL_LINUX: | - set -ex - dnf -y install --enablerepo=crb boost-devel openssl-devel libcurl-devel \ - zlib-devel snappy-devel libzstd-devel protobuf-devel protobuf-compiler - cpp_version="$(awk '/^pulsar-cpp:/ {print $2}' {project}/dependencies.yaml)" - pybind11_version="$(awk '/^pybind11:/ {print $2}' {project}/dependencies.yaml)" - curl -fsSL "https://archive.apache.org/dist/pulsar/pulsar-client-cpp-$cpp_version/apache-pulsar-client-cpp-$cpp_version.tar.gz" | tar xz -C /tmp - cmake -S "/tmp/apache-pulsar-client-cpp-$cpp_version" -B /tmp/build-cpp \ - -D CMAKE_BUILD_TYPE=Release \ - -D BUILD_TESTS=OFF \ - -D BUILD_PERF_TOOLS=OFF \ - -D BUILD_DYNAMIC_LIB=ON \ - -D BUILD_STATIC_LIB=OFF \ - -D CMAKE_DISABLE_FIND_PACKAGE_zlib=ON - cmake --build /tmp/build-cpp -j "$(nproc)" --target install - echo /usr/local/lib > /etc/ld.so.conf.d/pulsar.conf - ldconfig - curl -fsSL "https://github.com/pybind/pybind11/archive/refs/tags/v$pybind11_version.tar.gz" | tar xz -C /tmp - rm -rf {project}/pybind11 - mv "/tmp/pybind11-$pybind11_version" {project}/pybind11 - bash {project}/collect-licenses.sh {project} - # setup.py ships a build_ext that only copies an already-compiled _pulsar.so, - # so the extension itself is built here, against this job's interpreter. - CIBW_BEFORE_BUILD_LINUX: | - set -ex - rm -rf {package}/build - cmake -S {package} -B {package}/build -D CMAKE_BUILD_TYPE=Release -D Python3_EXECUTABLE="$(which python)" - cmake --build {package}/build -j "$(nproc)" - mv {package}/build/lib_pulsar.so {package}/ - CIBW_TEST_EXTRAS: avro,protobuf - CIBW_TEST_REQUIRES: pytest requests - CIBW_TEST_SOURCES: tests/schema_test.py - # Every test file upstream runs needs a live Pulsar cluster, and the - # apachepulsar/pulsar image its test service starts has no riscv64 build, so - # this runs the suite's one broker-free class plus upstream's own wheel check - # (pkg/test-wheel.sh) widened to exercise libpulsar's client lifecycle and its - # connection-error path. - CIBW_TEST_COMMAND: >- - python -c "import pulsar, logging; c = pulsar.Client('pulsar://localhost:6650', logger=logging.getLogger('t')); c.close()" && - python -c "import pulsar, pytest; c = pulsar.Client('pulsar://127.0.0.1:1', connection_timeout_ms=2000, operation_timeout_seconds=2); pytest.raises(pulsar.PulsarException, c.create_producer, 'topic')" && - pytest -v tests/schema_test.py::ProtobufNativeSchemaTest + name: pulsar-client-${{ env.PULSAR_CLIENT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the extension, libpulsar and the vendored licences run: | @@ -193,12 +200,6 @@ jobs: print("\n".join(sorted(lic))) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pulsar-client-${{ env.PULSAR_CLIENT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -234,7 +235,7 @@ jobs: publish: name: Publish pulsar-client ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pupil-apriltags.yml b/.github/workflows/build-pupil-apriltags.yml index 371e8be2cb5c..d96a0855d227 100644 --- a/.github/workflows/build-pupil-apriltags.yml +++ b/.github/workflows/build-pupil-apriltags.yml @@ -59,7 +59,6 @@ jobs: checkout-submodules: true cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # cmake/ninja/numpy have no riscv64 wheel on public PyPI; pull ours too. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-environment: PIP_ONLY_BINARY=numpy timeout-minutes: 90 diff --git a/.github/workflows/build-py-radix.yml b/.github/workflows/build-py-radix.yml index a5f017bb3e51..71847dc39e46 100644 --- a/.github/workflows/build-py-radix.yml +++ b/.github/workflows/build-py-radix.yml @@ -61,7 +61,7 @@ jobs: cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 # setup.py appends a `+dev-v` local version unless VERSION matches # the hardcoded release tag exactly. - cibw-environment: VERSION=v${{ matrix.version }} + cibw-environment-linux: VERSION=v${{ matrix.version }} # radix/ at the checkout root (with a pure-Python fallback) would # otherwise shadow the installed wheel; CIBW_TEST_SOURCES stages only # tests/ into an empty cwd. diff --git a/.github/workflows/build-pya2ldb.yml b/.github/workflows/build-pya2ldb.yml index bb3f1579fafb..7feedc257274 100644 --- a/.github/workflows/build-pya2ldb.yml +++ b/.github/workflows/build-pya2ldb.yml @@ -62,9 +62,7 @@ jobs: # whose pyproject.toml/CMakeLists.txt are byte-identical to the released 1.0.355 sdist. # Update it alongside the package version. cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=SQLAlchemy + cibw-environment-linux: "PIP_ONLY_BINARY=SQLAlchemy" cibw-test-requires: pytest # gotcha 25: {project} in CIBW_TEST_COMMAND bypasses the staged test_cwd and # shadows the wheel with the unbuilt checkout. gotcha 36: test-sources keeps diff --git a/.github/workflows/build-pybammsolvers.yml b/.github/workflows/build-pybammsolvers.yml index ab355cdf6610..c59d499d7981 100644 --- a/.github/workflows/build-pybammsolvers.yml +++ b/.github/workflows/build-pybammsolvers.yml @@ -56,68 +56,74 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pybammsolvers ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pybammsolvers" + version: "${{ matrix.version }}" + repository: "pybamm-team/PyBaMM" + ref: "pybammsolvers-v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-submodules: "recursive" + pre-build: |- + export PYBAMMSOLVERS_VERSION='${{ matrix.version }}' + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + patches="$PWD/python-wheels/patches/pybammsolvers/$PYBAMMSOLVERS_VERSION" + if [ -d "$patches" ]; then + git apply "$patches"/*.patch + fi + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "packages/pybammsolvers" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # before-all runs from the checkout root, not package-dir, hence the cd; + # openblas-devel/lapack-devel satisfy SUNDIALS' ENABLE_LAPACK=ON. + cibw-before-all-linux: "dnf install -y --setopt=install_weak_deps=False openblas-devel lapack-devel && cd packages/pybammsolvers && python install_KLU_Sundials.py" + # casadi==3.8.1 (a build-time and runtime dependency) and numpy have no riscv64 + # wheel on public PyPI; reaches both phases (gotcha 12). + # libcasadi ships in the casadi wheel (RPATH $ORIGIN/../casadi); its soname stayed at 3.7 in 3.8. + cibw-repair-wheel-command-linux: "auditwheel repair --exclude libcasadi.so.3.7 -w {dest_dir} {wheel}" + cibw-test-extras: "dev" + # {project} is the cibuildwheel invocation cwd (this job's checkout root, + # the whole PyBaMM monorepo) - {package} is package-dir. Upstream's own + # CIBW_TEST_COMMAND uses {project}/tests, but that only works there because + # its job sets working-directory: packages/pybammsolvers, making {project} + # and {package} the same directory. Here they differ, so {project}/tests + # resolves to a tests/ that doesn't exist at the monorepo root. + cibw-test-command: |- + set -e -x + python -m pytest {package}/tests + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYBAMMSOLVERS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pybamm-team/PyBaMM pybammsolvers-v${{ env.PYBAMMSOLVERS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pybamm-team/PyBaMM - ref: pybammsolvers-v${{ env.PYBAMMSOLVERS_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # Only some versions need patching, so a missing directory is not an error. - - name: Patch pybammsolvers source - run: | - patches="$PWD/python-wheels/patches/pybammsolvers/$PYBAMMSOLVERS_VERSION" - if [ -d "$patches" ]; then - git apply "$patches"/*.patch - fi - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: packages/pybammsolvers - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # before-all runs from the checkout root, not package-dir, hence the cd; - # openblas-devel/lapack-devel satisfy SUNDIALS' ENABLE_LAPACK=ON. - CIBW_BEFORE_ALL_LINUX: >- - dnf install -y --setopt=install_weak_deps=False openblas-devel lapack-devel && - cd packages/pybammsolvers && - python install_KLU_Sundials.py - # casadi==3.8.1 (a build-time and runtime dependency) and numpy have no riscv64 - # wheel on public PyPI; reaches both phases (gotcha 12). - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # libcasadi ships in the casadi wheel (RPATH $ORIGIN/../casadi); its soname stayed at 3.7 in 3.8. - CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair --exclude libcasadi.so.3.7 -w {dest_dir} {wheel} - CIBW_TEST_EXTRAS: dev - # {project} is the cibuildwheel invocation cwd (this job's checkout root, - # the whole PyBaMM monorepo) - {package} is package-dir. Upstream's own - # CIBW_TEST_COMMAND uses {project}/tests, but that only works there because - # its job sets working-directory: packages/pybammsolvers, making {project} - # and {package} the same directory. Here they differ, so {project}/tests - # resolves to a tests/ that doesn't exist at the monorepo root. - CIBW_TEST_COMMAND: | - set -e -x - python -m pytest {package}/tests + name: pybammsolvers-${{ env.PYBAMMSOLVERS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the idaklu extension and all licences run: | @@ -132,15 +138,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pybammsolvers-${{ env.PYBAMMSOLVERS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pybammsolvers ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pybcj.yml b/.github/workflows/build-pybcj.yml index 28823e3889f8..646b850a2f66 100644 --- a/.github/workflows/build-pybcj.yml +++ b/.github/workflows/build-pybcj.yml @@ -58,7 +58,6 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test cibw-test-sources: tests # bcj/__init__.py silently falls back to the pure-Python filter, so assert diff --git a/.github/workflows/build-pybedtools.yml b/.github/workflows/build-pybedtools.yml index 6ce794751e2d..a1f0c3e83d2b 100644 --- a/.github/workflows/build-pybedtools.yml +++ b/.github/workflows/build-pybedtools.yml @@ -62,7 +62,6 @@ jobs: cibw-test-requires: numpy pysam cibw-test-command: >- python -c "import pybedtools; from pybedtools.cbedtools import create_interval_from_list; iv = create_interval_from_list(['chr1', '1', '100']); assert str(iv).startswith('chr1'), iv; print('ok')" - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ timeout-minutes: 60 publish: diff --git a/.github/workflows/build-pyboy.yml b/.github/workflows/build-pyboy.yml index 17d91206e59b..1f164c0165c8 100644 --- a/.github/workflows/build-pyboy.yml +++ b/.github/workflows/build-pyboy.yml @@ -61,9 +61,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # numpy is both a build and a runtime dependency; only our registry has riscv64 # wheels, and PIP_ONLY_BINARY keeps a newer PyPI sdist from winning the resolution. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" # Upstream's own pytest suite needs commercial Game Boy ROMs downloaded/decrypted # via a PYTEST_SECRETS_KEY secret we don't have, so this checks the extensions # actually built and PyBoy imports instead of running that suite. diff --git a/.github/workflows/build-pybullet.yml b/.github/workflows/build-pybullet.yml index b873a07d86e1..0f7149d43492 100644 --- a/.github/workflows/build-pybullet.yml +++ b/.github/workflows/build-pybullet.yml @@ -53,52 +53,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pybullet ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pybullet" + version: "${{ matrix.version }}" + repository: "bulletphysics/bullet3" + ref: "6c888f4abd7b46f572587360cc214985f02e5c6b" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 1440 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py enables the numpy code paths from a plain `import numpy`, + # which a PEP 517 build-isolation overlay is invisible to, so numpy is + # preinstalled with isolation disabled (upstream's wheel.sh installs + # requirements.txt into the interpreter it then builds with). + # pybullet.c hands PyObject* to numpy's PyArrayObject* accessors, which + # GCC 14 rejects outright where upstream's older image only warned. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy CFLAGS=-Wno-error=incompatible-pointer-types" + cibw-before-build: "pip install setuptools wheel -r {package}/requirements.txt" + cibw-build-frontend: "pip; args: --no-build-isolation" + cibw-test-requires: "numpy" + # The unittests resolve `r2d2.urdf` & co through bullet's own relative + # `../../../data/` search path, so `data/` is staged beside them. + cibw-test-sources: "data examples/pybullet/unittests" + cibw-test-command: "cd examples/pybullet/unittests && python unittests.py && python userDataTest.py && python saveRestoreStateTest.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 1440 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYBULLET_VERSION: ${{ matrix.version }} - steps: - - name: Checkout bullet3 for pybullet ${{ env.PYBULLET_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: bulletphysics/bullet3 - ref: ${{ env.PYBULLET_REF }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py enables the numpy code paths from a plain `import numpy`, - # which a PEP 517 build-isolation overlay is invisible to, so numpy is - # preinstalled with isolation disabled (upstream's wheel.sh installs - # requirements.txt into the interpreter it then builds with). - # pybullet.c hands PyObject* to numpy's PyArrayObject* accessors, which - # GCC 14 rejects outright where upstream's older image only warned. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CFLAGS=-Wno-error=incompatible-pointer-types - CIBW_BEFORE_BUILD: pip install setuptools wheel -r {package}/requirements.txt - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_TEST_REQUIRES: numpy - # The unittests resolve `r2d2.urdf` & co through bullet's own relative - # `../../../data/` search path, so `data/` is staged beside them. - CIBW_TEST_SOURCES: data examples/pybullet/unittests - CIBW_TEST_COMMAND: >- - cd examples/pybullet/unittests && - python unittests.py && - python userDataTest.py && - python saveRestoreStateTest.py + name: pybullet-${{ env.PYBULLET_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -109,16 +109,9 @@ jobs: assert exts == {"pybullet", "eglRenderer"}, exts EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pybullet-${{ env.PYBULLET_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pybullet ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pycapnp.yml b/.github/workflows/build-pycapnp.yml index def94cbb1348..fce4602590d6 100644 --- a/.github/workflows/build-pycapnp.yml +++ b/.github/workflows/build-pycapnp.yml @@ -50,54 +50,60 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pycapnp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pycapnp" + version: "${{ matrix.version }}" + repository: "capnproto/pycapnp" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply -v python-wheels/patches/pycapnp/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # pycapnp bundles and statically links its own build of Cap'n Proto + # C++ (buildutils/bundle.py's pinned capnproto-c++-1.4.0, MIT), so + # its licence has to be staged manually for setup.cfg's + # license_files to pick up (gotcha-style: nothing upstream carries + # this into the wheel either). + cibw-before-all-linux: "curl -fsSLO https://capnproto.org/capnproto-c++-1.4.0.tar.gz && tar xzf capnproto-c++-1.4.0.tar.gz && cp capnproto-c++-1.4.0/LICENSE.txt /project/LICENSE.capnp" + cibw-test-requires: "pytest pytest-asyncio" + cibw-test-command: "pytest {project} -q" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYCAPNP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pycapnp v${{ env.PYCAPNP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: capnproto/pycapnp - ref: v${{ env.PYCAPNP_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply -v python-wheels/patches/pycapnp/${{ env.PYCAPNP_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # pycapnp bundles and statically links its own build of Cap'n Proto - # C++ (buildutils/bundle.py's pinned capnproto-c++-1.4.0, MIT), so - # its licence has to be staged manually for setup.cfg's - # license_files to pick up (gotcha-style: nothing upstream carries - # this into the wheel either). - CIBW_BEFORE_ALL_LINUX: >- - curl -fsSLO https://capnproto.org/capnproto-c++-1.4.0.tar.gz && - tar xzf capnproto-c++-1.4.0.tar.gz && - cp capnproto-c++-1.4.0/LICENSE.txt /project/LICENSE.capnp - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest pytest-asyncio - CIBW_TEST_COMMAND: pytest {project} -q + name: pycapnp-${{ env.PYCAPNP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel contents run: | @@ -111,15 +117,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pycapnp-${{ env.PYCAPNP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pycapnp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pycares.yml b/.github/workflows/build-pycares.yml index ccc85482a01f..e6a859093963 100644 --- a/.github/workflows/build-pycares.yml +++ b/.github/workflows/build-pycares.yml @@ -53,50 +53,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pycares ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - PYCARES_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout pycares v${{ env.PYCARES_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: saghul/pycares - ref: v${{ env.PYCARES_VERSION }} - submodules: true - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pycares" + version: "${{ matrix.version }}" + repository: "saghul/pycares" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + git apply python-wheels/patches/pycares/${{ matrix.version }}/00*.patch - # The extension statically links the bundled c-ares but ships only pycares' own LICENSE. - - name: Patch pycares source - run: | - git apply python-wheels/patches/pycares/${{ env.PYCARES_VERSION }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # cffi has no riscv64 wheel on public PyPI; ours saves a source build in both phases. + cibw-test-extras: "idna" + # cibuildwheel runs the tests in an empty directory, so stage upstream's suite there. + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import importlib.metadata as m; n=sorted(str(p).split('licenses/', 1)[1] for p in m.files('pycares') if 'licenses/' in str(p)); assert n == ['LICENSE', 'deps/c-ares/AUTHORS', 'deps/c-ares/LICENSE.md', 'deps/c-ares/LICENSES/APSL-2.0.txt', 'deps/c-ares/LICENSES/BSD-3-Clause.txt'], n\" && python -m unittest -v" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + PYCARES_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cffi has no riscv64 wheel on public PyPI; ours saves a source build in both phases. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_EXTRAS: idna - # cibuildwheel runs the tests in an empty directory, so stage upstream's suite there. - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import importlib.metadata as m; n=sorted(str(p).split('licenses/', 1)[1] for p in m.files('pycares') if 'licenses/' in str(p)); assert n == ['LICENSE', 'deps/c-ares/AUTHORS', 'deps/c-ares/LICENSE.md', 'deps/c-ares/LICENSES/APSL-2.0.txt', 'deps/c-ares/LICENSES/BSD-3-Clause.txt'], n" && - python -m unittest -v + name: pycares-${{ env.PYCARES_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the compiled extension made it into the wheel run: | @@ -108,15 +114,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pycares-${{ env.PYCARES_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pycares ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pycauset.yml b/.github/workflows/build-pycauset.yml index 175da5cb3691..d9e9dd261cf4 100644 --- a/.github/workflows/build-pycauset.yml +++ b/.github/workflows/build-pycauset.yml @@ -49,60 +49,63 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pycauset ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pycauset" + version: "${{ matrix.version }}" + repository: "BrorH/pycauset" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + checkout-fetch-depth: 0 + pre-build: |- + cat > collect-licenses.sh <<'EOF' + #!/bin/bash + set -euo pipefail + project="${1:?usage: collect-licenses.sh }" + cp /usr/share/licenses/openblas/LICENSE "${project}/LICENSE.openblas" + cp /usr/share/doc/lapack/LICENSE "${project}/LICENSE.lapack" + curl -fsSL --retry 3 https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 -o "${project}/LICENSE.eigen" + curl -fsSL --retry 3 https://raw.githubusercontent.com/pybind/pybind11/v2.12.0/LICENSE -o "${project}/LICENSE.pybind11" + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's before-all minus gcc-toolset-12 and ccache: the image's default GCC already has full C++20. + # lapack marks its LICENSE %doc (/usr/share/doc/lapack/LICENSE), which the image's + # tsflags=nodocs drops, so install with docs enabled (gotcha 137). + cibw-before-all-linux: "dnf -y --setopt=tsflags= install libatomic openblas-devel lapack-devel && bash {project}/collect-licenses.sh {project}" + cibw-environment-linux: "CMAKE_ARGS='-DPython_FIND_STRATEGY=LOCATION' PIP_ONLY_BINARY=numpy" + cibw-test-extras: "test" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest tests/python -q" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYCAUSET_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pycauset v${{ env.PYCAUSET_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: BrorH/pycauset - ref: v${{ env.PYCAUSET_VERSION }} - fetch-depth: 0 # setuptools_scm derives the version from git tag history - persist-credentials: false - - - name: Write the licence collector - # auditwheel vendors OpenBLAS and LAPACK(E) into pycauset.libs/, and the - # extension compiles in Eigen and pybind11 headers; scikit-build-core's - # default LICEN[CS]E* glob ships whatever is staged at the project root. - run: | - cat > collect-licenses.sh <<'EOF' - #!/bin/bash - set -euo pipefail - project="${1:?usage: collect-licenses.sh }" - cp /usr/share/licenses/openblas/LICENSE "${project}/LICENSE.openblas" - cp /usr/share/doc/lapack/LICENSE "${project}/LICENSE.lapack" - curl -fsSL --retry 3 https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 -o "${project}/LICENSE.eigen" - curl -fsSL --retry 3 https://raw.githubusercontent.com/pybind/pybind11/v2.12.0/LICENSE -o "${project}/LICENSE.pybind11" - EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's before-all minus gcc-toolset-12 and ccache: the image's default GCC already has full C++20. - # lapack marks its LICENSE %doc (/usr/share/doc/lapack/LICENSE), which the image's - # tsflags=nodocs drops, so install with docs enabled (gotcha 137). - CIBW_BEFORE_ALL_LINUX: >- - dnf -y --setopt=tsflags= install libatomic openblas-devel lapack-devel && - bash {project}/collect-licenses.sh {project} - CIBW_ENVIRONMENT_LINUX: >- - CMAKE_ARGS='-DPython_FIND_STRATEGY=LOCATION' - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_EXTRAS: test - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest tests/python -q + name: pycauset-${{ env.PYCAUSET_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and all licences run: | @@ -117,12 +120,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pycauset-${{ env.PYCAUSET_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -157,7 +154,7 @@ jobs: publish: name: Publish pycauset ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyclipper.yml b/.github/workflows/build-pyclipper.yml index 8eb980b72267..f3ba02ef5479 100644 --- a/.github/workflows/build-pyclipper.yml +++ b/.github/workflows/build-pyclipper.yml @@ -59,7 +59,6 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 checkout-fetch-depth: 0 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-requires: sympy pytest cibw-test-command: pytest {package}/tests -v timeout-minutes: 120 diff --git a/.github/workflows/build-pyclothoids.yml b/.github/workflows/build-pyclothoids.yml index fd84b77d83e2..bf2cdc19a4e9 100644 --- a/.github/workflows/build-pyclothoids.yml +++ b/.github/workflows/build-pyclothoids.yml @@ -51,48 +51,58 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyclothoids ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyclothoids" + version: "${{ matrix.version }}" + repository: "phillipd94/PyClothoids" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pyclothoids/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py's setup_requires fetches pybind11 via easy_install, which + # doesn't see our registry; preinstall and build against it directly. + cibw-before-build: "pip install setuptools pybind11" + cibw-build-frontend: "pip; args: --no-build-isolation" + cibw-test-requires: "pytest pytest-mock" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYCLOTHOIDS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout PyClothoids v${{ env.PYCLOTHOIDS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: phillipd94/PyClothoids - ref: v${{ env.PYCLOTHOIDS_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/pyclothoids/${{ env.PYCLOTHOIDS_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py's setup_requires fetches pybind11 via easy_install, which - # doesn't see our registry; preinstall and build against it directly. - CIBW_BEFORE_BUILD: pip install setuptools pybind11 - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_TEST_REQUIRES: pytest pytest-mock - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest -v tests + name: pyclothoids-${{ env.PYCLOTHOIDS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -106,15 +116,9 @@ jobs: assert licences == {"LICENSE", "LICENSE.Clothoids"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyclothoids-${{ env.PYCLOTHOIDS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyclothoids ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pycocotools.yml b/.github/workflows/build-pycocotools.yml index 48a54497db7c..7a2142ea7bf1 100644 --- a/.github/workflows/build-pycocotools.yml +++ b/.github/workflows/build-pycocotools.yml @@ -58,60 +58,28 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build pycocotools ${{ matrix.version }} cp312-abi3-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 90 - env: - PYCOCOTOOLS_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout cocoapi ${{ env.PYCOCOTOOLS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ppwwyyxx/cocoapi - ref: ${{ env.PYCOCOTOOLS_REF }} - persist-credentials: false - - # setup.py's Extension lives in PythonAPI/, but license.txt sits at the - # repo root, so setuptools' default LICEN[CS]E* glob never finds it and - # upstream's own wheels ship no licence (gotcha 86). - - name: Stage cocoapi's licence for the wheel - run: cp license.txt PythonAPI/LICENSE - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: ./PythonAPI - env: - CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is both a build and a runtime requirement, and only our - # registry has it for riscv64. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_COMMAND: python {project}/tests/test_cases.py - - - name: Check wheel contents - run: | - python3 - wheelhouse/*.whl <<'EOF' - import sys, zipfile - for whl in sys.argv[1:]: - names = zipfile.ZipFile(whl).namelist() - assert any(n == "pycocotools/_mask.abi3.so" for n in names), names - assert any(n.endswith(".dist-info/licenses/LICENSE") for n in names), names - print(whl, "ok") - EOF - - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pycocotools-${{ env.PYCOCOTOOLS_VERSION }}-cp312-abi3-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pycocotools" + version: "${{ matrix.version }}" + repository: "ppwwyyxx/cocoapi" + ref: "ac87f5077ad6b8864c2dc5e93d14cae62d1db05a" + artifact-tag: "cp312-abi3-manylinux_riscv64" + timeout-minutes: 90 + pre-build: |- + cp license.txt PythonAPI/LICENSE + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "./PythonAPI" + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # numpy is both a build and a runtime requirement, and only our + # registry has it for riscv64. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-command: "python {project}/tests/test_cases.py" - # Free-threaded wheel: Py_GIL_DISABLED disables the limited API in setup.py, - # so this is a per-interpreter build. Only cp314t - cibuildwheel 4.2.0 has no - # cp313t identifier on any platform (gotcha 204), matching upstream's own - # later decision to drop 3.13t support (PR #35, not in this release). build_freethreaded: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -120,35 +88,59 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build pycocotools ${{ matrix.version }} cp314t-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pycocotools" + version: "${{ matrix.version }}" + repository: "ppwwyyxx/cocoapi" + ref: "ac87f5077ad6b8864c2dc5e93d14cae62d1db05a" + artifact-tag: "cp314t-manylinux_riscv64" + timeout-minutes: 90 + pre-build: |- + cp license.txt PythonAPI/LICENSE + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "./PythonAPI" + cibw-build: "cp314t-manylinux_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-command: "python {project}/tests/test_cases.py" + + verify_wheels: + needs: [setup, build_abi3, build_freethreaded] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + wheel: [abi3, freethreaded] env: PYCOCOTOOLS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cocoapi ${{ env.PYCOCOTOOLS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ppwwyyxx/cocoapi - ref: ${{ env.PYCOCOTOOLS_REF }} - persist-credentials: false - - - name: Stage cocoapi's licence for the wheel - run: cp license.txt PythonAPI/LICENSE + name: pycocotools-${{ env.PYCOCOTOOLS_VERSION }}-${{ matrix.wheel == 'abi3' && 'cp312-abi3' || 'cp314t' }}-manylinux_riscv64 + path: wheelhouse - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: ./PythonAPI - env: - CIBW_BUILD: cp314t-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_COMMAND: python {project}/tests/test_cases.py + - name: Check ABI3 wheel contents + if: matrix.wheel == 'abi3' + run: | + python3 - wheelhouse/*.whl <<'EOF' + import sys, zipfile + for whl in sys.argv[1:]: + names = zipfile.ZipFile(whl).namelist() + assert any(n == "pycocotools/_mask.abi3.so" for n in names), names + assert any(n.endswith(".dist-info/licenses/LICENSE") for n in names), names + print(whl, "ok") + EOF - - name: Check wheel contents + - name: Check free-threaded wheel contents + if: matrix.wheel == 'freethreaded' run: | python3 - wheelhouse/*.whl <<'EOF' import sys, zipfile @@ -159,15 +151,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pycocotools-${{ env.PYCOCOTOOLS_VERSION }}-cp314t-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pycocotools ${{ matrix.version }} - needs: [setup, build_abi3, build_freethreaded] + needs: [setup, build_abi3, build_freethreaded, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pycryptosat.yml b/.github/workflows/build-pycryptosat.yml index 75a9a3a0fcc6..9adc93da37c0 100644 --- a/.github/workflows/build-pycryptosat.yml +++ b/.github/workflows/build-pycryptosat.yml @@ -48,46 +48,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pycryptosat ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pycryptosat" + version: "${{ matrix.version }}" + repository: "msoos/cryptominisat" + ref: "release/v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-submodules: "true" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # No EPEL (hence no ccache) on riscv64. CaDiCaL/CadiBack are cloned here, from the + # branches upstream's FetchContent tracks, so the bundled licences match what is built. + cibw-before-all-linux: "dnf -y install gmp-devel && git clone --depth 1 --branch master https://github.com/meelgroup/cadical /tmp/cadical && git clone --depth 1 --branch main https://github.com/meelgroup/cadiback /tmp/cadiback && cp /tmp/cadical/LICENSE /project/LICENSE.cadical && cp /tmp/cadiback/LICENSE /project/LICENSE.cadiback && cp /usr/share/licenses/gmp/COPYING.LESSERv3 /project/LICENSE.gmp && cp /usr/share/licenses/gmp/COPYINGv3 /project/LICENSE.gmp.GPL" + cibw-environment-linux: "PIP_ONLY_BINARY=cmake,ninja CMAKE_ARGS=\"-DFETCHCONTENT_SOURCE_DIR_CADICAL=/tmp/cadical -DFETCHCONTENT_SOURCE_DIR_CADIBACK=/tmp/cadiback\"" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYCRYPTOSAT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout cryptominisat release/v${{ env.PYCRYPTOSAT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: msoos/cryptominisat - ref: release/v${{ env.PYCRYPTOSAT_VERSION }} - submodules: 'true' - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # No EPEL (hence no ccache) on riscv64. CaDiCaL/CadiBack are cloned here, from the - # branches upstream's FetchContent tracks, so the bundled licences match what is built. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install gmp-devel && - git clone --depth 1 --branch master https://github.com/meelgroup/cadical /tmp/cadical && - git clone --depth 1 --branch main https://github.com/meelgroup/cadiback /tmp/cadiback && - cp /tmp/cadical/LICENSE /project/LICENSE.cadical && - cp /tmp/cadiback/LICENSE /project/LICENSE.cadiback && - cp /usr/share/licenses/gmp/COPYING.LESSERv3 /project/LICENSE.gmp && - cp /usr/share/licenses/gmp/COPYINGv3 /project/LICENSE.gmp.GPL - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=cmake,ninja - CMAKE_ARGS="-DFETCHCONTENT_SOURCE_DIR_CADICAL=/tmp/cadical -DFETCHCONTENT_SOURCE_DIR_CADIBACK=/tmp/cadiback" + name: pycryptosat-${{ env.PYCRYPTOSAT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension, vendored libraries and licences made it into the wheel run: | @@ -103,12 +99,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pycryptosat-${{ env.PYCRYPTOSAT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -142,7 +132,7 @@ jobs: publish: name: Publish pycryptosat ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pycurl.yml b/.github/workflows/build-pycurl.yml index e9b624c8da29..fe9485c4be67 100644 --- a/.github/workflows/build-pycurl.yml +++ b/.github/workflows/build-pycurl.yml @@ -49,129 +49,139 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pycurl ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - PYCURL_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout pycurl v${{ env.PYCURL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pycurl/pycurl - ref: v${{ env.PYCURL_VERSION }} - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pycurl" + version: "${{ matrix.version }}" + repository: "pycurl/pycurl" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + git apply python-wheels/patches/pycurl/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Patch pycurl source - run: git apply python-wheels/patches/pycurl/${{ env.PYCURL_VERSION }}/00*.patch + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of every shared library + # auditwheel vendors out of the build image alongside libcurl. + # setuptools' widened LICENSE.* glob (see the patch) copies them into the wheel. + set -euo pipefail - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of every shared library - # auditwheel vendors out of the build image alongside libcurl. - # setuptools' widened LICENSE.* glob (see the patch) copies them into the wheel. - set -euo pipefail + project="${1:?usage: collect-licenses.sh }" - project="${1:?usage: collect-licenses.sh }" + # ldd is transitive, so libcurl.so alone covers its whole closure; + # ldd does not list the root itself, so resolve that too. + mapfile -t libs < <( + { + ldd /usr/lib64/libcurl.so | tr ' ' '\n' | grep '^/' + readlink -f /usr/lib64/libcurl.so + } | sort -u + ) - # ldd is transitive, so libcurl.so alone covers its whole closure; - # ldd does not list the root itself, so resolve that too. - mapfile -t libs < <( - { - ldd /usr/lib64/libcurl.so | tr ' ' '\n' | grep '^/' - readlink -f /usr/lib64/libcurl.so - } | sort -u - ) + # `rpm -qf` reports unowned files on stdout, so keep only bare package names. + # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist and + # are never vendored into the wheel. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' + ) - # `rpm -qf` reports unowned files on stdout, so keep only bare package names. - # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist and - # are never vendored into the wheel. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' - ) + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + # Some subpackages leave the licence to a sibling of the same source RPM. + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi - # Some subpackages leave the licence to a sibling of the same source RPM. - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi + # Others mark it %doc rather than %license, and the image installs no docs. + if [ -z "${files[0]:-}" ]; then + dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi - # Others mark it %doc rather than %license, and the image installs no docs. - if [ -z "${files[0]:-}" ]; then - dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Replaces upstream's vcpkg before-all: the riscv64 image's own + # libcurl-devel (appstream, not EPEL - gotcha 51) is a full build of + # curl, so no source build is needed. + cibw-before-all-linux: "dnf install -y libcurl-devel && bash {project}/collect-licenses.sh {project}" + cibw-environment-linux: "PYCURL_SSL_LIBRARY=openssl" + # paramiko's cryptography/bcrypt deps have no riscv64 wheel below cp312; + # fall back to the rest of the dev requirements so its sftp tests, which are + # pytest.importorskip'd, skip instead of failing metadata generation. + # 7.49.0 replaced requirements-dev.txt with a `test` dependency group in + # pyproject.toml (`pip install --group test`); older releases still ship the file. + cibw-before-test-linux: |- + if [ -f {package}/requirements-dev.txt ]; then + pip install flake8 -r {package}/requirements-dev.txt || + { grep -v '^paramiko' {package}/requirements-dev.txt > /tmp/requirements-dev.txt && + pip install flake8 -r /tmp/requirements-dev.txt; }; + else + pip install flake8 --group {package}/pyproject.toml:test || + { pip install tomli && + python -c "import tomli; print(*[r for r in tomli.load(open('{package}/pyproject.toml', 'rb'))['dependency-groups']['test'] if not r.startswith('paramiko')], sep='\n')" > /tmp/requirements-test.txt && + pip install flake8 -r /tmp/requirements-test.txt; }; + fi && make -C {package}/tests/fake-curl/libcurl + cibw-test-command: "pytest -v -ra {project}/tests" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + PYCURL_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces upstream's vcpkg before-all: the riscv64 image's own - # libcurl-devel (appstream, not EPEL - gotcha 51) is a full build of - # curl, so no source build is needed. - CIBW_BEFORE_ALL_LINUX: >- - dnf install -y libcurl-devel && - bash {project}/collect-licenses.sh {project} - CIBW_ENVIRONMENT: >- - PYCURL_SSL_LIBRARY=openssl - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # paramiko's cryptography/bcrypt deps have no riscv64 wheel below cp312; - # fall back to the rest of the dev requirements so its sftp tests, which are - # pytest.importorskip'd, skip instead of failing metadata generation. - # 7.49.0 replaced requirements-dev.txt with a `test` dependency group in - # pyproject.toml (`pip install --group test`); older releases still ship the file. - CIBW_BEFORE_TEST_LINUX: >- - if [ -f {package}/requirements-dev.txt ]; then - pip install flake8 -r {package}/requirements-dev.txt || - { grep -v '^paramiko' {package}/requirements-dev.txt > /tmp/requirements-dev.txt && - pip install flake8 -r /tmp/requirements-dev.txt; }; - else - pip install flake8 --group {package}/pyproject.toml:test || - { pip install tomli && - python -c "import tomli; print(*[r for r in tomli.load(open('{package}/pyproject.toml', 'rb'))['dependency-groups']['test'] if not r.startswith('paramiko')], sep='\n')" > /tmp/requirements-test.txt && - pip install flake8 -r /tmp/requirements-test.txt; }; - fi && - make -C {package}/tests/fake-curl/libcurl - CIBW_TEST_COMMAND: pytest -v -ra {project}/tests + name: pycurl-${{ env.PYCURL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension and licences run: | @@ -195,12 +205,6 @@ jobs: assert expected_pkgs <= have_pkgs, expected_pkgs - have_pkgs EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pycurl-${{ env.PYCURL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -239,7 +243,7 @@ jobs: publish: name: Publish pycurl ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pydemumble.yml b/.github/workflows/build-pydemumble.yml index 588484b23c4a..a57f2e39f72f 100644 --- a/.github/workflows/build-pydemumble.yml +++ b/.github/workflows/build-pydemumble.yml @@ -63,9 +63,7 @@ jobs: cibw-build: cp312-${{ matrix.libc }}_riscv64 cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 # Ship the licences of the statically linked nanobind/robin_map and the vendored LLVM/Swift demanglers. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - SKBUILD_WHEEL_LICENSE_FILES="LICENSE;src/nanobind/LICENSE;src/nanobind/ext/robin_map/LICENSE;src/third_party/llvm/LICENSE.txt;src/third_party/swift/LICENSE.txt" + cibw-environment-linux: "SKBUILD_WHEEL_LICENSE_FILES=\"LICENSE;src/nanobind/LICENSE;src/nanobind/ext/robin_map/LICENSE;src/third_party/llvm/LICENSE.txt;src/third_party/swift/LICENSE.txt\"" timeout-minutes: 60 publish: diff --git a/.github/workflows/build-pydivsufsort.yml b/.github/workflows/build-pydivsufsort.yml index 1151f438605f..18c00d69b6ce 100644 --- a/.github/workflows/build-pydivsufsort.yml +++ b/.github/workflows/build-pydivsufsort.yml @@ -49,53 +49,59 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pydivsufsort ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pydivsufsort" + version: "${{ matrix.version }}" + repository: "louisabraham/pydivsufsort" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "recursive" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream builds libdivsufsort on the host runner, before cibuildwheel + # starts, then skips the rebuild inside the container + # (SKIP_LIBDIVSUFSORT_BUILD). Our riscv64 runner has no PyPI cmake wheel + # to fall back on (gotcha 1 shape), so this builds libdivsufsort inside + # the manylinux container instead, with the same CMake invocation as + # upstream's build.sh. + cibw-before-all: |- + set -e + dnf install -y -q cmake + cmake -S {project}/libdivsufsort -B /tmp/libdivsufsort-build \ + -DBUILD_DIVSUFSORT64=ON -DBUILD_EXAMPLES=OFF -DUSE_OPENMP=ON \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + cmake --build /tmp/libdivsufsort-build -j"$(nproc)" + cp /tmp/libdivsufsort-build/lib/libdivsufsort.so* \ + /tmp/libdivsufsort-build/lib/libdivsufsort64.so* \ + {project}/pydivsufsort/ + # Upstream's own wheel omits this; the wheel ships libdivsufsort's + # compiled .so as package_data, so its licence travels with it too. + cp {project}/libdivsufsort/LICENSE {project}/LICENSE.libdivsufsort + cibw-environment-linux: "SKIP_LIBDIVSUFSORT_BUILD=1" + cibw-test-requires: "pytest" + cibw-test-command: "pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PYDIVSUFSORT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pydivsufsort ${{ env.PYDIVSUFSORT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: louisabraham/pydivsufsort - ref: v${{ env.PYDIVSUFSORT_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream builds libdivsufsort on the host runner, before cibuildwheel - # starts, then skips the rebuild inside the container - # (SKIP_LIBDIVSUFSORT_BUILD). Our riscv64 runner has no PyPI cmake wheel - # to fall back on (gotcha 1 shape), so this builds libdivsufsort inside - # the manylinux container instead, with the same CMake invocation as - # upstream's build.sh. - CIBW_BEFORE_ALL: | - set -e - dnf install -y -q cmake - cmake -S {project}/libdivsufsort -B /tmp/libdivsufsort-build \ - -DBUILD_DIVSUFSORT64=ON -DBUILD_EXAMPLES=OFF -DUSE_OPENMP=ON \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - cmake --build /tmp/libdivsufsort-build -j"$(nproc)" - cp /tmp/libdivsufsort-build/lib/libdivsufsort.so* \ - /tmp/libdivsufsort-build/lib/libdivsufsort64.so* \ - {project}/pydivsufsort/ - # Upstream's own wheel omits this; the wheel ships libdivsufsort's - # compiled .so as package_data, so its licence travels with it too. - cp {project}/libdivsufsort/LICENSE {project}/LICENSE.libdivsufsort - CIBW_ENVIRONMENT: SKIP_LIBDIVSUFSORT_BUILD=1 - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest {project}/tests + name: pydivsufsort-${{ env.PYDIVSUFSORT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the bundled licences made it into the wheel run: | @@ -109,12 +115,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pydivsufsort-${{ env.PYDIVSUFSORT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -150,7 +150,7 @@ jobs: publish: name: Publish pydivsufsort ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pye57.yml b/.github/workflows/build-pye57.yml index b2973273d21d..e15e53fa2f73 100644 --- a/.github/workflows/build-pye57.yml +++ b/.github/workflows/build-pye57.yml @@ -49,6 +49,37 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pye57 ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pye57" + version: "${{ matrix.version }}" + repository: "davidcaron/pye57" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + timeout-minutes: 120 + checkout-submodules: "recursive" + pre-build: |- + cp libE57Format/LICENSE.md LICENSE.libE57Format.md + cp libE57Format/extern/CRCpp/LICENSE LICENSE.CRCpp + xerces_version=$(sed -n 's/^XERCES_\(MAJOR\|MINOR\|PATCH\)=//p' scripts/install_xerces_c.sh | paste -sd.) + curl -fsSL --retry 5 -o LICENSE.xerces-c "https://raw.githubusercontent.com/apache/xerces-c/v${xerces_version}/LICENSE" + curl -fsSL --retry 5 -o NOTICE.xerces-c "https://raw.githubusercontent.com/apache/xerces-c/v${xerces_version}/NOTICE" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + cibw-before-all-linux: "bash scripts/install_xerces_c.sh" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: @@ -57,36 +88,12 @@ jobs: include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PYE57_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pye57 ${{ env.PYE57_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: davidcaron/pye57 - ref: v${{ env.PYE57_VERSION }} - submodules: recursive - persist-credentials: false - - # Upstream's wheel bundles libE57Format, CRCpp and Xerces-C but ships none of their licences. - - name: Stage the bundled dependencies' licences - run: | - cp libE57Format/LICENSE.md LICENSE.libE57Format.md - cp libE57Format/extern/CRCpp/LICENSE LICENSE.CRCpp - xerces_version=$(sed -n 's/^XERCES_\(MAJOR\|MINOR\|PATCH\)=//p' scripts/install_xerces_c.sh | paste -sd.) - curl -fsSL --retry 5 -o LICENSE.xerces-c "https://raw.githubusercontent.com/apache/xerces-c/v${xerces_version}/LICENSE" - curl -fsSL --retry 5 -o NOTICE.xerces-c "https://raw.githubusercontent.com/apache/xerces-c/v${xerces_version}/NOTICE" - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: "bash scripts/install_xerces_c.sh" - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + name: pye57-${{ env.PYE57_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Check the bundled licences made it into the wheel run: | @@ -102,15 +109,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pye57-${{ env.PYE57_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pye57 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyedflib.yml b/.github/workflows/build-pyedflib.yml index e8878b03d1a5..30ee51b3cd12 100644 --- a/.github/workflows/build-pyedflib.yml +++ b/.github/workflows/build-pyedflib.yml @@ -48,42 +48,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyedflib ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyedflib" + version: "${{ matrix.version }}" + repository: "holgern/pyedflib" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is both a build and a runtime requirement, and only our registry + # has it for riscv64; only-binary keeps a newer PyPI release from winning + # the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest" + # pyedflib/tests has no __init__.py, so it isn't importable via --pyargs; + # stage just the suite so `import pyedflib` resolves to the installed wheel. + cibw-test-sources: "pyedflib/tests" + cibw-test-command: "python -m pytest pyedflib/tests -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYEDFLIB_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyedflib v${{ env.PYEDFLIB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: holgern/pyedflib - ref: v${{ env.PYEDFLIB_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is both a build and a runtime requirement, and only our registry - # has it for riscv64; only-binary keeps a newer PyPI release from winning - # the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest - # pyedflib/tests has no __init__.py, so it isn't importable via --pyargs; - # stage just the suite so `import pyedflib` resolves to the installed wheel. - CIBW_TEST_SOURCES: pyedflib/tests - CIBW_TEST_COMMAND: python -m pytest pyedflib/tests -v + name: pyedflib-${{ env.PYEDFLIB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -96,16 +101,9 @@ jobs: assert "LICENSE" in licences, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyedflib-${{ env.PYEDFLIB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyedflib ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyerfa.yml b/.github/workflows/build-pyerfa.yml index 4b912bad792d..9fd5c9dcaa3d 100644 --- a/.github/workflows/build-pyerfa.yml +++ b/.github/workflows/build-pyerfa.yml @@ -54,46 +54,46 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build pyerfa ${{ matrix.version }} cp39-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyerfa" + version: "${{ matrix.version }}" + repository: "liberfa/pyerfa" + ref: "v${{ matrix.version }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 90 + checkout-submodules: "true" + # setup.py's bdist_wheel_abi3 always tags the wheel cp39-abi3 + # regardless of the interpreter that builds it (gotcha 34); numpy + # (a build and runtime requirement) has no riscv64 wheel for + # cp39/cp310 on our registry, so cp311 is the oldest we can build + # on. cibuildwheel builds there once and reuses+retests it on + # cp312-cp314 via find_compatible_wheel. + cibw-build: "cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # numpy is a build and a runtime requirement, and only our registry + # has it for riscv64; only-binary keeps a newer PyPI release from + # winning the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYERFA=${{ matrix.version }}" + cibw-test-extras: "test" + cibw-test-command: "pytest --pyargs erfa" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: PYERFA_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyerfa v${{ env.PYERFA_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: liberfa/pyerfa - ref: v${{ env.PYERFA_VERSION }} - submodules: true # liberfa/erfa (the vendored ERFA C library) is a submodule - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # setup.py's bdist_wheel_abi3 always tags the wheel cp39-abi3 - # regardless of the interpreter that builds it (gotcha 34); numpy - # (a build and runtime requirement) has no riscv64 wheel for - # cp39/cp310 on our registry, so cp311 is the oldest we can build - # on. cibuildwheel builds there once and reuses+retests it on - # cp312-cp314 via find_compatible_wheel. - CIBW_BUILD: >- - cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_ARCHS: riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build and a runtime requirement, and only our registry - # has it for riscv64; only-binary keeps a newer PyPI release from - # winning the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYERFA=${{ env.PYERFA_VERSION }} - CIBW_TEST_EXTRAS: test - CIBW_TEST_COMMAND: pytest --pyargs erfa + name: pyerfa-${{ env.PYERFA_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -115,16 +115,9 @@ jobs: assert licences, names EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyerfa-${{ env.PYERFA_VERSION }}-cp39-abi3-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyerfa ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyfastx.yml b/.github/workflows/build-pyfastx.yml index 805f92ed0d6f..2457cb2ba4ce 100644 --- a/.github/workflows/build-pyfastx.yml +++ b/.github/workflows/build-pyfastx.yml @@ -51,48 +51,58 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyfastx ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyfastx" + version: "${{ matrix.version }}" + repository: "lmdu/pyfastx" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pyfastx/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pyfaidx==0.5.8 pytest" + # Not upstream's `setup.py build_ext -i && pytest {project}/tests`: + # tests/ is a package, so pytest would put {project} on sys.path + # ahead of site-packages and import that in-place rebuild instead + # of the wheel just installed (gotcha 25). test_fasta.py also reads + # src/version.h directly, so src/ is staged alongside tests/. + cibw-test-sources: "tests src" + cibw-test-command: "python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYFASTX_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyfastx ${{ env.PYFASTX_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: lmdu/pyfastx - ref: ${{ env.PYFASTX_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pyfastx source - run: git apply python-wheels/patches/pyfastx/${{ env.PYFASTX_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pyfaidx==0.5.8 pytest - # Not upstream's `setup.py build_ext -i && pytest {project}/tests`: - # tests/ is a package, so pytest would put {project} on sys.path - # ahead of site-packages and import that in-place rebuild instead - # of the wheel just installed (gotcha 25). test_fasta.py also reads - # src/version.h directly, so src/ is staged alongside tests/. - CIBW_TEST_SOURCES: tests src - CIBW_TEST_COMMAND: python -m pytest tests + name: pyfastx-${{ env.PYFASTX_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and every vendored licence run: | @@ -107,16 +117,9 @@ jobs: print(whl, "ok") EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyfastx-${{ env.PYFASTX_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyfastx ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyfftw.yml b/.github/workflows/build-pyfftw.yml index 1120b6b1b6dc..57341c9870fe 100644 --- a/.github/workflows/build-pyfftw.yml +++ b/.github/workflows/build-pyfftw.yml @@ -51,57 +51,58 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyfftw ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyfftw" + version: "${{ matrix.version }}" + repository: "pyFFTW/pyFFTW" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pyfftw/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's before-all, plus the notice for the libfftw3* that + # auditwheel vendors (upstream's wheels ship none). + cibw-before-all-linux: "yum install -y fftw-devel && cp /usr/share/licenses/fftw-libs-double/COPYING {project}/LICENSE.fftw" + cibw-environment-linux: "PIP_PREFER_BINARY=true PIP_ONLY_BINARY=numpy,scipy SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYFFTW=${{ matrix.version }}" + # These 21 tests hardcode x86 SSE/AVX alignment (16/32 bytes, /proc/cpuinfo + # "flags"); upstream skips all aarch64 tests for the same 21 (pyFFTW/pyFFTW#326). + cibw-test-command: "pytest --import-mode=append {project} -k \"not (BuildersTest and test_auto_align_input) and not test_aligned_flag and not test_flags and not test_get_alignment and not (test_alignment and not LongDouble)\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYFFTW_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyFFTW v${{ env.PYFFTW_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pyFFTW/pyFFTW - ref: v${{ env.PYFFTW_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/pyfftw/${{ env.PYFFTW_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's before-all, plus the notice for the libfftw3* that - # auditwheel vendors (upstream's wheels ship none). - CIBW_BEFORE_ALL_LINUX: >- - yum install -y fftw-devel && - cp /usr/share/licenses/fftw-libs-double/COPYING {project}/LICENSE.fftw - CIBW_ENVIRONMENT: >- - PIP_PREFER_BINARY=true - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYFFTW=${{ env.PYFFTW_VERSION }} - # These 21 tests hardcode x86 SSE/AVX alignment (16/32 bytes, /proc/cpuinfo - # "flags"); upstream skips all aarch64 tests for the same 21 (pyFFTW/pyFFTW#326). - CIBW_TEST_COMMAND: >- - pytest --import-mode=append {project} - -k "not (BuildersTest and test_auto_align_input) and not test_aligned_flag - and not test_flags and not test_get_alignment - and not (test_alignment and not LongDouble)" + name: pyfftw-${{ env.PYFFTW_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel vendors FFTW and ships its licence run: | @@ -116,12 +117,6 @@ jobs: print(whl, "ok", sorted(libs)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyfftw-${{ env.PYFFTW_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -156,7 +151,7 @@ jobs: publish: name: Publish pyfftw ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyfqmr.yml b/.github/workflows/build-pyfqmr.yml index 1bd468f33cc6..b67a26adfbd8 100644 --- a/.github/workflows/build-pyfqmr.yml +++ b/.github/workflows/build-pyfqmr.yml @@ -49,37 +49,41 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyfqmr ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyfqmr" + version: "${{ matrix.version }}" + repository: "Kramer84/pyfqmr-Fast-quadric-Mesh-Reduction" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy and cython (both build and test/runtime deps) ship no riscv64 wheel on + # public PyPI; ours is what resolves them. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest trimesh" + cibw-test-command: "python -c \"import pyfqmr; assert pyfqmr.Simplify\" && python -m pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PYFQMR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyfqmr v${{ env.PYFQMR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Kramer84/pyfqmr-Fast-quadric-Mesh-Reduction - ref: v${{ env.PYFQMR_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy and cython (both build and test/runtime deps) ship no riscv64 wheel on - # public PyPI; ours is what resolves them. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest trimesh - CIBW_TEST_COMMAND: >- - python -c "import pyfqmr; assert pyfqmr.Simplify" && - python -m pytest {project}/tests + name: pyfqmr-${{ env.PYFQMR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -91,16 +95,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyfqmr-${{ env.PYFQMR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyfqmr ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pygame-ce.yml b/.github/workflows/build-pygame-ce.yml index 24b8745ec8c9..e79a2c485461 100644 --- a/.github/workflows/build-pygame-ce.yml +++ b/.github/workflows/build-pygame-ce.yml @@ -49,164 +49,166 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pygame-ce ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - PYGAME_CE_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout pygame-ce ${{ env.PYGAME_CE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pygame-community/pygame-ce - ref: ${{ env.PYGAME_CE_VERSION }} - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pygame-ce" + version: "${{ matrix.version }}" + repository: "pygame-community/pygame-ce" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + git apply python-wheels/patches/pygame-ce/${{ matrix.version }}/00*.patch - - name: Patch pygame-ce source - run: | - git apply python-wheels/patches/pygame-ce/${{ env.PYGAME_CE_VERSION }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream builds its own SDL2 stack from source in a ghcr.io docker_base + # image (buildconfig/manylinux-build/docker_base) it doesn't publish for + # riscv64. This rebuilds only the pieces that image's dnf repos can't + # provide, at the same versions/CMake flags as its sdl_libs/portmidi + # build scripts (no riscv64 SDL2-devel package exists at all: Rocky 10 + # dropped it for sdl2-compat, a headless SDL3-backed shim -- see + # build-pygame.yml / gotcha 288). libpng, libjpeg-turbo, freetype, + # libwebp, libtiff, mpg123, flac, libvorbis+libogg and opus come from + # Rocky 10's own repos, same as build-pygame.yml. + cibw-before-all: |- + dnf install -y -q \ + libpng-devel libjpeg-turbo-devel freetype-devel libwebp-devel libtiff-devel \ + mpg123-devel flac-devel libvorbis-devel libogg-devel opus-devel \ + libX11-devel libXext-devel libXcursor-devel libXi-devel libXrandr-devel \ + libXinerama-devel libXxf86vm-devel libxkbcommon-devel \ + wayland-devel wayland-protocols-devel dbus-devel dbus-tools \ + alsa-lib-devel pulseaudio-libs-devel dejavu-sans-fonts - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream builds its own SDL2 stack from source in a ghcr.io docker_base - # image (buildconfig/manylinux-build/docker_base) it doesn't publish for - # riscv64. This rebuilds only the pieces that image's dnf repos can't - # provide, at the same versions/CMake flags as its sdl_libs/portmidi - # build scripts (no riscv64 SDL2-devel package exists at all: Rocky 10 - # dropped it for sdl2-compat, a headless SDL3-backed shim -- see - # build-pygame.yml / gotcha 288). libpng, libjpeg-turbo, freetype, - # libwebp, libtiff, mpg123, flac, libvorbis+libogg and opus come from - # Rocky 10's own repos, same as build-pygame.yml. - CIBW_BEFORE_ALL: | - dnf install -y -q \ - libpng-devel libjpeg-turbo-devel freetype-devel libwebp-devel libtiff-devel \ - mpg123-devel flac-devel libvorbis-devel libogg-devel opus-devel \ - libX11-devel libXext-devel libXcursor-devel libXi-devel libXrandr-devel \ - libXinerama-devel libXxf86vm-devel libxkbcommon-devel \ - wayland-devel wayland-protocols-devel dbus-devel dbus-tools \ - alsa-lib-devel pulseaudio-libs-devel dejavu-sans-fonts + export MAKEFLAGS="-j$(nproc)" + mkdir -p /tmp/pg-deps && cd /tmp/pg-deps + mkdir -p /usr/local/share/pg-licenses - export MAKEFLAGS="-j$(nproc)" - mkdir -p /tmp/pg-deps && cd /tmp/pg-deps - mkdir -p /usr/local/share/pg-licenses + curl -fsSL --retry 5 -o portmidi.tar.gz https://github.com/PortMidi/portmidi/archive/refs/tags/v2.0.7.tar.gz + tar xzf portmidi.tar.gz + (cd portmidi-2.0.7 && cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON && make && make install) + cp portmidi-2.0.7/license.txt /usr/local/share/pg-licenses/LICENSE.portmidi.txt - curl -fsSL --retry 5 -o portmidi.tar.gz https://github.com/PortMidi/portmidi/archive/refs/tags/v2.0.7.tar.gz - tar xzf portmidi.tar.gz - (cd portmidi-2.0.7 && cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON && make && make install) - cp portmidi-2.0.7/license.txt /usr/local/share/pg-licenses/LICENSE.portmidi.txt + curl -fsSL --retry 5 -o SDL2.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.32.10/SDL2-2.32.10.tar.gz + tar xzf SDL2.tar.gz + (cd SDL2-2.32.10 && mkdir builddir && cd builddir && cmake -S .. -B . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DSDL_VULKAN=0 && make && make install) + cp SDL2-2.32.10/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2.txt - curl -fsSL --retry 5 -o SDL2.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.32.10/SDL2-2.32.10.tar.gz - tar xzf SDL2.tar.gz - (cd SDL2-2.32.10 && mkdir builddir && cd builddir && cmake -S .. -B . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DSDL_VULKAN=0 && make && make install) - cp SDL2-2.32.10/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2.txt + curl -fsSL --retry 5 -o SDL2_image.tar.gz https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.12/SDL2_image-2.8.12.tar.gz + tar xzf SDL2_image.tar.gz + (cd SDL2_image-2.8.12 && mkdir builddir && cd builddir && cmake -S .. -B . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON \ + -DSDL2IMAGE_DEPS_SHARED=0 -DSDL2IMAGE_VENDORED=0 -DSDL2IMAGE_BACKEND_STB=0 -DSDL2IMAGE_AVIF=0 -DSDL2IMAGE_JXL=0 -DSDL2IMAGE_TIF=1 -DSDL2IMAGE_WEBP=1 \ + && make && make install) + cp SDL2_image-2.8.12/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2_image.txt - curl -fsSL --retry 5 -o SDL2_image.tar.gz https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.12/SDL2_image-2.8.12.tar.gz - tar xzf SDL2_image.tar.gz - (cd SDL2_image-2.8.12 && mkdir builddir && cd builddir && cmake -S .. -B . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON \ - -DSDL2IMAGE_DEPS_SHARED=0 -DSDL2IMAGE_VENDORED=0 -DSDL2IMAGE_BACKEND_STB=0 -DSDL2IMAGE_AVIF=0 -DSDL2IMAGE_JXL=0 -DSDL2IMAGE_TIF=1 -DSDL2IMAGE_WEBP=1 \ - && make && make install) - cp SDL2_image-2.8.12/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2_image.txt + # SDL2TTF_HARFBUZZ left at its default (off): Rocky 10 does ship a riscv64 + # harfbuzz-devel, but its libharfbuzz pulls in libglib-2.0 and libgraphite2, + # which auditwheel would then vendor and whose copyleft sources the + # gpl_sources job would have to carry -- same trim build-pygame.yml made. + # pygame-ce's own _freetype module still links Rocky 10's system freetype. + curl -fsSL --retry 5 -o SDL2_ttf.tar.gz https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.24.0/SDL2_ttf-2.24.0.tar.gz + tar xzf SDL2_ttf.tar.gz + (cd SDL2_ttf-2.24.0 && mkdir builddir && cd builddir && cmake -S .. -B . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON && make && make install) + cp SDL2_ttf-2.24.0/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2_ttf.txt - # SDL2TTF_HARFBUZZ left at its default (off): Rocky 10 does ship a riscv64 - # harfbuzz-devel, but its libharfbuzz pulls in libglib-2.0 and libgraphite2, - # which auditwheel would then vendor and whose copyleft sources the - # gpl_sources job would have to carry -- same trim build-pygame.yml made. - # pygame-ce's own _freetype module still links Rocky 10's system freetype. - curl -fsSL --retry 5 -o SDL2_ttf.tar.gz https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.24.0/SDL2_ttf-2.24.0.tar.gz - tar xzf SDL2_ttf.tar.gz - (cd SDL2_ttf-2.24.0 && mkdir builddir && cd builddir && cmake -S .. -B . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON && make && make install) - cp SDL2_ttf-2.24.0/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2_ttf.txt + # MOD/MIDI_FLUIDSYNTH need libxmp(-lite)/modplug and fluidsynth, all + # EPEL-only (gotcha 51, EPEL is empty on riscv64), and OPUS needs the + # separate libopusfile project that no Rocky 10 package provides; + # dropped like build-pygame.yml drops the same backends. WAVPACK is + # dropped with them to keep one coherent "no optional backends" set + # (PG_DEPS_FROM_SYSTEM, which upstream's own system-deps CI sets, then + # skips every test that needs one). MOD needs an explicit -0: + # CMakeLists.txt fatal-errors if enabled with no backend. + curl -fsSL --retry 5 -o SDL2_mixer.tar.gz https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.2/SDL2_mixer-2.8.2.tar.gz + tar xzf SDL2_mixer.tar.gz + (cd SDL2_mixer-2.8.2 && mkdir builddir && cd builddir && cmake -S .. -B . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON \ + -DSDL2MIXER_DEPS_SHARED=0 -DSDL2MIXER_VENDORED=0 \ + -DSDL2MIXER_FLAC_LIBFLAC=1 -DSDL2MIXER_FLAC_DRFLAC=0 \ + -DSDL2MIXER_MP3_MPG123=1 -DSDL2MIXER_MP3_MINIMP3=0 \ + -DSDL2MIXER_VORBIS=VORBISFILE \ + -DSDL2MIXER_MOD=0 -DSDL2MIXER_MIDI_FLUIDSYNTH=0 -DSDL2MIXER_WAVPACK=0 \ + -DSDL2MIXER_OPUS=0 \ + && make && make install) + cp SDL2_mixer-2.8.2/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2_mixer.txt - # MOD/MIDI_FLUIDSYNTH need libxmp(-lite)/modplug and fluidsynth, all - # EPEL-only (gotcha 51, EPEL is empty on riscv64), and OPUS needs the - # separate libopusfile project that no Rocky 10 package provides; - # dropped like build-pygame.yml drops the same backends. WAVPACK is - # dropped with them to keep one coherent "no optional backends" set - # (PG_DEPS_FROM_SYSTEM, which upstream's own system-deps CI sets, then - # skips every test that needs one). MOD needs an explicit -0: - # CMakeLists.txt fatal-errors if enabled with no backend. - curl -fsSL --retry 5 -o SDL2_mixer.tar.gz https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.2/SDL2_mixer-2.8.2.tar.gz - tar xzf SDL2_mixer.tar.gz - (cd SDL2_mixer-2.8.2 && mkdir builddir && cd builddir && cmake -S .. -B . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON \ - -DSDL2MIXER_DEPS_SHARED=0 -DSDL2MIXER_VENDORED=0 \ - -DSDL2MIXER_FLAC_LIBFLAC=1 -DSDL2MIXER_FLAC_DRFLAC=0 \ - -DSDL2MIXER_MP3_MPG123=1 -DSDL2MIXER_MP3_MINIMP3=0 \ - -DSDL2MIXER_VORBIS=VORBISFILE \ - -DSDL2MIXER_MOD=0 -DSDL2MIXER_MIDI_FLUIDSYNTH=0 -DSDL2MIXER_WAVPACK=0 \ - -DSDL2MIXER_OPUS=0 \ - && make && make install) - cp SDL2_mixer-2.8.2/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2_mixer.txt + ldconfig + # cibuildwheel's own `uv pip install numpy` (from pygame-ce's own + # [tool.cibuildwheel] test-requires, which this workflow doesn't + # override) needs the UV_* variables as well as PIP_EXTRA_INDEX_URL to + # resolve the registry's riscv64 numpy. + # PG_DEPS_FROM_SYSTEM is upstream's own marker for a build linked against + # system SDL dependencies instead of its curated set, which is what this + # is; its test suite uses it to skip what such a build cannot satisfy. + cibw-environment-linux: "SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk PG_DEPS_FROM_SYSTEM=1 PATH=/usr/local/bin:$PATH PIP_ONLY_BINARY=numpy UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ UV_INDEX_STRATEGY=unsafe-best-match UV_ONLY_BINARY=numpy" + cibw-before-build: |- + # docs/reST/conf.py's extensions list also needs sphinx-autoapi + # (the "autoapi.extension" entry); upstream's own build-wheels.sh + # only installs Sphinx itself, relying on something else in their + # manylinux image (not found in their own Dockerfiles) to supply + # it -- installing it explicitly here instead. + python3 -m pip install Sphinx sphinx-autoapi + python3 buildconfig/make_docs.py + cp /usr/local/share/pg-licenses/LICENSE.*.txt docs/licenses/LICENSE.sdl_gfx.txt docs/generated/ + cp /usr/share/licenses/libpng/LICENSE docs/generated/LICENSE.png.txt + cp /usr/share/licenses/freetype/FTL.TXT docs/generated/LICENSE.freetype.txt + cp /usr/share/licenses/libjpeg-turbo/LICENSE.md docs/generated/LICENSE.jpeg.txt + cp /usr/share/licenses/libwebp/COPYING docs/generated/LICENSE.webp.txt + cp /usr/share/licenses/libtiff/LICENSE.md docs/generated/LICENSE.tiff.txt + cp /usr/share/licenses/mpg123-libs/COPYING docs/generated/LICENSE.mpg123.txt + cp /usr/share/licenses/flac-libs/COPYING.Xiph docs/generated/LICENSE.FLAC.txt + cp /usr/share/licenses/libvorbis/COPYING docs/generated/LICENSE.ogg-vorbis.txt + cp /usr/share/licenses/opus/COPYING docs/generated/LICENSE.opus.txt + cp /usr/share/licenses/alsa-lib/COPYING docs/generated/LICENSE.alsa.txt + cp /usr/share/licenses/bzip2-libs/LICENSE docs/generated/LICENSE.bzip2.txt + cp /usr/share/licenses/libzstd/LICENSE docs/generated/LICENSE.zstd.txt + cp /usr/share/licenses/jbigkit-libs/COPYING docs/generated/LICENSE.jbig.txt + cp /usr/share/licenses/libbrotli/LICENSE docs/generated/LICENSE.brotli.txt + cp /usr/share/licenses/liblerc/LICENSE docs/generated/LICENSE.lerc.txt + # Same dbus fix as build-pygame.yml: + # >>> process 338: D-Bus library appears to be incorrectly set up; failed to read + # machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory + cibw-before-test: |- + mkdir -p /var/lib/dbus + if [ ! -f /var/lib/dbus/machine-id ]; then + dbus-uuidgen > /var/lib/dbus/machine-id + fi + # pyproject.toml's own test-command, plus python -u: the runner prints + # a module's results only once that module finishes, so with buffered + # stdout a module that stalls leaves no trace of which one it was. + cibw-test-command: "python -u -m pygame.tests -v --exclude opengl,music,timing --time_out 300" - ldconfig - # cibuildwheel's own `uv pip install numpy` (from pygame-ce's own - # [tool.cibuildwheel] test-requires, which this workflow doesn't - # override) needs the UV_* variables as well as PIP_EXTRA_INDEX_URL to - # resolve the registry's riscv64 numpy. - # PG_DEPS_FROM_SYSTEM is upstream's own marker for a build linked against - # system SDL dependencies instead of its curated set, which is what this - # is; its test suite uses it to skip what such a build cannot satisfy. - CIBW_ENVIRONMENT: >- - SDL_VIDEODRIVER=dummy - SDL_AUDIODRIVER=disk - PG_DEPS_FROM_SYSTEM=1 - PATH=/usr/local/bin:$PATH - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - UV_INDEX_STRATEGY=unsafe-best-match - UV_ONLY_BINARY=numpy - CIBW_BEFORE_BUILD: | - # docs/reST/conf.py's extensions list also needs sphinx-autoapi - # (the "autoapi.extension" entry); upstream's own build-wheels.sh - # only installs Sphinx itself, relying on something else in their - # manylinux image (not found in their own Dockerfiles) to supply - # it -- installing it explicitly here instead. - python3 -m pip install Sphinx sphinx-autoapi - python3 buildconfig/make_docs.py - cp /usr/local/share/pg-licenses/LICENSE.*.txt docs/licenses/LICENSE.sdl_gfx.txt docs/generated/ - cp /usr/share/licenses/libpng/LICENSE docs/generated/LICENSE.png.txt - cp /usr/share/licenses/freetype/FTL.TXT docs/generated/LICENSE.freetype.txt - cp /usr/share/licenses/libjpeg-turbo/LICENSE.md docs/generated/LICENSE.jpeg.txt - cp /usr/share/licenses/libwebp/COPYING docs/generated/LICENSE.webp.txt - cp /usr/share/licenses/libtiff/LICENSE.md docs/generated/LICENSE.tiff.txt - cp /usr/share/licenses/mpg123-libs/COPYING docs/generated/LICENSE.mpg123.txt - cp /usr/share/licenses/flac-libs/COPYING.Xiph docs/generated/LICENSE.FLAC.txt - cp /usr/share/licenses/libvorbis/COPYING docs/generated/LICENSE.ogg-vorbis.txt - cp /usr/share/licenses/opus/COPYING docs/generated/LICENSE.opus.txt - cp /usr/share/licenses/alsa-lib/COPYING docs/generated/LICENSE.alsa.txt - cp /usr/share/licenses/bzip2-libs/LICENSE docs/generated/LICENSE.bzip2.txt - cp /usr/share/licenses/libzstd/LICENSE docs/generated/LICENSE.zstd.txt - cp /usr/share/licenses/jbigkit-libs/COPYING docs/generated/LICENSE.jbig.txt - cp /usr/share/licenses/libbrotli/LICENSE docs/generated/LICENSE.brotli.txt - cp /usr/share/licenses/liblerc/LICENSE docs/generated/LICENSE.lerc.txt - # Same dbus fix as build-pygame.yml: - # >>> process 338: D-Bus library appears to be incorrectly set up; failed to read - # machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory - CIBW_BEFORE_TEST: | - mkdir -p /var/lib/dbus - if [ ! -f /var/lib/dbus/machine-id ]; then - dbus-uuidgen > /var/lib/dbus/machine-id - fi - # pyproject.toml's own test-command, plus python -u: the runner prints - # a module's results only once that module finishes, so with buffered - # stdout a module that stalls leaves no trace of which one it was. - CIBW_TEST_COMMAND: python -u -m pygame.tests -v --exclude opengl,music,timing --time_out 300 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 180 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + PYGAME_CE_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: pygame-ce-${{ env.PYGAME_CE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the vendored licences made it into the wheel run: | @@ -228,12 +230,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pygame-ce-${{ env.PYGAME_CE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -271,7 +267,7 @@ jobs: publish: name: Publish pygame-ce ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pygame.yml b/.github/workflows/build-pygame.yml index 6fdc13f15581..2085431a454f 100644 --- a/.github/workflows/build-pygame.yml +++ b/.github/workflows/build-pygame.yml @@ -49,137 +49,140 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pygame ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 600 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - PYGAME_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout pygame ${{ env.PYGAME_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pygame/pygame - ref: ${{ env.PYGAME_VERSION }} - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pygame" + version: "${{ matrix.version }}" + repository: "pygame/pygame" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 600 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # No pyproject.toml: cibuildwheel's default "build" frontend still creates an + # isolated build venv with only setuptools/wheel, so Cython (installed below, + # into the outer env) never reaches the actual build_wheel call without this. + cibw-build-frontend: "pip; args: --no-build-isolation" + # Upstream's own manylinux2014 image (pygame/manylinux2014_base_*) has no + # riscv64 build; this rebuilds its dependency stack instead. SDL2/SDL2_image/ + # SDL2_ttf/SDL2_mixer are built from source at the versions and configure + # flags upstream's own docker_base/sdl_libs/build-sdl2-libs.sh uses (no + # riscv64 SDL2-devel package exists: Rocky 10 shipped SDL2 as sdl2-compat, a + # SDL3-backed runtime shim with no headers/pkg-config). portmidi is built + # from source too (EPEL-only package, and manylinux ships no EPEL on + # riscv64, gotcha 51); libmodplug and fluidsynth are EPEL-only as well, so + # SDL2_mixer's mod/fluidsynth-midi backends are dropped (upstream's own test + # command already excludes "music" tests). Everything else (libpng, + # libjpeg-turbo, freetype, libwebp, libtiff, mpg123, flac, libvorbis+libogg, + # opus, libX11 and friends) comes from Rocky 10's own repos. dbus-tools and + # dejavu-sans-fonts match upstream's own Dockerfile (dbus-uuidgen for the + # test suite; a real font for pygame.sysfont's alias table to resolve). + cibw-before-all: |- + dnf install -y -q \ + libpng-devel libjpeg-turbo-devel freetype-devel libwebp-devel libtiff-devel \ + mpg123-devel flac-devel libvorbis-devel libogg-devel opus-devel \ + libX11-devel libXext-devel libXcursor-devel libXi-devel libXrandr-devel \ + libXinerama-devel libXxf86vm-devel libxkbcommon-devel \ + wayland-devel wayland-protocols-devel dbus-devel dbus-tools \ + alsa-lib-devel pulseaudio-libs-devel dejavu-sans-fonts - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # No pyproject.toml: cibuildwheel's default "build" frontend still creates an - # isolated build venv with only setuptools/wheel, so Cython (installed below, - # into the outer env) never reaches the actual build_wheel call without this. - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - # Upstream's own manylinux2014 image (pygame/manylinux2014_base_*) has no - # riscv64 build; this rebuilds its dependency stack instead. SDL2/SDL2_image/ - # SDL2_ttf/SDL2_mixer are built from source at the versions and configure - # flags upstream's own docker_base/sdl_libs/build-sdl2-libs.sh uses (no - # riscv64 SDL2-devel package exists: Rocky 10 shipped SDL2 as sdl2-compat, a - # SDL3-backed runtime shim with no headers/pkg-config). portmidi is built - # from source too (EPEL-only package, and manylinux ships no EPEL on - # riscv64, gotcha 51); libmodplug and fluidsynth are EPEL-only as well, so - # SDL2_mixer's mod/fluidsynth-midi backends are dropped (upstream's own test - # command already excludes "music" tests). Everything else (libpng, - # libjpeg-turbo, freetype, libwebp, libtiff, mpg123, flac, libvorbis+libogg, - # opus, libX11 and friends) comes from Rocky 10's own repos. dbus-tools and - # dejavu-sans-fonts match upstream's own Dockerfile (dbus-uuidgen for the - # test suite; a real font for pygame.sysfont's alias table to resolve). - CIBW_BEFORE_ALL: | - dnf install -y -q \ - libpng-devel libjpeg-turbo-devel freetype-devel libwebp-devel libtiff-devel \ - mpg123-devel flac-devel libvorbis-devel libogg-devel opus-devel \ - libX11-devel libXext-devel libXcursor-devel libXi-devel libXrandr-devel \ - libXinerama-devel libXxf86vm-devel libxkbcommon-devel \ - wayland-devel wayland-protocols-devel dbus-devel dbus-tools \ - alsa-lib-devel pulseaudio-libs-devel dejavu-sans-fonts + export MAKEFLAGS="-j$(nproc)" + mkdir -p /tmp/pg-deps && cd /tmp/pg-deps - export MAKEFLAGS="-j$(nproc)" - mkdir -p /tmp/pg-deps && cd /tmp/pg-deps + mkdir -p /usr/local/share/pg-licenses - mkdir -p /usr/local/share/pg-licenses + curl -fsSL --retry 5 -o portmidi.tar.gz https://github.com/PortMidi/portmidi/archive/refs/tags/v2.0.3.tar.gz + tar xzf portmidi.tar.gz + (cd portmidi-2.0.3 && cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON && make && make install) + cp portmidi-2.0.3/license.txt /usr/local/share/pg-licenses/LICENSE.portmidi.txt - curl -fsSL --retry 5 -o portmidi.tar.gz https://github.com/PortMidi/portmidi/archive/refs/tags/v2.0.3.tar.gz - tar xzf portmidi.tar.gz - (cd portmidi-2.0.3 && cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON && make && make install) - cp portmidi-2.0.3/license.txt /usr/local/share/pg-licenses/LICENSE.portmidi.txt + curl -fsSL --retry 5 -o SDL2.tar.gz https://www.libsdl.org/release/SDL2-2.28.4.tar.gz + tar xzf SDL2.tar.gz + (cd SDL2-2.28.4 && ./configure --disable-video-vulkan --enable-video-wayland && make && make install) + cp SDL2-2.28.4/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2.txt - curl -fsSL --retry 5 -o SDL2.tar.gz https://www.libsdl.org/release/SDL2-2.28.4.tar.gz - tar xzf SDL2.tar.gz - (cd SDL2-2.28.4 && ./configure --disable-video-vulkan --enable-video-wayland && make && make install) - cp SDL2-2.28.4/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2.txt + curl -fsSL --retry 5 -o SDL2_image.tar.gz https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.5.tar.gz + tar xzf SDL2_image.tar.gz + (cd SDL2_image-2.0.5 && ./configure --enable-png --disable-png-shared --enable-jpg --disable-jpg-shared --enable-tif --disable-tif-shared --enable-webp --disable-webp-shared && make && make install) + cp SDL2_image-2.0.5/COPYING.txt /usr/local/share/pg-licenses/LICENSE.sdl2_image.txt - curl -fsSL --retry 5 -o SDL2_image.tar.gz https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.5.tar.gz - tar xzf SDL2_image.tar.gz - (cd SDL2_image-2.0.5 && ./configure --enable-png --disable-png-shared --enable-jpg --disable-jpg-shared --enable-tif --disable-tif-shared --enable-webp --disable-webp-shared && make && make install) - cp SDL2_image-2.0.5/COPYING.txt /usr/local/share/pg-licenses/LICENSE.sdl2_image.txt + # freetype/harfbuzz-builtin (default): bundles its own copies instead of linking + # the image's (no harfbuzz-devel on riscv64; freetype-devel is used separately + # below, by pygame's own _freetype module). + curl -fsSL --retry 5 -o SDL2_ttf.tar.gz https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.20.1.tar.gz + tar xzf SDL2_ttf.tar.gz + (cd SDL2_ttf-2.20.1 && ./configure && make && make install) + cp SDL2_ttf-2.20.1/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2_ttf.txt + cp SDL2_ttf-2.20.1/external/harfbuzz/COPYING /usr/local/share/pg-licenses/LICENSE.harfbuzz.txt - # freetype/harfbuzz-builtin (default): bundles its own copies instead of linking - # the image's (no harfbuzz-devel on riscv64; freetype-devel is used separately - # below, by pygame's own _freetype module). - curl -fsSL --retry 5 -o SDL2_ttf.tar.gz https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.20.1.tar.gz - tar xzf SDL2_ttf.tar.gz - (cd SDL2_ttf-2.20.1 && ./configure && make && make install) - cp SDL2_ttf-2.20.1/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2_ttf.txt - cp SDL2_ttf-2.20.1/external/harfbuzz/COPYING /usr/local/share/pg-licenses/LICENSE.harfbuzz.txt + curl -fsSL --retry 5 -o SDL2_mixer.tar.gz https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.6.3.tar.gz + tar xzf SDL2_mixer.tar.gz + (cd SDL2_mixer-2.6.3 && ./configure \ + --disable-dependency-tracking \ + --disable-music-ogg-stb --enable-music-ogg-vorbis \ + --disable-music-flac-drflac --enable-music-flac-libflac \ + --disable-music-mp3-drmp3 --enable-music-mp3-mpg123 \ + --disable-music-mod-modplug --disable-music-mod-mikmod-shared --disable-music-mod-xmp --disable-music-mod-xmp-shared \ + --disable-music-midi-fluidsynth \ + --enable-music-opus --disable-music-opus-shared \ + --disable-music-ogg-vorbis-shared --disable-music-ogg-tremor-shared \ + --disable-music-flac-libflac-shared --disable-music-mp3-mpg123-shared \ + && make && make install) + cp SDL2_mixer-2.6.3/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2_mixer.txt - curl -fsSL --retry 5 -o SDL2_mixer.tar.gz https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.6.3.tar.gz - tar xzf SDL2_mixer.tar.gz - (cd SDL2_mixer-2.6.3 && ./configure \ - --disable-dependency-tracking \ - --disable-music-ogg-stb --enable-music-ogg-vorbis \ - --disable-music-flac-drflac --enable-music-flac-libflac \ - --disable-music-mp3-drmp3 --enable-music-mp3-mpg123 \ - --disable-music-mod-modplug --disable-music-mod-mikmod-shared --disable-music-mod-xmp --disable-music-mod-xmp-shared \ - --disable-music-midi-fluidsynth \ - --enable-music-opus --disable-music-opus-shared \ - --disable-music-ogg-vorbis-shared --disable-music-ogg-tremor-shared \ - --disable-music-flac-libflac-shared --disable-music-mp3-mpg123-shared \ - && make && make install) - cp SDL2_mixer-2.6.3/LICENSE.txt /usr/local/share/pg-licenses/LICENSE.sdl2_mixer.txt + ldconfig + cibw-environment-linux: "PORTMIDI_INC_PORTTIME=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk PATH=/usr/local/bin:$PATH" + cibw-before-build: |- + pip install Sphinx "Cython>=3.0,<3.1" setuptools wheel + python setup.py docs + cp /usr/local/share/pg-licenses/LICENSE.*.txt docs/licenses/LICENSE.sdl_gfx.txt docs/generated/ + cp /usr/share/licenses/libpng/LICENSE docs/generated/LICENSE.png.txt + cp /usr/share/licenses/freetype/FTL.TXT docs/generated/LICENSE.freetype.txt + cp /usr/share/licenses/libjpeg-turbo/LICENSE.md docs/generated/LICENSE.jpeg.txt + cp /usr/share/licenses/libwebp/COPYING docs/generated/LICENSE.webp.txt + cp /usr/share/licenses/libtiff/LICENSE.md docs/generated/LICENSE.tiff.txt + cp /usr/share/licenses/mpg123-libs/COPYING docs/generated/LICENSE.mpg123.txt + cp /usr/share/licenses/flac-libs/COPYING.Xiph docs/generated/LICENSE.FLAC.txt + cp /usr/share/licenses/libvorbis/COPYING docs/generated/LICENSE.ogg-vorbis.txt + cp /usr/share/licenses/opus/COPYING docs/generated/LICENSE.opus.txt + cp /usr/share/licenses/alsa-lib/COPYING docs/generated/LICENSE.alsa.txt + cp /usr/share/licenses/bzip2-libs/LICENSE docs/generated/LICENSE.bzip2.txt + cp /usr/share/licenses/libzstd/LICENSE docs/generated/LICENSE.zstd.txt + cp /usr/share/licenses/jbigkit-libs/COPYING docs/generated/LICENSE.jbig.txt + cp /usr/share/licenses/libbrotli/LICENSE docs/generated/LICENSE.brotli.txt + cp /usr/share/licenses/liblerc/LICENSE docs/generated/LICENSE.lerc.txt + cp /usr/share/licenses/graphite2/LICENSE docs/generated/LICENSE.graphite2.txt + # To 'solve' this issue: + # >>> process 338: D-Bus library appears to be incorrectly set up; failed to read + # machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory + cibw-before-test: |- + mkdir -p /var/lib/dbus + if [ ! -f /var/lib/dbus/machine-id ]; then + dbus-uuidgen > /var/lib/dbus/machine-id + fi + cibw-test-command: "python -m pygame.tests -v --exclude opengl,music,timing --time_out 300" - ldconfig - CIBW_ENVIRONMENT: >- - PORTMIDI_INC_PORTTIME=1 - SDL_VIDEODRIVER=dummy - SDL_AUDIODRIVER=disk - PATH=/usr/local/bin:$PATH - CIBW_BEFORE_BUILD: | - pip install Sphinx "Cython>=3.0,<3.1" setuptools wheel - python setup.py docs - cp /usr/local/share/pg-licenses/LICENSE.*.txt docs/licenses/LICENSE.sdl_gfx.txt docs/generated/ - cp /usr/share/licenses/libpng/LICENSE docs/generated/LICENSE.png.txt - cp /usr/share/licenses/freetype/FTL.TXT docs/generated/LICENSE.freetype.txt - cp /usr/share/licenses/libjpeg-turbo/LICENSE.md docs/generated/LICENSE.jpeg.txt - cp /usr/share/licenses/libwebp/COPYING docs/generated/LICENSE.webp.txt - cp /usr/share/licenses/libtiff/LICENSE.md docs/generated/LICENSE.tiff.txt - cp /usr/share/licenses/mpg123-libs/COPYING docs/generated/LICENSE.mpg123.txt - cp /usr/share/licenses/flac-libs/COPYING.Xiph docs/generated/LICENSE.FLAC.txt - cp /usr/share/licenses/libvorbis/COPYING docs/generated/LICENSE.ogg-vorbis.txt - cp /usr/share/licenses/opus/COPYING docs/generated/LICENSE.opus.txt - cp /usr/share/licenses/alsa-lib/COPYING docs/generated/LICENSE.alsa.txt - cp /usr/share/licenses/bzip2-libs/LICENSE docs/generated/LICENSE.bzip2.txt - cp /usr/share/licenses/libzstd/LICENSE docs/generated/LICENSE.zstd.txt - cp /usr/share/licenses/jbigkit-libs/COPYING docs/generated/LICENSE.jbig.txt - cp /usr/share/licenses/libbrotli/LICENSE docs/generated/LICENSE.brotli.txt - cp /usr/share/licenses/liblerc/LICENSE docs/generated/LICENSE.lerc.txt - cp /usr/share/licenses/graphite2/LICENSE docs/generated/LICENSE.graphite2.txt - # To 'solve' this issue: - # >>> process 338: D-Bus library appears to be incorrectly set up; failed to read - # machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory - CIBW_BEFORE_TEST: | - mkdir -p /var/lib/dbus - if [ ! -f /var/lib/dbus/machine-id ]; then - dbus-uuidgen > /var/lib/dbus/machine-id - fi - CIBW_TEST_COMMAND: python -m pygame.tests -v --exclude opengl,music,timing --time_out 300 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 600 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + PYGAME_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: pygame-${{ env.PYGAME_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the vendored licences made it into the wheel run: | @@ -201,12 +204,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pygame-${{ env.PYGAME_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -243,7 +240,7 @@ jobs: publish: name: Publish pygame ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pygeohash.yml b/.github/workflows/build-pygeohash.yml index d98af63e0ee3..1916c3a6da20 100644 --- a/.github/workflows/build-pygeohash.yml +++ b/.github/workflows/build-pygeohash.yml @@ -60,7 +60,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build-frontend: build # matplotlib/pandas have no riscv64 wheel on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: viz # `benchmark` extra's comparison libraries have no riscv64 wheel, but # test_benchmark_comparison.py drops each one that fails to import. diff --git a/.github/workflows/build-pygraphviz.yml b/.github/workflows/build-pygraphviz.yml index 3e36bfa7dd32..41c054d4f21c 100644 --- a/.github/workflows/build-pygraphviz.yml +++ b/.github/workflows/build-pygraphviz.yml @@ -51,6 +51,152 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pygraphviz ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + # Upstream builds cp310-cp314 and publishes no free-threaded wheel. + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pygraphviz" + version: "${{ matrix.version }}" + repository: "pygraphviz/pygraphviz" + ref: "pygraphviz-${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pygraphviz/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of every shared library auditwheel + # vendors into the wheel out of the build image. pyproject.toml's LICENSE.* + # pattern then copies them into the wheel beside pygraphviz's own. + set -euo pipefail + + project="${1:?usage: collect-licenses.sh }" + prefix="${2:?usage: collect-licenses.sh }" + + # Everything the wheel holds: the libraries the extension links, the plugins it + # loads, and the CLI tools copied into pygraphviz/bin. ldd is transitive, so this + # is the whole closure. Graphviz's own libraries are not rpm-owned and are + # covered by the checked-in LICENSE.graphviz. + roots=( + "$prefix"/lib/libcdt.so "$prefix"/lib/libcgraph.so "$prefix"/lib/libgvc.so + "$prefix"/lib/graphviz/libgvplugin_core.so + "$prefix"/lib/graphviz/libgvplugin_dot_layout.so + "$prefix"/lib/graphviz/libgvplugin_neato_layout.so + "$prefix"/lib/graphviz/libgvplugin_gd.so + "$prefix"/lib/graphviz/libgvplugin_pango.so + "$prefix"/bin/gc "$prefix"/bin/acyclic "$prefix"/bin/gvpr "$prefix"/bin/gvcolor + "$prefix"/bin/ccomps "$prefix"/bin/sccmap "$prefix"/bin/tred "$prefix"/bin/unflatten + ) + + # Libraries on auditwheel's allowlist are assumed present on the host and are + # never vendored, so they carry no obligation here. + mapfile -t allow < <( + "$(dirname "$(readlink -f "$(command -v auditwheel)")")/python" - <<'PY' + import json, pathlib, auditwheel + + policy = pathlib.Path(auditwheel.__file__).parent / "policy" / "manylinux-policy.json" + policies = json.loads(policy.read_text()) + print("\n".join(next(p["lib_whitelist"] for p in policies if p["name"] == "manylinux_2_39"))) + PY + ) + + mapfile -t libs < <( + ldd "${roots[@]}" | tr ' ' '\n' | grep '^/' | sort -u | + grep -vFf <(printf '%s\n' "${allow[@]}") + ) + + # `rpm -qf` reports unowned files on stdout, so keep only bare package names. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u + ) + + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + + # Some subpackages leave the licence to a sibling of the same source RPM. + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi + + # Others mark it %doc rather than %license, and the image installs no docs. + if [ -z "${files[0]:-}" ]; then + dnf -y reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi + + # A few ship the text only in the source RPM (libxcb's %license COPYING is + # not in the binary package). + if [ -z "${files[0]:-}" ]; then + dnf -y install dnf-plugins-core >/dev/null + rm -rf /tmp/srpm && mkdir -p /tmp/srpm && pushd /tmp/srpm >/dev/null + dnf -y download --source "$pkg" >/dev/null + rpm2archive -n ./*.src.rpm | tar x + for tarball in ./*.tar.*; do + tar xf "$tarball" + done + popd >/dev/null + mapfile -t files < <( + find /tmp/srpm -maxdepth 3 -type f -regextype posix-extended \ + -iregex '.*/(COPYING|LICEN[CS]E|NOTICE)[^/]*' | sort + ) + fi + + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done + + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Graphviz from source, as upstream does; the release tarballs use + # autotools. CFLAGS=-fPIC is needed to link it into the extension. + # riscv64 links executables at 0x10000, which is also mmap_min_addr, + # so the segment auditwheel's patchelf prepends to the bundled CLI + # tools cannot be mapped and they segfault at startup; raise the base. + cibw-before-all-linux: "dnf install -y gcc gcc-c++ bison flex expat-devel zlib-devel autoconf automake libtool gd-devel cairo-devel pango-devel && curl -L \"https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/14.1.5/graphviz-14.1.5.tar.gz\" -o /tmp/graphviz.tar.gz && tar xzf /tmp/graphviz.tar.gz -C /tmp && cd /tmp/graphviz-14.1.5 && ./configure --prefix=/opt/graphviz --with-pangocairo --disable-swig --disable-tcl --disable-sharp --disable-go --disable-guile --disable-java --disable-lua --disable-perl --disable-php --disable-python --disable-python3 --disable-r --disable-ruby --disable-man-pdfs --with-expat --with-zlib CFLAGS=\"-fPIC\" LDFLAGS=\"-Wl,-Ttext-segment=0x200000\" && make -j$(nproc) && make install && ldconfig && bash {project}/collect-licenses.sh {project} /opt/graphviz" + cibw-environment-linux: "GRAPHVIZ_PREFIX=/opt/graphviz LD_LIBRARY_PATH=/opt/graphviz/lib:/opt/graphviz/lib/graphviz PATH=\"$PATH:/opt/graphviz/bin\"" + cibw-before-build-linux: "mkdir -p {package}/pygraphviz/bin && cp /opt/graphviz/bin/gc /opt/graphviz/bin/acyclic /opt/graphviz/bin/gvpr /opt/graphviz/bin/gvcolor /opt/graphviz/bin/ccomps /opt/graphviz/bin/sccmap /opt/graphviz/bin/tred /opt/graphviz/bin/unflatten {package}/pygraphviz/bin/" + cibw-test-requires: "pytest" + cibw-test-command: "python -c \"import os, tempfile, pygraphviz as p; print('pygraphviz', p.__version__); G = p.AGraph(); G.add_edge('a', 'b'); f = os.path.join(tempfile.mkdtemp(), 't.png'); G.draw(f, prog='dot'); assert os.path.getsize(f) > 0; print('PNG render OK:', f)\" && pytest --pyargs pygraphviz" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: @@ -58,191 +204,14 @@ jobs: # Upstream builds cp310-cp314 and publishes no free-threaded wheel. matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYGRAPHVIZ_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pygraphviz ${{ env.PYGRAPHVIZ_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pygraphviz/pygraphviz - ref: pygraphviz-${{ env.PYGRAPHVIZ_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pygraphviz source - run: git apply python-wheels/patches/pygraphviz/${{ env.PYGRAPHVIZ_VERSION }}/*.patch - - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of every shared library auditwheel - # vendors into the wheel out of the build image. pyproject.toml's LICENSE.* - # pattern then copies them into the wheel beside pygraphviz's own. - set -euo pipefail - - project="${1:?usage: collect-licenses.sh }" - prefix="${2:?usage: collect-licenses.sh }" - - # Everything the wheel holds: the libraries the extension links, the plugins it - # loads, and the CLI tools copied into pygraphviz/bin. ldd is transitive, so this - # is the whole closure. Graphviz's own libraries are not rpm-owned and are - # covered by the checked-in LICENSE.graphviz. - roots=( - "$prefix"/lib/libcdt.so "$prefix"/lib/libcgraph.so "$prefix"/lib/libgvc.so - "$prefix"/lib/graphviz/libgvplugin_core.so - "$prefix"/lib/graphviz/libgvplugin_dot_layout.so - "$prefix"/lib/graphviz/libgvplugin_neato_layout.so - "$prefix"/lib/graphviz/libgvplugin_gd.so - "$prefix"/lib/graphviz/libgvplugin_pango.so - "$prefix"/bin/gc "$prefix"/bin/acyclic "$prefix"/bin/gvpr "$prefix"/bin/gvcolor - "$prefix"/bin/ccomps "$prefix"/bin/sccmap "$prefix"/bin/tred "$prefix"/bin/unflatten - ) - - # Libraries on auditwheel's allowlist are assumed present on the host and are - # never vendored, so they carry no obligation here. - mapfile -t allow < <( - "$(dirname "$(readlink -f "$(command -v auditwheel)")")/python" - <<'PY' - import json, pathlib, auditwheel - - policy = pathlib.Path(auditwheel.__file__).parent / "policy" / "manylinux-policy.json" - policies = json.loads(policy.read_text()) - print("\n".join(next(p["lib_whitelist"] for p in policies if p["name"] == "manylinux_2_39"))) - PY - ) - - mapfile -t libs < <( - ldd "${roots[@]}" | tr ' ' '\n' | grep '^/' | sort -u | - grep -vFf <(printf '%s\n' "${allow[@]}") - ) - - # `rpm -qf` reports unowned files on stdout, so keep only bare package names. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u - ) - - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - - # Some subpackages leave the licence to a sibling of the same source RPM. - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi - - # Others mark it %doc rather than %license, and the image installs no docs. - if [ -z "${files[0]:-}" ]; then - dnf -y reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi - - # A few ship the text only in the source RPM (libxcb's %license COPYING is - # not in the binary package). - if [ -z "${files[0]:-}" ]; then - dnf -y install dnf-plugins-core >/dev/null - rm -rf /tmp/srpm && mkdir -p /tmp/srpm && pushd /tmp/srpm >/dev/null - dnf -y download --source "$pkg" >/dev/null - rpm2archive -n ./*.src.rpm | tar x - for tarball in ./*.tar.*; do - tar xf "$tarball" - done - popd >/dev/null - mapfile -t files < <( - find /tmp/srpm -maxdepth 3 -type f -regextype posix-extended \ - -iregex '.*/(COPYING|LICEN[CS]E|NOTICE)[^/]*' | sort - ) - fi - - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done - - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Graphviz from source, as upstream does; the release tarballs use - # autotools. CFLAGS=-fPIC is needed to link it into the extension. - # riscv64 links executables at 0x10000, which is also mmap_min_addr, - # so the segment auditwheel's patchelf prepends to the bundled CLI - # tools cannot be mapped and they segfault at startup; raise the base. - CIBW_BEFORE_ALL_LINUX: >- - dnf install -y gcc gcc-c++ bison flex expat-devel zlib-devel autoconf automake libtool gd-devel cairo-devel pango-devel && - curl -L - "https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/${{ env.GRAPHVIZ_VERSION }}/graphviz-${{ env.GRAPHVIZ_VERSION }}.tar.gz" - -o /tmp/graphviz.tar.gz && - tar xzf /tmp/graphviz.tar.gz -C /tmp && - cd /tmp/graphviz-${{ env.GRAPHVIZ_VERSION }} && - ./configure - --prefix=/opt/graphviz - --with-pangocairo - --disable-swig - --disable-tcl - --disable-sharp - --disable-go - --disable-guile - --disable-java - --disable-lua - --disable-perl - --disable-php - --disable-python - --disable-python3 - --disable-r - --disable-ruby - --disable-man-pdfs - --with-expat - --with-zlib - CFLAGS="-fPIC" - LDFLAGS="-Wl,-Ttext-segment=0x200000" && - make -j$(nproc) && - make install && - ldconfig && - bash {project}/collect-licenses.sh {project} /opt/graphviz - CIBW_ENVIRONMENT_LINUX: >- - GRAPHVIZ_PREFIX=/opt/graphviz - LD_LIBRARY_PATH=/opt/graphviz/lib:/opt/graphviz/lib/graphviz - PATH="$PATH:/opt/graphviz/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_BEFORE_BUILD_LINUX: >- - mkdir -p {package}/pygraphviz/bin && - cp /opt/graphviz/bin/gc - /opt/graphviz/bin/acyclic - /opt/graphviz/bin/gvpr - /opt/graphviz/bin/gvcolor - /opt/graphviz/bin/ccomps - /opt/graphviz/bin/sccmap - /opt/graphviz/bin/tred - /opt/graphviz/bin/unflatten - {package}/pygraphviz/bin/ - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: >- - python -c "import os, tempfile, pygraphviz as p; print('pygraphviz', p.__version__); G = p.AGraph(); G.add_edge('a', 'b'); f = os.path.join(tempfile.mkdtemp(), 't.png'); G.draw(f, prog='dot'); assert os.path.getsize(f) > 0; print('PNG render OK:', f)" && - pytest --pyargs pygraphviz + name: pygraphviz-${{ env.PYGRAPHVIZ_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and the bundled licences run: | @@ -270,12 +239,6 @@ jobs: assert any(n.startswith(f"LICENSE.{pkg}.") for n in licences), (pkg, licences) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pygraphviz-${{ env.PYGRAPHVIZ_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -312,7 +275,7 @@ jobs: publish: name: Publish pygraphviz ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pygrib.yml b/.github/workflows/build-pygrib.yml index d6ff3d861578..e00a8892fc09 100644 --- a/.github/workflows/build-pygrib.yml +++ b/.github/workflows/build-pygrib.yml @@ -52,91 +52,90 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pygrib ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pygrib" + version: "${{ matrix.version }}" + repository: "jswhit/pygrib" + ref: "v${{ matrix.version }}rel" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 600 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # libpng comes from the distro; upstream only builds it because its manylinux2014 base lacks it. + cibw-before-all-linux: |- + set -ex + dnf -y install libpng-devel zlib-devel + mkdir -p /tmp/libaec /tmp/openjpeg + + curl -fsSL "https://github.com/Deutsches-Klimarechenzentrum/libaec/releases/download/v$LIBAEC_VERSION/libaec-$LIBAEC_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/libaec + cmake -S /tmp/libaec -B /tmp/libaec/build \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_INSTALL_PREFIX=/usr/local \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D BUILD_STATIC_LIBS=OFF \ + -D BUILD_TESTING=OFF + cmake --build /tmp/libaec/build -j "$(nproc)" + cmake --install /tmp/libaec/build + + curl -fsSL "https://github.com/uclouvain/openjpeg/archive/refs/tags/v$OPENJPEG_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/openjpeg + cmake -S /tmp/openjpeg -B /tmp/openjpeg/build \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_INSTALL_PREFIX=/usr/local \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D BUILD_CODEC=OFF + cmake --build /tmp/openjpeg/build -j "$(nproc)" + cmake --install /tmp/openjpeg/build + ldconfig + + curl -fsSL "https://confluence.ecmwf.int/download/attachments/45757960/eccodes-$ECCODES_VERSION-Source.tar.gz" | tar xz -C /tmp + cp -r "/tmp/eccodes-$ECCODES_VERSION-Source/definitions" "{project}/src/pygrib/share/eccodes" + mv "{project}/src/pygrib/share/eccodes/template.3.32769.def" "{project}/src/pygrib/share/eccodes/definitions/grib2" + cmake -S "/tmp/eccodes-$ECCODES_VERSION-Source" -B /tmp/eccodes-build \ + -D CMAKE_INSTALL_PREFIX=/usr/local \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D ENABLE_FORTRAN=OFF \ + -D ENABLE_NETCDF=OFF \ + -D ENABLE_TESTS=OFF \ + -D ENABLE_JPG_LIBJASPER=OFF \ + -D ENABLE_JPG_LIBOPENJPEG=ON \ + -D ENABLE_PNG=ON \ + -D ENABLE_AEC=ON + cmake --build /tmp/eccodes-build -j "$(nproc)" + cmake --install /tmp/eccodes-build + ldconfig + + cp "/tmp/eccodes-$ECCODES_VERSION-Source/LICENSE" "{project}/LICENSE.eccodes" + cp "/tmp/eccodes-$ECCODES_VERSION-Source/NOTICE" "{project}/NOTICE.eccodes" + cp /tmp/openjpeg/LICENSE "{project}/LICENSE.openjpeg" + cp /tmp/libaec/LICENSE.txt "{project}/LICENSE.libaec" + cp /usr/share/licenses/libpng/LICENSE "{project}/LICENSE.libpng" + cibw-environment-linux: "PYGRIB_WHEEL=true ECCODES_VERSION=2.44.0 OPENJPEG_VERSION=2.5.4 LIBAEC_VERSION=1.1.4 PIP_ONLY_BINARY=numpy,pyproj" + cibw-test-requires: "pytest" + cibw-test-sources: "test sampledata utils" + cibw-test-command: "cd test && pytest -vv test.py test_latlons.py && cd .. && python utils/grib_list sampledata/rap.wrfnat.grib2 -s" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 600 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYGRIB_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pygrib ${{ env.PYGRIB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: jswhit/pygrib - ref: v${{ env.PYGRIB_VERSION }}rel - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # libpng comes from the distro; upstream only builds it because its manylinux2014 base lacks it. - CIBW_BEFORE_ALL_LINUX: | - set -ex - dnf -y install libpng-devel zlib-devel - mkdir -p /tmp/libaec /tmp/openjpeg - - curl -fsSL "https://github.com/Deutsches-Klimarechenzentrum/libaec/releases/download/v$LIBAEC_VERSION/libaec-$LIBAEC_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/libaec - cmake -S /tmp/libaec -B /tmp/libaec/build \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_INSTALL_PREFIX=/usr/local \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D BUILD_STATIC_LIBS=OFF \ - -D BUILD_TESTING=OFF - cmake --build /tmp/libaec/build -j "$(nproc)" - cmake --install /tmp/libaec/build - - curl -fsSL "https://github.com/uclouvain/openjpeg/archive/refs/tags/v$OPENJPEG_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/openjpeg - cmake -S /tmp/openjpeg -B /tmp/openjpeg/build \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_INSTALL_PREFIX=/usr/local \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D BUILD_CODEC=OFF - cmake --build /tmp/openjpeg/build -j "$(nproc)" - cmake --install /tmp/openjpeg/build - ldconfig - - curl -fsSL "https://confluence.ecmwf.int/download/attachments/45757960/eccodes-$ECCODES_VERSION-Source.tar.gz" | tar xz -C /tmp - cp -r "/tmp/eccodes-$ECCODES_VERSION-Source/definitions" "{project}/src/pygrib/share/eccodes" - mv "{project}/src/pygrib/share/eccodes/template.3.32769.def" "{project}/src/pygrib/share/eccodes/definitions/grib2" - cmake -S "/tmp/eccodes-$ECCODES_VERSION-Source" -B /tmp/eccodes-build \ - -D CMAKE_INSTALL_PREFIX=/usr/local \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D ENABLE_FORTRAN=OFF \ - -D ENABLE_NETCDF=OFF \ - -D ENABLE_TESTS=OFF \ - -D ENABLE_JPG_LIBJASPER=OFF \ - -D ENABLE_JPG_LIBOPENJPEG=ON \ - -D ENABLE_PNG=ON \ - -D ENABLE_AEC=ON - cmake --build /tmp/eccodes-build -j "$(nproc)" - cmake --install /tmp/eccodes-build - ldconfig - - cp "/tmp/eccodes-$ECCODES_VERSION-Source/LICENSE" "{project}/LICENSE.eccodes" - cp "/tmp/eccodes-$ECCODES_VERSION-Source/NOTICE" "{project}/NOTICE.eccodes" - cp /tmp/openjpeg/LICENSE "{project}/LICENSE.openjpeg" - cp /tmp/libaec/LICENSE.txt "{project}/LICENSE.libaec" - cp /usr/share/licenses/libpng/LICENSE "{project}/LICENSE.libpng" - CIBW_ENVIRONMENT: >- - PYGRIB_WHEEL=true - ECCODES_VERSION=${{ env.ECCODES_VERSION }} - OPENJPEG_VERSION=${{ env.OPENJPEG_VERSION }} - LIBAEC_VERSION=${{ env.LIBAEC_VERSION }} - PIP_ONLY_BINARY=numpy,pyproj - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: test sampledata utils - CIBW_TEST_COMMAND: >- - cd test && pytest -vv test.py test_latlons.py && cd .. && - python utils/grib_list sampledata/rap.wrfnat.grib2 -s + name: pygrib-${{ env.PYGRIB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension, the definitions and the licences run: | @@ -165,15 +164,9 @@ jobs: }, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pygrib-${{ env.PYGRIB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pygrib ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyhdf.yml b/.github/workflows/build-pyhdf.yml index 6c43de9af115..6b63acd7ea93 100644 --- a/.github/workflows/build-pyhdf.yml +++ b/.github/workflows/build-pyhdf.yml @@ -52,51 +52,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyhdf ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyhdf" + version: "${{ matrix.version }}" + repository: "fhs/pyhdf" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 600 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: |- + set -ex + dnf -y install zlib-devel libjpeg-turbo-devel + git clone --depth 1 --branch "$HDF4_REF" https://github.com/HDFGroup/hdf4.git /tmp/hdf4 + mkdir /tmp/hdf4-build + cd /tmp/hdf4-build + /tmp/hdf4/configure --enable-hdf4-xdr --enable-shared --disable-static --disable-fortran --disable-netcdf --enable-production --with-zlib --prefix=/usr/local + make -j "$(nproc)" + make install + ldconfig + cp /tmp/hdf4/COPYING "{project}/LICENSE.hdf4" + cibw-environment-linux: "INCLUDE_DIRS=/usr/local/include LIBRARY_DIRS=/usr/local/lib HDF4_REF=hdf4.3.0 SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYHDF=${{ matrix.version }} PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest" + cibw-test-command: "python -m pytest --pyargs pyhdf.test_SD -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 600 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYHDF_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyhdf ${{ env.PYHDF_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: fhs/pyhdf - ref: v${{ env.PYHDF_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: | - set -ex - dnf -y install zlib-devel libjpeg-turbo-devel - git clone --depth 1 --branch "$HDF4_REF" https://github.com/HDFGroup/hdf4.git /tmp/hdf4 - mkdir /tmp/hdf4-build - cd /tmp/hdf4-build - /tmp/hdf4/configure --enable-hdf4-xdr --enable-shared --disable-static --disable-fortran --disable-netcdf --enable-production --with-zlib --prefix=/usr/local - make -j "$(nproc)" - make install - ldconfig - cp /tmp/hdf4/COPYING "{project}/LICENSE.hdf4" - CIBW_ENVIRONMENT: >- - INCLUDE_DIRS=/usr/local/include - LIBRARY_DIRS=/usr/local/lib - HDF4_REF=${{ env.HDF4_REF }} - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYHDF=${{ env.PYHDF_VERSION }} - PIP_ONLY_BINARY=numpy - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: python -m pytest --pyargs pyhdf.test_SD -v + name: pyhdf-${{ env.PYHDF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and the HDF4 licence run: | @@ -115,15 +116,9 @@ jobs: assert "LICENSE.hdf4" in licences, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyhdf-${{ env.PYHDF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyhdf ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyheck.yml b/.github/workflows/build-pyheck.yml index 57f387bf4f26..87f5608e2e62 100644 --- a/.github/workflows/build-pyheck.yml +++ b/.github/workflows/build-pyheck.yml @@ -53,51 +53,51 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build pyheck ${{ matrix.version }} cp37-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyheck" + version: "${{ matrix.version }}" + repository: "kevinheavey/pyheck" + ref: "${{ matrix.version }}" + artifact-tag: "cp37-abi3-manylinux_riscv64" + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + # pyo3's abi3-py37 feature is on unconditionally (Cargo.toml), so + # one abi3 wheel serves every interpreter in our matrix; pyo3 + # 0.15.1 predates PEP 703 entirely, so there is no free-threaded + # (cp314t) job. + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # pyheck ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # pyproject.toml pins maturin<0.13 (2022), which has no riscv64 + # wheel on PyPI and fails to build from sdist (its own bootstrap + # needs setuptools, which Python 3.12+ no longer seeds into a + # fresh build-isolation venv). A current maturin builds this tree + # unmodified, so install one and skip isolation to bypass the pin. + cibw-before-build: "pip install maturin" + cibw-build-frontend: "pip; args: --no-build-isolation" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import pyheck; assert pyheck.pyheck.__file__.endswith('.abi3.so'), pyheck.pyheck.__file__\" && python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: PYHECK_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyheck ${{ env.PYHECK_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: kevinheavey/pyheck - ref: ${{ env.PYHECK_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - # pyo3's abi3-py37 feature is on unconditionally (Cargo.toml), so - # one abi3 wheel serves every interpreter in our matrix; pyo3 - # 0.15.1 predates PEP 703 entirely, so there is no free-threaded - # (cp314t) job. - CIBW_BUILD: >- - cp312-manylinux_riscv64 cp313-manylinux_riscv64 - cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # pyheck ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - # pyproject.toml pins maturin<0.13 (2022), which has no riscv64 - # wheel on PyPI and fails to build from sdist (its own bootstrap - # needs setuptools, which Python 3.12+ no longer seeds into a - # fresh build-isolation venv). A current maturin builds this tree - # unmodified, so install one and skip isolation to bypass the pin. - CIBW_BEFORE_BUILD: pip install maturin - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import pyheck; assert pyheck.pyheck.__file__.endswith('.abi3.so'), pyheck.pyheck.__file__" && - python -m pytest -v tests + name: pyheck-${{ env.PYHECK_VERSION }}-cp37-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the licence made it into the wheel run: | @@ -109,15 +109,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyheck-${{ env.PYHECK_VERSION }}-cp37-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyheck ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyheif.yml b/.github/workflows/build-pyheif.yml index becb7bacf4db..f6a4bcccc07d 100644 --- a/.github/workflows/build-pyheif.yml +++ b/.github/workflows/build-pyheif.yml @@ -49,91 +49,95 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyheif ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyheif" + version: "${{ matrix.version }}" + repository: "carsales/pyheif" + ref: "release-${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's own Dockerfile builds x265/libde265/libaom/libheif from source rather + # than relying on distro packages (none of the four are in Rocky 10's repos anyway). + # pkg-config is already on the image (gotcha 46); nasm is x86-only and x265/libaom + # both no-op their asm paths without it (upstream's own build_libs.py skips it the + # same way on non-x86_64). Upstream's own pin, x265 3.6, hard-sets CMP0025/CMP0054 + # to OLD, which CMake 4 (on the image) refuses outright regardless of + # CMAKE_POLICY_VERSION_MINIMUM (gotcha 207/257 doesn't cover this, since it's an + # explicit cmake_policy() call, not a bare cmake_minimum_required floor); 4.2 (the + # version pillow-heif's own riscv64 port already bumped to for the same reason) + # dropped both. + cibw-before-all-linux: |- + set -e + export BUILD_DIR=/tmp/ph_build_stuff + mkdir -p "$BUILD_DIR" + cd "$BUILD_DIR" + + curl -fLO https://bitbucket.org/multicoreware/x265_git/downloads/x265_4.2.tar.gz + tar xf x265_4.2.tar.gz + cmake -DCMAKE_INSTALL_PREFIX=/usr -G "Unix Makefiles" x265_4.2/source + make -j"$(nproc)" && make install && ldconfig + + curl -fLO https://github.com/strukturag/libde265/releases/download/v1.0.15/libde265-1.0.15.tar.gz + tar xf libde265-1.0.15.tar.gz + cd libde265-1.0.15 + ./autogen.sh + CXXFLAGS="-g1 -O2" ./configure --prefix /usr --disable-encoder --disable-dec265 --disable-sherlock265 --disable-dependency-tracking + make -j"$(nproc)" && make install && ldconfig + cd .. + + mkdir aom && cd aom + curl -fLO https://aomedia.googlesource.com/aom/+archive/v3.8.3.tar.gz + tar xf v3.8.3.tar.gz + cd .. + mkdir aom_build && cd aom_build + cmake -DENABLE_TESTS=0 -DENABLE_TOOLS=0 -DENABLE_EXAMPLES=0 -DENABLE_DOCS=0 -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_SHARED_LIBS=1 ../aom + make -j"$(nproc)" && make install && ldconfig + cd .. + + curl -fLO https://github.com/strukturag/libheif/releases/download/v1.18.2/libheif-1.18.2.tar.gz + tar xf libheif-1.18.2.tar.gz + mkdir libheif_build && cd libheif_build + cmake --install-prefix=/usr --preset=release-noplugins -DWITH_EXAMPLES=no ../libheif-1.18.2 + make -j"$(nproc)" && make install && ldconfig + cd .. + + cp x265_4.2/COPYING "{package}/LICENSE.x265" + cp libde265-1.0.15/COPYING "{package}/LICENSE.libde265" + cat aom/LICENSE aom/PATENTS > "{package}/LICENSE.libaom" + cp libheif-1.18.2/COPYING "{package}/LICENSE.libheif" + # pyheif's own requirements-test.txt pins pytest==6.2.5 (2021), which predates + # cp312+ internals; Pillow ships no riscv64 wheel on public PyPI, ours is what the + # test env installs. + cibw-test-requires: "pytest piexif Pillow" + # test_versions.py reads pyheif/data/version.txt by a cwd-relative path rather than + # through the installed package, so that one file has to be staged at its original + # relative position too (gotcha 36) -- it does not reintroduce the shadow gotcha 25 + # warns about, since the resulting `pyheif/` here has no __init__.py (gotcha 174). + cibw-test-sources: "tests pyheif/data" + cibw-test-command: "python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PYHEIF_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyheif release-${{ env.PYHEIF_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: carsales/pyheif - ref: release-${{ env.PYHEIF_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's own Dockerfile builds x265/libde265/libaom/libheif from source rather - # than relying on distro packages (none of the four are in Rocky 10's repos anyway). - # pkg-config is already on the image (gotcha 46); nasm is x86-only and x265/libaom - # both no-op their asm paths without it (upstream's own build_libs.py skips it the - # same way on non-x86_64). Upstream's own pin, x265 3.6, hard-sets CMP0025/CMP0054 - # to OLD, which CMake 4 (on the image) refuses outright regardless of - # CMAKE_POLICY_VERSION_MINIMUM (gotcha 207/257 doesn't cover this, since it's an - # explicit cmake_policy() call, not a bare cmake_minimum_required floor); 4.2 (the - # version pillow-heif's own riscv64 port already bumped to for the same reason) - # dropped both. - CIBW_BEFORE_ALL_LINUX: | - set -e - export BUILD_DIR=/tmp/ph_build_stuff - mkdir -p "$BUILD_DIR" - cd "$BUILD_DIR" - - curl -fLO https://bitbucket.org/multicoreware/x265_git/downloads/x265_4.2.tar.gz - tar xf x265_4.2.tar.gz - cmake -DCMAKE_INSTALL_PREFIX=/usr -G "Unix Makefiles" x265_4.2/source - make -j"$(nproc)" && make install && ldconfig - - curl -fLO https://github.com/strukturag/libde265/releases/download/v1.0.15/libde265-1.0.15.tar.gz - tar xf libde265-1.0.15.tar.gz - cd libde265-1.0.15 - ./autogen.sh - CXXFLAGS="-g1 -O2" ./configure --prefix /usr --disable-encoder --disable-dec265 --disable-sherlock265 --disable-dependency-tracking - make -j"$(nproc)" && make install && ldconfig - cd .. - - mkdir aom && cd aom - curl -fLO https://aomedia.googlesource.com/aom/+archive/v3.8.3.tar.gz - tar xf v3.8.3.tar.gz - cd .. - mkdir aom_build && cd aom_build - cmake -DENABLE_TESTS=0 -DENABLE_TOOLS=0 -DENABLE_EXAMPLES=0 -DENABLE_DOCS=0 -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_SHARED_LIBS=1 ../aom - make -j"$(nproc)" && make install && ldconfig - cd .. - - curl -fLO https://github.com/strukturag/libheif/releases/download/v1.18.2/libheif-1.18.2.tar.gz - tar xf libheif-1.18.2.tar.gz - mkdir libheif_build && cd libheif_build - cmake --install-prefix=/usr --preset=release-noplugins -DWITH_EXAMPLES=no ../libheif-1.18.2 - make -j"$(nproc)" && make install && ldconfig - cd .. - - cp x265_4.2/COPYING "{package}/LICENSE.x265" - cp libde265-1.0.15/COPYING "{package}/LICENSE.libde265" - cat aom/LICENSE aom/PATENTS > "{package}/LICENSE.libaom" - cp libheif-1.18.2/COPYING "{package}/LICENSE.libheif" - # pyheif's own requirements-test.txt pins pytest==6.2.5 (2021), which predates - # cp312+ internals; Pillow ships no riscv64 wheel on public PyPI, ours is what the - # test env installs. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest piexif Pillow - # test_versions.py reads pyheif/data/version.txt by a cwd-relative path rather than - # through the installed package, so that one file has to be staged at its original - # relative position too (gotcha 36) -- it does not reintroduce the shadow gotcha 25 - # warns about, since the resulting `pyheif/` here has no __init__.py (gotcha 174). - CIBW_TEST_SOURCES: tests pyheif/data - CIBW_TEST_COMMAND: python -m pytest tests + name: pyheif-${{ env.PYHEIF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel contents run: | @@ -151,15 +155,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyheif-${{ env.PYHEIF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyheif ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyiceberg.yml b/.github/workflows/build-pyiceberg.yml index 950aa98e02fb..d6feda5b78bf 100644 --- a/.github/workflows/build-pyiceberg.yml +++ b/.github/workflows/build-pyiceberg.yml @@ -49,39 +49,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyiceberg ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyiceberg" + version: "${{ matrix.version }}" + repository: "apache/iceberg-python" + ref: "pyiceberg-${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py already makes the Cython extension mandatory when CIBUILDWHEEL=1. + # Upstream's wheel job runs only this module; it imports CythonBinaryDecoder, + # so a pure-Python wheel fails here. tests/conftest.py is left unstaged: it + # pulls in boto3/moto that this module needs no fixture from. + cibw-test-sources: "tests/avro/test_decoder.py pyproject.toml" + cibw-test-requires: "pytest==7.4.4" + cibw-test-command: "pytest tests/avro/test_decoder.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYICEBERG_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyiceberg ${{ env.PYICEBERG_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: apache/iceberg-python - ref: pyiceberg-${{ env.PYICEBERG_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # setup.py already makes the Cython extension mandatory when CIBUILDWHEEL=1. - # Upstream's wheel job runs only this module; it imports CythonBinaryDecoder, - # so a pure-Python wheel fails here. tests/conftest.py is left unstaged: it - # pulls in boto3/moto that this module needs no fixture from. - CIBW_TEST_SOURCES: tests/avro/test_decoder.py pyproject.toml - CIBW_TEST_REQUIRES: pytest==7.4.4 - CIBW_TEST_COMMAND: pytest tests/avro/test_decoder.py + name: pyiceberg-${{ env.PYICEBERG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the Cython decoder made it into the wheel run: | @@ -93,15 +99,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyiceberg-${{ env.PYICEBERG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyiceberg ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyicu-binary.yml b/.github/workflows/build-pyicu-binary.yml index 7085c6099f9e..17b724cd2568 100644 --- a/.github/workflows/build-pyicu-binary.yml +++ b/.github/workflows/build-pyicu-binary.yml @@ -51,64 +51,75 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyicu-binary ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - PYICU_BINARY_VERSION: ${{ matrix.version }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyicu-binary" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + git clone --depth 1 --branch "v${{ matrix.version }}" \ + https://gitlab.pyicu.org/main/pyicu.git pyicu - steps: - # gitlab.pyicu.org isn't github.com, so actions/checkout can't reach it. - - name: Checkout pyicu v${{ env.PYICU_BINARY_VERSION }} - run: | - git clone --depth 1 --branch "v${{ env.PYICU_BINARY_VERSION }}" \ - https://gitlab.pyicu.org/main/pyicu.git pyicu + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Apply riscv64 patches - working-directory: pyicu - run: git apply -v ../python-wheels/patches/pyicu-binary/${{ env.PYICU_BINARY_VERSION }}/*.patch + git apply -v ../python-wheels/patches/pyicu-binary/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "pyicu" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py links ICU dynamically via icu-config/pkg-config; auditwheel + # then vendors libicudata/libicuuc/libicui18n into the wheel (the + # "-binary" in the name), which is what makes it self-contained. Its + # Unicode License requires the notice to travel with the binary. + cibw-before-all-linux: "dnf -y install libicu-devel && cp /usr/share/licenses/libicu/LICENSE {package}/LICENSE.icu" + cibw-test-requires: "pytest six" + cibw-test-sources: "pyicu/test" + # 2.7.4's own tests hardcode CLDR-formatted strings and a tzdata + # transition pinned to ICU <=69 (test_DateTimeParserGenerator's + # own ICU_VERSION check tops out at "68.0"); manylinux_2_39 + # links 74.2, whose newer CLDR/tzdata legitimately renders these + # four differently (e.g. narrow-no-break-space in "5:30 PM", + # Fiji's DST rule having no further transitions). Not a riscv64 + # or code defect - deselect rather than chase upstream's CLDR pin. + cibw-test-command: "python -c \"import icu; print('linked ICU', icu.ICU_VERSION)\" && python -m pytest pyicu/test --deselect pyicu/test/test_DateTimeParserGenerator.py::TestDateTimePatternGenerator::testAddPattern --deselect pyicu/test/test_DateTimeParserGenerator.py::TestDateTimePatternGenerator::testGetBestPattern --deselect pyicu/test/test_DateTimeParserGenerator.py::TestDateTimePatternGenerator::testReplaceFieldType --deselect pyicu/test/test_TimeZone.py::TestTimeZone::testTransition" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + PYICU_BINARY_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: pyicu - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py links ICU dynamically via icu-config/pkg-config; auditwheel - # then vendors libicudata/libicuuc/libicui18n into the wheel (the - # "-binary" in the name), which is what makes it self-contained. Its - # Unicode License requires the notice to travel with the binary. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install libicu-devel && - cp /usr/share/licenses/libicu/LICENSE {package}/LICENSE.icu - CIBW_TEST_REQUIRES: pytest six - CIBW_TEST_SOURCES: pyicu/test - # 2.7.4's own tests hardcode CLDR-formatted strings and a tzdata - # transition pinned to ICU <=69 (test_DateTimeParserGenerator's - # own ICU_VERSION check tops out at "68.0"); manylinux_2_39 - # links 74.2, whose newer CLDR/tzdata legitimately renders these - # four differently (e.g. narrow-no-break-space in "5:30 PM", - # Fiji's DST rule having no further transitions). Not a riscv64 - # or code defect - deselect rather than chase upstream's CLDR pin. - CIBW_TEST_COMMAND: >- - python -c "import icu; print('linked ICU', icu.ICU_VERSION)" && - python -m pytest pyicu/test - --deselect pyicu/test/test_DateTimeParserGenerator.py::TestDateTimePatternGenerator::testAddPattern - --deselect pyicu/test/test_DateTimeParserGenerator.py::TestDateTimePatternGenerator::testGetBestPattern - --deselect pyicu/test/test_DateTimeParserGenerator.py::TestDateTimePatternGenerator::testReplaceFieldType - --deselect pyicu/test/test_TimeZone.py::TestTimeZone::testTransition + name: pyicu-binary-${{ env.PYICU_BINARY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel bundles ICU and its licence run: | @@ -122,15 +133,9 @@ jobs: print(whl, "OK") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyicu-binary-${{ env.PYICU_BINARY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyicu-binary ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyinstrument.yml b/.github/workflows/build-pyinstrument.yml index 2cd1d8b12d8b..b8d6ab96fa4b 100644 --- a/.github/workflows/build-pyinstrument.yml +++ b/.github/workflows/build-pyinstrument.yml @@ -59,7 +59,6 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # cffi and psutil have no riscv64 wheel on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # stat_profile declares no free-threading support, so 3.14t re-enables the # GIL on import and warns; test_cmdline compares subprocess stderr exactly. cibw-test-environment: PYTHON_GIL=1 diff --git a/.github/workflows/build-pyjls.yml b/.github/workflows/build-pyjls.yml index 79729e8888e8..c06789480728 100644 --- a/.github/workflows/build-pyjls.yml +++ b/.github/workflows/build-pyjls.yml @@ -58,7 +58,7 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" cibw-test-requires: pytest cibw-test-command: pytest --pyargs pyjls timeout-minutes: 60 diff --git a/.github/workflows/build-pyjpegls.yml b/.github/workflows/build-pyjpegls.yml index 0d7c8ae84eeb..9c290f3bc790 100644 --- a/.github/workflows/build-pyjpegls.yml +++ b/.github/workflows/build-pyjpegls.yml @@ -50,49 +50,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyjpegls ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyjpegls" + version: "${{ matrix.version }}" + repository: "pydicom/pyjpegls" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pyjpegls/${{ matrix.version }}/00*.patch + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest" + cibw-test-command: "pytest --pyargs jpeg_ls.tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYJPEGLS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyjpegls v${{ env.PYJPEGLS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pydicom/pyjpegls - ref: v${{ env.PYJPEGLS_VERSION }} - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # The extension compiles in the vendored CharLS (BSD-3-Clause) but the - # wheel ships no licence at all, for either project. - - name: Patch pyjpegls source - run: | - git apply python-wheels/patches/pyjpegls/${{ env.PYJPEGLS_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest --pyargs jpeg_ls.tests + name: pyjpegls-${{ env.PYJPEGLS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel contents run: | @@ -106,15 +112,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyjpegls-${{ env.PYJPEGLS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyjpegls ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyjpt.yml b/.github/workflows/build-pyjpt.yml index 23d47d85f156..341ac51167f4 100644 --- a/.github/workflows/build-pyjpt.yml +++ b/.github/workflows/build-pyjpt.yml @@ -60,12 +60,7 @@ jobs: # Cython 3.3.0 shipped after this release and rejects the .pyx/.pxd # signature pairs in jpt.base.intervals; build-system.requires only floors it. cibw-before-all: echo 'Cython<3.3.0' > /cython-constraint.txt - cibw-environment: >- - PIP_CONSTRAINT=/cython-constraint.txt - PIP_BUILD_CONSTRAINT=/cython-constraint.txt - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn,matplotlib,contourpy,kiwisolver,pillow - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYJPT=${{ matrix.version }} + cibw-environment-linux: "PIP_CONSTRAINT=/cython-constraint.txt PIP_BUILD_CONSTRAINT=/cython-constraint.txt PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn,matplotlib,contourpy,kiwisolver,pillow SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYJPT=${{ matrix.version }}" cibw-before-test-linux: dnf -y install graphviz cibw-test-sources: tests examples # The dev extra minus docs/jupyter/mlflow/kaleido; mlflow is what holds diff --git a/.github/workflows/build-pykdtree.yml b/.github/workflows/build-pykdtree.yml index 8d68204eb061..7d661da33fbd 100644 --- a/.github/workflows/build-pykdtree.yml +++ b/.github/workflows/build-pykdtree.yml @@ -50,49 +50,58 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pykdtree ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pykdtree" + version: "${{ matrix.version }}" + repository: "storpipfugl/pykdtree" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pykdtree/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a build-time requirement (headers) and, despite not being + # declared as a runtime dependency by name>=2, an implicit one too (the + # compiled extension calls numpy's C API at import time). Only our + # registry has it for riscv64; only-binary keeps a newer PyPI release + # from winning the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest mypy numpy typing-extensions>=4.15" + cibw-test-command: "python -m pytest -v --pyargs pykdtree" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYKDTREE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pykdtree v${{ env.PYKDTREE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: storpipfugl/pykdtree - ref: v${{ env.PYKDTREE_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/pykdtree/${{ env.PYKDTREE_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build-time requirement (headers) and, despite not being - # declared as a runtime dependency by name>=2, an implicit one too (the - # compiled extension calls numpy's C API at import time). Only our - # registry has it for riscv64; only-binary keeps a newer PyPI release - # from winning the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest mypy numpy typing-extensions>=4.15 - CIBW_TEST_COMMAND: python -m pytest -v --pyargs pykdtree + name: pykdtree-${{ env.PYKDTREE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -105,13 +114,6 @@ jobs: assert licences == {"LICENSE.txt"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pykdtree-${{ env.PYKDTREE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -147,7 +149,7 @@ jobs: publish: name: Publish pykdtree ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pykrige.yml b/.github/workflows/build-pykrige.yml index aeb9657795e0..a941574fbbc4 100644 --- a/.github/workflows/build-pykrige.yml +++ b/.github/workflows/build-pykrige.yml @@ -60,10 +60,7 @@ jobs: checkout-fetch-depth: 0 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # Replaces upstream's [tool.cibuildwheel] environment table, so its two keys are restated. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - PIP_PREFER_BINARY=1 + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy PIP_PREFER_BINARY=1" timeout-minutes: 90 publish: diff --git a/.github/workflows/build-pylhasa.yml b/.github/workflows/build-pylhasa.yml index 3827bfa899ac..45cf35452387 100644 --- a/.github/workflows/build-pylhasa.yml +++ b/.github/workflows/build-pylhasa.yml @@ -49,31 +49,39 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pylhasa ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pylhasa" + version: "${{ matrix.version }}" + repository: "bwhitn/pylhasa" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-command: "pytest -q {project}/tests" + cibw-test-requires: "pytest" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYLHASA_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pylhasa v${{ env.PYLHASA_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: bwhitn/pylhasa - ref: v${{ env.PYLHASA_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_COMMAND: "pytest -q {project}/tests" - CIBW_TEST_REQUIRES: "pytest" + name: pylhasa-${{ env.PYLHASA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -88,15 +96,9 @@ jobs: assert licences == {"LICENSE", "native/vendor/lhasa/COPYING.md"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pylhasa-${{ env.PYLHASA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pylhasa ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pylibjpeg-libjpeg.yml b/.github/workflows/build-pylibjpeg-libjpeg.yml index 6bad08ac6e6f..11cc44a1c713 100644 --- a/.github/workflows/build-pylibjpeg-libjpeg.yml +++ b/.github/workflows/build-pylibjpeg-libjpeg.yml @@ -50,61 +50,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pylibjpeg-libjpeg ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pylibjpeg-libjpeg" + version: "${{ matrix.version }}" + repository: "pydicom/pylibjpeg-libjpeg" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "true" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a build-time requirement (headers, via pyproject.toml's + # build-system.requires) and a runtime one too (the compiled + # extension calls numpy's C API at import time). Only our registry + # has it for riscv64; only-binary keeps a newer PyPI release from + # winning the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + # The test stage has its own environment (CIBW_ENVIRONMENT does not + # reach it). pillow is wheel-only there: its newest PyPI release has + # no riscv64 wheel (the registry has one), and the sdist can't build + # without jpeg headers. + cibw-test-environment: "PIP_ONLY_BINARY=pillow,numpy" + cibw-test-requires: "pillow" + cibw-test-command: "python -c \"import io; import numpy as np; from PIL import Image; import libjpeg, _libjpeg; assert _libjpeg.__file__.endswith('.so'), _libjpeg.__file__; src = np.arange(64 * 64, dtype=np.uint8).reshape(64, 64); buf = io.BytesIO(); Image.fromarray(src).save(buf, format='JPEG', quality=100); out = libjpeg.decode(buf.getvalue()); assert out.shape == (64, 64), out.shape; assert out.dtype == np.uint8, out.dtype \"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYLIBJPEG_LIBJPEG_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pylibjpeg-libjpeg v${{ env.PYLIBJPEG_LIBJPEG_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pydicom/pylibjpeg-libjpeg - ref: v${{ env.PYLIBJPEG_LIBJPEG_VERSION }} - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a build-time requirement (headers, via pyproject.toml's - # build-system.requires) and a runtime one too (the compiled - # extension calls numpy's C API at import time). Only our registry - # has it for riscv64; only-binary keeps a newer PyPI release from - # winning the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - # The test stage has its own environment (CIBW_ENVIRONMENT does not - # reach it). pillow is wheel-only there: its newest PyPI release has - # no riscv64 wheel (the registry has one), and the sdist can't build - # without jpeg headers. - CIBW_TEST_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=pillow,numpy - CIBW_TEST_REQUIRES: pillow - CIBW_TEST_COMMAND: >- - python -c "import io; - import numpy as np; - from PIL import Image; - import libjpeg, _libjpeg; - assert _libjpeg.__file__.endswith('.so'), _libjpeg.__file__; - src = np.arange(64 * 64, dtype=np.uint8).reshape(64, 64); - buf = io.BytesIO(); - Image.fromarray(src).save(buf, format='JPEG', quality=100); - out = libjpeg.decode(buf.getvalue()); - assert out.shape == (64, 64), out.shape; - assert out.dtype == np.uint8, out.dtype - " + name: pylibjpeg-libjpeg-${{ env.PYLIBJPEG_LIBJPEG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel contents run: | @@ -119,15 +109,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pylibjpeg-libjpeg-${{ env.PYLIBJPEG_LIBJPEG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pylibjpeg-libjpeg ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pylibjpeg-openjpeg.yml b/.github/workflows/build-pylibjpeg-openjpeg.yml index 243074277b54..ddc2ef489aa8 100644 --- a/.github/workflows/build-pylibjpeg-openjpeg.yml +++ b/.github/workflows/build-pylibjpeg-openjpeg.yml @@ -50,53 +50,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pylibjpeg-openjpeg ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pylibjpeg-openjpeg" + version: "${{ matrix.version }}" + repository: "pydicom/pylibjpeg-openjpeg" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pylibjpeg-openjpeg/${{ matrix.version }}/00*.patch + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest pydicom pylibjpeg git+https://github.com/pydicom/pylibjpeg-data" + cibw-test-command: "pytest --pyargs openjpeg.tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYLIBJPEG_OPENJPEG_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pylibjpeg-openjpeg v${{ env.PYLIBJPEG_OPENJPEG_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pydicom/pylibjpeg-openjpeg - ref: v${{ env.PYLIBJPEG_OPENJPEG_VERSION }} - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # The extension compiles in the vendored Little CMS but the wheel ships - # no licence for it. - - name: Patch pylibjpeg-openjpeg source - run: | - git apply python-wheels/patches/pylibjpeg-openjpeg/${{ env.PYLIBJPEG_OPENJPEG_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: >- - pytest - pydicom - pylibjpeg - git+https://github.com/pydicom/pylibjpeg-data - CIBW_TEST_COMMAND: pytest --pyargs openjpeg.tests + name: pylibjpeg-openjpeg-${{ env.PYLIBJPEG_OPENJPEG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel contents run: | @@ -110,15 +113,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pylibjpeg-openjpeg-${{ env.PYLIBJPEG_OPENJPEG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pylibjpeg-openjpeg ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pylibjpeg-rle.yml b/.github/workflows/build-pylibjpeg-rle.yml index 0579b1a900f5..872885703e2d 100644 --- a/.github/workflows/build-pylibjpeg-rle.yml +++ b/.github/workflows/build-pylibjpeg-rle.yml @@ -50,46 +50,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pylibjpeg-rle ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pylibjpeg-rle" + version: "${{ matrix.version }}" + repository: "pydicom/pylibjpeg-rle" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "true" + # musllinux is dropped: numpy, a runtime dependency, has no + # musllinux riscv64 wheel on either index. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all: "curl -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest pydicom pylibjpeg git+https://github.com/pydicom/pylibjpeg-data" + cibw-test-command: "pytest --pyargs rle.tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYLIBJPEG_RLE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pylibjpeg-rle v${{ env.PYLIBJPEG_RLE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pydicom/pylibjpeg-rle - ref: v${{ env.PYLIBJPEG_RLE_VERSION }} - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # musllinux is dropped: numpy, a runtime dependency, has no - # musllinux riscv64 wheel on either index. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL: >- - curl -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y - CIBW_ENVIRONMENT: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: >- - pytest - pydicom - pylibjpeg - git+https://github.com/pydicom/pylibjpeg-data - CIBW_TEST_COMMAND: pytest --pyargs rle.tests + name: pylibjpeg-rle-${{ env.PYLIBJPEG_RLE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel contents run: | @@ -102,15 +100,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pylibjpeg-rle-${{ env.PYLIBJPEG_RLE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pylibjpeg-rle ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pylibmc.yml b/.github/workflows/build-pylibmc.yml index 58a875da1e12..bf50ce23973e 100644 --- a/.github/workflows/build-pylibmc.yml +++ b/.github/workflows/build-pylibmc.yml @@ -58,85 +58,90 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pylibmc ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pylibmc" + version: "${{ matrix.version }}" + repository: "lericson/pylibmc" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pylibmc/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Mirrors upstream's install_libaec/install_hdf5-style before-all + # (build-h5py.yml): fetch, configure and install the dependency into + # the container instead of yum-installing a devel package. SASL and + # OpenSSL-crypto support are left at their (off) CMake defaults -- + # pylibmc's own tests exercise neither, and upstream's official + # wheel pulls in a large Kerberos/GSSAPI stack for SASL that isn't + # worth the added scope for an untested feature. + cibw-before-all-linux: |- + set -ex + dnf -y install zlib-devel flex + mkdir -p /tmp/libmemcached + curl -fsSL "https://github.com/awesomized/libmemcached/archive/refs/tags/$LIBMEMCACHED_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/libmemcached + cmake -S /tmp/libmemcached -B /tmp/libmemcached/build \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_INSTALL_PREFIX=/usr \ + -D BUILD_TESTING=OFF \ + -D ENABLE_HASH_HSIEH=ON \ + -D ENABLE_HASH_FNV64=ON \ + -D ENABLE_HASH_MURMUR=ON + cmake --build /tmp/libmemcached/build -j "$(nproc)" + cmake --install /tmp/libmemcached/build + ldconfig + # LIBMEMCACHED_VERSION must be restated here: CIBW_BEFORE_ALL_LINUX + # runs inside the manylinux container via `sh -c`, which does not + # inherit the job's plain `env:` (only what CIBW_ENVIRONMENT passes + # through). + cibw-environment-linux: "LIBMEMCACHED_VERSION=1.1.4" + cibw-test-requires: "pytest" + # Rocky 10's `memcached` package (appstream, no EPEL needed) stands + # in for upstream's CI service container; it refuses to start as + # root without an explicit -u. + cibw-before-test-linux: |- + dnf -y install memcached + memcached -d -u root + # src-layout checkout (package_dir={'': 'src'}) has no top-level + # pylibmc/ to shadow the installed wheel (gotcha territory: + # testing-and-shadowing.md), so testing straight from {project} is + # safe -- mirrors upstream's `runtests.py -v tests --with-doctest`. + cibw-test-command: "python -c \"import importlib.metadata as m; f = sorted(p.name for p in m.files('pylibmc') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'LICENSE.libmemcached'], f\" && cd {project} && python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYLIBMC_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pylibmc ${{ env.PYLIBMC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: lericson/pylibmc - ref: ${{ env.PYLIBMC_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pylibmc source - run: git apply python-wheels/patches/pylibmc/${{ env.PYLIBMC_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Mirrors upstream's install_libaec/install_hdf5-style before-all - # (build-h5py.yml): fetch, configure and install the dependency into - # the container instead of yum-installing a devel package. SASL and - # OpenSSL-crypto support are left at their (off) CMake defaults -- - # pylibmc's own tests exercise neither, and upstream's official - # wheel pulls in a large Kerberos/GSSAPI stack for SASL that isn't - # worth the added scope for an untested feature. - CIBW_BEFORE_ALL_LINUX: | - set -ex - dnf -y install zlib-devel flex - mkdir -p /tmp/libmemcached - curl -fsSL "https://github.com/awesomized/libmemcached/archive/refs/tags/$LIBMEMCACHED_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/libmemcached - cmake -S /tmp/libmemcached -B /tmp/libmemcached/build \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_INSTALL_PREFIX=/usr \ - -D BUILD_TESTING=OFF \ - -D ENABLE_HASH_HSIEH=ON \ - -D ENABLE_HASH_FNV64=ON \ - -D ENABLE_HASH_MURMUR=ON - cmake --build /tmp/libmemcached/build -j "$(nproc)" - cmake --install /tmp/libmemcached/build - ldconfig - # LIBMEMCACHED_VERSION must be restated here: CIBW_BEFORE_ALL_LINUX - # runs inside the manylinux container via `sh -c`, which does not - # inherit the job's plain `env:` (only what CIBW_ENVIRONMENT passes - # through). - CIBW_ENVIRONMENT: >- - LIBMEMCACHED_VERSION=${{ env.LIBMEMCACHED_VERSION }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest - # Rocky 10's `memcached` package (appstream, no EPEL needed) stands - # in for upstream's CI service container; it refuses to start as - # root without an explicit -u. - CIBW_BEFORE_TEST_LINUX: | - dnf -y install memcached - memcached -d -u root - # src-layout checkout (package_dir={'': 'src'}) has no top-level - # pylibmc/ to shadow the installed wheel (gotcha territory: - # testing-and-shadowing.md), so testing straight from {project} is - # safe -- mirrors upstream's `runtests.py -v tests --with-doctest`. - CIBW_TEST_COMMAND: >- - python -c "import importlib.metadata as m; - f = sorted(p.name for p in m.files('pylibmc') if '.dist-info/licenses/' in str(p)); - assert f == ['LICENSE', 'LICENSE.libmemcached'], f" && - cd {project} && python -m pytest -v tests + name: pylibmc-${{ env.PYLIBMC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel is a compiled extension run: | @@ -148,15 +153,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pylibmc-${{ env.PYLIBMC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pylibmc ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pylibsrtp.yml b/.github/workflows/build-pylibsrtp.yml index ace99d0f7729..0090d9c2abfc 100644 --- a/.github/workflows/build-pylibsrtp.yml +++ b/.github/workflows/build-pylibsrtp.yml @@ -54,57 +54,56 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build pylibsrtp ${{ matrix.version }} cp310-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pylibsrtp" + version: "${{ matrix.version }}" + repository: "aiortc/pylibsrtp" + ref: "${{ matrix.version }}" + artifact-tag: "cp310-abi3-manylinux_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pylibsrtp/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # cp310 first: setup.py forces the cp310-abi3 tag regardless of the + # build interpreter (gotcha 96); the later entries build nothing, + # they only re-test the one wheel. + cibw-build: "cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # aiortc/aioquic-openssl (scripts/fetch-vendor.py) has no riscv64 build; + # the patch falls back to the image's own openssl-devel, whose runtime + # .so auditwheel then vendors (Apache-2.0) into the wheel without a + # licence, so stage one. libsrtp is linked statically (BSD-3-Clause). + cibw-before-all-linux: "dnf -y install openssl-devel && cp /usr/share/licenses/openssl-libs/LICENSE.txt {project}/LICENSE.openssl && curl -fsSL --retry 5 https://raw.githubusercontent.com/cisco/libsrtp/v2.7.0/LICENSE -o {project}/LICENSE.libsrtp" + cibw-before-build: "python scripts/build-libsrtp.py /tmp/vendor" + cibw-environment-linux: "CFLAGS=-I/tmp/vendor/include LDFLAGS=-L/tmp/vendor/lib PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig" + cibw-test-command: "python -m unittest discover -s {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: PYLIBSRTP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pylibsrtp ${{ env.PYLIBSRTP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: aiortc/pylibsrtp - ref: ${{ env.PYLIBSRTP_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pylibsrtp source - run: git apply python-wheels/patches/pylibsrtp/${{ env.PYLIBSRTP_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - # cp310 first: setup.py forces the cp310-abi3 tag regardless of the - # build interpreter (gotcha 96); the later entries build nothing, - # they only re-test the one wheel. - CIBW_BUILD: >- - cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # aiortc/aioquic-openssl (scripts/fetch-vendor.py) has no riscv64 build; - # the patch falls back to the image's own openssl-devel, whose runtime - # .so auditwheel then vendors (Apache-2.0) into the wheel without a - # licence, so stage one. libsrtp is linked statically (BSD-3-Clause). - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install openssl-devel && - cp /usr/share/licenses/openssl-libs/LICENSE.txt {project}/LICENSE.openssl && - curl -fsSL --retry 5 https://raw.githubusercontent.com/cisco/libsrtp/v2.7.0/LICENSE -o {project}/LICENSE.libsrtp - CIBW_BEFORE_BUILD: python scripts/build-libsrtp.py /tmp/vendor - CIBW_ENVIRONMENT: >- - CFLAGS=-I/tmp/vendor/include - LDFLAGS=-L/tmp/vendor/lib - PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_COMMAND: python -m unittest discover -s {project}/tests + name: pylibsrtp-${{ env.PYLIBSRTP_VERSION }}-cp310-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and both licences run: | @@ -120,15 +119,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pylibsrtp-${{ env.PYLIBSRTP_VERSION }}-cp310-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pylibsrtp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pylife.yml b/.github/workflows/build-pylife.yml index cecc12f0e1c8..26c5619d2de7 100644 --- a/.github/workflows/build-pylife.yml +++ b/.github/workflows/build-pylife.yml @@ -49,49 +49,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pylife ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pylife" + version: "${{ matrix.version }}" + repository: "boschresearch/pylife" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy/cython are build-time deps and numpy, scipy, pandas and h5py are runtime + # ones; only our registry has riscv64 wheels for them, and PIP_ONLY_BINARY keeps a + # newer PyPI sdist from winning the resolution and compiling from source. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,pandas,h5py,cython" + cibw-test-requires: "pytest" + # tests/stress/rainflow/test_fkm_nonlinear.py opens its reference JSON fixtures by a + # path relative to the process cwd (e.g. 'tests/stress/rainflow/reference-fkm-nonlinear/ + # reference_first_second-4.json'), not relative to __file__. cibuildwheel runs + # CIBW_TEST_COMMAND from an isolated test_cwd, not from {project}, so those opens + # raise FileNotFoundError regardless of interpreter or arch (gotcha 104/111; see also + # gotcha 243 on not assuming a CIBW_TEST_COMMAND failure is riscv64-specific). pylife + # uses a src/ layout (package lives at src/pylife, not at the checkout root), so + # cd'ing into {project} does not risk shadowing the installed wheel with the local + # source tree. + cibw-test-command: "cd {project} && pytest tests/stress/rainflow tests/strength/fkm_linear" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYLIFE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pylife ${{ env.PYLIFE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: boschresearch/pylife - ref: ${{ env.PYLIFE_VERSION }} - fetch-depth: 0 # setuptools_scm derives the version from the git tag - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy/cython are build-time deps and numpy, scipy, pandas and h5py are runtime - # ones; only our registry has riscv64 wheels for them, and PIP_ONLY_BINARY keeps a - # newer PyPI sdist from winning the resolution and compiling from source. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas,h5py,cython - CIBW_TEST_REQUIRES: pytest - # tests/stress/rainflow/test_fkm_nonlinear.py opens its reference JSON fixtures by a - # path relative to the process cwd (e.g. 'tests/stress/rainflow/reference-fkm-nonlinear/ - # reference_first_second-4.json'), not relative to __file__. cibuildwheel runs - # CIBW_TEST_COMMAND from an isolated test_cwd, not from {project}, so those opens - # raise FileNotFoundError regardless of interpreter or arch (gotcha 104/111; see also - # gotcha 243 on not assuming a CIBW_TEST_COMMAND failure is riscv64-specific). pylife - # uses a src/ layout (package lives at src/pylife, not at the checkout root), so - # cd'ing into {project} does not risk shadowing the installed wheel with the local - # source tree. - CIBW_TEST_COMMAND: cd {project} && pytest tests/stress/rainflow tests/strength/fkm_linear + name: pylife-${{ env.PYLIFE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the licence and the compiled extensions run: | @@ -104,16 +108,9 @@ jobs: assert any(n.startswith(f"pylife/{ext}.") and n.endswith(".so") for n in names), names EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pylife-${{ env.PYLIFE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pylife ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pymatgen-core.yml b/.github/workflows/build-pymatgen-core.yml index 92d56d94cf39..f19addf8937f 100644 --- a/.github/workflows/build-pymatgen-core.yml +++ b/.github/workflows/build-pymatgen-core.yml @@ -49,59 +49,54 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pymatgen-core ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pymatgen-core" + version: "${{ matrix.version }}" + repository: "materialsproject/pymatgen-core" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + git sparse-checkout init --no-cone + printf '%s\n' '/*' '!/test-files' | git sparse-checkout set --stdin + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # cython and numpy have riscv64 wheels only on our registry; the pretend + # version stands in for setuptools-scm, which gets no git in the container. + cibw-environment-linux: "PIP_ONLY_BINARY=cython,numpy SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYMATGEN_CORE=${{ matrix.version }}" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + # Everything left out reads the test-files tree dropped from the checkout. + cibw-test-command: "pytest tests/optimization tests/util tests/core/test_lattice.py tests/core/test_sites.py tests/core/test_composition.py tests/core/test_periodic_table.py tests/core/test_operations.py --ignore=tests/util/test_io.py --ignore=tests/util/test_testing.py" + # These have riscv64 wheels only on our registry; only-binary keeps a newer + # PyPI release from winning the resolution and then compiling from sdist. + # Named individually rather than :all:, which holds bibtexparser at 1.3.0 + # (1.4 onwards ships no wheel) and that release fails pymatgen's own BibTeX + # validation on every architecture. + cibw-test-environment: "MPLBACKEND=Agg PIP_ONLY_BINARY=charset-normalizer,contourpy,fonttools,kiwisolver,lxml,matplotlib,numpy,orjson,pandas,pillow,scipy,spglib" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYMATGEN_CORE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pymatgen-core v${{ env.PYMATGEN_CORE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: materialsproject/pymatgen-core - ref: v${{ env.PYMATGEN_CORE_VERSION }} - persist-credentials: false - # test-files/ is a 514 MB tree of reference calculation outputs that - # neither the build nor the tests selected below read. - sparse-checkout: | - /* - !/test-files - sparse-checkout-cone-mode: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cython and numpy have riscv64 wheels only on our registry; the pretend - # version stands in for setuptools-scm, which gets no git in the container. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=cython,numpy - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYMATGEN_CORE=${{ env.PYMATGEN_CORE_VERSION }} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - # Everything left out reads the test-files tree dropped from the checkout. - CIBW_TEST_COMMAND: >- - pytest tests/optimization tests/util tests/core/test_lattice.py - tests/core/test_sites.py tests/core/test_composition.py - tests/core/test_periodic_table.py tests/core/test_operations.py - --ignore=tests/util/test_io.py --ignore=tests/util/test_testing.py - # These have riscv64 wheels only on our registry; only-binary keeps a newer - # PyPI release from winning the resolution and then compiling from sdist. - # Named individually rather than :all:, which holds bibtexparser at 1.3.0 - # (1.4 onwards ships no wheel) and that release fails pymatgen's own BibTeX - # validation on every architecture. - CIBW_TEST_ENVIRONMENT: >- - MPLBACKEND=Agg - PIP_ONLY_BINARY=charset-normalizer,contourpy,fonttools,kiwisolver,lxml,matplotlib,numpy,orjson,pandas,pillow,scipy,spglib + name: pymatgen-core-${{ env.PYMATGEN_CORE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -115,15 +110,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pymatgen-core-${{ env.PYMATGEN_CORE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pymatgen-core ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pymaxflow.yml b/.github/workflows/build-pymaxflow.yml index 3de80829c882..40ee635f2c68 100644 --- a/.github/workflows/build-pymaxflow.yml +++ b/.github/workflows/build-pymaxflow.yml @@ -50,55 +50,65 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pymaxflow ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pymaxflow" + version: "${{ matrix.version }}" + repository: "pmneila/PyMaxflow" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pymaxflow/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cp maxflow/src/core/README.TXT LICENSE.maxflow-core + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is both a build and a runtime requirement, and only our + # registry has it for riscv64; Cython has no public riscv64 wheel + # anywhere either, so it comes from the registry too. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest imageio networkx" + cibw-test-sources: "test_maxflow.py examples" + cibw-test-command: "python -m pytest test_maxflow.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYMAXFLOW_VERSION: ${{ matrix.version }} - steps: - - name: Checkout PyMaxflow v${{ env.PYMAXFLOW_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pmneila/PyMaxflow - ref: v${{ env.PYMAXFLOW_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pymaxflow source - run: git apply python-wheels/patches/pymaxflow/${{ env.PYMAXFLOW_VERSION }}/*.patch - - # The core solver (maxflow/src/core/) is a separate GPLv3-licensed - # vendored library with its own copyright notice; it is compiled - # straight into the extension but never installed as package data. - - name: Stage the vendored core solver's licence notice - run: cp maxflow/src/core/README.TXT LICENSE.maxflow-core - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is both a build and a runtime requirement, and only our - # registry has it for riscv64; Cython has no public riscv64 wheel - # anywhere either, so it comes from the registry too. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest imageio networkx - CIBW_TEST_SOURCES: test_maxflow.py examples - CIBW_TEST_COMMAND: python -m pytest test_maxflow.py + name: pymaxflow-${{ env.PYMAXFLOW_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and both licences run: | @@ -113,16 +123,9 @@ jobs: print(whl, "ok") EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pymaxflow-${{ env.PYMAXFLOW_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pymaxflow ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pymcubes.yml b/.github/workflows/build-pymcubes.yml index 2a280fe5bc0b..5ab87c5ec247 100644 --- a/.github/workflows/build-pymcubes.yml +++ b/.github/workflows/build-pymcubes.yml @@ -50,51 +50,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pymcubes ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pymcubes" + version: "${{ matrix.version }}" + repository: "pmneila/PyMCubes" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # pyproject.toml pins build-system.requires to "numpy~=2.0", which has + # no cp313/cp314 wheels at all (numpy 2.0 predates Python 3.13). Pin the + # same requires with the ceiling lifted and disable isolation so it holds. + cibw-before-build: "pip install setuptools wheel Cython \"numpy>=2.0,<3.0\"" + cibw-build-frontend: "build; args: --no-isolation" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy" + cibw-test-requires: "pytest pycollada" + # test_mcubes.py/test_smoothing.py sit at the repo root beside the mcubes/ + # source package; testing from {project} would import that source tree + # instead of the built wheel (gotcha 25). + cibw-test-sources: "test_mcubes.py test_smoothing.py" + # Upstream's own CI creates this dir before pytest; test_export() writes into it. + cibw-test-command: "mkdir -p output && python -m pytest -v test_mcubes.py test_smoothing.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYMCUBES_VERSION: ${{ matrix.version }} - steps: - - name: Checkout PyMCubes v${{ env.PYMCUBES_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pmneila/PyMCubes - ref: v${{ env.PYMCUBES_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # pyproject.toml pins build-system.requires to "numpy~=2.0", which has - # no cp313/cp314 wheels at all (numpy 2.0 predates Python 3.13). Pin the - # same requires with the ceiling lifted and disable isolation so it holds. - CIBW_BEFORE_BUILD: pip install setuptools wheel Cython "numpy>=2.0,<3.0" - CIBW_BUILD_FRONTEND: "build; args: --no-isolation" - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - CIBW_TEST_REQUIRES: pytest pycollada - # test_mcubes.py/test_smoothing.py sit at the repo root beside the mcubes/ - # source package; testing from {project} would import that source tree - # instead of the built wheel (gotcha 25). - CIBW_TEST_SOURCES: test_mcubes.py test_smoothing.py - # Upstream's own CI creates this dir before pytest; test_export() writes into it. - CIBW_TEST_COMMAND: mkdir -p output && python -m pytest -v test_mcubes.py test_smoothing.py + name: pymcubes-${{ env.PYMCUBES_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -107,16 +112,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pymcubes-${{ env.PYMCUBES_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pymcubes ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pymediainfo.yml b/.github/workflows/build-pymediainfo.yml index 80b44e3435d0..ce526f47c685 100644 --- a/.github/workflows/build-pymediainfo.yml +++ b/.github/workflows/build-pymediainfo.yml @@ -56,6 +56,84 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pymediainfo ${{ matrix.version }} py3-none-${{ matrix.libc }}_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + libc: [manylinux, musllinux] + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pymediainfo" + version: "${{ matrix.version }}" + repository: "sbraz/pymediainfo" + ref: "v${{ matrix.version }}" + artifact-tag: "py3-none-${{ matrix.libc }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pymediainfo/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-${{ matrix.libc }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-environment-linux: "MEDIAINFOLIB_VERSION=24.12 ZENLIB_VERSION=0.4.41 PDM_BUILD_SCM_VERSION=${{ matrix.version }}" + cibw-before-all-linux: |- + set -ex + if command -v apk > /dev/null; then + apk add --no-cache cmake zlib-dev + else + dnf install -y cmake zlib-devel + fi + mkdir -p /tmp/mediainfo-src/ZenLib /tmp/mediainfo-src/MediaInfoLib + curl -fsSL "https://github.com/MediaArea/ZenLib/archive/refs/tags/v$ZENLIB_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/mediainfo-src/ZenLib + curl -fsSL "https://github.com/MediaArea/MediaInfoLib/archive/refs/tags/v$MEDIAINFOLIB_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/mediainfo-src/MediaInfoLib + # Built standalone (static, -fPIC) and found via find_package below rather + # than through MediaInfoLib's BUILD_ZENLIB=ON add_subdirectory: ZenLib's own + # CMakeLists.txt calls option(BUILD_SHARED_LIBS ON) under CMP0077 OLD (its + # cmake_minimum_required floor predates that policy), which wins over the + # parent's temporary override and silently links a shared, unbundled libzen. + cmake -S /tmp/mediainfo-src/ZenLib/Project/CMake -B /tmp/mediainfo-src/zenlib-build \ + -D CMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -D CMAKE_BUILD_TYPE=Release \ + -D BUILD_SHARED_LIBS=OFF \ + -D CMAKE_POSITION_INDEPENDENT_CODE=ON \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D CMAKE_INSTALL_PREFIX=/tmp/mediainfo-install + cmake --build /tmp/mediainfo-src/zenlib-build -j"$(nproc)" + cmake --install /tmp/mediainfo-src/zenlib-build + cmake -S /tmp/mediainfo-src/MediaInfoLib/Project/CMake -B /tmp/mediainfo-src/build \ + -D CMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -D CMAKE_BUILD_TYPE=Release \ + -D BUILD_SHARED_LIBS=ON \ + -D BUILD_ZENLIB=OFF \ + -D CMAKE_PREFIX_PATH=/tmp/mediainfo-install \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D CMAKE_INSTALL_PREFIX=/tmp/mediainfo-install + cmake --build /tmp/mediainfo-src/build -j"$(nproc)" + cmake --install /tmp/mediainfo-src/build + cp -L /tmp/mediainfo-install/lib/libmediainfo.so.0 {package}/src/pymediainfo/libmediainfo.so.0 + # pdm-backend tags a wheel "py3-none-any" unless told otherwise (there + # are no ext_modules); cibuildwheel refuses a "none-any" build output + # outright, so a placeholder platform tag is forced here and auditwheel + # repair (default, unmodified) turns it into the real manylinux/musllinux tag. + cibw-build-frontend: "build; args: -C--plat-name=linux_riscv64" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + # test_parse_url needs libcurl, which isn't linked in (kept optional, + # matching upstream's own CMake build when libcurl-dev isn't present). + cibw-test-command: "python -m pytest {project}/tests -k \"not test_parse_url\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: @@ -63,83 +141,14 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} libc: [manylinux, musllinux] - env: PYMEDIAINFO_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pymediainfo ${{ env.PYMEDIAINFO_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: sbraz/pymediainfo - ref: v${{ env.PYMEDIAINFO_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pymediainfo source - run: git apply python-wheels/patches/pymediainfo/${{ env.PYMEDIAINFO_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: cp312-${{ matrix.libc }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - MEDIAINFOLIB_VERSION=${{ env.MEDIAINFOLIB_VERSION }} - ZENLIB_VERSION=${{ env.ZENLIB_VERSION }} - PDM_BUILD_SCM_VERSION=${{ env.PYMEDIAINFO_VERSION }} - CIBW_BEFORE_ALL_LINUX: | - set -ex - if command -v apk > /dev/null; then - apk add --no-cache cmake zlib-dev - else - dnf install -y cmake zlib-devel - fi - mkdir -p /tmp/mediainfo-src/ZenLib /tmp/mediainfo-src/MediaInfoLib - curl -fsSL "https://github.com/MediaArea/ZenLib/archive/refs/tags/v$ZENLIB_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/mediainfo-src/ZenLib - curl -fsSL "https://github.com/MediaArea/MediaInfoLib/archive/refs/tags/v$MEDIAINFOLIB_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/mediainfo-src/MediaInfoLib - # Built standalone (static, -fPIC) and found via find_package below rather - # than through MediaInfoLib's BUILD_ZENLIB=ON add_subdirectory: ZenLib's own - # CMakeLists.txt calls option(BUILD_SHARED_LIBS ON) under CMP0077 OLD (its - # cmake_minimum_required floor predates that policy), which wins over the - # parent's temporary override and silently links a shared, unbundled libzen. - cmake -S /tmp/mediainfo-src/ZenLib/Project/CMake -B /tmp/mediainfo-src/zenlib-build \ - -D CMAKE_POLICY_VERSION_MINIMUM=3.5 \ - -D CMAKE_BUILD_TYPE=Release \ - -D BUILD_SHARED_LIBS=OFF \ - -D CMAKE_POSITION_INDEPENDENT_CODE=ON \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D CMAKE_INSTALL_PREFIX=/tmp/mediainfo-install - cmake --build /tmp/mediainfo-src/zenlib-build -j"$(nproc)" - cmake --install /tmp/mediainfo-src/zenlib-build - cmake -S /tmp/mediainfo-src/MediaInfoLib/Project/CMake -B /tmp/mediainfo-src/build \ - -D CMAKE_POLICY_VERSION_MINIMUM=3.5 \ - -D CMAKE_BUILD_TYPE=Release \ - -D BUILD_SHARED_LIBS=ON \ - -D BUILD_ZENLIB=OFF \ - -D CMAKE_PREFIX_PATH=/tmp/mediainfo-install \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D CMAKE_INSTALL_PREFIX=/tmp/mediainfo-install - cmake --build /tmp/mediainfo-src/build -j"$(nproc)" - cmake --install /tmp/mediainfo-src/build - cp -L /tmp/mediainfo-install/lib/libmediainfo.so.0 {package}/src/pymediainfo/libmediainfo.so.0 - # pdm-backend tags a wheel "py3-none-any" unless told otherwise (there - # are no ext_modules); cibuildwheel refuses a "none-any" build output - # outright, so a placeholder platform tag is forced here and auditwheel - # repair (default, unmodified) turns it into the real manylinux/musllinux tag. - CIBW_BUILD_FRONTEND: "build; args: -C--plat-name=linux_riscv64" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - # test_parse_url needs libcurl, which isn't linked in (kept optional, - # matching upstream's own CMake build when libcurl-dev isn't present). - CIBW_TEST_COMMAND: python -m pytest {project}/tests -k "not test_parse_url" + name: pymediainfo-${{ env.PYMEDIAINFO_VERSION }}-py3-none-${{ matrix.libc }}_riscv64 + path: wheelhouse - name: Check the wheel carries libmediainfo and its licence run: | @@ -156,15 +165,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pymediainfo-${{ env.PYMEDIAINFO_VERSION }}-py3-none-${{ matrix.libc }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pymediainfo ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pymeshfix.yml b/.github/workflows/build-pymeshfix.yml index ee0163635ff5..65f914b7267d 100644 --- a/.github/workflows/build-pymeshfix.yml +++ b/.github/workflows/build-pymeshfix.yml @@ -53,33 +53,38 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build pymeshfix ${{ matrix.version }} manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pymeshfix" + version: "${{ matrix.version }}" + repository: "pyvista/pymeshfix" + ref: "v${{ matrix.version }}" + artifact-tag: "manylinux_riscv64" + timeout-minutes: 120 + # Matches upstream's own [tool.cibuildwheel] build matrix exactly: + # cp310/cp311 each get a real per-version extension, cp312+ collapse + # into one forward-compatible cp312-abi3 wheel (upstream ships no + # cp313/cp314 glob entries - abi3 covers those interpreters already). + cibw-build: "cp310-* cp311-* cp312-*" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,vtk,matplotlib,pillow,contourpy,kiwisolver,fonttools" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: PYMESHFIX_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pymeshfix v${{ env.PYMESHFIX_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pyvista/pymeshfix - ref: v${{ env.PYMESHFIX_VERSION }} - persist-credentials: false - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # Matches upstream's own [tool.cibuildwheel] build matrix exactly: - # cp310/cp311 each get a real per-version extension, cp312+ collapse - # into one forward-compatible cp312-abi3 wheel (upstream ships no - # cp313/cp314 glob entries - abi3 covers those interpreters already). - CIBW_BUILD: "cp310-* cp311-* cp312-*" - CIBW_ARCHS: riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,vtk,matplotlib,pillow,contourpy,kiwisolver,fonttools + name: pymeshfix-${{ env.PYMESHFIX_VERSION }}-manylinux_riscv64 + path: wheelhouse - name: Check the extension and license made it into the wheel run: | @@ -92,15 +97,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pymeshfix-${{ env.PYMESHFIX_VERSION }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pymeshfix ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pymetis.yml b/.github/workflows/build-pymetis.yml index f6c2903e93f6..b9a859fc3a1d 100644 --- a/.github/workflows/build-pymetis.yml +++ b/.github/workflows/build-pymetis.yml @@ -50,46 +50,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pymetis ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pymetis" + version: "${{ matrix.version }}" + repository: "inducer/pymetis" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pymetis/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + # upstream's wheels.yml tests nothing; run the pytest suite its ci.yml runs + cibw-test-requires: "numpy pytest" + cibw-test-sources: "test" + cibw-test-command: "python -m pytest -v test" + # numpy has no riscv64 musllinux wheel in our registry. + cibw-test-skip: "*-musllinux*" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PYMETIS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pymetis v${{ env.PYMETIS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: inducer/pymetis - ref: v${{ env.PYMETIS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pymetis source - run: git apply python-wheels/patches/pymetis/${{ env.PYMETIS_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy - # upstream's wheels.yml tests nothing; run the pytest suite its ci.yml runs - CIBW_TEST_REQUIRES: numpy pytest - CIBW_TEST_SOURCES: test - CIBW_TEST_COMMAND: python -m pytest -v test - # numpy has no riscv64 musllinux wheel in our registry. - CIBW_TEST_SKIP: "*-musllinux*" + name: pymetis-${{ env.PYMETIS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and licences made it into the wheel run: | @@ -103,12 +114,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pymetis-${{ env.PYMETIS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -143,7 +148,7 @@ jobs: publish: name: Publish pymetis ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pymgclient.yml b/.github/workflows/build-pymgclient.yml index c16dbd60a1de..d8da79ac4382 100644 --- a/.github/workflows/build-pymgclient.yml +++ b/.github/workflows/build-pymgclient.yml @@ -51,61 +51,65 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pymgclient ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pymgclient" + version: "${{ matrix.version }}" + repository: "memgraph/pymgclient" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pymgclient/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream always ships --static-ssl, linked against a hand-built OpenSSL + # baked into their own manylinux_2_34 image (tools/build-openssl.sh). The + # riscv64 image carries no such static archives, so link the image's own + # OpenSSL dynamically instead (PYMGCLIENT_STATIC_OPENSSL=0, setup.py's own + # escape for this) and let auditwheel vendor it, same as build-ssh2-python.yml. + cibw-before-all-linux: "dnf -y install openssl-devel && cp /usr/share/licenses/openssl-libs/LICENSE.txt {project}/LICENSE.openssl" + cibw-environment-linux: "PYMGCLIENT_STATIC_OPENSSL=0" + cibw-test-requires: "pytest pyopenssl networkx tzdata" + # The rest of test/ needs a live Memgraph server (upstream runs it as a + # Docker sidecar); these three don't, and still exercise the real + # extension: arg validation, a refused-connection TransientError, and the + # exception hierarchy. + cibw-test-sources: "test" + cibw-test-command: "python -c \"import importlib.metadata as m; f = sorted(p.name for p in m.files('pymgclient') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'LICENSE.openssl'], f\" && python -m pytest test/test_connection.py::test_connect_args_validation test/test_connection.py::test_connection_refused_is_transient test/test_connection.py::test_transient_error_hierarchy" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYMGCLIENT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pymgclient v${{ env.PYMGCLIENT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: memgraph/pymgclient - ref: v${{ env.PYMGCLIENT_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pymgclient source - run: git apply python-wheels/patches/pymgclient/${{ env.PYMGCLIENT_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream always ships --static-ssl, linked against a hand-built OpenSSL - # baked into their own manylinux_2_34 image (tools/build-openssl.sh). The - # riscv64 image carries no such static archives, so link the image's own - # OpenSSL dynamically instead (PYMGCLIENT_STATIC_OPENSSL=0, setup.py's own - # escape for this) and let auditwheel vendor it, same as build-ssh2-python.yml. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install openssl-devel && - cp /usr/share/licenses/openssl-libs/LICENSE.txt {project}/LICENSE.openssl - CIBW_ENVIRONMENT: >- - PYMGCLIENT_STATIC_OPENSSL=0 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest pyopenssl networkx tzdata - # The rest of test/ needs a live Memgraph server (upstream runs it as a - # Docker sidecar); these three don't, and still exercise the real - # extension: arg validation, a refused-connection TransientError, and the - # exception hierarchy. - CIBW_TEST_SOURCES: test - CIBW_TEST_COMMAND: >- - python -c "import importlib.metadata as m; f = sorted(p.name for p in m.files('pymgclient') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'LICENSE.openssl'], f" - && python -m pytest test/test_connection.py::test_connect_args_validation test/test_connection.py::test_connection_refused_is_transient test/test_connection.py::test_transient_error_hierarchy + name: pymgclient-${{ env.PYMGCLIENT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and OpenSSL made it into the wheel run: | @@ -119,15 +123,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pymgclient-${{ env.PYMGCLIENT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pymgclient ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pymongo.yml b/.github/workflows/build-pymongo.yml index 668bd9478fd9..92eda294201d 100644 --- a/.github/workflows/build-pymongo.yml +++ b/.github/workflows/build-pymongo.yml @@ -60,7 +60,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # _setup.py swallows build_ext failures and ships a pure-Python wheel # unless this is set (CLAUDE.md gotcha 20). - cibw-environment: PYMONGO_C_EXT_MUST_BUILD=1 + cibw-environment-linux: PYMONGO_C_EXT_MUST_BUILD=1 # Staged into the (empty) test cwd so pytest imports the installed wheel # rather than the checkout's pure-Python bson/ and pymongo/ packages. cibw-test-sources: test tools pyproject.toml diff --git a/.github/workflows/build-pymongoarrow.yml b/.github/workflows/build-pymongoarrow.yml index 4e1dfe8f1de3..80b42ba39f3b 100644 --- a/.github/workflows/build-pymongoarrow.yml +++ b/.github/workflows/build-pymongoarrow.yml @@ -52,71 +52,65 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pymongoarrow ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pymongoarrow" + version: "${{ matrix.version }}" + repository: "mongodb-labs/mongo-arrow" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-package-dir: "bindings/python" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # mongo-c-driver's root CMakeLists.txt itself declares cmake_minimum_required(3.15), + # but nested subdirectories built along with libbson can declare older floors that + # CMake 4 (bundled in the manylinux image) rejects outright (gotcha 257). + # pyarrow/numpy/pymongo are build-time requirements (CMakeLists.txt cimports pyarrow's + # headers and links its libraries; find_package(... NumPy) needs numpy's), so the + # registry URL has to reach both the build and test phases (gotcha 12); cython is left + # unscoped since our registry has no riscv64 cp314t build of it and it must compile + # from sdist there. + # before-build and the actual scikit-build-core/CMake configure run with different + # cwds, so upstream's relative LIBBSON_INSTALL_DIR=./libbson (pyproject.toml) would + # resolve to two different directories; pin it absolute instead. + cibw-environment-linux: "CMAKE_POLICY_VERSION_MINIMUM=3.5 LIBBSON_INSTALL_DIR=/tmp/pymongoarrow-libbson PIP_ONLY_BINARY=pyarrow,numpy,pymongo" + # before-build runs from the checkout root, not package-dir (same as + # test-sources below), so upstream's own relative "./cibw_before_build.sh" 404s. + # Upstream's script itself (Linux branch) just installs rust-just/uv and runs + # `just build-libbson`, but that recipe's `uv sync --dev` step pulls the full dev + # group (pre-commit, sphinx-autobuild -> watchfiles), and watchfiles needs a Rust + # target rustup has no riscv64 entry for. build-libbson.sh needs no Python beyond an + # existing .venv to source, so call it directly instead of through the dev sync. + cibw-before-build: "cd bindings/python && pip install -q uv && uv venv .venv && bash build-libbson.sh" + cibw-test-requires: "pytest>=8.0" + # test-sources resolves against the checkout root, not package-dir. + cibw-test-sources: "bindings/python/test bindings/python/pyproject.toml" + # No riscv64 mongod exists (upstream's own MongoDB Server download center ships no + # riscv64 build), so only the tests that don't need a live server run - the same + # constraint build-pymongo.yml documents for the driver itself. + cibw-test-command: "cd bindings/python && python -c \"from pymongoarrow.lib import libbson_version\" && python -m pytest test/test_bson.py test/test_builders.py test/test_schema.py test/test_monkey.py test/test_libbson.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYMONGOARROW_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pymongoarrow ${{ env.PYMONGOARROW_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: mongodb-labs/mongo-arrow - ref: ${{ env.PYMONGOARROW_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: bindings/python - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # mongo-c-driver's root CMakeLists.txt itself declares cmake_minimum_required(3.15), - # but nested subdirectories built along with libbson can declare older floors that - # CMake 4 (bundled in the manylinux image) rejects outright (gotcha 257). - # pyarrow/numpy/pymongo are build-time requirements (CMakeLists.txt cimports pyarrow's - # headers and links its libraries; find_package(... NumPy) needs numpy's), so the - # registry URL has to reach both the build and test phases (gotcha 12); cython is left - # unscoped since our registry has no riscv64 cp314t build of it and it must compile - # from sdist there. - # before-build and the actual scikit-build-core/CMake configure run with different - # cwds, so upstream's relative LIBBSON_INSTALL_DIR=./libbson (pyproject.toml) would - # resolve to two different directories; pin it absolute instead. - CIBW_ENVIRONMENT: >- - CMAKE_POLICY_VERSION_MINIMUM=3.5 - LIBBSON_INSTALL_DIR=/tmp/pymongoarrow-libbson - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=pyarrow,numpy,pymongo - # before-build runs from the checkout root, not package-dir (same as - # test-sources below), so upstream's own relative "./cibw_before_build.sh" 404s. - # Upstream's script itself (Linux branch) just installs rust-just/uv and runs - # `just build-libbson`, but that recipe's `uv sync --dev` step pulls the full dev - # group (pre-commit, sphinx-autobuild -> watchfiles), and watchfiles needs a Rust - # target rustup has no riscv64 entry for. build-libbson.sh needs no Python beyond an - # existing .venv to source, so call it directly instead of through the dev sync. - CIBW_BEFORE_BUILD: >- - cd bindings/python && - pip install -q uv && - uv venv .venv && - bash build-libbson.sh - CIBW_TEST_REQUIRES: pytest>=8.0 - # test-sources resolves against the checkout root, not package-dir. - CIBW_TEST_SOURCES: bindings/python/test bindings/python/pyproject.toml - # No riscv64 mongod exists (upstream's own MongoDB Server download center ships no - # riscv64 build), so only the tests that don't need a live server run - the same - # constraint build-pymongo.yml documents for the driver itself. - CIBW_TEST_COMMAND: >- - cd bindings/python && - python -c "from pymongoarrow.lib import libbson_version" && - python -m pytest test/test_bson.py test/test_builders.py test/test_schema.py - test/test_monkey.py test/test_libbson.py + name: pymongoarrow-${{ env.PYMONGOARROW_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel bundles libbson2 and its licence run: | @@ -129,15 +123,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pymongoarrow-${{ env.PYMONGOARROW_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pymongoarrow ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pymoo.yml b/.github/workflows/build-pymoo.yml index bceed1a6c891..6f8e73953198 100644 --- a/.github/workflows/build-pymoo.yml +++ b/.github/workflows/build-pymoo.yml @@ -62,9 +62,7 @@ jobs: # numpy is a build-time requirement (setup.py's numpy.get_include()); only # our registry has it for riscv64, and only-binary keeps a newer PyPI # release from winning resolution and compiling from sdist. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" # Test phase only: force wheels-only for the full runtime dependency # resolution (scipy, matplotlib and its own compiled deps - Pillow, # contourpy, kiwisolver, fonttools - and moocore), so a newer PyPI release diff --git a/.github/workflows/build-pymp3.yml b/.github/workflows/build-pymp3.yml index 6b72508f8611..3d695373a2fa 100644 --- a/.github/workflows/build-pymp3.yml +++ b/.github/workflows/build-pymp3.yml @@ -49,61 +49,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pymp3 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pymp3" + version: "${{ matrix.version }}" + repository: "miarec/pymp3" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # CMakeLists.txt FetchContents libmad and libmp3lame from miarec's own + # forks at their unpinned "master" branch (same as upstream's own build); + # neither licence ships at the project root, so pull it from the same ref + # CMake fetches and stage it where setuptools' default LICEN[CS]E* glob + # (gotcha 44) picks it up. pymp3 derives its version with + # setuptools-git-versioning, whose dirty check is `git status --short` - + # unlike setuptools_scm's `git describe --dirty`, that also flags untracked + # files, so staging the two LICENSE files straight into {project} poisons the + # version into `0.2.0.post0+git..dirty` with nothing ever `git add`ed or + # committed. Exclude them via `.git/info/exclude` before copying so they stay + # invisible to `git status` while still landing on disk for the wheel + # (gotcha 683). + cibw-before-all-linux: "pip install cmake && mkdir -p /tmp/libmad /tmp/lame && curl -sSLf https://github.com/miarec/libmad/archive/refs/heads/master.tar.gz | tar -xz -C /tmp/libmad --strip-components=1 && curl -sSLf https://github.com/miarec/lame/archive/refs/heads/master.tar.gz | tar -xz -C /tmp/lame --strip-components=1 && printf '%s\\n' LICENSE.libmad LICENSE.lame >> {project}/.git/info/exclude && cp /tmp/libmad/COPYING {project}/LICENSE.libmad && cp /tmp/lame/COPYING {project}/LICENSE.lame" + cibw-environment-linux: "MAKEFLAGS=-j$(nproc)" + cibw-test-requires: "pytest" + cibw-test-command: "python3 -c \"import mp3; assert mp3.__file__.endswith('.so'), mp3.__file__\" && PYTHONPATH={project}/tests pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 - strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYMP3_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pymp3 v${{ env.PYMP3_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: miarec/pymp3 - ref: v${{ env.PYMP3_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # CMakeLists.txt FetchContents libmad and libmp3lame from miarec's own - # forks at their unpinned "master" branch (same as upstream's own build); - # neither licence ships at the project root, so pull it from the same ref - # CMake fetches and stage it where setuptools' default LICEN[CS]E* glob - # (gotcha 44) picks it up. pymp3 derives its version with - # setuptools-git-versioning, whose dirty check is `git status --short` — - # unlike setuptools_scm's `git describe --dirty`, that also flags untracked - # files, so staging the two LICENSE files straight into {project} poisons the - # version into `0.2.0.post0+git..dirty` with nothing ever `git add`ed or - # committed. Exclude them via `.git/info/exclude` before copying so they stay - # invisible to `git status` while still landing on disk for the wheel - # (gotcha 683). - CIBW_BEFORE_ALL_LINUX: >- - pip install cmake && - mkdir -p /tmp/libmad /tmp/lame && - curl -sSLf https://github.com/miarec/libmad/archive/refs/heads/master.tar.gz - | tar -xz -C /tmp/libmad --strip-components=1 && - curl -sSLf https://github.com/miarec/lame/archive/refs/heads/master.tar.gz - | tar -xz -C /tmp/lame --strip-components=1 && - printf '%s\n' LICENSE.libmad LICENSE.lame >> {project}/.git/info/exclude && - cp /tmp/libmad/COPYING {project}/LICENSE.libmad && - cp /tmp/lame/COPYING {project}/LICENSE.lame - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - MAKEFLAGS=-j$(nproc) - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: >- - python3 -c "import mp3; assert mp3.__file__.endswith('.so'), mp3.__file__" && - PYTHONPATH={project}/tests pytest {project}/tests + name: pymp3-${{ env.PYMP3_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and the licences made it into the wheel run: | @@ -118,15 +110,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pymp3-${{ env.PYMP3_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pymp3 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pymupdf-layout.yml b/.github/workflows/build-pymupdf-layout.yml index 66bcdd003c73..423d659bee77 100644 --- a/.github/workflows/build-pymupdf-layout.yml +++ b/.github/workflows/build-pymupdf-layout.yml @@ -61,39 +61,38 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build pymupdf-layout ${{ matrix.version }} cp312-abi3-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pymupdf-layout" + version: "${{ matrix.version }}" + repository: "ArtifexSoftware/pymupdf_layout" + ref: "${{ matrix.version }}" + artifact-tag: "cp312-abi3-manylinux_riscv64" + cibw-build: "cp312-manylinux_riscv64" + cibw-environment-linux: "PYMUPDF_LAYOUT_SETUP_SWIG=swig" + # The extensions link the MuPDF shared libraries shipped inside the + # installed pymupdf wheel and find them at runtime via $ORIGIN, so + # auditwheel must not vendor a second 36MB copy of them (gotcha 17). + cibw-repair-wheel-command: "auditwheel repair -w {dest_dir} {wheel} --exclude 'libmupdf.so.*' --exclude 'libmupdfcpp.so.*'" + cibw-test-requires: "pytest" + cibw-test-command: "python -c \"import pymupdf.features, pymupdf.tgif\" && pytest {package}/tests" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: PYMUPDF_LAYOUT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pymupdf-layout ${{ env.PYMUPDF_LAYOUT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ArtifexSoftware/pymupdf_layout - ref: ${{ env.PYMUPDF_LAYOUT_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PYMUPDF_LAYOUT_SETUP_SWIG=swig - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # The extensions link the MuPDF shared libraries shipped inside the - # installed pymupdf wheel and find them at runtime via $ORIGIN, so - # auditwheel must not vendor a second 36MB copy of them (gotcha 17). - CIBW_REPAIR_WHEEL_COMMAND: >- - auditwheel repair -w {dest_dir} {wheel} - --exclude 'libmupdf.so.*' --exclude 'libmupdfcpp.so.*' - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: >- - python -c "import pymupdf.features, pymupdf.tgif" && - pytest {package}/tests + name: pymupdf-layout-${{ env.PYMUPDF_LAYOUT_VERSION }}-cp312-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension modules made it into the wheel run: | @@ -106,15 +105,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pymupdf-layout-${{ env.PYMUPDF_LAYOUT_VERSION }}-cp312-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pymupdf-layout ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pymupdf.yml b/.github/workflows/build-pymupdf.yml index eb7e9ca1dcbf..fe852ba21b93 100644 --- a/.github/workflows/build-pymupdf.yml +++ b/.github/workflows/build-pymupdf.yml @@ -74,13 +74,7 @@ jobs: # no riscv64 build, so use the image's own libclang.so instead (dnf # `clang-devel` supplies the unversioned symlink clang.cindex dlopens). cibw-before-all-linux: dnf install -y clang-devel - cibw-environment: >- - PYMUPDF_SETUP_PY_LIMITED_API=${{ matrix.py_limited_api }} - PYMUPDF_SETUP_LIBCLANG=clang - PYMUPDF_SETUP_SWIG=swig - XCFLAGS=-D__LITTLE_ENDIAN__ - XCXXFLAGS=-D__LITTLE_ENDIAN__ - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PYMUPDF_SETUP_PY_LIMITED_API=${{ matrix.py_limited_api }} PYMUPDF_SETUP_LIBCLANG=clang PYMUPDF_SETUP_SWIG=swig XCFLAGS=-D__LITTLE_ENDIAN__ XCXXFLAGS=-D__LITTLE_ENDIAN__" # Upstream's test deps (scripts/gh_release.py:test_packages), minus the # linters - see the ignores below. cibw-test-requires: pytest fontTools pymupdf-fonts pillow psutil diff --git a/.github/workflows/build-pymupdfb.yml b/.github/workflows/build-pymupdfb.yml index 489b14eb5b23..a5aba36425a8 100644 --- a/.github/workflows/build-pymupdfb.yml +++ b/.github/workflows/build-pymupdfb.yml @@ -54,48 +54,50 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build pymupdfb ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pymupdfb" + version: "${{ matrix.version }}" + repository: "pymupdf/PyMuPDF" + ref: "${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 360 + # setup.py's get_requires_for_build_wheel() always adds swig/libclang + # regardless of flavour, and the resulting wheel is py3-none-*, so one + # CPython selector covers it. + cibw-build: "cp312-manylinux_riscv64" + # As in build-pymupdf.yml: the `libclang` PyPI wheel has no riscv64 + # build, so use the image's own libclang.so via the pure-Python + # `clang` bindings instead (clang-devel supplies the unversioned + # symlink clang.cindex dlopens). Pinned below <21: 21.x's `File` + # gained __eq__ with no __hash__, so mupdf's own File-keyed parse + # cache dies with `TypeError: unhashable type: 'File'` (gotcha 346). + cibw-before-all-linux: "dnf install -y clang-devel" + cibw-environment-linux: "PYMUPDF_SETUP_FLAVOUR=bd PYMUPDF_SETUP_LIBCLANG=\"clang==20.1.5\" XCFLAGS=-D__LITTLE_ENDIAN__ XCXXFLAGS=-D__LITTLE_ENDIAN__" + # Upstream's own gh_release.py disables repair for this flavour: + # auditwheel finds nothing to add and exits non-zero. setup.py's + # pipcl already tags the wheel from the image's own AUDITWHEEL_PLAT. + cibw-repair-wheel-command-linux: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv # musllinux is skipped: it needs the same libclang-via-dnf workaround below, # which build-pymupdf.yml also only exercises on manylinux. timeout-minutes: 360 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: PYMUPDFB_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pymupdf/PyMuPDF ${{ env.PYMUPDFB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pymupdf/PyMuPDF - ref: ${{ env.PYMUPDFB_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # setup.py's get_requires_for_build_wheel() always adds swig/libclang - # regardless of flavour, and the resulting wheel is py3-none-*, so one - # CPython selector covers it. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # As in build-pymupdf.yml: the `libclang` PyPI wheel has no riscv64 - # build, so use the image's own libclang.so via the pure-Python - # `clang` bindings instead (clang-devel supplies the unversioned - # symlink clang.cindex dlopens). Pinned below <21: 21.x's `File` - # gained __eq__ with no __hash__, so mupdf's own File-keyed parse - # cache dies with `TypeError: unhashable type: 'File'` (gotcha 346). - CIBW_BEFORE_ALL_LINUX: dnf install -y clang-devel - CIBW_ENVIRONMENT: >- - PYMUPDF_SETUP_FLAVOUR=bd - PYMUPDF_SETUP_LIBCLANG="clang==20.1.5" - XCFLAGS=-D__LITTLE_ENDIAN__ - XCXXFLAGS=-D__LITTLE_ENDIAN__ - # Upstream's own gh_release.py disables repair for this flavour: - # auditwheel finds nothing to add and exits non-zero. setup.py's - # pipcl already tags the wheel from the image's own AUDITWHEEL_PLAT. - CIBW_REPAIR_WHEEL_COMMAND_LINUX: '' + name: pymupdfb-${{ env.PYMUPDFB_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries riscv64 MuPDF libraries run: | @@ -124,15 +126,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pymupdfb-${{ env.PYMUPDFB_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pymupdfb ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyo.yml b/.github/workflows/build-pyo.yml index 7b52437178c1..a72c36e47a9c 100644 --- a/.github/workflows/build-pyo.yml +++ b/.github/workflows/build-pyo.yml @@ -49,83 +49,88 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyo ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyo" + version: "${{ matrix.version }}" + repository: "belangeo/pyo" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's manylinux-pre-build-script.sh dnf-installs portaudio-devel/ + # portmidi-devel directly and builds liblo/libsndfile/alsa-lib/JACK2 from + # source, then ships --use-jack --use-double. EPEL is empty on riscv64 + # (gotcha 51), so portaudio-devel/portmidi-devel aren't available via dnf + # either; alsa-lib-devel is (Rocky 10 AppStream, no EPEL needed, same + # package build-pygame.yml already uses on this image). portaudio 19.7.0 + # and portmidi 2.0.3 are built from source the same way build-sherpa-onnx.yml + # (portaudio tarball) and build-pygame.yml (portmidi via CMake) already do + # on this riscv64 image; liblo and libsndfile have no in-repo precedent but + # are plain autotools builds with no arch-specific code. JACK2's own + # waf-based server build has no riscv64 precedent here and exists only to + # match --use-jack bit-for-bit, so --use-jack is dropped (no jackd on this + # headless CI runner either way) -- a documented divergence from upstream, + # kept to --use-double otherwise. pyo's own setup.py has no arch-specific + # (x86/SIMD) code path. + cibw-before-all: |- + set -euo pipefail + dnf install -y -q alsa-lib-devel + + export MAKEFLAGS="-j$(nproc)" + mkdir -p /tmp/pyo-deps && cd /tmp/pyo-deps + + # portaudio 19.7.0, liblo 0.31 and libsndfile 1.0.31 each bundle a + # config.guess/config.sub too old to recognise riscv64 ("cannot guess + # build type"); automake's copy on this image already does (gotcha 138). + config_scripts=(/usr/share/automake-*/config.guess /usr/share/automake-*/config.sub) + + curl -fsSL --retry 5 -o portaudio.tgz http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz + tar xzf portaudio.tgz + cp "${config_scripts[@]}" portaudio/ + (cd portaudio && ./configure && make && make install) + + curl -fsSL --retry 5 -o portmidi.tar.gz https://github.com/PortMidi/portmidi/archive/refs/tags/v2.0.3.tar.gz + tar xzf portmidi.tar.gz + (cd portmidi-2.0.3 && cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON && make && make install) + + curl -fsSL --retry 5 -o liblo.tar.gz https://downloads.sourceforge.net/liblo/liblo-0.31.tar.gz + tar xzf liblo.tar.gz + cp "${config_scripts[@]}" liblo-0.31/ + (cd liblo-0.31 && ./configure && make && make install) + + curl -fsSL --retry 5 -o libsndfile.tar.bz2 https://github.com/libsndfile/libsndfile/releases/download/1.0.31/libsndfile-1.0.31.tar.bz2 + tar xjf libsndfile.tar.bz2 + cp "${config_scripts[@]}" libsndfile-1.0.31/ + (cd libsndfile-1.0.31 && ./configure && make && make install) + + ldconfig + cibw-config-settings: "--build-option=--use-double" + cibw-environment-linux: "CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib" + cibw-test-command: "python -c \"import pyo; print(pyo.getVersion())\" && python -c \"import pyo64; print(pyo64.getVersion())\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYO_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyo ${{ env.PYO_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: belangeo/pyo - ref: ${{ env.PYO_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's manylinux-pre-build-script.sh dnf-installs portaudio-devel/ - # portmidi-devel directly and builds liblo/libsndfile/alsa-lib/JACK2 from - # source, then ships --use-jack --use-double. EPEL is empty on riscv64 - # (gotcha 51), so portaudio-devel/portmidi-devel aren't available via dnf - # either; alsa-lib-devel is (Rocky 10 AppStream, no EPEL needed, same - # package build-pygame.yml already uses on this image). portaudio 19.7.0 - # and portmidi 2.0.3 are built from source the same way build-sherpa-onnx.yml - # (portaudio tarball) and build-pygame.yml (portmidi via CMake) already do - # on this riscv64 image; liblo and libsndfile have no in-repo precedent but - # are plain autotools builds with no arch-specific code. JACK2's own - # waf-based server build has no riscv64 precedent here and exists only to - # match --use-jack bit-for-bit, so --use-jack is dropped (no jackd on this - # headless CI runner either way) -- a documented divergence from upstream, - # kept to --use-double otherwise. pyo's own setup.py has no arch-specific - # (x86/SIMD) code path. - CIBW_BEFORE_ALL: | - set -euo pipefail - dnf install -y -q alsa-lib-devel - - export MAKEFLAGS="-j$(nproc)" - mkdir -p /tmp/pyo-deps && cd /tmp/pyo-deps - - # portaudio 19.7.0, liblo 0.31 and libsndfile 1.0.31 each bundle a - # config.guess/config.sub too old to recognise riscv64 ("cannot guess - # build type"); automake's copy on this image already does (gotcha 138). - config_scripts=(/usr/share/automake-*/config.guess /usr/share/automake-*/config.sub) - - curl -fsSL --retry 5 -o portaudio.tgz http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz - tar xzf portaudio.tgz - cp "${config_scripts[@]}" portaudio/ - (cd portaudio && ./configure && make && make install) - - curl -fsSL --retry 5 -o portmidi.tar.gz https://github.com/PortMidi/portmidi/archive/refs/tags/v2.0.3.tar.gz - tar xzf portmidi.tar.gz - (cd portmidi-2.0.3 && cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON && make && make install) - - curl -fsSL --retry 5 -o liblo.tar.gz https://downloads.sourceforge.net/liblo/liblo-0.31.tar.gz - tar xzf liblo.tar.gz - cp "${config_scripts[@]}" liblo-0.31/ - (cd liblo-0.31 && ./configure && make && make install) - - curl -fsSL --retry 5 -o libsndfile.tar.bz2 https://github.com/libsndfile/libsndfile/releases/download/1.0.31/libsndfile-1.0.31.tar.bz2 - tar xjf libsndfile.tar.bz2 - cp "${config_scripts[@]}" libsndfile-1.0.31/ - (cd libsndfile-1.0.31 && ./configure && make && make install) - - ldconfig - CIBW_CONFIG_SETTINGS: --build-option=--use-double - CIBW_ENVIRONMENT: CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib - CIBW_TEST_COMMAND: >- - python -c "import pyo; print(pyo.getVersion())" && - python -c "import pyo64; print(pyo64.getVersion())" + name: pyo-${{ env.PYO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships both the single- and double-precision extensions run: | @@ -138,15 +143,9 @@ jobs: print(sys.argv[1], "->", sos) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyo-${{ env.PYO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyo ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyodbc.yml b/.github/workflows/build-pyodbc.yml index ba3ab42778c1..6bef59df2a02 100644 --- a/.github/workflows/build-pyodbc.yml +++ b/.github/workflows/build-pyodbc.yml @@ -49,50 +49,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyodbc ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyodbc" + version: "${{ matrix.version }}" + repository: "mkleehammer/pyodbc" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "dnf -y install unixODBC-devel" + cibw-repair-wheel-command-linux: "auditwheel repair --exclude \"libodbc.so.*\" --wheel-dir {dest_dir} {wheel}" + # Upstream's wheel jobs run no tests at all; its test workflow needs database + # servers supplied as GitHub services. PostgreSQL and its ODBC driver are both + # packaged for riscv64, so run upstream's PostgreSQL suite against a server + # started inside the build container. + cibw-before-test-linux: "dnf -y install postgresql-server postgresql-odbc && install -d -o postgres -g postgres /run/postgresql /var/lib/pgsql/data && su postgres -c \"/usr/bin/initdb -A trust -D /var/lib/pgsql/data\" && su postgres -c \"/usr/bin/pg_ctl -D /var/lib/pgsql/data -l /tmp/pg.log -o '-c listen_addresses=127.0.0.1' -w start\" && su postgres -c \"/usr/bin/createdb test\"" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-environment: "PYODBC_POSTGRESQL=\"DRIVER=PostgreSQL;SERVER=127.0.0.1;PORT=5432;UID=postgres;DATABASE=test\"" + cibw-test-command: "python -m pytest --no-header -v ./tests/postgresql_test.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PYODBC_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyodbc ${{ env.PYODBC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: mkleehammer/pyodbc - ref: ${{ env.PYODBC_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: dnf -y install unixODBC-devel - CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- - auditwheel repair - --exclude "libodbc.so.*" - --wheel-dir {dest_dir} - {wheel} - # Upstream's wheel jobs run no tests at all; its test workflow needs database - # servers supplied as GitHub services. PostgreSQL and its ODBC driver are both - # packaged for riscv64, so run upstream's PostgreSQL suite against a server - # started inside the build container. - CIBW_BEFORE_TEST_LINUX: >- - dnf -y install postgresql-server postgresql-odbc && - install -d -o postgres -g postgres /run/postgresql /var/lib/pgsql/data && - su postgres -c "/usr/bin/initdb -A trust -D /var/lib/pgsql/data" && - su postgres -c "/usr/bin/pg_ctl -D /var/lib/pgsql/data -l /tmp/pg.log -o '-c listen_addresses=127.0.0.1' -w start" && - su postgres -c "/usr/bin/createdb test" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_ENVIRONMENT: PYODBC_POSTGRESQL="DRIVER=PostgreSQL;SERVER=127.0.0.1;PORT=5432;UID=postgres;DATABASE=test" - CIBW_TEST_COMMAND: python -m pytest --no-header -v ./tests/postgresql_test.py + name: pyodbc-${{ env.PYODBC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension module made it into the wheel run: | @@ -105,15 +102,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyodbc-${{ env.PYODBC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyodbc ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyodps.yml b/.github/workflows/build-pyodps.yml index 3426efe0624d..f98928f48e72 100644 --- a/.github/workflows/build-pyodps.yml +++ b/.github/workflows/build-pyodps.yml @@ -51,54 +51,59 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyodps ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyodps" + version: "${{ matrix.version }}" + repository: "aliyun/aliyun-odps-python-sdk" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pyodps/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy (a build requirement) and pyarrow (a hard runtime requirement) are + # only on our registry for riscv64; only-binary keeps a newer PyPI release + # from winning the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,pyarrow" + # No live MaxCompute account is available in CI (upstream's own wheel + # workflow runs no test-command either); prove the wheel installs with + # its real runtime deps and that the Cython tunnel codec is correct. + cibw-test-command: "python -c \"import odps; from odps.src.crc32c_c import Crc32c; c = Crc32c(); c.update(bytearray(b'123456789')); assert c.getvalue() == 0xe3069283, hex(c.getvalue()); print('pyodps', odps.__version__, 'OK')\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYODPS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyodps v${{ env.PYODPS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: aliyun/aliyun-odps-python-sdk - ref: v${{ env.PYODPS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pyodps source - run: git apply python-wheels/patches/pyodps/${{ env.PYODPS_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy (a build requirement) and pyarrow (a hard runtime requirement) are - # only on our registry for riscv64; only-binary keeps a newer PyPI release - # from winning the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pyarrow - # No live MaxCompute account is available in CI (upstream's own wheel - # workflow runs no test-command either); prove the wheel installs with - # its real runtime deps and that the Cython tunnel codec is correct. - CIBW_TEST_COMMAND: >- - python -c "import odps; from odps.src.crc32c_c import Crc32c; - c = Crc32c(); c.update(bytearray(b'123456789')); - assert c.getvalue() == 0xe3069283, hex(c.getvalue()); - print('pyodps', odps.__version__, 'OK')" + name: pyodps-${{ env.PYODPS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -116,15 +121,9 @@ jobs: assert licenses == {"LICENSE"}, licenses EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyodps-${{ env.PYODPS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyodps ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyopencl.yml b/.github/workflows/build-pyopencl.yml index 474a898523cb..640ea396ff5e 100644 --- a/.github/workflows/build-pyopencl.yml +++ b/.github/workflows/build-pyopencl.yml @@ -48,40 +48,43 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyopencl ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyopencl" + version: "${{ matrix.version }}" + repository: "inducer/pyopencl" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "true" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy and siphash24 (via pytools) only have riscv64 wheels on our registry. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,siphash24" + # Upstream runs no Linux tests (no OpenCL device in CI); smoke-test the import instead. + cibw-test-command: "python -c \"import pyopencl, pyopencl._cl; assert pyopencl.VERSION_TEXT == '${{ matrix.version }}', pyopencl.VERSION_TEXT\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYOPENCL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyopencl v${{ env.PYOPENCL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: inducer/pyopencl - ref: v${{ env.PYOPENCL_VERSION }} - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy and siphash24 (via pytools) only have riscv64 wheels on our registry. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,siphash24 - # Upstream runs no Linux tests (no OpenCL device in CI); smoke-test the import instead. - CIBW_TEST_COMMAND: >- - python -c "import pyopencl, pyopencl._cl; - assert pyopencl.VERSION_TEXT == '${{ env.PYOPENCL_VERSION }}', pyopencl.VERSION_TEXT" + name: pyopencl-${{ env.PYOPENCL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -97,15 +100,9 @@ jobs: assert "ocl-icd" in licence, "ocl-icd licence missing" EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyopencl-${{ env.PYOPENCL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyopencl ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyopengl-accelerate.yml b/.github/workflows/build-pyopengl-accelerate.yml index b42cc67735be..e9d95da5d4d0 100644 --- a/.github/workflows/build-pyopengl-accelerate.yml +++ b/.github/workflows/build-pyopengl-accelerate.yml @@ -48,51 +48,62 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyopengl-accelerate ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyopengl-accelerate" + version: "${{ matrix.version }}" + repository: "mcfletch/pyopengl" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pyopengl-accelerate/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "accelerate" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy has no riscv64 musllinux wheel anywhere (registry or public PyPI), + # and it's a build-time requirement (numpy_formathandler); musllinux is + # dropped rather than compiling numpy from source in-container. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + # OpenGL.GL binds libGL at import time (not lazily at first call), so the + # accelerate test suite needs it on disk even though it never creates a + # real GL context - mesa-libGL provides it. + cibw-before-test-linux: "dnf install -y mesa-libGL" + cibw-test-requires: "pytest PyOpenGL numpy" + cibw-test-sources: "accelerate/tests" + cibw-test-command: "python -m pytest -ra {project}/accelerate/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYOPENGL_ACCELERATE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyopengl ${{ env.PYOPENGL_ACCELERATE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: mcfletch/pyopengl - ref: ${{ env.PYOPENGL_ACCELERATE_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pyopengl-accelerate source - run: git apply python-wheels/patches/pyopengl-accelerate/${{ env.PYOPENGL_ACCELERATE_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: accelerate - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy has no riscv64 musllinux wheel anywhere (registry or public PyPI), - # and it's a build-time requirement (numpy_formathandler); musllinux is - # dropped rather than compiling numpy from source in-container. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy - # OpenGL.GL binds libGL at import time (not lazily at first call), so the - # accelerate test suite needs it on disk even though it never creates a - # real GL context - mesa-libGL provides it. - CIBW_BEFORE_TEST_LINUX: dnf install -y mesa-libGL - CIBW_TEST_REQUIRES: pytest PyOpenGL numpy - CIBW_TEST_SOURCES: accelerate/tests - CIBW_TEST_COMMAND: python -m pytest -ra {project}/accelerate/tests + name: pyopengl-accelerate-${{ env.PYOPENGL_ACCELERATE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the compiled extensions and licence made it into the wheel run: | @@ -116,15 +127,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyopengl-accelerate-${{ env.PYOPENGL_ACCELERATE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyopengl-accelerate ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyopenxlsx.yml b/.github/workflows/build-pyopenxlsx.yml index 55cf5d7a453b..9e543af02bec 100644 --- a/.github/workflows/build-pyopenxlsx.yml +++ b/.github/workflows/build-pyopenxlsx.yml @@ -48,58 +48,63 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyopenxlsx ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyopenxlsx" + version: "${{ matrix.version }}" + repository: "twn39/pyopenxlsx" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-submodules: "recursive" + pre-build: |- + set -euo pipefail + tp=third_party/OpenXLSX/third_party + cp third_party/OpenXLSX/LICENSE.md LICENSE.OpenXLSX + cp third_party/nanobind/LICENSE LICENSE.nanobind + cp third_party/nanobind/ext/robin_map/LICENSE LICENSE.robin-map + cp "$tp/GSL/LICENSE" LICENSE.GSL + cp "$tp/fast_float/LICENSE-MIT" LICENSE.fast-float + cp "$tp/fmt/LICENSE" LICENSE.fmt + cp "$tp/libzip/LICENSE" LICENSE.libzip + cp "$tp/mbedtls/LICENSE" LICENSE.mbedtls + cp "$tp/pugixml/LICENSE.md" LICENSE.pugixml + cp "$tp/unordered_dense/LICENSE" LICENSE.unordered-dense + cp "$tp/zlib/LICENSE.md" LICENSE.zlib-ng + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # build[uv] needs a host uv for the audit step, which the riscv64 runner lacks (gotcha 13). + cibw-build-frontend: "build" + # Upstream's test-extras pull numpy and pillow; without PIP_ONLY_BINARY pip takes + # PyPI's newer sdists over our wheels and Pillow's fails on missing jpeg (gotchas 30/67). + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,pillow SKBUILD_WHEEL_LICENSE_FILES=\"LICENSE;LICENSE.*\"" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYOPENXLSX_VERSION: ${{ matrix.version }} - steps: - - name: Checkout twn39/pyopenxlsx v${{ env.PYOPENXLSX_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: twn39/pyopenxlsx - ref: v${{ env.PYOPENXLSX_VERSION }} - submodules: recursive - persist-credentials: false - - # The extension statically links OpenXLSX and its vendored libraries, whose - # notices upstream's default licence glob (root LICENSE only) leaves out. - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - tp=third_party/OpenXLSX/third_party - cp third_party/OpenXLSX/LICENSE.md LICENSE.OpenXLSX - cp third_party/nanobind/LICENSE LICENSE.nanobind - cp third_party/nanobind/ext/robin_map/LICENSE LICENSE.robin-map - cp "$tp/GSL/LICENSE" LICENSE.GSL - cp "$tp/fast_float/LICENSE-MIT" LICENSE.fast-float - cp "$tp/fmt/LICENSE" LICENSE.fmt - cp "$tp/libzip/LICENSE" LICENSE.libzip - cp "$tp/mbedtls/LICENSE" LICENSE.mbedtls - cp "$tp/pugixml/LICENSE.md" LICENSE.pugixml - cp "$tp/unordered_dense/LICENSE" LICENSE.unordered-dense - cp "$tp/zlib/LICENSE.md" LICENSE.zlib-ng - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # build[uv] needs a host uv for the audit step, which the riscv64 runner lacks (gotcha 13). - CIBW_BUILD_FRONTEND: build - # Upstream's test-extras pull numpy and pillow; without PIP_ONLY_BINARY pip takes - # PyPI's newer sdists over our wheels and Pillow's fails on missing jpeg (gotchas 30/67). - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pillow - SKBUILD_WHEEL_LICENSE_FILES="LICENSE;LICENSE.*" + name: pyopenxlsx-${{ env.PYOPENXLSX_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -118,15 +123,9 @@ jobs: "LICENSE.zlib-ng"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyopenxlsx-${{ env.PYOPENXLSX_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyopenxlsx ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyorthomosaic.yml b/.github/workflows/build-pyorthomosaic.yml index cbd837fe494a..fcbb0104c07b 100644 --- a/.github/workflows/build-pyorthomosaic.yml +++ b/.github/workflows/build-pyorthomosaic.yml @@ -49,35 +49,39 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyorthomosaic ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyorthomosaic" + version: "${{ matrix.version }}" + repository: "SoyabulIslamLincoln/py_ortho" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + # musllinux is dropped: numpy (build and runtime dependency) has no musllinux riscv64 wheel. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_PREFER_BINARY=1 PIP_ONLY_BINARY=numpy,pillow" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYORTHOMOSAIC_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyorthomosaic v${{ env.PYORTHOMOSAIC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: SoyabulIslamLincoln/py_ortho - ref: v${{ env.PYORTHOMOSAIC_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # musllinux is dropped: numpy (build and runtime dependency) has no musllinux riscv64 wheel. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_LINUX: >- - PIP_PREFER_BINARY=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pillow + name: pyorthomosaic-${{ env.PYORTHOMOSAIC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -88,15 +92,9 @@ jobs: assert exts == {"_core", "_ba", "_mvs", "_dense", "_fast"}, names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyorthomosaic-${{ env.PYORTHOMOSAIC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyorthomosaic ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pypolyline.yml b/.github/workflows/build-pypolyline.yml index bdacaea10fbf..3789e7698b76 100644 --- a/.github/workflows/build-pypolyline.yml +++ b/.github/workflows/build-pypolyline.yml @@ -49,53 +49,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pypolyline ${{ matrix.version }} cp311-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pypolyline" + version: "${{ matrix.version }}" + repository: "urschrei/pypolyline" + ref: "v${{ matrix.version }}" + artifact-tag: "cp311-abi3-manylinux_riscv64" + timeout-minutes: 120 + cibw-build: "cp312-manylinux_riscv64" + # manylinux images ship no Rust toolchain (upstream's before-all, minus + # its macOS-only parts). Without cargo on PATH maturin falls back to + # puccinialin, which has no riscv64 toolchain to install. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal" + cibw-environment-linux: "PATH=\"$HOME/.cargo/bin:$PATH\"" + # cibuildwheel's build[uv] frontend (upstream's pyproject.toml default) + # crashes the audit step: it asserts a host `uv`, which the self-hosted + # riscv64 runner doesn't have (gotcha 13). + cibw-build-frontend: "build" + # numpy has riscv64 wheels only on our registry; tests that need it + # importorskip it, so it is installed to run them rather than skip them. + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest numpy" + cibw-test-command: "pytest {package}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: PYPOLYLINE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pypolyline v${{ env.PYPOLYLINE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: urschrei/pypolyline - ref: v${{ env.PYPOLYLINE_VERSION }} - persist-credentials: false - - # 1.0.0 is a rewrite as a pure Rust/PyO3 extension built by maturin (the - # earlier releases were Cython over a prebuilt libpolylineffi), with - # pyo3's abi3-py311 feature on: one wheel serves every CPython >= 3.11. - # It is built on cp312, the oldest interpreter this repo's image has. - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # manylinux images ship no Rust toolchain (upstream's before-all, minus - # its macOS-only parts). Without cargo on PATH maturin falls back to - # puccinialin, which has no riscv64 toolchain to install. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | - sh -s -- -y --profile minimal - CIBW_ENVIRONMENT_LINUX: PATH="$HOME/.cargo/bin:$PATH" - # cibuildwheel's build[uv] frontend (upstream's pyproject.toml default) - # crashes the audit step: it asserts a host `uv`, which the self-hosted - # riscv64 runner doesn't have (gotcha 13). - CIBW_BUILD_FRONTEND: build - # numpy has riscv64 wheels only on our registry; tests that need it - # importorskip it, so it is installed to run them rather than skip them. - CIBW_TEST_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest numpy - CIBW_TEST_COMMAND: pytest {package} + name: pypolyline-${{ env.PYPOLYLINE_VERSION }}-cp311-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension and the licence made it into the wheel run: | @@ -110,15 +109,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pypolyline-${{ env.PYPOLYLINE_VERSION }}-cp311-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pypolyline ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyppmd.yml b/.github/workflows/build-pyppmd.yml index 7197b2263e70..d605f890277b 100644 --- a/.github/workflows/build-pyppmd.yml +++ b/.github/workflows/build-pyppmd.yml @@ -58,7 +58,6 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-test-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test cibw-test-sources: tests pyproject.toml # tests/test_fuzzer.py is a randomised hypothesis fuzzer; its Ppmd8 CUT_OFF diff --git a/.github/workflows/build-pyproj.yml b/.github/workflows/build-pyproj.yml index 950415a46225..0e98b8a6f20e 100644 --- a/.github/workflows/build-pyproj.yml +++ b/.github/workflows/build-pyproj.yml @@ -52,61 +52,60 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyproj ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyproj" + version: "${{ matrix.version }}" + repository: "pyproj4/pyproj" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 600 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pyproj/${{ matrix.version }}/00*.patch + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all: "bash ./ci/proj-compile-wheels.sh" + cibw-environment-linux: "PROJ_WHEEL=true PROJ_NETWORK=ON PROJ_VERSION=9.5.1 PROJ_DIR=/project/pyproj/proj_dir" + cibw-test-requires: "cython pytest numpy" + cibw-before-test: "python -m pip install shapely pandas xarray || echo \"Optional requirements install failed\"" + # PyPI has no riscv64 wheel for these and ours lag its latest release, so keep pip + # off the sdists; test-only (gotcha 12) since Cython has to compile from source. + cibw-test-environment: "PIP_ONLY_BINARY=numpy,pandas,shapely" + cibw-test-command: "python -c \"import importlib.metadata as m; n=sorted(p.name for p in m.files('pyproj') if 'licenses/' in str(p)); assert n == ['LICENSE', 'LICENSE_curl', 'LICENSE_libtiff', 'LICENSE_nghttp2', 'LICENSE_openssl', 'LICENSE_proj'], n\" && pyproj -v && python -c \"import pyproj; pyproj.Proj(init='epsg:4269')\" && cp -r {package}/test . && python -m pytest test -v -s" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 600 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYPROJ_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyproj ${{ env.PYPROJ_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pyproj4/pyproj - ref: ${{ env.PYPROJ_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # auditwheel vendors the curl/libtiff/nghttp2 (and statically, OpenSSL) that - # ci/proj-compile-wheels.sh builds, but the wheel ships only pyproj's own licences. - - name: Patch pyproj source - run: | - git apply python-wheels/patches/pyproj/${{ env.PYPROJ_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL: bash ./ci/proj-compile-wheels.sh - CIBW_ENVIRONMENT: >- - PROJ_WHEEL=true - PROJ_NETWORK=ON - PROJ_VERSION=${{ env.PROJ_VERSION }} - PROJ_DIR=/project/pyproj/proj_dir - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: cython pytest numpy - CIBW_BEFORE_TEST: python -m pip install shapely pandas xarray || echo "Optional requirements install failed" - # PyPI has no riscv64 wheel for these and ours lag its latest release, so keep pip - # off the sdists; test-only (gotcha 12) since Cython has to compile from source. - CIBW_TEST_ENVIRONMENT: 'PIP_ONLY_BINARY=numpy,pandas,shapely' - CIBW_TEST_COMMAND: >- - python -c "import importlib.metadata as m; n=sorted(p.name for p in m.files('pyproj') if 'licenses/' in str(p)); assert n == ['LICENSE', 'LICENSE_curl', 'LICENSE_libtiff', 'LICENSE_nghttp2', 'LICENSE_openssl', 'LICENSE_proj'], n" && - pyproj -v && - python -c "import pyproj; pyproj.Proj(init='epsg:4269')" && - cp -r {package}/test . && - python -m pytest test -v -s + name: pyproj-${{ env.PYPROJ_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the compiled extensions and PROJ made it into the wheel run: | @@ -120,15 +119,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyproj-${{ env.PYPROJ_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyproj ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pypulseqpp.yml b/.github/workflows/build-pypulseqpp.yml index 20db06f7936a..c20f3f29193c 100644 --- a/.github/workflows/build-pypulseqpp.yml +++ b/.github/workflows/build-pypulseqpp.yml @@ -48,43 +48,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pypulseqpp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pypulseqpp" + version: "${{ matrix.version }}" + repository: "pulserver/pypulseqpp" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-submodules: "recursive" + checkout-fetch-depth: 0 + pre-build: |- + set -euo pipefail + cp external/MRArbGrad/LICENSE LICENSES/MRArbGrad-MIT.txt + pybind11=$(curl -fsSL --retry 5 https://pypi.org/pypi/pybind11/json | python3 -c 'import json, sys; print(json.load(sys.stdin)["info"]["version"])') + curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/v${pybind11}/LICENSE" -o LICENSES/pybind11-BSD-3-Clause.txt + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy,h5py,matplotlib,contourpy,kiwisolver,pillow" + cibw-test-command: "python -c \"import pypulseqpp; print(pypulseqpp.__version__)\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYPULSEQPP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pypulseqpp v${{ env.PYPULSEQPP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pulserver/pypulseqpp - ref: v${{ env.PYPULSEQPP_VERSION }} - submodules: recursive - fetch-depth: 0 - persist-credentials: false - - # MRArbGrad and pybind11 are compiled into the extension; upstream's LICENSES/* glob ships neither notice. - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - cp external/MRArbGrad/LICENSE LICENSES/MRArbGrad-MIT.txt - pybind11=$(curl -fsSL --retry 5 https://pypi.org/pypi/pybind11/json | python3 -c 'import json, sys; print(json.load(sys.stdin)["info"]["version"])') - curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/v${pybind11}/LICENSE" -o LICENSES/pybind11-BSD-3-Clause.txt - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,scipy,h5py,matplotlib,contourpy,kiwisolver,pillow - CIBW_TEST_COMMAND: "python -c \"import pypulseqpp; print(pypulseqpp.__version__)\"" + name: pypulseqpp-${{ env.PYPULSEQPP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -101,15 +111,9 @@ jobs: "LICENSES/safe_pns_prediction-BSD-3-Clause.txt"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pypulseqpp-${{ env.PYPULSEQPP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pypulseqpp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyqir.yml b/.github/workflows/build-pyqir.yml index 9fe73094ebe8..7c38c2e6f56c 100644 --- a/.github/workflows/build-pyqir.yml +++ b/.github/workflows/build-pyqir.yml @@ -52,83 +52,81 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyqir ${{ matrix.version }} cp39-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyqir" + version: "${{ matrix.version }}" + repository: "qir-alliance/pyqir" + ref: "v${{ matrix.version }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 1440 + pre-build: |- + cp pyqir/NOTICE-WHEEL.txt pyqir/LICENSE-THIRD-PARTY-NOTICES.txt + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "pyqir" + # pyo3's abi3-py39 feature is on unconditionally (workspace Cargo.toml): built + # once on cp39 and re-tested on the newer interpreters. Upstream publishes no + # free-threaded wheel. musllinux is dropped: rustup.rs ships no riscv64 musl + # toolchain. + cibw-build: "cp39-manylinux_riscv64" + # qirlib's own CMakeLists.txt (qirlib/CMakeLists.txt) already caps the LLVM + # build to LLVM_TARGETS_TO_BUILD=Native (just the RISCV backend here, not + # upstream's own all-targets default) -- there is no equally-scoped riscv64 + # from-source LLVM port in this repo to compare against. Its ExternalProject_Add + # hardcodes `BUILD_COMMAND ninja` with no job cap, so the usual + # CMAKE_BUILD_PARALLEL_LEVEL env var (build-circt.yml/build-clangd.yml) has + # nothing to act on; a PATH-shadowing ninja shim is the only lever, paired with + # lld the same way those two bound the runner's RAM. + cibw-before-all-linux: |- + set -ex + dnf -y install ninja-build lld + mkdir -p /tmp/ninja-shim + printf '#!/bin/sh\nexec /usr/bin/ninja -j3 "$@"\n' > /tmp/ninja-shim/ninja + chmod +x /tmp/ninja-shim/ninja + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + cd qirlib + PATH="/tmp/ninja-shim:$PATH:$HOME/.cargo/bin" LDFLAGS=-fuse-ld=lld \ + QIRLIB_CACHE_DIR=/tmp/qirlib-llvm \ + cargo build --release --no-default-features --features "build-llvm,llvm20-1-no-llvm-linking" + # qirlib's build.rs locates llvm-config for its own llvm-wrapper C++ glue via + # QIRLIB_CACHE_DIR, while the llvm-sys-201 crate links LLVM itself via + # LLVM_SYS_201_PREFIX (gotcha 59: a maturin cargo feature reaches the build + # through MATURIN_PEP517_ARGS, not a cibuildwheel knob). + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" QIRLIB_CACHE_DIR=/tmp/qirlib-llvm LLVM_SYS_201_PREFIX=/tmp/qirlib-llvm MATURIN_PEP517_ARGS=\"--features llvm20-1\"" + cibw-test-extras: "test" + cibw-test-sources: "pyqir/tests" + # Upstream's own test task (eng/psakefile.ps1) runs pytest with its cwd at + # $Pyqir (the pyqir/ dir, parent of tests/), not inside tests/ itself: the + # bitcode/IR fixtures live at pyqir/tests/*.{bc,ll} and the test code opens + # them via the relative path "tests/", so cwd must be one level above. + cibw-test-command: "python -c \"import pyqir._native as m, importlib.metadata as md; assert m.__file__.endswith('.so'), m.__file__; assert any(str(p).endswith('licenses/LICENSE') for p in md.files('pyqir'))\" && cd pyqir && pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 1440 # full LLVM 20 build from source (qirlib's build-llvm feature) strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: PYQIR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyqir v${{ env.PYQIR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: qir-alliance/pyqir - ref: v${{ env.PYQIR_VERSION }} - persist-credentials: false - - - name: Stage the third-party notices beside pyqir's pyproject.toml - # maturin globs LICEN[CS]E* relative to the pyproject directory (pyqir/); the - # repo's own NOTICE-WHEEL.txt (eng's cargo-about task, excluded from the sdist - # by MANIFEST.in) already carries the LLVM 20.1 notice, so reuse it as-is. - run: cp pyqir/NOTICE-WHEEL.txt pyqir/LICENSE-THIRD-PARTY-NOTICES.txt - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: pyqir - output-dir: wheelhouse/ - # pyo3's abi3-py39 feature is on unconditionally (workspace Cargo.toml): built - # once on cp39 and re-tested on the newer interpreters. Upstream publishes no - # free-threaded wheel. musllinux is dropped: rustup.rs ships no riscv64 musl - # toolchain. - only: cp39-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # qirlib's own CMakeLists.txt (qirlib/CMakeLists.txt) already caps the LLVM - # build to LLVM_TARGETS_TO_BUILD=Native (just the RISCV backend here, not - # upstream's own all-targets default) -- there is no equally-scoped riscv64 - # from-source LLVM port in this repo to compare against. Its ExternalProject_Add - # hardcodes `BUILD_COMMAND ninja` with no job cap, so the usual - # CMAKE_BUILD_PARALLEL_LEVEL env var (build-circt.yml/build-clangd.yml) has - # nothing to act on; a PATH-shadowing ninja shim is the only lever, paired with - # lld the same way those two bound the runner's RAM. - CIBW_BEFORE_ALL_LINUX: | - set -ex - dnf -y install ninja-build lld - mkdir -p /tmp/ninja-shim - printf '#!/bin/sh\nexec /usr/bin/ninja -j3 "$@"\n' > /tmp/ninja-shim/ninja - chmod +x /tmp/ninja-shim/ninja - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - cd qirlib - PATH="/tmp/ninja-shim:$PATH:$HOME/.cargo/bin" LDFLAGS=-fuse-ld=lld \ - QIRLIB_CACHE_DIR=/tmp/qirlib-llvm \ - cargo build --release --no-default-features --features "build-llvm,llvm20-1-no-llvm-linking" - # qirlib's build.rs locates llvm-config for its own llvm-wrapper C++ glue via - # QIRLIB_CACHE_DIR, while the llvm-sys-201 crate links LLVM itself via - # LLVM_SYS_201_PREFIX (gotcha 59: a maturin cargo feature reaches the build - # through MATURIN_PEP517_ARGS, not a cibuildwheel knob). - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - QIRLIB_CACHE_DIR=/tmp/qirlib-llvm - LLVM_SYS_201_PREFIX=/tmp/qirlib-llvm - MATURIN_PEP517_ARGS="--features llvm20-1" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_EXTRAS: test - CIBW_TEST_SOURCES: pyqir/tests - # Upstream's own test task (eng/psakefile.ps1) runs pytest with its cwd at - # $Pyqir (the pyqir/ dir, parent of tests/), not inside tests/ itself: the - # bitcode/IR fixtures live at pyqir/tests/*.{bc,ll} and the test code opens - # them via the relative path "tests/", so cwd must be one level above. - CIBW_TEST_COMMAND: >- - python -c "import pyqir._native as m, importlib.metadata as md; - assert m.__file__.endswith('.so'), m.__file__; - assert any(str(p).endswith('licenses/LICENSE') for p in md.files('pyqir'))" && - cd pyqir && - pytest -v tests + name: pyqir-${{ env.PYQIR_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel licences # NOTICE-WHEEL.txt ships twice over: once under its own name because @@ -145,15 +143,9 @@ jobs: assert licences == {"LICENSE", "LICENSE-THIRD-PARTY-NOTICES.txt", "NOTICE-WHEEL.txt"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyqir-${{ env.PYQIR_VERSION }}-cp39-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyqir ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyqrack-cpu.yml b/.github/workflows/build-pyqrack-cpu.yml index 35649d1713eb..acec7668c4fe 100644 --- a/.github/workflows/build-pyqrack-cpu.yml +++ b/.github/workflows/build-pyqrack-cpu.yml @@ -59,44 +59,56 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build pyqrack-cpu ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyqrack-cpu" + version: "${{ matrix.version }}" + repository: "vm6502q/pyqrack" + ref: "v${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 90 + pre-build: |- + export PYQRACK_VERSION='${{ matrix.version }}' + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply "python-wheels/patches/pyqrack-cpu/${PYQRACK_VERSION}"/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp312-manylinux_riscv64" + cibw-before-all-linux: "dnf install -y cmake boost-devel git" + # setup.py's build_py has no ext_modules to key a platform tag off + # of, so bdist_wheel defaults to "py3-none-any"; this placeholder + # forces a real platform and auditwheel repair (default, unmodified) + # turns it into the real manylinux_riscv64 tag. + cibw-build-frontend: "build; args: -C--build-option=--plat-name=linux_riscv64" + cibw-test-requires: "pytest numpy" + cibw-test-sources: "pyqrack/tests" + cibw-test-command: "python -m pytest {project}/pyqrack/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: PYQRACK_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyqrack ${{ env.PYQRACK_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: vm6502q/pyqrack - ref: v${{ env.PYQRACK_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pyqrack source - run: git apply "python-wheels/patches/pyqrack-cpu/${PYQRACK_VERSION}"/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: dnf install -y cmake boost-devel git - # setup.py's build_py has no ext_modules to key a platform tag off - # of, so bdist_wheel defaults to "py3-none-any"; this placeholder - # forces a real platform and auditwheel repair (default, unmodified) - # turns it into the real manylinux_riscv64 tag. - CIBW_BUILD_FRONTEND: "build; args: -C--build-option=--plat-name=linux_riscv64" - CIBW_TEST_REQUIRES: pytest numpy - CIBW_TEST_SOURCES: pyqrack/tests - CIBW_TEST_COMMAND: python -m pytest {project}/pyqrack/tests + name: pyqrack-cpu-${{ env.PYQRACK_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries libqrack_pinvoke and both licences run: | @@ -111,15 +123,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyqrack-cpu-${{ env.PYQRACK_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyqrack-cpu ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyre2.yml b/.github/workflows/build-pyre2.yml index bb3490d88d53..b49ee18e89fe 100644 --- a/.github/workflows/build-pyre2.yml +++ b/.github/workflows/build-pyre2.yml @@ -53,6 +53,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyre2 ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyre2" + version: "${{ matrix.version }}" + repository: "andreasvc/pyre2" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + timeout-minutes: 300 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pyre2/${{ matrix.version }}/0001-pyproject-widen-license-files-to-cover-re2-and-abseil.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-environment-linux: "LIBRARY_PATH=/usr/local/lib LD_LIBRARY_PATH=/usr/local/lib SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYRE2=${{ matrix.version }} ABSEIL_VERSION=20250512.1 RE2_TAG=2025-11-05" + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + # Upstream's before-all installs EPEL's re2-devel, unavailable on + # riscv64 (gotcha 51 - no EPEL there); build abseil-cpp + re2 from + # source instead, installed so CMakeLists.txt's own + # find_package(re2 CONFIG) picks them up unmodified. + # + # No riscv64 cmake wheel exists, so CIBW_BEFORE_BUILD's pip install + # builds it from source as a build dependency; its own CMake + # bootstrap needs OpenSSL's dev headers to find libcrypto for + # Utilities/cmcurl (gotcha 608). + cibw-before-all: "dnf -y install openssl-devel && mkdir -p /tmp/abseil-cpp && curl -sSLf \"https://github.com/abseil/abseil-cpp/archive/refs/tags/${ABSEIL_VERSION}.tar.gz\" | tar -xz -C /tmp/abseil-cpp --strip-components=1 && cmake -S /tmp/abseil-cpp -B /tmp/abseil-cpp/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CXX_STANDARD=17 -DABSL_PROPAGATE_CXX_STD=ON -DABSL_ENABLE_INSTALL=ON -DCMAKE_INSTALL_LIBDIR=lib && cmake --build /tmp/abseil-cpp/build --parallel --target install && mkdir -p /tmp/re2 && curl -sSLf \"https://github.com/google/re2/archive/refs/tags/${RE2_TAG}.tar.gz\" | tar -xz -C /tmp/re2 --strip-components=1 && cmake -S /tmp/re2 -B /tmp/re2/build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_LIBDIR=lib && cmake --build /tmp/re2/build --parallel --target install && ldconfig && cp /tmp/re2/LICENSE {project}/LICENSE.re2 && cp /tmp/abseil-cpp/LICENSE {project}/LICENSE.abseil-cpp" + cibw-build-frontend: "pip; args: --no-build-isolation" + cibw-before-build: "pip install setuptools \"setuptools_scm>=8\" \"Cython>=0.20\" \"pybind11>=2.12\" ninja \"cmake>=3.18,<4.0.0\"" + cibw-repair-wheel-command: "auditwheel repair --strip -w {dest_dir} {wheel}" + cibw-test-requires: "pytest" + cibw-test-sources: "tests pyproject.toml" + cibw-test-command: "pytest -v ." + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv # riscv64 builds run several times slower than x86_64; raised from 90 after jobs were killed mid-build by the timeout, not a dead runner. timeout-minutes: 300 @@ -62,73 +109,12 @@ jobs: include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PYRE2_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyre2 v${{ env.PYRE2_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: andreasvc/pyre2 - ref: v${{ env.PYRE2_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # CLAUDE.md gotcha 31: git apply leaves the checkout dirty, and - # setuptools_scm reads a dirty tree at a tag as post-release - # (X.Y.(Z+1).dev0+g.d) instead of the tagged version; - # SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYRE2 below pins it back. - - name: Patch pyre2 source - run: git apply python-wheels/patches/pyre2/${{ env.PYRE2_VERSION }}/0001-pyproject-widen-license-files-to-cover-re2-and-abseil.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_PASS_LINUX: ABSEIL_VERSION RE2_TAG - # Upstream's before-all installs EPEL's re2-devel, unavailable on - # riscv64 (gotcha 51 - no EPEL there); build abseil-cpp + re2 from - # source instead, installed so CMakeLists.txt's own - # find_package(re2 CONFIG) picks them up unmodified. - # - # No riscv64 cmake wheel exists, so CIBW_BEFORE_BUILD's pip install - # builds it from source as a build dependency; its own CMake - # bootstrap needs OpenSSL's dev headers to find libcrypto for - # Utilities/cmcurl (gotcha 608). - CIBW_BEFORE_ALL: >- - dnf -y install openssl-devel && - mkdir -p /tmp/abseil-cpp && - curl -sSLf "https://github.com/abseil/abseil-cpp/archive/refs/tags/${ABSEIL_VERSION}.tar.gz" - | tar -xz -C /tmp/abseil-cpp --strip-components=1 && - cmake -S /tmp/abseil-cpp -B /tmp/abseil-cpp/build -DCMAKE_BUILD_TYPE=Release - -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CXX_STANDARD=17 - -DABSL_PROPAGATE_CXX_STD=ON -DABSL_ENABLE_INSTALL=ON -DCMAKE_INSTALL_LIBDIR=lib && - cmake --build /tmp/abseil-cpp/build --parallel --target install && - mkdir -p /tmp/re2 && - curl -sSLf "https://github.com/google/re2/archive/refs/tags/${RE2_TAG}.tar.gz" - | tar -xz -C /tmp/re2 --strip-components=1 && - cmake -S /tmp/re2 -B /tmp/re2/build -DCMAKE_BUILD_TYPE=Release - -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_LIBDIR=lib && - cmake --build /tmp/re2/build --parallel --target install && - ldconfig && - cp /tmp/re2/LICENSE {project}/LICENSE.re2 && - cp /tmp/abseil-cpp/LICENSE {project}/LICENSE.abseil-cpp - CIBW_ENVIRONMENT: >- - LIBRARY_PATH=/usr/local/lib LD_LIBRARY_PATH=/usr/local/lib - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYRE2=${{ env.PYRE2_VERSION }} - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_BEFORE_BUILD: >- - pip install setuptools "setuptools_scm>=8" "Cython>=0.20" "pybind11>=2.12" ninja "cmake>=3.18,<4.0.0" - CIBW_REPAIR_WHEEL_COMMAND: auditwheel repair --strip -w {dest_dir} {wheel} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_COMMAND: pytest -v . + name: pyre2-${{ env.PYRE2_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Check the extension and licences made it into the wheel run: | @@ -143,15 +129,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyre2-${{ env.PYRE2_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyre2 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyreadr.yml b/.github/workflows/build-pyreadr.yml index 558d62574e8a..faf1dbee8d02 100644 --- a/.github/workflows/build-pyreadr.yml +++ b/.github/workflows/build-pyreadr.yml @@ -49,63 +49,67 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyreadr ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyreadr" + version: "${{ matrix.version }}" + repository: "ofajardo/pyreadr" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + cat > collect-licenses.sh <<'EOF' + #!/bin/bash + set -euo pipefail + project="${1:?usage: collect-licenses.sh }" + for pkg in bzip2-libs xz-libs; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" | grep '^/' | while read -r f; do [ -f "$f" ] && echo "$f"; done || true) + if [ -z "${files[0]:-}" ]; then + dnf -y reinstall --setopt=tsflags= "$pkg" + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING)[^/]*$') + fi + for f in "${files[@]}"; do + cp "$f" "$project/LICENSE.${pkg%-libs}.$(basename "$f")" + done + done + ls "$project"/LICENSE* + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "dnf -y install bzip2-devel xz-devel zlib-devel && bash {project}/collect-licenses.sh {project}" + # Our registry carries numpy/pandas for cp310/cp311 only at older releases (gotcha 354). + cibw-test-environment: "PIP_PREFER_BINARY=1" + cibw-test-sources: "tests test_data" + cibw-test-requires: "pandas xarray" + cibw-test-command: "python tests/test_basic.py && python tests/test_http_integration.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYREADR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyreadr v${{ env.PYREADR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ofajardo/pyreadr - ref: v${{ env.PYREADR_VERSION }} - persist-credentials: false - - - name: Stage the vendored-library licence collector - # auditwheel vendors libbz2 and liblzma (zlib is on the manylinux allowlist); - # stage their licences at the root for setuptools' default LICEN[CS]E* glob (gotcha 137). - run: | - cat > collect-licenses.sh <<'EOF' - #!/bin/bash - set -euo pipefail - project="${1:?usage: collect-licenses.sh }" - for pkg in bzip2-libs xz-libs; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" | grep '^/' | while read -r f; do [ -f "$f" ] && echo "$f"; done || true) - if [ -z "${files[0]:-}" ]; then - dnf -y reinstall --setopt=tsflags= "$pkg" - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING)[^/]*$') - fi - for f in "${files[@]}"; do - cp "$f" "$project/LICENSE.${pkg%-libs}.$(basename "$f")" - done - done - ls "$project"/LICENSE* - EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install bzip2-devel xz-devel zlib-devel && - bash {project}/collect-licenses.sh {project} - CIBW_ENVIRONMENT_LINUX: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Our registry carries numpy/pandas for cp310/cp311 only at older releases (gotcha 354). - CIBW_TEST_ENVIRONMENT: PIP_PREFER_BINARY=1 - CIBW_TEST_SOURCES: tests test_data - CIBW_TEST_REQUIRES: pandas xarray - CIBW_TEST_COMMAND: >- - python tests/test_basic.py && - python tests/test_http_integration.py + name: pyreadr-${{ env.PYREADR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and the licences made it into the wheel run: | @@ -124,15 +128,9 @@ jobs: print(whl, sorted(grafted), sorted(licences)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyreadr-${{ env.PYREADR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyreadr ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyreadstat.yml b/.github/workflows/build-pyreadstat.yml index ee929957e64c..08d48360fb8d 100644 --- a/.github/workflows/build-pyreadstat.yml +++ b/.github/workflows/build-pyreadstat.yml @@ -49,58 +49,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyreadstat ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyreadstat" + version: "${{ matrix.version }}" + repository: "Roche/pyreadstat" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # gcc 13+ miscompiles readstat_writer.c's strict-aliasing violations at -O2 + # (silently drops value-label writes); upstream's own CI carries the same flag. + cibw-environment-linux: "CFLAGS=\"-O2 -fno-strict-aliasing\"" + # The test requirements install pandas (and numpy), whose newest PyPI release has no + # riscv64 wheel; only our registry does, and only-binary keeps pip from compiling it. + cibw-test-environment: "PIP_ONLY_BINARY=pandas,numpy" + # polars has no riscv64 wheel, so test_narwhalified.py (which imports it + # unconditionally) is dropped; test_runtime_types.py and test_typing.yml + # keep running with their polars-only cases deselected. test_runtime_types.py + # only imports pyreadstat inside its own `if __name__ == "__main__":` guard, so + # it has to run as a script (its unittest -k, not pytest's) or that name is undefined. + cibw-test-sources: "tests test_data" + cibw-test-requires: "pytest mypy pytest-mypy-plugins pandas-stubs pandas" + cibw-test-command: "python tests/test_basic.py && python tests/test_http_integration.py && python tests/test_runtime_types.py -k test_read_default_returns_pandas -k test_read_output_pandas -k test_read_output_dict -k test_write_returns_none -k test_metadata_field_types -k test_set_value_labels_pandas -k test_set_catalog_to_sas_pandas && python -m pytest tests/test_typing.yml --mypy-ini-file=tests/test_mypy_setup.ini -k \"not polars and not worker_types\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYREADSTAT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyreadstat v${{ env.PYREADSTAT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Roche/pyreadstat - ref: v${{ env.PYREADSTAT_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # gcc 13+ miscompiles readstat_writer.c's strict-aliasing violations at -O2 - # (silently drops value-label writes); upstream's own CI carries the same flag. - CIBW_ENVIRONMENT_LINUX: >- - CFLAGS="-O2 -fno-strict-aliasing" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # The test requirements install pandas (and numpy), whose newest PyPI release has no - # riscv64 wheel; only our registry does, and only-binary keeps pip from compiling it. - CIBW_TEST_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=pandas,numpy - # polars has no riscv64 wheel, so test_narwhalified.py (which imports it - # unconditionally) is dropped; test_runtime_types.py and test_typing.yml - # keep running with their polars-only cases deselected. test_runtime_types.py - # only imports pyreadstat inside its own `if __name__ == "__main__":` guard, so - # it has to run as a script (its unittest -k, not pytest's) or that name is undefined. - CIBW_TEST_SOURCES: tests test_data - CIBW_TEST_REQUIRES: pytest mypy pytest-mypy-plugins pandas-stubs pandas - CIBW_TEST_COMMAND: >- - python tests/test_basic.py && - python tests/test_http_integration.py && - python tests/test_runtime_types.py - -k test_read_default_returns_pandas -k test_read_output_pandas - -k test_read_output_dict -k test_write_returns_none -k test_metadata_field_types - -k test_set_value_labels_pandas -k test_set_catalog_to_sas_pandas - && - python -m pytest tests/test_typing.yml --mypy-ini-file=tests/test_mypy_setup.ini - -k "not polars and not worker_types" + name: pyreadstat-${{ env.PYREADSTAT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the Cython extensions made it into the wheel run: | @@ -114,15 +108,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyreadstat-${{ env.PYREADSTAT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyreadstat ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyrealsense2.yml b/.github/workflows/build-pyrealsense2.yml index e883040078b7..1670e6409360 100644 --- a/.github/workflows/build-pyrealsense2.yml +++ b/.github/workflows/build-pyrealsense2.yml @@ -52,151 +52,144 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyrealsense2 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - PYREALSENSE2_VERSION: ${{ matrix.version }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyrealsense2" + version: "${{ matrix.version }}" + repository: "realsenseai/librealsense" + ref: '' + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + export PYREALSENSE2_VERSION='${{ matrix.version }}' + ref="v${PYREALSENSE2_VERSION%.*}" - steps: - # The fourth component of the PyPI version is upstream's release build number, not part of the tag. - - id: tag - run: echo "ref=v${PYREALSENSE2_VERSION%.*}" >> "$GITHUB_OUTPUT" + git fetch -q --no-tags origin "$ref" + git checkout -q --detach FETCH_HEAD - - name: Checkout librealsense ${{ steps.tag.outputs.ref }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: realsenseai/librealsense - ref: ${{ steps.tag.outputs.ref }} - persist-credentials: false + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + git apply python-wheels/patches/pyrealsense2/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Patch librealsense - run: git apply python-wheels/patches/pyrealsense2/${{ env.PYREALSENSE2_VERSION }}/*.patch + sed -i -E "s/^(#define RS2_API_BUILD_VERSION[[:space:]]+)0$/\1${PYREALSENSE2_VERSION##*.}/" include/librealsense2/rs.h + grep -q "RS2_API_BUILD_VERSION *${PYREALSENSE2_VERSION##*.}$" include/librealsense2/rs.h + echo "__version__ = \"${PYREALSENSE2_VERSION}\"" > wrappers/python/pyrealsense2/_version.py + cp LICENSE NOTICE.md wrappers/python/ - - name: Stamp the release build number - run: | - sed -i -E "s/^(#define RS2_API_BUILD_VERSION[[:space:]]+)0$/\1${PYREALSENSE2_VERSION##*.}/" include/librealsense2/rs.h - grep -q "RS2_API_BUILD_VERSION *${PYREALSENSE2_VERSION##*.}$" include/librealsense2/rs.h - echo "__version__ = \"${PYREALSENSE2_VERSION}\"" > wrappers/python/pyrealsense2/_version.py - cp LICENSE NOTICE.md wrappers/python/ + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, in the wheel's project dir, the licence of every shared library - # auditwheel vendors out of the build image alongside libusb/libudev. - # hatchling's default LICEN[CS]E* glob copies them into the wheel. - set -euo pipefail + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, in the wheel's project dir, the licence of every shared library + # auditwheel vendors out of the build image alongside libusb/libudev. + # hatchling's default LICEN[CS]E* glob copies them into the wheel. + set -euo pipefail + + project="${1:?usage: collect-licenses.sh }" - project="${1:?usage: collect-licenses.sh }" + # ldd is transitive, so the two linked libs alone cover their whole + # closure; ldd does not list the root itself, so resolve those too. + mapfile -t libs < <( + { + ldd /usr/lib64/libusb-1.0.so | tr ' ' '\n' | grep '^/' + readlink -f /usr/lib64/libusb-1.0.so + ldd /usr/lib64/libudev.so | tr ' ' '\n' | grep '^/' + readlink -f /usr/lib64/libudev.so + } | sort -u + ) - # ldd is transitive, so the two linked libs alone cover their whole - # closure; ldd does not list the root itself, so resolve those too. - mapfile -t libs < <( - { - ldd /usr/lib64/libusb-1.0.so | tr ' ' '\n' | grep '^/' - readlink -f /usr/lib64/libusb-1.0.so - ldd /usr/lib64/libudev.so | tr ' ' '\n' | grep '^/' - readlink -f /usr/lib64/libudev.so - } | sort -u - ) + # `rpm -qf` reports unowned files on stdout, so keep only bare package names. + # glibc and the gcc runtime are on auditwheel's manylinux allowlist and + # are never vendored into the wheel. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc)$' + ) - # `rpm -qf` reports unowned files on stdout, so keep only bare package names. - # glibc and the gcc runtime are on auditwheel's manylinux allowlist and - # are never vendored into the wheel. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc)$' - ) + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + # Some subpackages leave the licence to a sibling of the same source RPM. + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi - # Some subpackages leave the licence to a sibling of the same source RPM. - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi + # Others mark it %doc rather than %license, and the image installs no docs. + if [ -z "${files[0]:-}" ]; then + dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi - # Others mark it %doc rather than %license, and the image installs no docs. - if [ -z "${files[0]:-}" ]; then - dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "wrappers/python" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,opencv-python-headless,zstandard" + # libudev-devel doesn't exist on Rocky 10; systemd-devel provides libudev.so/libudev.h instead (gotcha 252) + cibw-before-all-linux: "dnf install -y libusb1-devel systemd-devel && bash {project}/collect-licenses.sh {project}/wrappers/python" + # ENABLE_STATS (new in 2.59, default ON) builds a static libcurl that needs OpenSSL headers the image lacks + cibw-before-build-linux: "cmake -S {project} -B {project}/build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=false -DBUILD_EXAMPLES=false -DBUILD_GRAPHICAL_EXAMPLES=false -DBUILD_TOOLS=false -DBUILD_UNIT_TESTS=false -DCHECK_FOR_UPDATES=false -DENABLE_STATS=false -DBUILD_WITH_DDS=false -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python) -DPython_EXECUTABLE=$(which python) && cmake --build {project}/build -- -j$(nproc) && cp -L {project}/build/Release/pyrealsense2.cpython-*.so {project}/build/Release/pyrsutils.cpython-*.so {project}/wrappers/python/pyrealsense2/" + cibw-test-requires: "pytest pytest-timeout pytest-rerunfailures pytest-repeat pytest-check numpy opencv-python-headless zstandard" + cibw-test-sources: "unit-tests" + # upstream's --not-live pytest run, minus the files that read recordings or binaries from a CMake build tree + cibw-test-command: "python -m pytest unit-tests/log unit-tests/sw-dev unit-tests/syncer unit-tests/post-processing --color=no --not-live --context linux -p no:cacheprovider --ignore=unit-tests/log/pytest-env-log-level-off.py --ignore=unit-tests/log/pytest-env-log-level-on.py --ignore=unit-tests/post-processing/pytest-filters.py --ignore=unit-tests/post-processing/pytest-post-processing-from-bag.py" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + PYREALSENSE2_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: wrappers/python - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,opencv-python-headless,zstandard - # libudev-devel doesn't exist on Rocky 10; systemd-devel provides libudev.so/libudev.h instead (gotcha 252) - CIBW_BEFORE_ALL_LINUX: >- - dnf install -y libusb1-devel systemd-devel && - bash {project}/collect-licenses.sh {project}/wrappers/python - # ENABLE_STATS (new in 2.59, default ON) builds a static libcurl that needs OpenSSL headers the image lacks - CIBW_BEFORE_BUILD_LINUX: >- - cmake -S {project} -B {project}/build - -DCMAKE_BUILD_TYPE=Release - -DBUILD_SHARED_LIBS=false - -DBUILD_EXAMPLES=false - -DBUILD_GRAPHICAL_EXAMPLES=false - -DBUILD_TOOLS=false - -DBUILD_UNIT_TESTS=false - -DCHECK_FOR_UPDATES=false - -DENABLE_STATS=false - -DBUILD_WITH_DDS=false - -DBUILD_PYTHON_BINDINGS=true - -DPYTHON_EXECUTABLE=$(which python) - -DPython_EXECUTABLE=$(which python) && - cmake --build {project}/build -- -j$(nproc) && - cp -L {project}/build/Release/pyrealsense2.cpython-*.so {project}/build/Release/pyrsutils.cpython-*.so {project}/wrappers/python/pyrealsense2/ - CIBW_TEST_REQUIRES: >- - pytest pytest-timeout pytest-rerunfailures pytest-repeat pytest-check - numpy opencv-python-headless zstandard - CIBW_TEST_SOURCES: unit-tests - # upstream's --not-live pytest run, minus the files that read recordings or binaries from a CMake build tree - CIBW_TEST_COMMAND: >- - python -m pytest unit-tests/log unit-tests/sw-dev unit-tests/syncer unit-tests/post-processing - --color=no --not-live --context linux -p no:cacheprovider - --ignore=unit-tests/log/pytest-env-log-level-off.py - --ignore=unit-tests/log/pytest-env-log-level-on.py - --ignore=unit-tests/post-processing/pytest-filters.py - --ignore=unit-tests/post-processing/pytest-post-processing-from-bag.py + name: pyrealsense2-${{ env.PYREALSENSE2_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships both compiled extensions and licences run: | @@ -216,12 +209,6 @@ jobs: assert expected_pkgs <= have_pkgs, expected_pkgs - have_pkgs EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyrealsense2-${{ env.PYREALSENSE2_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -257,7 +244,7 @@ jobs: publish: name: Publish pyrealsense2 ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyresample.yml b/.github/workflows/build-pyresample.yml index 9e0d28f82b19..7a71ef9b06bc 100644 --- a/.github/workflows/build-pyresample.yml +++ b/.github/workflows/build-pyresample.yml @@ -48,49 +48,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyresample ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyresample" + version: "${{ matrix.version }}" + repository: "pytroll/pyresample" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,pyproj,pykdtree,shapely,pyyaml,scipy,pandas,matplotlib,contourpy,kiwisolver,pillow,cartopy,rasterio,numcodecs,msgspec,google-crc32c" + # The test suite's conftest imports xarray, and pandas (an xarray dependency) + # has no cp314t riscv64 wheel yet, so that leg runs upstream's own wheel check only. + # (`cond && '' || x` is broken in GitHub Actions expressions: the empty string + # is falsy, so it always falls through to x. Negate the condition instead.) + # + # pyresample.gradient's __init__.py unconditionally does `import dask` and + # `import xarray` (gotcha: the module is heavier than the single Cython symbol + # we want from it), so even the bare sanity import below can't cover it on + # cp314t without pandas. The "Check wheel contents" step already proves + # gradient._gradient_search.so is in the wheel without importing it, so skip + # that import here for cp314t instead of trying to satisfy its transitive deps. + cibw-test-requires: "${{ matrix.python != 'cp314t' && 'pytest pytest-lazy-fixtures dask xarray scipy pillow matplotlib cartopy rasterio zarr odc-geo' || '' }}" + cibw-test-command: "python -c \"import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'; from pyresample.ewa import _ll2cr, _fornav\" ${{ matrix.python != 'cp314t' && '&& python -c \"from pyresample.gradient import _gradient_search\" && python -m pytest -v --pyargs pyresample.test' || '' }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYRESAMPLE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyresample v${{ env.PYRESAMPLE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pytroll/pyresample - ref: v${{ env.PYRESAMPLE_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pyproj,pykdtree,shapely,pyyaml,scipy,pandas,matplotlib,contourpy,kiwisolver,pillow,cartopy,rasterio,numcodecs,msgspec,google-crc32c - # The test suite's conftest imports xarray, and pandas (an xarray dependency) - # has no cp314t riscv64 wheel yet, so that leg runs upstream's own wheel check only. - # (`cond && '' || x` is broken in GitHub Actions expressions: the empty string - # is falsy, so it always falls through to x. Negate the condition instead.) - # - # pyresample.gradient's __init__.py unconditionally does `import dask` and - # `import xarray` (gotcha: the module is heavier than the single Cython symbol - # we want from it), so even the bare sanity import below can't cover it on - # cp314t without pandas. The "Check wheel contents" step already proves - # gradient._gradient_search.so is in the wheel without importing it, so skip - # that import here for cp314t instead of trying to satisfy its transitive deps. - CIBW_TEST_REQUIRES: >- - ${{ matrix.python != 'cp314t' && 'pytest pytest-lazy-fixtures dask xarray scipy pillow matplotlib cartopy rasterio zarr odc-geo' || '' }} - CIBW_TEST_COMMAND: >- - python -c "import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'; from pyresample.ewa import _ll2cr, _fornav" - ${{ matrix.python != 'cp314t' && '&& python -c "from pyresample.gradient import _gradient_search" && python -m pytest -v --pyargs pyresample.test' || '' }} + name: pyresample-${{ env.PYRESAMPLE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -102,16 +105,9 @@ jobs: assert any(n.endswith(".dist-info/licenses/LICENSE.txt") for n in names), names EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyresample-${{ env.PYRESAMPLE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyresample ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyrnnoise.yml b/.github/workflows/build-pyrnnoise.yml index ce9232131f52..65338cc68bab 100644 --- a/.github/workflows/build-pyrnnoise.yml +++ b/.github/workflows/build-pyrnnoise.yml @@ -63,78 +63,85 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build pyrnnoise ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyrnnoise" + version: "${{ matrix.version }}" + repository: "pengzhendong/pyrnnoise" + ref: |- + ${{ fromJSON('{"0.4.3": "a4edc697a2f475dcdac14c453d7c06eebbd06b33", + "0.4.4": "56c437f32cfa10136fdf766321d5570d9368d0a6", + "0.4.5": "fe603b252ccc7d3bacadb77d6ab766c48acc6fce"}')[matrix.version] }} + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 90 + checkout-submodules: "true" + pre-build: |- + expected='${{ fromJSON('{"0.4.3": "a4edc697a2f475dcdac14c453d7c06eebbd06b33", + "0.4.4": "56c437f32cfa10136fdf766321d5570d9368d0a6", + "0.4.5": "fe603b252ccc7d3bacadb77d6ab766c48acc6fce"}')[matrix.version] }}' + test -n "$expected" + test "$(git rev-parse HEAD)" = "$expected" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pyrnnoise/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + echo "${{ matrix.version }}" > VERSION + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # setup.py ships no ext_modules and forces root_is_pure = False + # (the C library is loaded via ctypes), so setuptools tags the + # wheel py3-none and one build serves every interpreter. + cibw-build: "cp312-manylinux_riscv64" + # Mirrors release.yml's own `cmake --build ... --target install` + # step, run here instead since setup.py does not invoke cmake + # itself. The image ships no cmake or wget (gotcha 289); the + # CMakeLists.txt wget call fetches the pretrained model weights + # that rnnoise_data.c/.h are generated from. + cibw-before-all-linux: "dnf install -y cmake wget && cmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build --target install --parallel" + # matplotlib, an unconditional runtime dependency, has no + # musllinux_riscv64 wheel on this registry, so musllinux is + # dropped (same outcome as build-keystone-engine.yml). + # pillow (a matplotlib dependency) has no riscv64 wheel on public + # PyPI's newest release and its sdist needs libjpeg headers. + cibw-test-environment: "PIP_ONLY_BINARY=numpy,matplotlib,av,soundfile,soxr,pillow" + cibw-test-command: "python -c \"import numpy as np; from pyrnnoise.rnnoise import create, destroy, process_frame, FRAME_SIZE; state = create(); frame = np.zeros(FRAME_SIZE, dtype=np.int16); out, prob = process_frame(state, frame); assert out.shape == (FRAME_SIZE,), out.shape; destroy(state); print('pyrnnoise OK')\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: PYRNNOISE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyrnnoise ${{ env.PYRNNOISE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pengzhendong/pyrnnoise - ref: ${{ fromJSON(env.PYRNNOISE_REFS)[env.PYRNNOISE_VERSION] }} - submodules: true - persist-credentials: false - - - name: Check the checkout is the requested version - run: | - expected='${{ fromJSON(env.PYRNNOISE_REFS)[env.PYRNNOISE_VERSION] }}' - test -n "$expected" - test "$(git rev-parse HEAD)" = "$expected" - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pyrnnoise source - run: git apply python-wheels/patches/pyrnnoise/${{ env.PYRNNOISE_VERSION }}/*.patch - - # Matches release.yml's own `echo "$RELEASE_VERSION" > VERSION` step; - # setup.py reads VERSION verbatim and the checkout above carries - # whatever placeholder was last committed to it. - - name: Stamp VERSION - run: echo "${{ env.PYRNNOISE_VERSION }}" > VERSION - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # setup.py ships no ext_modules and forces root_is_pure = False - # (the C library is loaded via ctypes), so setuptools tags the - # wheel py3-none and one build serves every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Mirrors release.yml's own `cmake --build ... --target install` - # step, run here instead since setup.py does not invoke cmake - # itself. The image ships no cmake or wget (gotcha 289); the - # CMakeLists.txt wget call fetches the pretrained model weights - # that rnnoise_data.c/.h are generated from. - CIBW_BEFORE_ALL_LINUX: >- - dnf install -y cmake wget && - cmake -B build -DCMAKE_BUILD_TYPE=Release && - cmake --build build --target install --parallel - # matplotlib, an unconditional runtime dependency, has no - # musllinux_riscv64 wheel on this registry, so musllinux is - # dropped (same outcome as build-keystone-engine.yml). - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # pillow (a matplotlib dependency) has no riscv64 wheel on public - # PyPI's newest release and its sdist needs libjpeg headers. - CIBW_TEST_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,matplotlib,av,soundfile,soxr,pillow - CIBW_TEST_COMMAND: >- - python -c "import numpy as np; - from pyrnnoise.rnnoise import create, destroy, process_frame, FRAME_SIZE; - state = create(); - frame = np.zeros(FRAME_SIZE, dtype=np.int16); - out, prob = process_frame(state, frame); - assert out.shape == (FRAME_SIZE,), out.shape; - destroy(state); - print('pyrnnoise OK')" + name: pyrnnoise-${{ env.PYRNNOISE_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries librnnoise and RNNoise's licence run: | @@ -149,15 +156,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyrnnoise-${{ env.PYRNNOISE_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyrnnoise ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyroaring.yml b/.github/workflows/build-pyroaring.yml index 596b3969f0f7..866227dbbf73 100644 --- a/.github/workflows/build-pyroaring.yml +++ b/.github/workflows/build-pyroaring.yml @@ -51,52 +51,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyroaring ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - PYROARING_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout pyroaring ${{ env.PYROARING_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Ezibenroc/PyRoaringBitMap - ref: ${{ env.PYROARING_VERSION }} - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyroaring" + version: "${{ matrix.version }}" + repository: "Ezibenroc/PyRoaringBitMap" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + git apply python-wheels/patches/pyroaring/${{ matrix.version }}/00*.patch - # The wheel statically links the bundled CRoaring amalgamation but ships only - # pyroaring's own LICENSE. - - name: Patch pyroaring source - run: | - git apply python-wheels/patches/pyroaring/${{ env.PYROARING_VERSION }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build-frontend: "build" + # Upstream ships no cp314t riscv64 hypothesis wheel; ours supplies it. only-binary is + # test-only (gotcha 12) so a missing wheel fails loudly instead of building the sdist. + cibw-test-environment: "PIP_ONLY_BINARY=hypothesis" + cibw-test-requires: "hypothesis pytest" + cibw-test-command: "python -c \"import importlib.metadata as m; n=sorted(p.name for p in m.files('pyroaring') if 'licenses/' in str(p)); assert n == ['LICENSE', 'LICENSE.CRoaring'], n\" && pytest {project}/test.py -v && python {project}/cydoctest.py -v" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + PYROARING_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BUILD_FRONTEND: build - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream ships no cp314t riscv64 hypothesis wheel; ours supplies it. only-binary is - # test-only (gotcha 12) so a missing wheel fails loudly instead of building the sdist. - CIBW_TEST_ENVIRONMENT: 'PIP_ONLY_BINARY=hypothesis' - CIBW_TEST_REQUIRES: hypothesis pytest - CIBW_TEST_COMMAND: >- - python -c "import importlib.metadata as m; n=sorted(p.name for p in m.files('pyroaring') if 'licenses/' in str(p)); assert n == ['LICENSE', 'LICENSE.CRoaring'], n" && - pytest {project}/test.py -v && - python {project}/cydoctest.py -v + name: pyroaring-${{ env.PYROARING_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the compiled extension made it into the wheel run: | @@ -108,15 +112,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyroaring-${{ env.PYROARING_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyroaring ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyroomacoustics.yml b/.github/workflows/build-pyroomacoustics.yml index 0b4dcd9e9933..9c15b4b473c2 100644 --- a/.github/workflows/build-pyroomacoustics.yml +++ b/.github/workflows/build-pyroomacoustics.yml @@ -48,52 +48,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyroomacoustics ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyroomacoustics" + version: "${{ matrix.version }}" + repository: "LCAV/pyroomacoustics" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pyroomacoustics/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PYROOMACOUSTICS_DATA_PATH={project}/pyroomacoustics/data/sofa SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYROOMACOUSTICS=${{ matrix.version }} PIP_ONLY_BINARY=numpy,scipy,matplotlib,pillow,netcdf4,cftime,soxr,cmake" + cibw-test-requires: "pytest numpy scipy matplotlib python-sofa soxr" + # test_room_plot.py's no-walls plot tests call the removed np.row_stack under + # NumPy 2 (room.py's get_bbox); upstream bug, reproduces on x86, unrelated to riscv64. + cibw-test-command: "pytest {project}/tests --deselect tests/test_room_plot.py::TestRoomPlot::test_anechoic_room_no_walls_2d --deselect tests/test_room_plot.py::TestRoomPlot::test_anechoic_room_no_walls_3d" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYROOMACOUSTICS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyroomacoustics v${{ env.PYROOMACOUSTICS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: LCAV/pyroomacoustics - ref: v${{ env.PYROOMACOUSTICS_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/pyroomacoustics/${{ env.PYROOMACOUSTICS_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PYROOMACOUSTICS_DATA_PATH={project}/pyroomacoustics/data/sofa - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYROOMACOUSTICS=${{ env.PYROOMACOUSTICS_VERSION }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,matplotlib,pillow,netcdf4,cftime,soxr,cmake - CIBW_TEST_REQUIRES: "pytest numpy scipy matplotlib python-sofa soxr" - # test_room_plot.py's no-walls plot tests call the removed np.row_stack under - # NumPy 2 (room.py's get_bbox); upstream bug, reproduces on x86, unrelated to riscv64. - CIBW_TEST_COMMAND: >- - pytest {project}/tests - --deselect tests/test_room_plot.py::TestRoomPlot::test_anechoic_room_no_walls_2d - --deselect tests/test_room_plot.py::TestRoomPlot::test_anechoic_room_no_walls_3d + name: pyroomacoustics-${{ env.PYROOMACOUSTICS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -106,15 +111,9 @@ jobs: assert licences == {"LICENSE", "LICENSE.eigen-mpl2", "LICENSE.eigen-bsd", "LICENSE.nanoflann", "LICENSE.pybind11"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyroomacoustics-${{ env.PYROOMACOUSTICS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyroomacoustics ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyroscope-io.yml b/.github/workflows/build-pyroscope-io.yml index cfaebcb1c226..838ce7002786 100644 --- a/.github/workflows/build-pyroscope-io.yml +++ b/.github/workflows/build-pyroscope-io.yml @@ -50,226 +50,237 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyroscope-io ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyroscope_io" + version: "${{ matrix.version }}" + repository: "grafana/pyroscope-python" + ref: "python-${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 480 + checkout-submodules: "true" + pre-build: |- + export PYROSCOPE_IO_VERSION='${{ matrix.version }}' + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + py_spy_url=$(sed -En 's|^py-spy = \{ git = "([^"]+)".*|\1|p' rust/Cargo.toml) + py_spy_rev=$(sed -En 's|^py-spy = \{ git = "[^"]+", rev = "([^"]+)".*|\1|p' rust/Cargo.toml) + git clone --filter=blob:none --no-checkout "$py_spy_url" py-spy + git -C py-spy checkout --detach "$py_spy_rev" + git -C py-spy apply "${GITHUB_WORKSPACE}/python-wheels/patches/pyroscope-io/${PYROSCOPE_IO_VERSION}/0002-python_bindings-return-no-tstate_current-offset-on-riscv64.patch" + git apply "python-wheels/patches/pyroscope-io/${PYROSCOPE_IO_VERSION}/0001-cargo-build-py-spy-from-a-locally-patched-checkout.patch" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + mkdir -p smoke + cat > before-all.sh <<'BEFORE_ALL_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Mirrors the build environment of upstream's docker/wheel.Dockerfile: a + # statically linked OpenSSL for reqwest's native-tls backend, plus the pinned + # Rust toolchain. + set -euxo pipefail + + OPENSSL_VERSION=3.5.7 + RUST_VERSION=1.98.0 + + # libstdc++-static is added to upstream's list: build.rs links the C++ memalloc + # profiler statically and Rocky 10 keeps libstdc++.a out of the default install. + yum -y install gcc perl-core glibc-devel make libstdc++-static + + curl -fsSL "https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz" -o /tmp/openssl.tar.gz + tar xzf /tmp/openssl.tar.gz -C /tmp + cd "/tmp/openssl-${OPENSSL_VERSION}" + ./config no-shared no-tests --prefix=/usr/local/openssl --openssldir=/etc/ssl + make -j"$(nproc)" + make install_sw + ln -sf /usr/local/openssl/lib64 /usr/local/openssl/lib || true + cd / + rm -rf /tmp/openssl* + + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | + sh -s -- -y --profile minimal --default-toolchain "${RUST_VERSION}" + BEFORE_ALL_EOF + cat > smoke/riscv64_smoke.py <<'SMOKE_EOF' + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + """End-to-end smoke test for the riscv64 pyroscope-io wheel. + + Upstream tests its wheels with a Go suite that runs a Pyroscope server and + the workload in separate Docker containers, which the build container cannot + do. This drives the same path in-process: point the agent at a local HTTP + server, do work, and assert the uploaded pprof carries the frames of the + function that did it. + """ + + import gzip + import hashlib + import http.server + import subprocess + import sys + import threading + import time + + MARKERS = {"cpu": b"smoke_cpu_burn", "mem": b"smoke_mem_churn"} + PUSH_PATH = "/push.v1.PusherService/Push" + + + def smoke_cpu_burn(deadline): + value = "riscv64" + while time.time() < deadline: + value = hashlib.sha256(value.encode()).hexdigest() + return value + + + def smoke_mem_churn(deadline): + retained = [] + while time.time() < deadline: + retained.append(bytearray(64 * 1024)) + if len(retained) >= 256: + del retained[:128] + time.sleep(0.005) + return len(retained) + + + def worker(mode, url): + import pyroscope + + options = dict( + application_name="riscv64.smoke", + server_address=url, + enable_logging=True, + upload_interval=1, + tags={"mode": mode}, + ) + if mode == "cpu": + options.update(cpu_enabled=True) + else: + options.update(cpu_enabled=False, mem_enabled=True) + + pyroscope.configure(**options) + deadline = time.time() + 15 + try: + if mode == "cpu": + smoke_cpu_burn(deadline) + else: + smoke_mem_churn(deadline) + finally: + pyroscope.shutdown() + + + class Collector(http.server.BaseHTTPRequestHandler): + bodies = [] + + def do_POST(self): + length = int(self.headers.get("Content-Length", 0)) + body = self.rfile.read(length) + if self.path.endswith(PUSH_PATH): + Collector.bodies.append(body) + self.send_response(200) + self.send_header("Content-Length", "0") + self.end_headers() + + def log_message(self, *_args): + pass + + + def run(mode): + Collector.bodies = [] + server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Collector) + thread = threading.Thread(target=server.serve_forever, daemon=True) + thread.start() + url = "http://127.0.0.1:%d" % server.server_address[1] + try: + result = subprocess.run( + [sys.executable, "-u", __file__, "worker", mode, url], + capture_output=True, + text=True, + timeout=180, + ) + finally: + server.shutdown() + + print(result.stdout, end="") + print(result.stderr, end="", file=sys.stderr) + if result.returncode != 0: + raise SystemExit("%s worker exited with %d" % (mode, result.returncode)) + + bodies = Collector.bodies + if not bodies: + raise SystemExit("%s: agent uploaded no profile" % mode) + + marker = MARKERS[mode] + profiles = b"".join(gzip.decompress(body) for body in bodies) + if marker not in profiles: + raise SystemExit( + "%s: %d uploads (%d bytes) carry no %s frame" + % (mode, len(bodies), len(profiles), marker.decode()) + ) + print("%s: %d uploads, %s sampled" % (mode, len(bodies), marker.decode())) + + + def main(): + import pyroscope + + print("pyroscope from", pyroscope.__file__) + print("native from", pyroscope.lib.__file__) + if "site-packages" not in pyroscope.__file__: + raise SystemExit("imported the source tree, not the wheel") + for mode in ("cpu", "mem"): + run(mode) + + + if __name__ == "__main__": + if len(sys.argv) > 1 and sys.argv[1] == "worker": + worker(sys.argv[2], sys.argv[3]) + else: + main() + SMOKE_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "bash {project}/before-all.sh" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" OPENSSL_DIR=/usr/local/openssl OPENSSL_STATIC=1" + cibw-test-sources: "smoke" + cibw-test-command: "python smoke/riscv64_smoke.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 480 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYROSCOPE_IO_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyroscope-python ${{ env.PYROSCOPE_IO_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: grafana/pyroscope-python - ref: python-${{ env.PYROSCOPE_IO_VERSION }} - # 1.3.0+ build the C++ memalloc profiler from the dd-trace-py submodule - # (rust/build.rs runs cmake on ../dd-trace-py); absent in older tags. - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Check out py-spy and add riscv64 support - run: | - py_spy_url=$(sed -En 's|^py-spy = \{ git = "([^"]+)".*|\1|p' rust/Cargo.toml) - py_spy_rev=$(sed -En 's|^py-spy = \{ git = "[^"]+", rev = "([^"]+)".*|\1|p' rust/Cargo.toml) - git clone --filter=blob:none --no-checkout "$py_spy_url" py-spy - git -C py-spy checkout --detach "$py_spy_rev" - git -C py-spy apply "${GITHUB_WORKSPACE}/python-wheels/patches/pyroscope-io/${PYROSCOPE_IO_VERSION}/0002-python_bindings-return-no-tstate_current-offset-on-riscv64.patch" - git apply "python-wheels/patches/pyroscope-io/${PYROSCOPE_IO_VERSION}/0001-cargo-build-py-spy-from-a-locally-patched-checkout.patch" - - - name: Stage the before-all script and the smoke test - run: | - mkdir -p smoke - cat > before-all.sh <<'BEFORE_ALL_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Mirrors the build environment of upstream's docker/wheel.Dockerfile: a - # statically linked OpenSSL for reqwest's native-tls backend, plus the pinned - # Rust toolchain. - set -euxo pipefail - - OPENSSL_VERSION=3.5.7 - RUST_VERSION=1.98.0 - - # libstdc++-static is added to upstream's list: build.rs links the C++ memalloc - # profiler statically and Rocky 10 keeps libstdc++.a out of the default install. - yum -y install gcc perl-core glibc-devel make libstdc++-static - - curl -fsSL "https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz" -o /tmp/openssl.tar.gz - tar xzf /tmp/openssl.tar.gz -C /tmp - cd "/tmp/openssl-${OPENSSL_VERSION}" - ./config no-shared no-tests --prefix=/usr/local/openssl --openssldir=/etc/ssl - make -j"$(nproc)" - make install_sw - ln -sf /usr/local/openssl/lib64 /usr/local/openssl/lib || true - cd / - rm -rf /tmp/openssl* - - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | - sh -s -- -y --profile minimal --default-toolchain "${RUST_VERSION}" - BEFORE_ALL_EOF - cat > smoke/riscv64_smoke.py <<'SMOKE_EOF' - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - """End-to-end smoke test for the riscv64 pyroscope-io wheel. - - Upstream tests its wheels with a Go suite that runs a Pyroscope server and - the workload in separate Docker containers, which the build container cannot - do. This drives the same path in-process: point the agent at a local HTTP - server, do work, and assert the uploaded pprof carries the frames of the - function that did it. - """ - - import gzip - import hashlib - import http.server - import subprocess - import sys - import threading - import time - - MARKERS = {"cpu": b"smoke_cpu_burn", "mem": b"smoke_mem_churn"} - PUSH_PATH = "/push.v1.PusherService/Push" - - - def smoke_cpu_burn(deadline): - value = "riscv64" - while time.time() < deadline: - value = hashlib.sha256(value.encode()).hexdigest() - return value - - - def smoke_mem_churn(deadline): - retained = [] - while time.time() < deadline: - retained.append(bytearray(64 * 1024)) - if len(retained) >= 256: - del retained[:128] - time.sleep(0.005) - return len(retained) - - - def worker(mode, url): - import pyroscope - - options = dict( - application_name="riscv64.smoke", - server_address=url, - enable_logging=True, - upload_interval=1, - tags={"mode": mode}, - ) - if mode == "cpu": - options.update(cpu_enabled=True) - else: - options.update(cpu_enabled=False, mem_enabled=True) - - pyroscope.configure(**options) - deadline = time.time() + 15 - try: - if mode == "cpu": - smoke_cpu_burn(deadline) - else: - smoke_mem_churn(deadline) - finally: - pyroscope.shutdown() - - - class Collector(http.server.BaseHTTPRequestHandler): - bodies = [] - - def do_POST(self): - length = int(self.headers.get("Content-Length", 0)) - body = self.rfile.read(length) - if self.path.endswith(PUSH_PATH): - Collector.bodies.append(body) - self.send_response(200) - self.send_header("Content-Length", "0") - self.end_headers() - - def log_message(self, *_args): - pass - - - def run(mode): - Collector.bodies = [] - server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Collector) - thread = threading.Thread(target=server.serve_forever, daemon=True) - thread.start() - url = "http://127.0.0.1:%d" % server.server_address[1] - try: - result = subprocess.run( - [sys.executable, "-u", __file__, "worker", mode, url], - capture_output=True, - text=True, - timeout=180, - ) - finally: - server.shutdown() - - print(result.stdout, end="") - print(result.stderr, end="", file=sys.stderr) - if result.returncode != 0: - raise SystemExit("%s worker exited with %d" % (mode, result.returncode)) - - bodies = Collector.bodies - if not bodies: - raise SystemExit("%s: agent uploaded no profile" % mode) - - marker = MARKERS[mode] - profiles = b"".join(gzip.decompress(body) for body in bodies) - if marker not in profiles: - raise SystemExit( - "%s: %d uploads (%d bytes) carry no %s frame" - % (mode, len(bodies), len(profiles), marker.decode()) - ) - print("%s: %d uploads, %s sampled" % (mode, len(bodies), marker.decode())) - - - def main(): - import pyroscope - - print("pyroscope from", pyroscope.__file__) - print("native from", pyroscope.lib.__file__) - if "site-packages" not in pyroscope.__file__: - raise SystemExit("imported the source tree, not the wheel") - for mode in ("cpu", "mem"): - run(mode) - - - if __name__ == "__main__": - if len(sys.argv) > 1 and sys.argv[1] == "worker": - worker(sys.argv[2], sys.argv[3]) - else: - main() - SMOKE_EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: bash {project}/before-all.sh - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - OPENSSL_DIR=/usr/local/openssl - OPENSSL_STATIC=1 - CIBW_TEST_SOURCES: smoke - CIBW_TEST_COMMAND: python smoke/riscv64_smoke.py + name: pyroscope_io-${{ env.PYROSCOPE_IO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel carries the compiled extension run: | @@ -281,15 +292,9 @@ jobs: print("\n".join(sos)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyroscope_io-${{ env.PYROSCOPE_IO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyroscope-io ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyrosm.yml b/.github/workflows/build-pyrosm.yml index a3f89768cafd..fd113929f5e7 100644 --- a/.github/workflows/build-pyrosm.yml +++ b/.github/workflows/build-pyrosm.yml @@ -58,9 +58,7 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # The wheel's compiled runtime deps (geopandas stack, pyarrow, rapidjson) only have riscv64 wheels on the RISE registry. - cibw-test-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pandas,pyogrio,pyproj,shapely,python-rapidjson,pyarrow + cibw-test-environment: "PIP_ONLY_BINARY=numpy,pandas,pyogrio,pyproj,shapely,python-rapidjson,pyarrow" timeout-minutes: 120 publish: diff --git a/.github/workflows/build-pyrsistent.yml b/.github/workflows/build-pyrsistent.yml index 34ab3bfe450b..13da9399f414 100644 --- a/.github/workflows/build-pyrsistent.yml +++ b/.github/workflows/build-pyrsistent.yml @@ -51,43 +51,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyrsistent ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyrsistent" + version: "${{ matrix.version }}" + repository: "tobgu/pyrsistent" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pyrsistent/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream pins `pytest==6.* hypothesis==6.*`, which predates CPython 3.12 + # and dies collecting the suite on `ast.Str`. + cibw-test-requires: "pytest hypothesis" + cibw-test-command: "bash {project}/tools/test_wheels.sh {project}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PYRSISTENT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyrsistent v${{ env.PYRSISTENT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: tobgu/pyrsistent - ref: v${{ env.PYRSISTENT_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pyrsistent source - run: git apply python-wheels/patches/pyrsistent/${{ env.PYRSISTENT_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream pins `pytest==6.* hypothesis==6.*`, which predates CPython 3.12 - # and dies collecting the suite on `ast.Str`. - CIBW_TEST_REQUIRES: pytest hypothesis - CIBW_TEST_COMMAND: bash {project}/tools/test_wheels.sh {project} + name: pyrsistent-${{ env.PYRSISTENT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the pvectorc extension made it into the wheel # setup.py's custom_build_ext swallows compile failures, so a wheel holding @@ -101,15 +111,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyrsistent-${{ env.PYRSISTENT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyrsistent ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyrush.yml b/.github/workflows/build-pyrush.yml index 71f8cdce7d51..bfc3296fe4d7 100644 --- a/.github/workflows/build-pyrush.yml +++ b/.github/workflows/build-pyrush.yml @@ -62,12 +62,7 @@ jobs: # numpy has no riscv64 wheel, so only-binary keeps it on the registry's. # -mtune=generic is an x86-only tuning target; gcc on riscv64 rejects it. cibw-before-all: echo 'cython<3.3.0' > /cython-constraint.txt - cibw-environment: >- - CFLAGS='-O3 -g0 -pipe -fPIC' - LDFLAGS='-fPIC' - PIP_BUILD_CONSTRAINT=/cython-constraint.txt - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "CFLAGS='-O3 -g0 -pipe -fPIC' LDFLAGS='-fPIC' PIP_BUILD_CONSTRAINT=/cython-constraint.txt PIP_ONLY_BINARY=numpy" # Upstream installs dev-requirements.txt before the wheel; medspacy in it pulls # PyRuSH from PyPI, and pip then keeps that same-version install over this wheel. cibw-test-requires: pytest medspacy diff --git a/.github/workflows/build-pysam.yml b/.github/workflows/build-pysam.yml index cd14085db155..85b19ecbeed3 100644 --- a/.github/workflows/build-pysam.yml +++ b/.github/workflows/build-pysam.yml @@ -49,51 +49,59 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pysam ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pysam" + version: "${{ matrix.version }}" + repository: "pysam-developers/pysam" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pysam/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # No libcurl-devel in the build image (as build-pybigwig.yml), so htslib configures + # without remote-URL support; pysam's own tests self-skip on HAVE_LIBCURL for that. + # samtools/bcftools aren't packaged for riscv64 on EPEL, so fall back to upstream's + # own devtools/emulate-tools.py, already used for the same gap on musllinux. + cibw-before-all-linux: |- + dnf -y install zlib-devel bzip2-devel xz-devel && ( (dnf -y install epel-release && dnf -y install samtools bcftools htslib-tools) || + for tool in samtools bcftools bgzip tabix; do + ln -sf {project}/devtools/emulate-tools.py /usr/local/bin/$tool + done ) + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYSAM_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pysam v${{ env.PYSAM_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pysam-developers/pysam - ref: v${{ env.PYSAM_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pysam source - run: git apply python-wheels/patches/pysam/${{ env.PYSAM_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # No libcurl-devel in the build image (as build-pybigwig.yml), so htslib configures - # without remote-URL support; pysam's own tests self-skip on HAVE_LIBCURL for that. - # samtools/bcftools aren't packaged for riscv64 on EPEL, so fall back to upstream's - # own devtools/emulate-tools.py, already used for the same gap on musllinux. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install zlib-devel bzip2-devel xz-devel && - ( (dnf -y install epel-release && dnf -y install samtools bcftools htslib-tools) || - for tool in samtools bcftools bgzip tabix; do - ln -sf {project}/devtools/emulate-tools.py /usr/local/bin/$tool - done ) - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + name: pysam-${{ env.PYSAM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extensions and vendored licences run: | @@ -109,15 +117,9 @@ jobs: assert {"COPYING", "LICENSE.htslib", "LICENSE.samtools", "LICENSE.bcftools"} <= set(lic), lic EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pysam-${{ env.PYSAM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pysam ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyscipopt.yml b/.github/workflows/build-pyscipopt.yml index e1f7e92acdc2..e6dd4c617c3f 100644 --- a/.github/workflows/build-pyscipopt.yml +++ b/.github/workflows/build-pyscipopt.yml @@ -59,173 +59,181 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyscipopt ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 1440 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - PYSCIPOPT_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout PySCIPOpt ${{ env.PYSCIPOPT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: scipopt/PySCIPOpt - ref: v${{ env.PYSCIPOPT_VERSION }} - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyscipopt" + version: "${{ matrix.version }}" + repository: "scipopt/PySCIPOpt" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 1440 + pre-build: |- + export PYSCIPOPT_VERSION='${{ matrix.version }}' + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + patches="$PWD/python-wheels/patches/pyscipopt/${PYSCIPOPT_VERSION}" + if [ -d "$patches" ]; then + git apply -v "$patches"/*.patch + fi - # Only some versions need patching (6.3.0 already carries the Cython 3.3 fix - # that 6.2.1 backported), so a missing directory is not an error. - - name: Patch PySCIPOpt source - run: | - patches="$PWD/python-wheels/patches/pyscipopt/${PYSCIPOPT_VERSION}" - if [ -d "$patches" ]; then - git apply -v "$patches"/*.patch - fi + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's before-all unzips a prebuilt SCIP; this builds it with scipoptsuite-deploy's + # recipe instead, minus GCG (not linked by PySCIPOpt) and the component test suites. + cibw-before-all-linux: |- + set -ex + project=$(pwd) + ws=/tmp/scipoptsuite + export CMAKE_POLICY_VERSION_MINIMUM=3.5 + mkdir -p $ws + cd $ws + # libgfortran-static/libstdc++-static: config.site links statically; Rocky 10's system GCC splits them out. + yum install gcc gcc-c++ libgfortran libgfortran-static libstdc++-static git patch wget lapack-static unzip zip make glibc-static -y + rm -f /usr/lib64/liblapack.s* + rm -f /usr/lib64/libblas.* + rm -rf /usr/include/boost + mkdir /usr/include/boost - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_PASS_LINUX: PIP_EXTRA_INDEX_URL - PIP_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/ - # Upstream's before-all unzips a prebuilt SCIP; this builds it with scipoptsuite-deploy's - # recipe instead, minus GCG (not linked by PySCIPOpt) and the component test suites. - CIBW_BEFORE_ALL_LINUX: | - set -ex - project=$(pwd) - ws=/tmp/scipoptsuite - export CMAKE_POLICY_VERSION_MINIMUM=3.5 - mkdir -p $ws - cd $ws - # libgfortran-static/libstdc++-static: config.site links statically; Rocky 10's system GCC splits them out. - yum install gcc gcc-c++ libgfortran libgfortran-static libstdc++-static git patch wget lapack-static unzip zip make glibc-static -y - rm -f /usr/lib64/liblapack.s* - rm -f /usr/lib64/libblas.* - rm -rf /usr/include/boost - mkdir /usr/include/boost + wget -q https://archives.boost.io/release/1.82.0/source/boost_1_82_0.tar.gz + tar -xf boost_1_82_0.tar.gz + cd boost_1_82_0 + ./bootstrap.sh --prefix=/usr/include/boost --with-libraries=program_options,serialization,iostreams,regex + ./b2 --prefix=/usr/include/boost -j$(nproc) install + cd .. - wget -q https://archives.boost.io/release/1.82.0/source/boost_1_82_0.tar.gz - tar -xf boost_1_82_0.tar.gz - cd boost_1_82_0 - ./bootstrap.sh --prefix=/usr/include/boost --with-libraries=program_options,serialization,iostreams,regex - ./b2 --prefix=/usr/include/boost -j$(nproc) install - cd .. + git clone --depth 1 --branch v3.12.1 https://github.com/Reference-LAPACK/lapack.git + cp lapack/LICENSE $project/LICENSE.lapack + cd lapack + mkdir build + cd build + cmake .. -DCMAKE_POSITION_INDEPENDENT_CODE=ON + make -j$(nproc) blas + mv lib/libblas.a /usr/lib64/. - git clone --depth 1 --branch ${{ env.LAPACK_REF }} https://github.com/Reference-LAPACK/lapack.git - cp lapack/LICENSE $project/LICENSE.lapack - cd lapack - mkdir build - cd build - cmake .. -DCMAKE_POSITION_INDEPENDENT_CODE=ON - make -j$(nproc) blas - mv lib/libblas.a /usr/lib64/. + cd $ws + mkdir scip_install + mkdir scip_install/share + wget -q https://github.com/coin-or/Ipopt/archive/refs/tags/releases/3.14.19.zip + unzip -q 3.14.19.zip + cp Ipopt-releases-3.14.19/LICENSE $project/LICENSE.ipopt + echo "enable_shared=no + enable_java=no + enable_sipopt=no + with_pic=yes + with_metis_cflags=\"-I$ws/metis/include/\" + with_metis_lflags=\"-L$ws/metis/lib -lmetis -lm\" + with_lapack_lflags=\"-llapack_pic -lblas -lgfortran -lm\" + LT_LDFLAGS=-all-static + LDFLAGS=-static" > $ws/scip_install/share/config.site - cd $ws - mkdir scip_install - mkdir scip_install/share - wget -q https://github.com/coin-or/Ipopt/archive/refs/tags/releases/${{ env.IPOPT_VERSION }}.zip - unzip -q ${{ env.IPOPT_VERSION }}.zip - cp Ipopt-releases-${{ env.IPOPT_VERSION }}/LICENSE $project/LICENSE.ipopt - echo "enable_shared=no - enable_java=no - enable_sipopt=no - with_pic=yes - with_metis_cflags=\"-I$ws/metis/include/\" - with_metis_lflags=\"-L$ws/metis/lib -lmetis -lm\" - with_lapack_lflags=\"-llapack_pic -lblas -lgfortran -lm\" - LT_LDFLAGS=-all-static - LDFLAGS=-static" > $ws/scip_install/share/config.site + cd $ws + wget -q https://github.com/KarypisLab/METIS/archive/refs/tags/v5.1.1-DistDGL-v0.5.tar.gz + tar -xf v5.1.1-DistDGL-v0.5.tar.gz + wget -q https://github.com/KarypisLab/GKlib/archive/refs/tags/METIS-v5.1.1-DistDGL-0.5.tar.gz + tar -xf METIS-v5.1.1-DistDGL-0.5.tar.gz + mkdir $ws/metis + cd GKlib-METIS-v5.1.1-DistDGL-0.5 + cp LICENSE.txt $project/LICENSE.gklib + sed -i 's/^CONFIG_FLAGS =/CONFIG_FLAGS = -DCMAKE_POLICY_VERSION_MINIMUM=3.5/' Makefile + # GCC rejects -march=native on riscv64, and it would tie METIS to the build host anyway. + sed -i 's/ -march=native//' GKlibSystem.cmake + make config prefix=$ws/GKlib-METIS-v5.1.1-DistDGL-0.5 + make + make install - cd $ws - wget -q https://github.com/KarypisLab/METIS/archive/refs/tags/v5.1.1-DistDGL-v0.5.tar.gz - tar -xf v5.1.1-DistDGL-v0.5.tar.gz - wget -q https://github.com/KarypisLab/GKlib/archive/refs/tags/METIS-v5.1.1-DistDGL-0.5.tar.gz - tar -xf METIS-v5.1.1-DistDGL-0.5.tar.gz - mkdir $ws/metis - cd GKlib-METIS-v5.1.1-DistDGL-0.5 - cp LICENSE.txt $project/LICENSE.gklib - sed -i 's/^CONFIG_FLAGS =/CONFIG_FLAGS = -DCMAKE_POLICY_VERSION_MINIMUM=3.5/' Makefile - # GCC rejects -march=native on riscv64, and it would tie METIS to the build host anyway. - sed -i 's/ -march=native//' GKlibSystem.cmake - make config prefix=$ws/GKlib-METIS-v5.1.1-DistDGL-0.5 - make - make install + cd $ws + cd METIS-5.1.1-DistDGL-v0.5 + cp LICENSE $project/LICENSE.metis + sed -i 's/^CONFIG_FLAGS =/CONFIG_FLAGS = -DCMAKE_POLICY_VERSION_MINIMUM=3.5/' Makefile + make config prefix=$ws/metis gklib_path=$ws/GKlib-METIS-v5.1.1-DistDGL-0.5 + make + make install - cd $ws - cd METIS-5.1.1-DistDGL-v0.5 - cp LICENSE $project/LICENSE.metis - sed -i 's/^CONFIG_FLAGS =/CONFIG_FLAGS = -DCMAKE_POLICY_VERSION_MINIMUM=3.5/' Makefile - make config prefix=$ws/metis gklib_path=$ws/GKlib-METIS-v5.1.1-DistDGL-0.5 - make - make install + cd $ws + git clone --depth 1 --branch releases/3.0.12 https://github.com/coin-or-tools/ThirdParty-Mumps.git + cd ThirdParty-Mumps + ./get.Mumps + cp MUMPS/LICENSE $project/LICENSE.mumps + ./configure --enable-shared=no --enable-static=yes --prefix=$ws/scip_install + make -j$(nproc) + make install - cd $ws - git clone --depth 1 --branch ${{ env.THIRDPARTY_MUMPS_REF }} https://github.com/coin-or-tools/ThirdParty-Mumps.git - cd ThirdParty-Mumps - ./get.Mumps - cp MUMPS/LICENSE $project/LICENSE.mumps - ./configure --enable-shared=no --enable-static=yes --prefix=$ws/scip_install - make -j$(nproc) - make install + cd $ws + cd Ipopt-releases-3.14.19 + mkdir build + cd build + ../configure --prefix=$ws/scip_install/ + make -j$(nproc) + make install + cd .. + cd .. + wget -q https://github.com/scipopt/soplex/archive/refs/tags/v8.0.2.zip + unzip -q v8.0.2.zip + cd soplex-8.0.2 + cp LICENSE $project/LICENSE.soplex + cp src/soplex/external/fmt/LICENSE.rst $project/LICENSE.fmt + mkdir build + cd build + cmake .. -DCMAKE_INSTALL_PREFIX=$ws/scip_install -DCMAKE_BUILD_TYPE=Release -DGMP=false -DPAPILO=false -DBOOST=true + make -j$(nproc) + make install - cd $ws - cd Ipopt-releases-${{ env.IPOPT_VERSION }} - mkdir build - cd build - ../configure --prefix=$ws/scip_install/ - make -j$(nproc) - make install - cd .. - cd .. - wget -q https://github.com/scipopt/soplex/archive/refs/tags/v${{ env.SOPLEX_VERSION }}.zip - unzip -q v${{ env.SOPLEX_VERSION }}.zip - cd soplex-${{ env.SOPLEX_VERSION }} - cp LICENSE $project/LICENSE.soplex - cp src/soplex/external/fmt/LICENSE.rst $project/LICENSE.fmt - mkdir build - cd build - cmake .. -DCMAKE_INSTALL_PREFIX=$ws/scip_install -DCMAKE_BUILD_TYPE=Release -DGMP=false -DPAPILO=false -DBOOST=true - make -j$(nproc) - make install + cd $ws + wget -q https://github.com/scipopt/scip/archive/refs/tags/v10.0.2.zip + unzip -q v10.0.2.zip + cd scip-10.0.2 + cp LICENSE $project/LICENSE.scip + cp src/amplmp/LICENSE.rst $project/LICENSE.amplmp + cp src/cppad/COPYING $project/LICENSE.cppad + cp src/dejavu/LICENSE $project/LICENSE.dejavu + cp src/nauty/COPYRIGHT $project/LICENSE.nauty + cp src/tinycthread/COPYRIGHT $project/LICENSE.tinycthread + mkdir build + cd build + cmake .. --preset interface -DCMAKE_INSTALL_PREFIX=$ws/scip_install -DCMAKE_BUILD_TYPE=Release -DSHARED=ON -DLPS=spx -DSYM=snauty -DSOPLEX_DIR=$ws/scip_install -DPAPILO=false -DZIMPL=false -DGMP=false -DREADLINE=false -DIPOPT=true -DIPOPT_DIR=$ws/scip_install -DTPI=tny -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + make -j$(nproc) + make install - cd $ws - wget -q https://github.com/scipopt/scip/archive/refs/tags/v${{ env.SCIP_VERSION }}.zip - unzip -q v${{ env.SCIP_VERSION }}.zip - cd scip-${{ env.SCIP_VERSION }} - cp LICENSE $project/LICENSE.scip - cp src/amplmp/LICENSE.rst $project/LICENSE.amplmp - cp src/cppad/COPYING $project/LICENSE.cppad - cp src/dejavu/LICENSE $project/LICENSE.dejavu - cp src/nauty/COPYRIGHT $project/LICENSE.nauty - cp src/tinycthread/COPYRIGHT $project/LICENSE.tinycthread - mkdir build - cd build - cmake .. --preset interface -DCMAKE_INSTALL_PREFIX=$ws/scip_install -DCMAKE_BUILD_TYPE=Release -DSHARED=ON -DLPS=spx -DSYM=snauty -DSOPLEX_DIR=$ws/scip_install -DPAPILO=false -DZIMPL=false -DGMP=false -DREADLINE=false -DIPOPT=true -DIPOPT_DIR=$ws/scip_install -DTPI=tny -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - make -j$(nproc) - make install + cd $ws + mkdir -p scip_install/lib + rm -rf scip_install/lib64/cmake + mv scip_install/lib64/* scip_install/lib/. + # Ship only what upstream's libscip-linux.zip holds: an empty lib64/ makes setup.py link against it. + mkdir $project/scip + mv scip_install/lib scip_install/include scip_install/bin $project/scip/ + cibw-before-test: "pip install -r {project}/requirements/test.txt" + cibw-test-command: "pytest {project}/tests" - cd $ws - mkdir -p scip_install/lib - rm -rf scip_install/lib64/cmake - mv scip_install/lib64/* scip_install/lib/. - # Ship only what upstream's libscip-linux.zip holds: an empty lib64/ makes setup.py link against it. - mkdir $project/scip - mv scip_install/lib scip_install/include scip_install/bin $project/scip/ - CIBW_BEFORE_TEST: "pip install -r {project}/requirements/test.txt" - CIBW_TEST_COMMAND: "pytest {project}/tests" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 1440 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + PYSCIPOPT_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: pyscipopt-${{ env.PYSCIPOPT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and all licences run: | @@ -244,12 +252,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyscipopt-${{ env.PYSCIPOPT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -283,7 +285,7 @@ jobs: publish: name: Publish pyscipopt ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pysjef.yml b/.github/workflows/build-pysjef.yml index d5e108a5023b..8fbf3f16a88b 100644 --- a/.github/workflows/build-pysjef.yml +++ b/.github/workflows/build-pysjef.yml @@ -51,59 +51,63 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pysjef ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pysjef" + version: "${{ matrix.version }}" + repository: "molpro/sjef" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-fetch-depth: 0 + pre-build: |- + curl -sSfL -o LICENSE.pugixml https://raw.githubusercontent.com/zeux/pugixml/v1.15/LICENSE.md + curl -sSfL -o LICENSE.libyaml https://raw.githubusercontent.com/pjknowles/libyaml/master/License + curl -sSfL -o LICENSE.tclap https://raw.githubusercontent.com/molpro/tclap/61987f0d9de1680a2f971a7c40a1f578f65fa5de/COPYING + curl -sSfL -o LICENSE.boost https://www.boost.org/LICENSE_1_0.txt + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-before-all-linux: |- + set -eux && if command -v yum >/dev/null 2>&1; then + yum -y install libxml2-devel libxslt-devel; + elif command -v apt-get >/dev/null 2>&1; then + apt-get update && apt-get install -y libxml2-dev libxslt1-dev; + elif command -v apk >/dev/null 2>&1; then + apk add --no-cache libxml2-dev libxslt-dev; + fi + cibw-test-requires: "pytest" + cibw-test-sources: "src/pysjef/test" + # test_run_ssh needs the sshd upstream's CI container starts on localhost. + cibw-test-command: "python -c \"import pysjef; print(pysjef.__version__)\" && python -m pytest -v src/pysjef/test -k 'not test_run_ssh or test_run_ssh_bad'" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYSJEF_VERSION: ${{ matrix.version }} - steps: - - name: Checkout sjef ${{ env.PYSJEF_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: molpro/sjef - ref: ${{ env.PYSJEF_VERSION }} - fetch-depth: 0 - persist-credentials: false - - # The extension statically links pugixml, libyaml and tclap (all MIT), fetched - # by CMake at the refs pinned in src/sjef/CMakeLists.txt, and Boost (BSL-1.0) - # headers; scikit-build-core's default LICEN[CS]E* glob ships these too. - - name: Stage third-party licences - run: | - curl -sSfL -o LICENSE.pugixml https://raw.githubusercontent.com/zeux/pugixml/v1.15/LICENSE.md - curl -sSfL -o LICENSE.libyaml https://raw.githubusercontent.com/pjknowles/libyaml/master/License - curl -sSfL -o LICENSE.tclap https://raw.githubusercontent.com/molpro/tclap/61987f0d9de1680a2f971a7c40a1f578f65fa5de/COPYING - curl -sSfL -o LICENSE.boost https://www.boost.org/LICENSE_1_0.txt - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: > - set -eux && - if command -v yum >/dev/null 2>&1; then - yum -y install libxml2-devel libxslt-devel; - elif command -v apt-get >/dev/null 2>&1; then - apt-get update && apt-get install -y libxml2-dev libxslt1-dev; - elif command -v apk >/dev/null 2>&1; then - apk add --no-cache libxml2-dev libxslt-dev; - fi - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: src/pysjef/test - # test_run_ssh needs the sshd upstream's CI container starts on localhost. - CIBW_TEST_COMMAND: >- - python -c "import pysjef; print(pysjef.__version__)" && - python -m pytest -v src/pysjef/test -k 'not test_run_ssh or test_run_ssh_bad' + name: pysjef-${{ env.PYSJEF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension module and licences made it into the wheel run: | @@ -120,12 +124,6 @@ jobs: print('vendored:', [n for n in names if '.libs/' in n]) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pysjef-${{ env.PYSJEF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -160,7 +158,7 @@ jobs: publish: name: Publish pysjef ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyslang.yml b/.github/workflows/build-pyslang.yml index 9558674fa140..5b903d38b857 100644 --- a/.github/workflows/build-pyslang.yml +++ b/.github/workflows/build-pyslang.yml @@ -68,50 +68,60 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyslang ${{ matrix.version }} cp311-abi3-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 360 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: - PYSLANG_VERSION: ${{ matrix.version }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyslang" + version: "${{ matrix.version }}" + repository: "MikePopoloski/slang" + ref: '' + artifact-tag: "cp311-abi3-manylinux_riscv64" + timeout-minutes: 360 + checkout-fetch-depth: 0 + pre-build: |- + export FMT_TAG=12.1.0 + export PYBIND11_TAG=v3.0.4 + export BS_THREAD_POOL_TAG=v5.1.0 + ref="v${PYSLANG_VERSION%.0}" - steps: - # Upstream tags two components (v11.0) but the wheel says 11.0.0. - - id: tag - run: echo "ref=v${PYSLANG_VERSION%.0}" >> "$GITHUB_OUTPUT" + git fetch -q --no-tags origin "$ref" + git checkout -q --detach FETCH_HEAD - - name: Checkout slang ${{ steps.tag.outputs.ref }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: MikePopoloski/slang - ref: ${{ steps.tag.outputs.ref }} - # cmake/gitversion.cmake reads `git describe --tags` for the patch segment. - fetch-depth: 0 - persist-credentials: false + set -euo pipefail + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fmtlib/fmt/${FMT_TAG}/LICENSE" -o LICENSE.fmt + curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/${PYBIND11_TAG}/LICENSE" -o LICENSE.pybind11 + curl -fsSL --retry 5 "https://raw.githubusercontent.com/bshoshany/thread-pool/${BS_THREAD_POOL_TAG}/LICENSE.txt" -o LICENSE.bs-thread-pool + cp LICENSES/BSL-1.0.txt LICENSE.boost-headers - # fmt (MIT) and pybind11 (BSD-3-Clause) are fetched from source and compiled - # in, as are the vendored BS_thread_pool.hpp (MIT) and the Boost/expected-lite - # headers (BSL-1.0); upstream's `wheel.license-files = ["LICENSE"]` ships none - # of them, so stage each notice and widen the list. - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fmtlib/fmt/${FMT_TAG}/LICENSE" -o LICENSE.fmt - curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/${PYBIND11_TAG}/LICENSE" -o LICENSE.pybind11 - curl -fsSL --retry 5 "https://raw.githubusercontent.com/bshoshany/thread-pool/${BS_THREAD_POOL_TAG}/LICENSE.txt" -o LICENSE.bs-thread-pool - cp LICENSES/BSL-1.0.txt LICENSE.boost-headers + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp311-manylinux_riscv64" + cibw-environment-linux: "SKBUILD_WHEEL_LICENSE_FILES=\"LICENSE;LICENSE.boost-headers;LICENSE.bs-thread-pool;LICENSE.fmt;LICENSE.pybind11\"" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 360 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + env: + PYSLANG_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: cp311-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: 'SKBUILD_WHEEL_LICENSE_FILES="LICENSE;LICENSE.boost-headers;LICENSE.bs-thread-pool;LICENSE.fmt;LICENSE.pybind11"' + name: pyslang-${{ env.PYSLANG_VERSION }}-cp311-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -130,15 +140,9 @@ jobs: "LICENSE.fmt", "LICENSE.pybind11"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyslang-${{ env.PYSLANG_VERSION }}-cp311-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyslang ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pystack.yml b/.github/workflows/build-pystack.yml index 14fb9e5e8513..4724ae1c43ec 100644 --- a/.github/workflows/build-pystack.yml +++ b/.github/workflows/build-pystack.yml @@ -48,95 +48,105 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pystack ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pystack" + version: "${{ matrix.version }}" + repository: "bloomberg/pystack" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of everything that ends up inside the + # wheel: the elfutils built by upstream's before-all and every shared library + # auditwheel vendors out of the build image alongside it. + # scikit-build-core's default LICEN[CS]E* glob copies them into the wheel. + set -euo pipefail + + project="${1:?usage: collect-licenses.sh }" + + # The extension must link the elfutils before-all built, not a packaged one. + vers=$(pkg-config --modversion libdw) + [ -d "/elfutils-$vers" ] || + { echo "libdw $vers is not the elfutils built by before-all" >&2; exit 1; } + libdir=$(pkg-config --variable=libdir libdw) + + for f in "/elfutils-$vers"/COPYING*; do + cp "$f" "$project/LICENSE.elfutils.$(basename "$f")" + done + + mapfile -t libs < <( + LD_LIBRARY_PATH="$libdir" ldd "$libdir/libdw.so" "$libdir/libelf.so" | + awk '$2 == "=>" && $3 ~ /^\// { print $3 }' | + xargs -r readlink -f | sort -u + ) + + # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist and + # are never vendored into the wheel. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' || true + ) + + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi + + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done + + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-build-linux: "bash {project}/collect-licenses.sh {project}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYSTACK_VERSION: ${{ matrix.version }} - steps: - # Upstream builds from its sdist; the checkout is the same tree. - - name: Checkout pystack v${{ env.PYSTACK_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: bloomberg/pystack - ref: v${{ env.PYSTACK_VERSION }} - persist-credentials: false - - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of everything that ends up inside the - # wheel: the elfutils built by upstream's before-all and every shared library - # auditwheel vendors out of the build image alongside it. - # scikit-build-core's default LICEN[CS]E* glob copies them into the wheel. - set -euo pipefail - - project="${1:?usage: collect-licenses.sh }" - - # The extension must link the elfutils before-all built, not a packaged one. - vers=$(pkg-config --modversion libdw) - [ -d "/elfutils-$vers" ] || - { echo "libdw $vers is not the elfutils built by before-all" >&2; exit 1; } - libdir=$(pkg-config --variable=libdir libdw) - - for f in "/elfutils-$vers"/COPYING*; do - cp "$f" "$project/LICENSE.elfutils.$(basename "$f")" - done - - mapfile -t libs < <( - LD_LIBRARY_PATH="$libdir" ldd "$libdir/libdw.so" "$libdir/libelf.so" | - awk '$2 == "=>" && $3 ~ /^\// { print $3 }' | - xargs -r readlink -f | sort -u - ) - - # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist and - # are never vendored into the wheel. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' || true - ) - - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi - - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done - - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_BUILD_LINUX: bash {project}/collect-licenses.sh {project} + name: pystack-${{ env.PYSTACK_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension and its licences run: | @@ -154,12 +164,6 @@ jobs: assert any(n.startswith("LICENSE.libzstd.") for n in lic), lic EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pystack-${{ env.PYSTACK_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - test_wheels: needs: [setup, build_wheels] if: needs.setup.outputs.versions != '[]' @@ -216,10 +220,10 @@ jobs: # gotcha 616: riscv64's native-frame reporting can't find the CPython eval-loop or # GC-collecting frame on 3.13+ targets (28 identical failures on 3.13/3.14/3.14t, - # all pass on 3.12) — deselect only those tests on the affected interpreters. With + # all pass on 3.12) - deselect only those tests on the affected interpreters. With # PYTHON_TEST_VERSION=auto, pystack's tests id the target python from # sys.version_info[:2], which drops the free-threading suffix, so the 3.14t leg - # produces "python=3.14" ids, not "python=3.14t" — strip the trailing "t" before + # produces "python=3.14" ids, not "python=3.14t" - strip the trailing "t" before # substituting, or the free-threaded leg's deselects silently miss their targets. - name: Run pytest env: @@ -316,7 +320,7 @@ jobs: publish: name: Publish pystack ${{ matrix.version }} - needs: [setup, build_wheels, test_wheels, gpl_sources] + needs: [setup, build_wheels, test_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyswisseph.yml b/.github/workflows/build-pyswisseph.yml index cc5618c431be..b57b6051a744 100644 --- a/.github/workflows/build-pyswisseph.yml +++ b/.github/workflows/build-pyswisseph.yml @@ -52,92 +52,69 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyswisseph ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyswisseph" + version: "${{ matrix.version }}" + repository: "astrorigin/pyswisseph" + ref: '' + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "recursive" + pre-build: |- + export PYSWISSEPH_VERSION='${{ matrix.version }}' + IFS='.' read -r major minor patch build <<< "${PYSWISSEPH_VERSION}" + printf -v ref 'v%s.%s.%02d.%s' "$major" "$minor" "$patch" "$build" + + git fetch -q --no-tags origin "$ref" + git checkout -q --detach FETCH_HEAD + + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pyswisseph/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-test-requires: "pytest" + # Real coverage from the packaged suite (94/126 tests pass with no + # ephemeris data files present). The deselected tests all assert + # exact swe.FLG_SWIEPH-precision output (fixed-star catalog lookups, + # eclipse/rise/heliacal timings, ...), which without the multi-file + # Swiss Ephemeris dataset (a large download from Astrodienst, not + # bundled in the sdist or by upstream's own CI either) silently + # falls back to the lower-precision Moshier ephemeris and fails the + # exact-value assertions - not a riscv64-specific failure. + cibw-test-command: "pytest {package}/tests -v --deselect tests/test_swe_azalt_refrac.py::TestSweAzaltRefrac::test_01 --deselect tests/test_swe_calc.py::TestSweCalc::test_01 --deselect tests/test_swe_calc_pctr.py::TestSweCalcPctr::test_01 --deselect tests/test_swe_calc_ut.py::TestSweCalcUt::test_01 --deselect tests/test_swe_fixstar.py::TestSweFixstar::test_01 --deselect tests/test_swe_fixstar2.py::TestSweFixstar2::test_01 --deselect tests/test_swe_fixstar2_mag.py::TestSweFixstar2Mag::test_01 --deselect tests/test_swe_fixstar2_ut.py::TestSweFixstar2Ut::test_01 --deselect tests/test_swe_fixstar_mag.py::TestSweFixstarMag::test_01 --deselect tests/test_swe_fixstar_ut.py::TestSweFixstarUt::test_01 --deselect tests/test_swe_gauquelin_sector.py::TestSweGauquelinSector::test_01 --deselect tests/test_swe_gauquelin_sector.py::TestSweGauquelinSector::test_02 --deselect tests/test_swe_get_current_file_data.py::TestSweGetCurrentFileData::test_01 --deselect tests/test_swe_get_orbital_elements.py::TestSweGetOrbitalElements::test_01 --deselect tests/test_swe_heliacal_pheno_ut.py::TestSweHeliacalPhenoUt::test_01 --deselect tests/test_swe_helio_cross.py::TestSweHelioCross::test_01 --deselect tests/test_swe_helio_cross_ut.py::TestSweHelioCrossUt::test_01 --deselect tests/test_swe_house_pos.py::TestSweHousePos::test_01 --deselect tests/test_swe_lun_eclipse.py::TestSweLunEclipse::test_01 --deselect tests/test_swe_lun_occult.py::TestSweLunOccult::test_01 --deselect tests/test_swe_pheno.py::TestSwePheno::test_01 --deselect tests/test_swe_pheno_ut.py::TestSwePhenoUt::test_01 --deselect tests/test_swe_rise_trans.py::TestSweRiseTrans::test_01 --deselect tests/test_swe_rise_trans.py::TestSweRiseTrans::test_02 --deselect tests/test_swe_rise_trans_true_hor.py::TestSweRiseTrans::test_01 --deselect tests/test_swe_rise_trans_true_hor.py::TestSweRiseTrans::test_02 --deselect tests/test_swe_set_sid_mode.py::TestSweSetSidMode::test_01 --deselect tests/test_swe_set_topo.py::TestSweSetTopo::test_01 --deselect tests/test_swe_sol_eclipse.py::TestSweSolEclipse::test_01 --deselect tests/test_swe_solcross.py::TestSweSolcross::test_01 --deselect tests/test_swe_solcross_ut.py::TestSweSolcrossUt::test_01 --deselect tests/test_swe_vis_limit_mag.py::TestSweVisLimitMag::test_01" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYSWISSEPH_VERSION: ${{ matrix.version }} - steps: - # Git tags zero-pad the third (swisseph library) version segment - # that the PyPI version doesn't (v2.10.03.2 vs. 2.10.3.2). - - name: Compute upstream git tag - id: tag - run: | - set -euo pipefail - IFS='.' read -r major minor patch build <<< "${PYSWISSEPH_VERSION}" - echo "value=v${major}.${minor}.$(printf '%02d' "${patch}").${build}" >> "$GITHUB_OUTPUT" - - - name: Checkout pyswisseph ${{ steps.tag.outputs.value }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: astrorigin/pyswisseph - ref: ${{ steps.tag.outputs.value }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch pyswisseph source - run: git apply python-wheels/patches/pyswisseph/${{ env.PYSWISSEPH_VERSION }}/00*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pytest - # Real coverage from the packaged suite (94/126 tests pass with no - # ephemeris data files present). The deselected tests all assert - # exact swe.FLG_SWIEPH-precision output (fixed-star catalog lookups, - # eclipse/rise/heliacal timings, ...), which without the multi-file - # Swiss Ephemeris dataset (a large download from Astrodienst, not - # bundled in the sdist or by upstream's own CI either) silently - # falls back to the lower-precision Moshier ephemeris and fails the - # exact-value assertions - not a riscv64-specific failure. - CIBW_TEST_COMMAND: >- - pytest {package}/tests -v - --deselect tests/test_swe_azalt_refrac.py::TestSweAzaltRefrac::test_01 - --deselect tests/test_swe_calc.py::TestSweCalc::test_01 - --deselect tests/test_swe_calc_pctr.py::TestSweCalcPctr::test_01 - --deselect tests/test_swe_calc_ut.py::TestSweCalcUt::test_01 - --deselect tests/test_swe_fixstar.py::TestSweFixstar::test_01 - --deselect tests/test_swe_fixstar2.py::TestSweFixstar2::test_01 - --deselect tests/test_swe_fixstar2_mag.py::TestSweFixstar2Mag::test_01 - --deselect tests/test_swe_fixstar2_ut.py::TestSweFixstar2Ut::test_01 - --deselect tests/test_swe_fixstar_mag.py::TestSweFixstarMag::test_01 - --deselect tests/test_swe_fixstar_ut.py::TestSweFixstarUt::test_01 - --deselect tests/test_swe_gauquelin_sector.py::TestSweGauquelinSector::test_01 - --deselect tests/test_swe_gauquelin_sector.py::TestSweGauquelinSector::test_02 - --deselect tests/test_swe_get_current_file_data.py::TestSweGetCurrentFileData::test_01 - --deselect tests/test_swe_get_orbital_elements.py::TestSweGetOrbitalElements::test_01 - --deselect tests/test_swe_heliacal_pheno_ut.py::TestSweHeliacalPhenoUt::test_01 - --deselect tests/test_swe_helio_cross.py::TestSweHelioCross::test_01 - --deselect tests/test_swe_helio_cross_ut.py::TestSweHelioCrossUt::test_01 - --deselect tests/test_swe_house_pos.py::TestSweHousePos::test_01 - --deselect tests/test_swe_lun_eclipse.py::TestSweLunEclipse::test_01 - --deselect tests/test_swe_lun_occult.py::TestSweLunOccult::test_01 - --deselect tests/test_swe_pheno.py::TestSwePheno::test_01 - --deselect tests/test_swe_pheno_ut.py::TestSwePhenoUt::test_01 - --deselect tests/test_swe_rise_trans.py::TestSweRiseTrans::test_01 - --deselect tests/test_swe_rise_trans.py::TestSweRiseTrans::test_02 - --deselect tests/test_swe_rise_trans_true_hor.py::TestSweRiseTrans::test_01 - --deselect tests/test_swe_rise_trans_true_hor.py::TestSweRiseTrans::test_02 - --deselect tests/test_swe_set_sid_mode.py::TestSweSetSidMode::test_01 - --deselect tests/test_swe_set_topo.py::TestSweSetTopo::test_01 - --deselect tests/test_swe_sol_eclipse.py::TestSweSolEclipse::test_01 - --deselect tests/test_swe_solcross.py::TestSweSolcross::test_01 - --deselect tests/test_swe_solcross_ut.py::TestSweSolcrossUt::test_01 - --deselect tests/test_swe_vis_limit_mag.py::TestSweVisLimitMag::test_01 + name: pyswisseph-${{ env.PYSWISSEPH_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -152,15 +129,9 @@ jobs: assert licences == {"LICENSE.txt", "libswe/LICENSE", "swephelp/LICENSE.txt"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyswisseph-${{ env.PYSWISSEPH_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyswisseph ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pytest-mergify.yml b/.github/workflows/build-pytest-mergify.yml index a847b6165661..e597da99cbd6 100644 --- a/.github/workflows/build-pytest-mergify.yml +++ b/.github/workflows/build-pytest-mergify.yml @@ -57,87 +57,96 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pytest-mergify ${{ matrix.version }} cp39-abi3-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 360 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: - PYTEST_MERGIFY_VERSION: ${{ matrix.version }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pytest-mergify" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 360 + pre-build: |- + export PYTEST_MERGIFY_VERSION='${{ matrix.version }}' + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - steps: - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + url="$(curl -sSfL "https://pypi.org/pypi/pytest-mergify/${PYTEST_MERGIFY_VERSION}/json" \ + | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" + curl -sSfL -o sdist.tar.gz "$url" + tar xzf sdist.tar.gz + test -f "pytest_mergify-${PYTEST_MERGIFY_VERSION}/pyproject.toml" - - name: Fetch pytest-mergify ${{ env.PYTEST_MERGIFY_VERSION }} sdist - run: | - url="$(curl -sSfL "https://pypi.org/pypi/pytest-mergify/${PYTEST_MERGIFY_VERSION}/json" \ - | python3 -c 'import json,sys; print(next(u["url"] for u in json.load(sys.stdin)["urls"] if u["packagetype"] == "sdist"))')" - curl -sSfL -o sdist.tar.gz "$url" - tar xzf sdist.tar.gz - test -f "pytest_mergify-${PYTEST_MERGIFY_VERSION}/pyproject.toml" + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Patch pytest-mergify source - run: git apply -p1 --directory "pytest_mergify-${PYTEST_MERGIFY_VERSION}" python-wheels/patches/pytest-mergify/${{ env.PYTEST_MERGIFY_VERSION }}/*.patch + git apply -p1 --directory "pytest_mergify-${PYTEST_MERGIFY_VERSION}" python-wheels/patches/pytest-mergify/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "pytest_mergify-${{ matrix.version }}" + # pyo3's abi3-py39 feature (patched from upstream's abi3-py38 -- + # gotcha 96) is on unconditionally, so one cp39-abi3 wheel serves + # every GIL-ful interpreter; upstream ships no free-threaded wheel + # because abi3 and Py_GIL_DISABLED only meet on 3.14+. cibuildwheel + # compiles once on cp39 -- the riscv64 image's oldest interpreter -- + # and re-tests that wheel on the newer ones. musllinux is dropped: + # rustup.rs ships no riscv64 musl toolchain. + cibw-build: "cp39-manylinux_riscv64 cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # pyproject.toml ships no [tool.cibuildwheel], so the Rust toolchain + # its maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest-timeout pytest-xdist freezegun anys opentelemetry-proto>=1.29" + # Relative to cwd (the workspace root, where the sdist was + # extracted beside python-wheels/), not to package-dir -- + # copy_test_sources() resolves CIBW_TEST_SOURCES against the + # former (gotcha 156). + cibw-test-sources: "pytest_mergify-${{ matrix.version }}/clients/pytest-mergify/tests" + # PYTHONNODEBUGRANGES=1 turns off PEP 657 fine-grained error + # locations (the caret-underline line under a failing statement): + # without it, tests/test_spans.py::test_test_failure's expected + # span attributes (recorded without that line) mismatch the + # traceback pytest renders on 3.11+, on every interpreter here. + # + # test_ci_insights.py's flaky-detection tests repeat a trivial + # assertion for as long as a fixed 4-second CPU-time budget lasts, + # then assert the exact iteration count that produced ("tested 717 + # times" vs. an expected 1001+) - a function of host CPU speed, not + # of this port. Deselected rather than patched: nothing here is + # riscv64-specific, and a hardcoded count would just as likely fail + # on any other sufficiently slower host. + cibw-test-command: "env PYTHONNODEBUGRANGES=1 python -m pytest -v pytest_mergify-${{ matrix.version }}/clients/pytest-mergify/tests --deselect pytest_mergify-${{ matrix.version }}/clients/pytest-mergify/tests/test_ci_insights.py::test_flaky_detection_for_new_tests --deselect pytest_mergify-${{ matrix.version }}/clients/pytest-mergify/tests/test_ci_insights.py::test_flaky_detection_for_unhealthy_tests --deselect pytest_mergify-${{ matrix.version }}/clients/pytest-mergify/tests/test_ci_insights.py::test_flaky_detection_with_fixtures --deselect pytest_mergify-${{ matrix.version }}/clients/pytest-mergify/tests/test_ci_insights.py::test_flaky_detection_with_only_one_new_test_at_the_end --deselect pytest_mergify-${{ matrix.version }}/clients/pytest-mergify/tests/test_ci_insights.py::test_flaky_detection_slow_test_not_reran --deselect pytest_mergify-${{ matrix.version }}/clients/pytest-mergify/tests/test_ci_insights.py::test_flaky_detection_excludes_opted_out_tests" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 360 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + env: + PYTEST_MERGIFY_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - package-dir: pytest_mergify-${{ env.PYTEST_MERGIFY_VERSION }} - env: - # pyo3's abi3-py39 feature (patched from upstream's abi3-py38 -- - # gotcha 96) is on unconditionally, so one cp39-abi3 wheel serves - # every GIL-ful interpreter; upstream ships no free-threaded wheel - # because abi3 and Py_GIL_DISABLED only meet on 3.14+. cibuildwheel - # compiles once on cp39 -- the riscv64 image's oldest interpreter -- - # and re-tests that wheel on the newer ones. musllinux is dropped: - # rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: >- - cp39-manylinux_riscv64 cp310-manylinux_riscv64 - cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # pyproject.toml ships no [tool.cibuildwheel], so the Rust toolchain - # its maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_REQUIRES: >- - pytest-timeout pytest-xdist freezegun anys - opentelemetry-proto>=1.29 - # Relative to cwd (the workspace root, where the sdist was - # extracted beside python-wheels/), not to package-dir -- - # copy_test_sources() resolves CIBW_TEST_SOURCES against the - # former (gotcha 156). - CIBW_TEST_SOURCES: pytest_mergify-${{ env.PYTEST_MERGIFY_VERSION }}/clients/pytest-mergify/tests - # PYTHONNODEBUGRANGES=1 turns off PEP 657 fine-grained error - # locations (the caret-underline line under a failing statement): - # without it, tests/test_spans.py::test_test_failure's expected - # span attributes (recorded without that line) mismatch the - # traceback pytest renders on 3.11+, on every interpreter here. - # - # test_ci_insights.py's flaky-detection tests repeat a trivial - # assertion for as long as a fixed 4-second CPU-time budget lasts, - # then assert the exact iteration count that produced ("tested 717 - # times" vs. an expected 1001+) - a function of host CPU speed, not - # of this port. Deselected rather than patched: nothing here is - # riscv64-specific, and a hardcoded count would just as likely fail - # on any other sufficiently slower host. - CIBW_TEST_COMMAND: >- - env PYTHONNODEBUGRANGES=1 python -m pytest -v - pytest_mergify-${{ env.PYTEST_MERGIFY_VERSION }}/clients/pytest-mergify/tests - --deselect pytest_mergify-${{ env.PYTEST_MERGIFY_VERSION }}/clients/pytest-mergify/tests/test_ci_insights.py::test_flaky_detection_for_new_tests - --deselect pytest_mergify-${{ env.PYTEST_MERGIFY_VERSION }}/clients/pytest-mergify/tests/test_ci_insights.py::test_flaky_detection_for_unhealthy_tests - --deselect pytest_mergify-${{ env.PYTEST_MERGIFY_VERSION }}/clients/pytest-mergify/tests/test_ci_insights.py::test_flaky_detection_with_fixtures - --deselect pytest_mergify-${{ env.PYTEST_MERGIFY_VERSION }}/clients/pytest-mergify/tests/test_ci_insights.py::test_flaky_detection_with_only_one_new_test_at_the_end - --deselect pytest_mergify-${{ env.PYTEST_MERGIFY_VERSION }}/clients/pytest-mergify/tests/test_ci_insights.py::test_flaky_detection_slow_test_not_reran - --deselect pytest_mergify-${{ env.PYTEST_MERGIFY_VERSION }}/clients/pytest-mergify/tests/test_ci_insights.py::test_flaky_detection_excludes_opted_out_tests + name: pytest-mergify-${{ env.PYTEST_MERGIFY_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -150,15 +159,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pytest-mergify-${{ env.PYTEST_MERGIFY_VERSION }}-cp39-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pytest-mergify ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pytetwild.yml b/.github/workflows/build-pytetwild.yml index 19fde9f58cb1..bffb106cb6e0 100644 --- a/.github/workflows/build-pytetwild.yml +++ b/.github/workflows/build-pytetwild.yml @@ -49,81 +49,85 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pytetwild ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pytetwild" + version: "${{ matrix.version }}" + repository: "pyvista/pytetwild" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + checkout-submodules: "true" + pre-build: |- + sed -i 's|GEO_PLATFORM "Linux64-gcc"|GEO_PLATFORM "Linux64-gcc-aarch64"|' src/fTetWild/cmake/FloatTetwildDependencies.cmake + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + sed -i 's|GIT_TAG v2022.2.0|GIT_TAG v2022.3.0|' src/fTetWild/cmake/FloatTetwildDependencies.cmake + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + set -euo pipefail + cp src/fTetWild/LICENSE.MPL2 LICENSE.ftetwild + sed -n '1,6p' src/fTetWild/src/external/getRSS.c > LICENSE.getrss + curl -fsSL --retry 5 "https://raw.githubusercontent.com/libigl/libigl/v2.6.0/LICENSE.MPL2" -o LICENSE.libigl + { + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.README" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.BSD" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.LGPL" + } > LICENSE.eigen + curl -fsSL --retry 5 "https://raw.githubusercontent.com/libigl/libigl-predicates/decb7bc1260e689cbe008109e3cc5d3a5a433aea/predicates.c" | sed -n '1,16p' > LICENSE.predicates + curl -fsSL --retry 5 "https://raw.githubusercontent.com/BrunoLevy/geogram/v1.9.6/LICENSE" -o LICENSE.geogram + curl -fsSL --retry 5 "https://raw.githubusercontent.com/BrunoLevy/geogram/v1.9.6/src/lib/geogram/third_party/zlib/LICENSE" -o LICENSE.geogram-zlib + curl -fsSL --retry 5 "https://raw.githubusercontent.com/BrunoLevy/geogram/v1.9.6/src/lib/geogram/third_party/PoissonRecon/LICENSE.txt" -o LICENSE.poissonrecon + curl -fsSL --retry 5 "https://raw.githubusercontent.com/BrunoLevy/geogram/v1.9.6/src/lib/geogram/third_party/xatlas/xatlas.h" | sed -n '1,30p' > LICENSE.xatlas + curl -fsSL --retry 5 "https://raw.githubusercontent.com/LoicMarechal/libMeshb/952a157c9d516b28cc6c69cd1550c3e48d4792f9/LICENSE.txt" -o LICENSE.libmeshb + curl -fsSL --retry 5 "https://raw.githubusercontent.com/diegonehab/rply/4296cc91b5c8c26d4e7d7aac0cee2b194ffc5800/LICENSE" -o LICENSE.rply + curl -fsSL --retry 5 "https://raw.githubusercontent.com/ddemidov/amgcl/ab57038d68ee372ed5df280631051b91f17ed2d1/LICENSE.md" -o LICENSE.amgcl + curl -fsSL --retry 5 "https://raw.githubusercontent.com/oneapi-src/oneTBB/v2022.3.0/LICENSE.txt" -o LICENSE.onetbb + curl -fsSL --retry 5 "https://raw.githubusercontent.com/fmtlib/fmt/11.2.0/LICENSE" -o LICENSE.fmt + curl -fsSL --retry 5 "https://raw.githubusercontent.com/gabime/spdlog/v1.15.3/LICENSE" -o LICENSE.spdlog + curl -fsSL --retry 5 "https://raw.githubusercontent.com/jdumas/json/0901d33bf6e7dfe6f70fd9d142c8f5c6695c6c5b/LICENSE.MIT" -o LICENSE.json + curl -fsSL --retry 5 "https://raw.githubusercontent.com/wjakob/nanobind/v3.1.0/LICENSE" -o LICENSE.nanobind + curl -fsSL --retry 5 "https://raw.githubusercontent.com/Tessil/robin-map/v1.4.0/LICENSE" -o LICENSE.robin-map + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "yum install -y gmp-devel && cat /usr/share/licenses/gmp/COPYING.LESSERv3 /usr/share/licenses/gmp/COPYINGv3 > /project/LICENSE.gmp" + cibw-environment-linux: "PIP_ONLY_BINARY=cmake SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTETWILD=${{ matrix.version }}" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYTETWILD_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pytetwild v${{ env.PYTETWILD_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pyvista/pytetwild - ref: v${{ env.PYTETWILD_VERSION }} - submodules: true - persist-credentials: false - - # Upstream's before-build does this for aarch64 only: geogram's default - # Linux64-gcc platform adds -m64, which riscv64 GCC rejects too. - - name: Select geogram's non-x86 platform - run: sed -i 's|GEO_PLATFORM "Linux64-gcc"|GEO_PLATFORM "Linux64-gcc-aarch64"|' src/fTetWild/cmake/FloatTetwildDependencies.cmake - - # oneTBB v2022.2.0 adds -fcf-protection=full on every non-aarch64 target, - # which riscv64 GCC rejects; v2022.3.0 is the first to gate it to x86. - - name: Bump oneTBB to v2022.3.0 - run: sed -i 's|GIT_TAG v2022.2.0|GIT_TAG v2022.3.0|' src/fTetWild/cmake/FloatTetwildDependencies.cmake - - # fTetWild FetchContent-pulls libigl/Eigen/libigl-predicates/geogram (with - # its compiled-in third_party code)/oneTBB/fmt/spdlog/json, and nanobind - # (with robin-map) comes from the build requirements; all are linked - # statically, while upstream's wheel ships only its own LICENSE. Stage - # each at the root for scikit-build-core's default license-files glob. - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - cp src/fTetWild/LICENSE.MPL2 LICENSE.ftetwild - sed -n '1,6p' src/fTetWild/src/external/getRSS.c > LICENSE.getrss - curl -fsSL --retry 5 "https://raw.githubusercontent.com/libigl/libigl/v2.6.0/LICENSE.MPL2" -o LICENSE.libigl - { - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.README" - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2" - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.BSD" - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.LGPL" - } > LICENSE.eigen - curl -fsSL --retry 5 "https://raw.githubusercontent.com/libigl/libigl-predicates/decb7bc1260e689cbe008109e3cc5d3a5a433aea/predicates.c" | sed -n '1,16p' > LICENSE.predicates - curl -fsSL --retry 5 "https://raw.githubusercontent.com/BrunoLevy/geogram/v1.9.6/LICENSE" -o LICENSE.geogram - curl -fsSL --retry 5 "https://raw.githubusercontent.com/BrunoLevy/geogram/v1.9.6/src/lib/geogram/third_party/zlib/LICENSE" -o LICENSE.geogram-zlib - curl -fsSL --retry 5 "https://raw.githubusercontent.com/BrunoLevy/geogram/v1.9.6/src/lib/geogram/third_party/PoissonRecon/LICENSE.txt" -o LICENSE.poissonrecon - curl -fsSL --retry 5 "https://raw.githubusercontent.com/BrunoLevy/geogram/v1.9.6/src/lib/geogram/third_party/xatlas/xatlas.h" | sed -n '1,30p' > LICENSE.xatlas - curl -fsSL --retry 5 "https://raw.githubusercontent.com/LoicMarechal/libMeshb/952a157c9d516b28cc6c69cd1550c3e48d4792f9/LICENSE.txt" -o LICENSE.libmeshb - curl -fsSL --retry 5 "https://raw.githubusercontent.com/diegonehab/rply/4296cc91b5c8c26d4e7d7aac0cee2b194ffc5800/LICENSE" -o LICENSE.rply - curl -fsSL --retry 5 "https://raw.githubusercontent.com/ddemidov/amgcl/ab57038d68ee372ed5df280631051b91f17ed2d1/LICENSE.md" -o LICENSE.amgcl - curl -fsSL --retry 5 "https://raw.githubusercontent.com/oneapi-src/oneTBB/v2022.3.0/LICENSE.txt" -o LICENSE.onetbb - curl -fsSL --retry 5 "https://raw.githubusercontent.com/fmtlib/fmt/11.2.0/LICENSE" -o LICENSE.fmt - curl -fsSL --retry 5 "https://raw.githubusercontent.com/gabime/spdlog/v1.15.3/LICENSE" -o LICENSE.spdlog - curl -fsSL --retry 5 "https://raw.githubusercontent.com/jdumas/json/0901d33bf6e7dfe6f70fd9d142c8f5c6695c6c5b/LICENSE.MIT" -o LICENSE.json - curl -fsSL --retry 5 "https://raw.githubusercontent.com/wjakob/nanobind/v3.1.0/LICENSE" -o LICENSE.nanobind - curl -fsSL --retry 5 "https://raw.githubusercontent.com/Tessil/robin-map/v1.4.0/LICENSE" -o LICENSE.robin-map - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - yum install -y gmp-devel && - cat /usr/share/licenses/gmp/COPYING.LESSERv3 /usr/share/licenses/gmp/COPYINGv3 > /project/LICENSE.gmp - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=cmake - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTETWILD=${{ env.PYTETWILD_VERSION }} + name: pytetwild-${{ env.PYTETWILD_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -145,12 +149,6 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pytetwild-${{ env.PYTETWILD_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - test_wheels: needs: [setup, build_wheels] if: needs.setup.outputs.versions != '[]' @@ -237,7 +235,7 @@ jobs: publish: name: Publish pytetwild ${{ matrix.version }} - needs: [setup, build_wheels, test_wheels, gpl_sources] + needs: [setup, build_wheels, test_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-python-active-directory.yml b/.github/workflows/build-python-active-directory.yml index eea1808fc86d..2af33853278c 100644 --- a/.github/workflows/build-python-active-directory.yml +++ b/.github/workflows/build-python-active-directory.yml @@ -49,112 +49,124 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build python-active-directory ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "python-active-directory" + version: "${{ matrix.version }}" + repository: "theatlantic/python-active-directory" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/python-active-directory/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of every shared library + # auditwheel vendors out of the build image alongside the krb5.c + # extension (the MIT Kerberos stack). setuptools' default + # LICEN[CS]E* glob copies them into the wheel. + set -euo pipefail + + project="${1:?usage: collect-licenses.sh }" + + mapfile -t libs < <( + ldd /usr/lib64/libkrb5.so | tr ' ' '\n' | grep '^/' + readlink -f /usr/lib64/libkrb5.so + ) + mapfile -t libs < <(printf '%s\n' "${libs[@]}" | sort -u) + + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' + ) + + for pkg in "${pkgs[@]}"; do + rpm -q --qf '%{NAME}: %{LICENSE}\n' "$pkg" + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi + + if [ -z "${files[0]:-}" ]; then + dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi + + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done + + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # krb5-devel builds our own extension; openldap-devel/cyrus-sasl-devel + # are for python-ldap (install_requires, no riscv64 wheel anywhere - + # it builds from its sdist whenever pip resolves it, here and for + # every consumer on this registry). + cibw-before-all-linux: "dnf -y install krb5-devel openldap-devel cyrus-sasl-devel && bash {project}/collect-licenses.sh {project}" + cibw-test-requires: "pytest pexpect" + # tests/ is a package whose sibling lib/ source dir would shadow the + # installed wheel (gotcha 25). + cibw-test-sources: "tests" + # Default tests/test.conf.example disables readonly/intrusive AD + # tests (conf.require() skips them), so the suite needs no real + # Active Directory server - matches upstream's own tox.ini. + cibw-test-command: "python -m pytest -q -ra tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYTHON_ACTIVE_DIRECTORY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout python-active-directory v${{ env.PYTHON_ACTIVE_DIRECTORY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: theatlantic/python-active-directory - ref: v${{ env.PYTHON_ACTIVE_DIRECTORY_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/python-active-directory/${{ env.PYTHON_ACTIVE_DIRECTORY_VERSION }}/*.patch - - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of every shared library - # auditwheel vendors out of the build image alongside the krb5.c - # extension (the MIT Kerberos stack). setuptools' default - # LICEN[CS]E* glob copies them into the wheel. - set -euo pipefail - - project="${1:?usage: collect-licenses.sh }" - - mapfile -t libs < <( - ldd /usr/lib64/libkrb5.so | tr ' ' '\n' | grep '^/' - readlink -f /usr/lib64/libkrb5.so - ) - mapfile -t libs < <(printf '%s\n' "${libs[@]}" | sort -u) - - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' - ) - - for pkg in "${pkgs[@]}"; do - rpm -q --qf '%{NAME}: %{LICENSE}\n' "$pkg" - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi - - if [ -z "${files[0]:-}" ]; then - dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi - - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done - - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # krb5-devel builds our own extension; openldap-devel/cyrus-sasl-devel - # are for python-ldap (install_requires, no riscv64 wheel anywhere - - # it builds from its sdist whenever pip resolves it, here and for - # every consumer on this registry). - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install krb5-devel openldap-devel cyrus-sasl-devel && - bash {project}/collect-licenses.sh {project} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest pexpect - # tests/ is a package whose sibling lib/ source dir would shadow the - # installed wheel (gotcha 25). - CIBW_TEST_SOURCES: tests - # Default tests/test.conf.example disables readonly/intrusive AD - # tests (conf.require() skips them), so the suite needs no real - # Active Directory server - matches upstream's own tox.ini. - CIBW_TEST_COMMAND: python -m pytest -q -ra tests + name: python-active-directory-${{ env.PYTHON_ACTIVE_DIRECTORY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and the licences run: | @@ -170,12 +182,6 @@ jobs: assert "krb5-libs" in pkgs, pkgs EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: python-active-directory-${{ env.PYTHON_ACTIVE_DIRECTORY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -211,7 +217,7 @@ jobs: publish: name: Publish python-active-directory ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-python-bidi.yml b/.github/workflows/build-python-bidi.yml index e4c1c45ac47d..af10921cd815 100644 --- a/.github/workflows/build-python-bidi.yml +++ b/.github/workflows/build-python-bidi.yml @@ -49,42 +49,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build python-bidi ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "python-bidi" + version: "${{ matrix.version }}" + repository: "MeirKriheli/python-bidi" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + # musllinux is out of reach: rustup publishes rust-std but no rustc/cargo + # host toolchain for riscv64gc-unknown-linux-musl. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # python-bidi ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYTHON_BIDI_VERSION: ${{ matrix.version }} - steps: - - name: Checkout python-bidi ${{ env.PYTHON_BIDI_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: MeirKriheli/python-bidi - ref: v${{ env.PYTHON_BIDI_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # musllinux is out of reach: rustup publishes rust-std but no rustc/cargo - # host toolchain for riscv64gc-unknown-linux-musl. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # python-bidi ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | - sh -s -- -y --profile minimal - CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"' - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest tests + name: python-bidi-${{ env.PYTHON_BIDI_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension module made it into the wheel run: | @@ -97,15 +102,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: python-bidi-${{ env.PYTHON_BIDI_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish python-bidi ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-python-crfsuite.yml b/.github/workflows/build-python-crfsuite.yml index 44be8006a6a2..c34a44e93971 100644 --- a/.github/workflows/build-python-crfsuite.yml +++ b/.github/workflows/build-python-crfsuite.yml @@ -49,33 +49,39 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build python-crfsuite ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "python-crfsuite" + version: "${{ matrix.version }}" + repository: "scrapinghub/python-crfsuite" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "true" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pytest" + cibw-test-command: "pytest {project}/tests --doctest-modules" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PYTHON_CRFSUITE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout python-crfsuite ${{ env.PYTHON_CRFSUITE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: scrapinghub/python-crfsuite - ref: ${{ env.PYTHON_CRFSUITE_VERSION }} - submodules: true - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest {project}/tests --doctest-modules + name: python-crfsuite-${{ env.PYTHON_CRFSUITE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extension made it into the wheel run: | @@ -87,15 +93,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: python-crfsuite-${{ env.PYTHON_CRFSUITE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish python-crfsuite ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-python-flint.yml b/.github/workflows/build-python-flint.yml index 188dbfa0711f..bd43c1b81043 100644 --- a/.github/workflows/build-python-flint.yml +++ b/.github/workflows/build-python-flint.yml @@ -50,52 +50,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build python-flint ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "python-flint" + version: "${{ matrix.version }}" + repository: "flintlib/python-flint" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/python-flint/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Restates upstream's [tool.cibuildwheel.linux.environment], which + # CIBW_ENVIRONMENT replaces wholesale. PIP_EXTRA_INDEX_URL resolves + # the meson-python/cython/ninja build requirements, which have no + # riscv64 wheel on PyPI. + cibw-environment-linux: "LD_LIBRARY_PATH=$(pwd)/.local/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=$(pwd)/.local/lib/pkgconfig" + cibw-test-command: "python -m flint.test -q" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYTHON_FLINT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout python-flint ${{ env.PYTHON_FLINT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: flintlib/python-flint - ref: ${{ env.PYTHON_FLINT_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # pyproject.toml's [tool.cibuildwheel.linux] before-all dispatches to - # bin/cibw_before_all_linux_$(uname -m).sh, which only exists for - # x86_64/aarch64 upstream. - - name: Patch python-flint source - run: git apply python-wheels/patches/python-flint/${{ env.PYTHON_FLINT_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Restates upstream's [tool.cibuildwheel.linux.environment], which - # CIBW_ENVIRONMENT replaces wholesale. PIP_EXTRA_INDEX_URL resolves - # the meson-python/cython/ninja build requirements, which have no - # riscv64 wheel on PyPI. - CIBW_ENVIRONMENT: >- - LD_LIBRARY_PATH=$(pwd)/.local/lib:$LD_LIBRARY_PATH - PKG_CONFIG_PATH=$(pwd)/.local/lib/pkgconfig - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_COMMAND: python -m flint.test -q + name: python-flint-${{ env.PYTHON_FLINT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -108,15 +113,9 @@ jobs: print(whl, sorted(got)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: python-flint-${{ env.PYTHON_FLINT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish python-flint ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-python-geohash.yml b/.github/workflows/build-python-geohash.yml index dc535ca938f8..45a102fe69d5 100644 --- a/.github/workflows/build-python-geohash.yml +++ b/.github/workflows/build-python-geohash.yml @@ -58,38 +58,42 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build python-geohash ${{ matrix.version }} cp312-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "python-geohash" + version: "${{ matrix.version }}" + repository: "hkwi/python-geohash" + ref: "1159f4f751d3c97406d8af016d7b4119aa03b8a3" + artifact-tag: "cp312-abi3-manylinux_riscv64" + timeout-minutes: 90 + # setup.py hardcodes cp38-abi3, so cibuildwheel compiles once for + # cp312 and reuses+tests that wheel for cp313/cp314. No cp314t: pyo3's + # abi3 feature cannot build for Py_GIL_DISABLED (verified locally), + # and upstream ships no free-threaded wheel either. + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import geohash; assert geohash._geohash.__file__.endswith('.so'), geohash._geohash.__file__\" && pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: GEOHASH_VERSION: ${{ matrix.version }} - steps: - - name: Checkout python-geohash ${{ env.GEOHASH_REF }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: hkwi/python-geohash - ref: ${{ env.GEOHASH_REF }} - persist-credentials: false - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # setup.py hardcodes cp38-abi3, so cibuildwheel compiles once for - # cp312 and reuses+tests that wheel for cp313/cp314. No cp314t: pyo3's - # abi3 feature cannot build for Py_GIL_DISABLED (verified locally), - # and upstream ships no free-threaded wheel either. - CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import geohash; assert geohash._geohash.__file__.endswith('.so'), geohash._geohash.__file__" && - pytest tests + name: python-geohash-${{ env.GEOHASH_VERSION }}-cp312-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension and license made it into the wheel run: | @@ -102,15 +106,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: python-geohash-${{ env.GEOHASH_VERSION }}-cp312-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish python-geohash ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-python-kadmin-rs.yml b/.github/workflows/build-python-kadmin-rs.yml index 0d2f71f6a169..259f0a14b77d 100644 --- a/.github/workflows/build-python-kadmin-rs.yml +++ b/.github/workflows/build-python-kadmin-rs.yml @@ -70,11 +70,7 @@ jobs: CFLAGS="-O2 -fpermissive" LIBS=-lcrypt ./configure --prefix=/usr/lib64/heimdal --disable-static --without-x --without-openldap --disable-otp && make -j$(nproc) && make install - cibw-environment-linux: >- - PATH="$HOME/.cargo/bin:$PATH" - KADMIN_HEIMDAL_CLIENT_KRB5_CONFIG=/usr/lib64/heimdal/bin/krb5-config - KADMIN_HEIMDAL_SERVER_KRB5_CONFIG=/usr/lib64/heimdal/bin/krb5-config - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PATH=\"$HOME/.cargo/bin:$PATH\" KADMIN_HEIMDAL_CLIENT_KRB5_CONFIG=/usr/lib64/heimdal/bin/krb5-config KADMIN_HEIMDAL_SERVER_KRB5_CONFIG=/usr/lib64/heimdal/bin/krb5-config" cibw-test-requires: k5test@git+https://github.com/pythongssapi/k5test.git@349b79ecdff9a3ec00441c467511ff03e92450c9 cibw-test-sources: python/tests cibw-test-command: >- diff --git a/.github/workflows/build-python-pkcs11.yml b/.github/workflows/build-python-pkcs11.yml index c1ea9ab8d06a..0b1c63fbfd56 100644 --- a/.github/workflows/build-python-pkcs11.yml +++ b/.github/workflows/build-python-pkcs11.yml @@ -72,10 +72,7 @@ jobs: make install mkdir -p /opt/softhsm_tokens echo "directories.tokendir = /opt/softhsm_tokens" > /opt/softhsm2.conf - cibw-environment: >- - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTHON_PKCS11=${{ matrix.version }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - SOFTHSM2_CONF=/opt/softhsm2.conf + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTHON_PKCS11=${{ matrix.version }} SOFTHSM2_CONF=/opt/softhsm2.conf" cibw-before-test-linux: softhsm2-util --init-token --free --label TEST --pin 1234 --so-pin 5678 cibw-test-environment: >- PKCS11_MODULE=/usr/lib/softhsm/libsofthsm2.so diff --git a/.github/workflows/build-python-stretch.yml b/.github/workflows/build-python-stretch.yml index 4258a5e167a5..838ca538be41 100644 --- a/.github/workflows/build-python-stretch.yml +++ b/.github/workflows/build-python-stretch.yml @@ -54,7 +54,6 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build python-stretch ${{ matrix.version }} cp312-abi3-${{ matrix.libc }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: @@ -76,41 +75,69 @@ jobs: assert (s.blockSamples(), s.intervalSamples(), s.inputLatency()) == (5292, 1323, 2646), (s.blockSamples(), s.intervalSamples(), s.inputLatency()); print('python_stretch OK')" + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "python-stretch" + version: "${{ matrix.version }}" + repository: "gregogiudici/python-stretch" + ref: "ac1fbfc9f5d6b912e2a9248d8e0f53888846588b" + artifact-tag: "cp312-abi3-${{ matrix.libc }}_riscv64" + checkout-submodules: "true" + pre-build: |- + export PYTHON_STRETCH_VERSION='${{ matrix.version }}' + grep -qx "version = \"${PYTHON_STRETCH_VERSION}\"" pyproject.toml + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cp include/stretch/LICENSE.txt LICENSE.signalsmith-stretch.txt + cp include/stretch/dsp/LICENSE.txt LICENSE.signalsmith-dsp.txt + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-before-build: "python -m pip install nanobind && python -c \"import importlib.metadata as m, shutil; shutil.copy(next(f.locate() for f in m.files('nanobind') if f.name == 'LICENSE'), '{project}/LICENSE.nanobind')\"" + cibw-build: "cp312-${{ matrix.libc }}_riscv64 cp313-${{ matrix.libc }}_riscv64 cp314-${{ matrix.libc }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-test-requires: "${{ matrix.test_requires }}" + cibw-test-command: "${{ matrix.test_command }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + libc: [manylinux, musllinux] + include: + - libc: manylinux + test_requires: pytest numpy + test_command: pytest {project}/tests + # No musllinux riscv64 numpy wheel exists, and every process() call takes one. + - libc: musllinux + test_requires: '' + test_command: >- + python -c "import python_stretch as ps; + s = ps.Signalsmith.Stretch(); + s.preset(2, 44100.0); + s.setTimeFactor(0.5); + s.setTransposeSemitones(12); + assert (s.blockSamples(), s.intervalSamples(), s.inputLatency()) == (5292, 1323, 2646), (s.blockSamples(), s.intervalSamples(), s.inputLatency()); + print('python_stretch OK')" env: PYTHON_STRETCH_VERSION: ${{ matrix.version }} - steps: - - name: Checkout python-stretch ${{ env.PYTHON_STRETCH_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: gregogiudici/python-stretch - ref: ${{ env.PYTHON_STRETCH_REF }} - submodules: true - persist-credentials: false - - - name: Check version - run: grep -qx "version = \"${PYTHON_STRETCH_VERSION}\"" pyproject.toml - - - name: Stage bundled licences - run: | - cp include/stretch/LICENSE.txt LICENSE.signalsmith-stretch.txt - cp include/stretch/dsp/LICENSE.txt LICENSE.signalsmith-dsp.txt - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_BEFORE_BUILD: >- - python -m pip install nanobind && - python -c "import importlib.metadata as m, shutil; shutil.copy(next(f.locate() for f in m.files('nanobind') if f.name == 'LICENSE'), '{project}/LICENSE.nanobind')" - CIBW_ARCHS: riscv64 - CIBW_BUILD: >- - cp312-${{ matrix.libc }}_riscv64 - cp313-${{ matrix.libc }}_riscv64 - cp314-${{ matrix.libc }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: ${{ matrix.test_requires }} - CIBW_TEST_COMMAND: ${{ matrix.test_command }} + name: python-stretch-${{ env.PYTHON_STRETCH_VERSION }}-cp312-abi3-${{ matrix.libc }}_riscv64 + path: wheelhouse - name: Check the bundled licences made it into the wheel run: | @@ -125,15 +152,9 @@ jobs: print(whl, sorted(found)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: python-stretch-${{ env.PYTHON_STRETCH_VERSION }}-cp312-abi3-${{ matrix.libc }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish python-stretch ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pytomlpp.yml b/.github/workflows/build-pytomlpp.yml index ffaef388d7ab..04b265a476f2 100644 --- a/.github/workflows/build-pytomlpp.yml +++ b/.github/workflows/build-pytomlpp.yml @@ -52,43 +52,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pytomlpp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pytomlpp" + version: "${{ matrix.version }}" + repository: "bobfang1992/pytomlpp" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/pytomlpp/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-before-test: "pip install -r {project}/tests/requirements.txt" + cibw-test-command: "pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYTOMLPP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pytomlpp v${{ env.PYTOMLPP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: bobfang1992/pytomlpp - ref: v${{ env.PYTOMLPP_VERSION }} - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/pytomlpp/${{ env.PYTOMLPP_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_TEST: pip install -r {project}/tests/requirements.txt - CIBW_TEST_COMMAND: pytest {project}/tests + name: pytomlpp-${{ env.PYTOMLPP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel carries the compiled extension and its licences run: | @@ -102,12 +114,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pytomlpp-${{ env.PYTOMLPP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -143,7 +149,7 @@ jobs: publish: name: Publish pytomlpp ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pytorch-tokenizers.yml b/.github/workflows/build-pytorch-tokenizers.yml index 2bf3114098ee..1f18c359f9f6 100644 --- a/.github/workflows/build-pytorch-tokenizers.yml +++ b/.github/workflows/build-pytorch-tokenizers.yml @@ -55,50 +55,59 @@ jobs: matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} name: Build pytorch-tokenizers ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pytorch-tokenizers" + version: "${{ matrix.version }}" + repository: "meta-pytorch/tokenizers" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + checkout-submodules: "recursive" + pre-build: |- + export PYBIND11_REF=v2.13.6 + set -euo pipefail + cp third-party/abseil-cpp/LICENSE LICENSE.abseil-cpp + cp third-party/re2/LICENSE LICENSE.re2 + cp third-party/sentencepiece/LICENSE LICENSE.sentencepiece + cp third-party/sentencepiece/third_party/darts_clone/LICENSE LICENSE.darts-clone + cp third-party/sentencepiece/third_party/esaxx/LICENSE LICENSE.esaxx + cp third-party/sentencepiece/third_party/protobuf-lite/LICENSE LICENSE.protobuf-lite + cp third-party/pcre2/LICENCE.md LICENSE.pcre2 + cp third-party/json/LICENSE.MIT LICENSE.nlohmann-json + sed -n '/^MIT License$/,/^SOFTWARE\.$/p' third-party/llama.cpp-unicode/src/unicode.cpp > LICENSE.llama.cpp-unicode + curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/${PYBIND11_REF}/LICENSE" -o LICENSE.pybind11 + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "CMAKE_BUILD_PARALLEL_LEVEL=8" + # Upstream's smoke test (.ci/scripts/wheel/test_wheel.py) copies test/ into a + # temp directory and runs pytest there, which is what test-sources reproduces. + cibw-test-sources: "test" + cibw-test-requires: "pytest transformers" + cibw-test-command: "python -m pytest -vv test" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 - + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: PYTORCH_TOKENIZERS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout tokenizers v${{ env.PYTORCH_TOKENIZERS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: meta-pytorch/tokenizers - ref: v${{ env.PYTORCH_TOKENIZERS_VERSION }} - submodules: recursive - persist-credentials: false - - # Every tree below is compiled into the extension, and setuptools' default licence - # glob only reaches the project root. - - name: Stage the vendored licences - run: | - set -euo pipefail - cp third-party/abseil-cpp/LICENSE LICENSE.abseil-cpp - cp third-party/re2/LICENSE LICENSE.re2 - cp third-party/sentencepiece/LICENSE LICENSE.sentencepiece - cp third-party/sentencepiece/third_party/darts_clone/LICENSE LICENSE.darts-clone - cp third-party/sentencepiece/third_party/esaxx/LICENSE LICENSE.esaxx - cp third-party/sentencepiece/third_party/protobuf-lite/LICENSE LICENSE.protobuf-lite - cp third-party/pcre2/LICENCE.md LICENSE.pcre2 - cp third-party/json/LICENSE.MIT LICENSE.nlohmann-json - sed -n '/^MIT License$/,/^SOFTWARE\.$/p' third-party/llama.cpp-unicode/src/unicode.cpp > LICENSE.llama.cpp-unicode - curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/${PYBIND11_REF}/LICENSE" -o LICENSE.pybind11 - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - CMAKE_BUILD_PARALLEL_LEVEL=8 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream's smoke test (.ci/scripts/wheel/test_wheel.py) copies test/ into a - # temp directory and runs pytest there, which is what test-sources reproduces. - CIBW_TEST_SOURCES: test - CIBW_TEST_REQUIRES: pytest transformers - CIBW_TEST_COMMAND: python -m pytest -vv test + name: pytorch-tokenizers-${{ env.PYTORCH_TOKENIZERS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and the vendored licences made it into the wheel run: | @@ -118,15 +127,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pytorch-tokenizers-${{ env.PYTORCH_TOKENIZERS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pytorch-tokenizers ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pytype.yml b/.github/workflows/build-pytype.yml index 8aa272a6a57c..237d2831e424 100644 --- a/.github/workflows/build-pytype.yml +++ b/.github/workflows/build-pytype.yml @@ -49,60 +49,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pytype ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pytype" + version: "${{ matrix.version }}" + repository: "google/pytype" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 300 + checkout-submodules: "recursive" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # libcst and msgspec have no riscv64 wheels on public PyPI. + # Without this pip takes the newest libcst, whose riscv64 form is an + # sdist needing Rust, over our registry's wheel for an older release. + cibw-test-environment: "PIP_ONLY_BINARY=:all:" + cibw-test-requires: "pytest pytest-xdist" + # The wheel carries pytype's unit tests but not the pytype.tests + # helpers a third of them import, so those are copied in beside it. + cibw-test-sources: "pytype/tests/__init__.py pytype/tests/test_base.py pytype/tests/test_utils.py" + # Deselected: the helpers themselves; main_test.py and test_error_doc, + # which run files that exist only in a git checkout; the two typeshed + # tests reading typeshed/tests/, excluded from the wheel; test_die, + # which needs a mkdir to fail and the container runs as root; and the + # two serialize_ast tests, which fail the same way on an x86 checkout. + cibw-test-command: "cp -r pytype/tests \"$(python -c 'import pytype, os; print(os.path.dirname(pytype.__file__))')\" && printf 'def f(x: int) -> str:\\n return str(x)\\n' > ok.py && pytype ok.py && python -m pytest --pyargs pytype -n auto --deselect tests/test_base.py --deselect tests/test_utils.py --deselect main_test.py --deselect errors/errors_test.py::ErrorDocTest::test_error_doc --deselect imports/typeshed_test.py::TestTypeshedLoading::test_blacklisted_modules --deselect imports/typeshed_test.py::TestTypeshedLoading::test_read_blacklist --deselect tools/tool_utils_test.py::TestMakeDirsOrDie::test_die --deselect pytd/serialize_ast_test.py::SerializeAstTest::test_node_index_visitor_usage --deselect pytd/serialize_ast_test.py::SerializeAstTest::test_unrestorable_child" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 300 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYTYPE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pytype ${{ env.PYTYPE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: google/pytype - ref: ${{ env.PYTYPE_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # libcst and msgspec have no riscv64 wheels on public PyPI. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Without this pip takes the newest libcst, whose riscv64 form is an - # sdist needing Rust, over our registry's wheel for an older release. - CIBW_TEST_ENVIRONMENT: "PIP_ONLY_BINARY=:all:" - CIBW_TEST_REQUIRES: pytest pytest-xdist - # The wheel carries pytype's unit tests but not the pytype.tests - # helpers a third of them import, so those are copied in beside it. - CIBW_TEST_SOURCES: pytype/tests/__init__.py pytype/tests/test_base.py pytype/tests/test_utils.py - # Deselected: the helpers themselves; main_test.py and test_error_doc, - # which run files that exist only in a git checkout; the two typeshed - # tests reading typeshed/tests/, excluded from the wheel; test_die, - # which needs a mkdir to fail and the container runs as root; and the - # two serialize_ast tests, which fail the same way on an x86 checkout. - CIBW_TEST_COMMAND: >- - cp -r pytype/tests "$(python -c 'import pytype, os; print(os.path.dirname(pytype.__file__))')" - && printf 'def f(x: int) -> str:\n return str(x)\n' > ok.py - && pytype ok.py - && python -m pytest --pyargs pytype -n auto - --deselect tests/test_base.py - --deselect tests/test_utils.py - --deselect main_test.py - --deselect errors/errors_test.py::ErrorDocTest::test_error_doc - --deselect imports/typeshed_test.py::TestTypeshedLoading::test_blacklisted_modules - --deselect imports/typeshed_test.py::TestTypeshedLoading::test_read_blacklist - --deselect tools/tool_utils_test.py::TestMakeDirsOrDie::test_die - --deselect pytd/serialize_ast_test.py::SerializeAstTest::test_node_index_visitor_usage - --deselect pytd/serialize_ast_test.py::SerializeAstTest::test_unrestorable_child + name: pytype-${{ env.PYTYPE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension module made it into the wheel run: | @@ -115,15 +107,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pytype-${{ env.PYTYPE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pytype ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyvirtualcam.yml b/.github/workflows/build-pyvirtualcam.yml index 062804cd0d62..a5f49a1a9868 100644 --- a/.github/workflows/build-pyvirtualcam.yml +++ b/.github/workflows/build-pyvirtualcam.yml @@ -50,57 +50,63 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyvirtualcam ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyvirtualcam" + version: "${{ matrix.version }}" + repository: "letmaik/pyvirtualcam" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "true" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # virtual_output.h pulls in linux/videodev2.h (the standard kernel + # UAPI header, not a v4l2loopback one - no kernel module needed to + # build); manylinux already has it via glibc-devel, musllinux's + # Alpine base needs linux-headers. + cibw-before-all-linux: "(command -v apk && apk add linux-headers) || true" + cibw-test-sources: "test" + cibw-test-requires: "pytest" + # Upstream's own test-linux.sh disables the whole suite on Linux: + # every test but test_util.py opens a real Camera(), which needs the + # v4l2loopback kernel module loaded and a device node present, + # neither available on the build runner. Run the one test that + # doesn't, and exercise the compiled extension's real device-open + # error path instead (gpiod/spidev pattern). + cibw-test-command: |- + set -e + python -m pytest {project}/test/test_util.py -v + python3 - <<'PYEOF' + import pyvirtualcam + try: + pyvirtualcam.Camera(width=640, height=480, fps=20) + except RuntimeError as e: + assert 'v4l2loopback' in str(e), e + else: + raise SystemExit('expected RuntimeError: no v4l2loopback device') + PYEOF + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYVIRTUALCAM_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyvirtualcam v${{ env.PYVIRTUALCAM_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: letmaik/pyvirtualcam - ref: v${{ env.PYVIRTUALCAM_VERSION }} - submodules: true - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # virtual_output.h pulls in linux/videodev2.h (the standard kernel - # UAPI header, not a v4l2loopback one - no kernel module needed to - # build); manylinux already has it via glibc-devel, musllinux's - # Alpine base needs linux-headers. - CIBW_BEFORE_ALL_LINUX: (command -v apk && apk add linux-headers) || true - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_SOURCES: test - CIBW_TEST_REQUIRES: pytest - # Upstream's own test-linux.sh disables the whole suite on Linux: - # every test but test_util.py opens a real Camera(), which needs the - # v4l2loopback kernel module loaded and a device node present, - # neither available on the build runner. Run the one test that - # doesn't, and exercise the compiled extension's real device-open - # error path instead (gpiod/spidev pattern). - CIBW_TEST_COMMAND: | - set -e - python -m pytest {project}/test/test_util.py -v - python3 - <<'PYEOF' - import pyvirtualcam - try: - pyvirtualcam.Camera(width=640, height=480, fps=20) - except RuntimeError as e: - assert 'v4l2loopback' in str(e), e - else: - raise SystemExit('expected RuntimeError: no v4l2loopback device') - PYEOF + name: pyvirtualcam-${{ env.PYVIRTUALCAM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension and licence run: | @@ -113,15 +119,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyvirtualcam-${{ env.PYVIRTUALCAM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyvirtualcam ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyvista-validation.yml b/.github/workflows/build-pyvista-validation.yml index e75bc2ee998f..d3bd9556cd7a 100644 --- a/.github/workflows/build-pyvista-validation.yml +++ b/.github/workflows/build-pyvista-validation.yml @@ -53,36 +53,36 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build pyvista-validation ${{ matrix.version }} cp310-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyvista-validation" + version: "${{ matrix.version }}" + repository: "pyvista/pyvista-validation" + ref: "v${{ matrix.version }}" + artifact-tag: "cp310-abi3-manylinux_riscv64" + timeout-minutes: 120 + # One cp310-abi3 wheel built on its floor, then re-tested on the newer + # interpreters via find_compatible_wheel (upstream re-runs the suite on 3.14). + cibw-build: "cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # numpy is a build and runtime requirement that only our registry ships for riscv64. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYVISTA_VALIDATION=${{ matrix.version }}" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: PYVISTA_VALIDATION_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyvista-validation v${{ env.PYVISTA_VALIDATION_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pyvista/pyvista-validation - ref: v${{ env.PYVISTA_VALIDATION_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # One cp310-abi3 wheel built on its floor, then re-tested on the newer - # interpreters via find_compatible_wheel (upstream re-runs the suite on 3.14). - CIBW_BUILD: >- - cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - # numpy is a build and runtime requirement that only our registry ships for riscv64. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYVISTA_VALIDATION=${{ env.PYVISTA_VALIDATION_VERSION }} + name: pyvista-validation-${{ env.PYVISTA_VALIDATION_VERSION }}-cp310-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -95,16 +95,9 @@ jobs: assert "pyvista_validation/_fast.abi3.so" in names, names EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyvista-validation-${{ env.PYVISTA_VALIDATION_VERSION }}-cp310-abi3-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyvista-validation ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pyvrl.yml b/.github/workflows/build-pyvrl.yml index e23b99f008c0..a2ee2ae74ff6 100644 --- a/.github/workflows/build-pyvrl.yml +++ b/.github/workflows/build-pyvrl.yml @@ -48,73 +48,77 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pyvrl ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pyvrl" + version: "${{ matrix.version }}" + repository: "crowdalert/pyvrl" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 1440 + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # pyvrl ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-command: |- + python3 - <<'PYEOF' + import datetime + from pyvrl import Transform + program = ''' + .y = "bar" + .x = upcase!(.x) + .n = to_int!(.n) + 1 + .list = push!(.list, "z") + . + ''' + transform = Transform(program) + assert transform.source == program + out = transform.remap({"x": "foo", "n": 41, "list": ["a"]}) + assert out == {"x": "FOO", "y": "bar", "n": 42, "list": ["a", "z"]}, out + unicode = Transform('.s = upcase!(.s)\n.') + assert unicode.remap({"s": "caf\N{LATIN SMALL LETTER E WITH ACUTE} \N{EARTH GLOBE AMERICAS}"}) == {"s": "CAF\N{LATIN CAPITAL LETTER E WITH ACUTE} \N{EARTH GLOBE AMERICAS}"} + parsed = Transform('. = parse_json!(.raw)').remap({"raw": '{"a": [1, 2.5, true, null]}'}) + assert parsed == {"a": [1, 2.5, True, None]}, parsed + stamp = Transform('. = {"t": parse_timestamp!("2024-05-06T07:08:09Z", "%+")}').remap({}) + assert stamp == {"t": datetime.datetime(2024, 5, 6, 7, 8, 9, tzinfo=datetime.timezone.utc)}, stamp + try: + Transform(".x = no_such_function!(.x)") + except ValueError: + pass + else: + raise AssertionError("expected a compile error") + try: + Transform("abort").remap({}) + except ValueError: + pass + else: + raise AssertionError("expected a runtime error") + print("pyvrl OK") + PYEOF + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 1440 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYVRL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pyvrl ${{ env.PYVRL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: crowdalert/pyvrl - ref: v${{ env.PYVRL_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # pyvrl ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_COMMAND: | - python3 - <<'PYEOF' - import datetime - from pyvrl import Transform - program = ''' - .y = "bar" - .x = upcase!(.x) - .n = to_int!(.n) + 1 - .list = push!(.list, "z") - . - ''' - transform = Transform(program) - assert transform.source == program - out = transform.remap({"x": "foo", "n": 41, "list": ["a"]}) - assert out == {"x": "FOO", "y": "bar", "n": 42, "list": ["a", "z"]}, out - unicode = Transform('.s = upcase!(.s)\n.') - assert unicode.remap({"s": "caf\N{LATIN SMALL LETTER E WITH ACUTE} \N{EARTH GLOBE AMERICAS}"}) == {"s": "CAF\N{LATIN CAPITAL LETTER E WITH ACUTE} \N{EARTH GLOBE AMERICAS}"} - parsed = Transform('. = parse_json!(.raw)').remap({"raw": '{"a": [1, 2.5, true, null]}'}) - assert parsed == {"a": [1, 2.5, True, None]}, parsed - stamp = Transform('. = {"t": parse_timestamp!("2024-05-06T07:08:09Z", "%+")}').remap({}) - assert stamp == {"t": datetime.datetime(2024, 5, 6, 7, 8, 9, tzinfo=datetime.timezone.utc)}, stamp - try: - Transform(".x = no_such_function!(.x)") - except ValueError: - pass - else: - raise AssertionError("expected a compile error") - try: - Transform("abort").remap({}) - except ValueError: - pass - else: - raise AssertionError("expected a runtime error") - print("pyvrl OK") - PYEOF + name: pyvrl-${{ env.PYVRL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -127,15 +131,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pyvrl-${{ env.PYVRL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pyvrl ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pywavelets.yml b/.github/workflows/build-pywavelets.yml index f2316947e4c0..af9f787ff109 100644 --- a/.github/workflows/build-pywavelets.yml +++ b/.github/workflows/build-pywavelets.yml @@ -49,51 +49,50 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pywavelets ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pywavelets" + version: "${{ matrix.version }}" + repository: "PyWavelets/pywt" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 300 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy has no riscv64 wheel on public PyPI; it is a build and a test dep. + cibw-environment-linux: "PIP_PREFER_BINARY=1" + cibw-test-requires: "pytest" + cibw-test-command: "pytest --pyargs pywt -m \"not slow\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 300 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYWAVELETS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pywavelets v${{ env.PYWAVELETS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: PyWavelets/pywt - ref: v${{ env.PYWAVELETS_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy has no riscv64 wheel on public PyPI; it is a build and a test dep. - CIBW_ENVIRONMENT: >- - PIP_PREFER_BINARY=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest --pyargs pywt -m "not slow" + name: pywavelets-${{ env.PYWAVELETS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extensions run: | unzip -l wheelhouse/*.whl | grep -E 'pywt/_extensions/.*\.so$' - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pywavelets-${{ env.PYWAVELETS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish pywavelets ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-pywhispercpp.yml b/.github/workflows/build-pywhispercpp.yml index 2ada4b69547d..e881ac8a6f2e 100644 --- a/.github/workflows/build-pywhispercpp.yml +++ b/.github/workflows/build-pywhispercpp.yml @@ -49,50 +49,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build pywhispercpp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "pywhispercpp" + version: "${{ matrix.version }}" + repository: "absadiki/pywhispercpp" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-submodules: "true" + pre-build: |- + cp whisper.cpp/LICENSE LICENSE.whisper.cpp + cp pybind11/LICENSE LICENSE.pybind11 + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # ggml defaults RVV/Zfh/Zvfh/Zicbop/Zihintpause on for riscv64 with no runtime + # dispatch; turning them off keeps the wheel at the rv64gc baseline. + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYWHISPERCPP=${{ matrix.version }} CMAKE_ARGS=\"-DGGML_NATIVE=OFF -DGGML_RVV=OFF -DGGML_RV_ZFH=OFF -DGGML_RV_ZVFH=OFF -DGGML_RV_ZICBOP=OFF -DGGML_RV_ZIHINTPAUSE=OFF\"" + cibw-test-requires: "pytest" + cibw-test-environment: "PIP_ONLY_BINARY=numpy PYTHON_GIL=1" + cibw-test-sources: "pyproject.toml tests whisper.cpp/models whisper.cpp/samples" + cibw-test-command: "python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: PYWHISPERCPP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout pywhispercpp v${{ env.PYWHISPERCPP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: absadiki/pywhispercpp - ref: v${{ env.PYWHISPERCPP_VERSION }} - submodules: true - persist-credentials: false - - # The wheel ships whisper.cpp/ggml and pybind11 code; upstream ships only its own licence. - - name: Stage the bundled libraries' licences - run: | - cp whisper.cpp/LICENSE LICENSE.whisper.cpp - cp pybind11/LICENSE LICENSE.pybind11 - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # ggml defaults RVV/Zfh/Zvfh/Zicbop/Zihintpause on for riscv64 with no runtime - # dispatch; turning them off keeps the wheel at the rv64gc baseline. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYWHISPERCPP=${{ env.PYWHISPERCPP_VERSION }} - CMAKE_ARGS="-DGGML_NATIVE=OFF -DGGML_RVV=OFF -DGGML_RV_ZFH=OFF -DGGML_RV_ZVFH=OFF -DGGML_RV_ZICBOP=OFF -DGGML_RV_ZIHINTPAUSE=OFF" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_ENVIRONMENT: >- - PIP_ONLY_BINARY=numpy - PYTHON_GIL=1 - CIBW_TEST_SOURCES: pyproject.toml tests whisper.cpp/models whisper.cpp/samples - CIBW_TEST_COMMAND: python -m pytest tests + name: pywhispercpp-${{ env.PYWHISPERCPP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel's extension, licences and ISA baseline run: | @@ -111,12 +116,6 @@ jobs: if echo "$arch" | grep -qE '_(v|zv[a-z0-9]*|zfh[a-z]*)[0-9]'; then exit 1; fi done - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: pywhispercpp-${{ env.PYWHISPERCPP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -151,7 +150,7 @@ jobs: publish: name: Publish pywhispercpp ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-qiskit-aer.yml b/.github/workflows/build-qiskit-aer.yml index c091c57c2993..7f70c6bef44d 100644 --- a/.github/workflows/build-qiskit-aer.yml +++ b/.github/workflows/build-qiskit-aer.yml @@ -49,83 +49,85 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build qiskit-aer ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "qiskit-aer" + version: "${{ matrix.version }}" + repository: "Qiskit/qiskit-aer" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 720 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Replaces upstream's manylinux2014/yum before-all (pyproject.toml + # [tool.cibuildwheel.linux]); also stages OpenBLAS' licence, which + # auditwheel bundles the library without. + cibw-before-all-linux: "dnf -y install openblas-devel && cp /usr/share/licenses/openblas/LICENSE {project}/LICENSE.openblas" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,qiskit,rustworkx" + # cmake/dependency_utils.cmake's setup_conan() runs Conan 1.x + # (conan<2.0.0, pinned by pyproject.toml) to build fmt/8.0.1 from + # source. Conan 1.x's settings.yml has no riscv64 arch entry, and + # its autodetection matches "riscv64" on the generic `"64" in + # machine` fallback and misreports arch=x86_64, so its + # CMakeToolchain then adds an x86-only -m64 flag. Seed a + # riscv64-aware settings.yml and default profile before Conan + # runs so it never autodetects. settings.yml validates arch, + # arch_build and arch_target as three SEPARATE enum lists (not + # one shared list), so all three need the same riscv64 addition - + # our profile only sets arch/arch_build, but arch_target is + # patched too for anyone who later adds a cross-compile profile. + cibw-before-build: |- + set -ex + pip install -q 'conan<2.0.0' + conan config init + conan_home=$(conan config home) + sed -i \ + -e 's/^arch_build: \[x86, x86_64,/arch_build: [x86, x86_64, riscv64,/' \ + -e 's/^arch_target: \[x86, x86_64,/arch_target: [x86, x86_64, riscv64,/' \ + -e 's/^arch: \[x86, x86_64,/arch: [x86, x86_64, riscv64,/' \ + "$conan_home/settings.yml" + grep -q '^arch_build: \[x86, x86_64, riscv64,' "$conan_home/settings.yml" + grep -q '^arch_target: \[x86, x86_64, riscv64,' "$conan_home/settings.yml" + grep -q '^arch: \[x86, x86_64, riscv64,' "$conan_home/settings.yml" + mkdir -p "$conan_home/profiles" + cat > "$conan_home/profiles/default" <<'PROFILE' + [settings] + os=Linux + os_build=Linux + arch=riscv64 + arch_build=riscv64 + build_type=Release + [options] + [build_requires] + [env] + PROFILE + # Upstream's own before-build (replaced above) also appends the bundled + # libraries' licence notices to LICENSE.txt from 0.18.0 on, and + # tools/verify_wheels.py checks for them. + if [ -f {project}/tools/wheels/append_bundled_licenses.sh ]; then + bash {project}/tools/wheels/append_bundled_licenses.sh {project} + fi + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 720 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: QISKIT_AER_VERSION: ${{ matrix.version }} - steps: - - name: Checkout qiskit-aer ${{ env.QISKIT_AER_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Qiskit/qiskit-aer - ref: ${{ env.QISKIT_AER_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces upstream's manylinux2014/yum before-all (pyproject.toml - # [tool.cibuildwheel.linux]); also stages OpenBLAS' licence, which - # auditwheel bundles the library without. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install openblas-devel && - cp /usr/share/licenses/openblas/LICENSE {project}/LICENSE.openblas - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,qiskit,rustworkx - # cmake/dependency_utils.cmake's setup_conan() runs Conan 1.x - # (conan<2.0.0, pinned by pyproject.toml) to build fmt/8.0.1 from - # source. Conan 1.x's settings.yml has no riscv64 arch entry, and - # its autodetection matches "riscv64" on the generic `"64" in - # machine` fallback and misreports arch=x86_64, so its - # CMakeToolchain then adds an x86-only -m64 flag. Seed a - # riscv64-aware settings.yml and default profile before Conan - # runs so it never autodetects. settings.yml validates arch, - # arch_build and arch_target as three SEPARATE enum lists (not - # one shared list), so all three need the same riscv64 addition - - # our profile only sets arch/arch_build, but arch_target is - # patched too for anyone who later adds a cross-compile profile. - CIBW_BEFORE_BUILD: | - set -ex - pip install -q 'conan<2.0.0' - conan config init - conan_home=$(conan config home) - sed -i \ - -e 's/^arch_build: \[x86, x86_64,/arch_build: [x86, x86_64, riscv64,/' \ - -e 's/^arch_target: \[x86, x86_64,/arch_target: [x86, x86_64, riscv64,/' \ - -e 's/^arch: \[x86, x86_64,/arch: [x86, x86_64, riscv64,/' \ - "$conan_home/settings.yml" - grep -q '^arch_build: \[x86, x86_64, riscv64,' "$conan_home/settings.yml" - grep -q '^arch_target: \[x86, x86_64, riscv64,' "$conan_home/settings.yml" - grep -q '^arch: \[x86, x86_64, riscv64,' "$conan_home/settings.yml" - mkdir -p "$conan_home/profiles" - cat > "$conan_home/profiles/default" <<'PROFILE' - [settings] - os=Linux - os_build=Linux - arch=riscv64 - arch_build=riscv64 - build_type=Release - [options] - [build_requires] - [env] - PROFILE - # Upstream's own before-build (replaced above) also appends the bundled - # libraries' licence notices to LICENSE.txt from 0.18.0 on, and - # tools/verify_wheels.py checks for them. - if [ -f {project}/tools/wheels/append_bundled_licenses.sh ]; then - bash {project}/tools/wheels/append_bundled_licenses.sh {project} - fi + name: qiskit-aer-${{ env.QISKIT_AER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and all licences run: | @@ -141,12 +143,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: qiskit-aer-${{ env.QISKIT_AER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -182,7 +178,7 @@ jobs: publish: name: Publish qiskit-aer ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-qiskit-terra.yml b/.github/workflows/build-qiskit-terra.yml index 32c843c75957..0cbf32483cd9 100644 --- a/.github/workflows/build-qiskit-terra.yml +++ b/.github/workflows/build-qiskit-terra.yml @@ -60,11 +60,7 @@ jobs: # One cp38-abi3 wheel; built and tested on cp312, the oldest interpreter our registry carries numpy/scipy for. cibw-build: cp312-manylinux_riscv64 # Replaces upstream's [tool.cibuildwheel.linux] environment, so its three variables are repeated. - cibw-environment-linux: >- - PATH="$PATH:$HOME/.cargo/bin" - CARGO_NET_GIT_FETCH_WITH_CLI="true" - RUSTUP_TOOLCHAIN="stable" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" CARGO_NET_GIT_FETCH_WITH_CLI=\"true\" RUSTUP_TOOLCHAIN=\"stable\"" # The riscv64 image has no pipx; cibuildwheel's default audit already runs abi3audit. cibw-repair-wheel-command-linux: auditwheel repair -w {dest_dir} {wheel} timeout-minutes: 360 diff --git a/.github/workflows/build-qiskit.yml b/.github/workflows/build-qiskit.yml index cec806a8ac48..3b1d8b810742 100644 --- a/.github/workflows/build-qiskit.yml +++ b/.github/workflows/build-qiskit.yml @@ -49,49 +49,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build qiskit ${{ matrix.version }} cp310-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "qiskit" + version: "${{ matrix.version }}" + repository: "Qiskit/qiskit" + ref: "${{ matrix.version }}" + artifact-tag: "cp310-abi3-manylinux_riscv64" + timeout-minutes: 1440 + # setup.py's py_limited_api="cp310" makes cp310 both the wheel's tag and + # the interpreter it must be built on; upstream's extra cp311-cp315 + # entries only re-run the whole stestr suite, hours of it on riscv64. + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "cp310-manylinux_riscv64" + # Replaces (not merges into) upstream's own [tool.cibuildwheel.linux] + # environment table, so its four variables are repeated here alongside + # our registry. + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" CARGO_NET_GIT_FETCH_WITH_CLI=\"true\" RUSTUP_TOOLCHAIN=\"stable\" QISKIT_BUILD_WITH_MIMALLOC=1" + # Upstream's own repair-wheel-command also runs abi3audit via pipx, + # which the riscv64 image doesn't carry; cibuildwheel's own default + # audit-command already abi3audits every abi3-tagged wheel natively + # after this repair step runs, so drop the pipx layer here. + cibw-repair-wheel-command-linux: "auditwheel repair -w {dest_dir} {wheel}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 1440 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: QISKIT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout qiskit ${{ env.QISKIT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Qiskit/qiskit - ref: ${{ env.QISKIT_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - # setup.py's py_limited_api="cp310" makes cp310 both the wheel's tag and - # the interpreter it must be built on; upstream's extra cp311-cp315 - # entries only re-run the whole stestr suite, hours of it on riscv64. - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: cp310-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces (not merges into) upstream's own [tool.cibuildwheel.linux] - # environment table, so its four variables are repeated here alongside - # our registry. - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - CARGO_NET_GIT_FETCH_WITH_CLI="true" - RUSTUP_TOOLCHAIN="stable" - QISKIT_BUILD_WITH_MIMALLOC=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream's own repair-wheel-command also runs abi3audit via pipx, - # which the riscv64 image doesn't carry; cibuildwheel's own default - # audit-command already abi3audits every abi3-tagged wheel natively - # after this repair step runs, so drop the pipx layer here. - CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair -w {dest_dir} {wheel} + name: qiskit-${{ env.QISKIT_VERSION }}-cp310-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contains the compiled extension run: | @@ -101,15 +103,9 @@ jobs: unzip -l "$whl" | grep '\.so$' done - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: qiskit-${{ env.QISKIT_VERSION }}-cp310-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish qiskit ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-qoi.yml b/.github/workflows/build-qoi.yml index ddb263f0b052..a1c7aab14762 100644 --- a/.github/workflows/build-qoi.yml +++ b/.github/workflows/build-qoi.yml @@ -49,49 +49,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build qoi ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "qoi" + version: "${{ matrix.version }}" + repository: "kodonnell/qoi" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # 0.8.0 rewrote the extension in Rust (PyO3 via maturin), replacing + # the setup.py+Cython build 0.7.2 still needs. maturin's own Rust + # auto-install (puccinialin) computes the wrong rustup target triple + # for riscv64 ("riscv64-unknown-linux-gnu" instead of + # "riscv64gc-unknown-linux-gnu") and fails, so a working toolchain + # has to be on PATH before it gets the chance to try, same as + # build-minijinja.yml. + cibw-before-all-linux: "${{ matrix.version != '0.7.2' && 'curl --proto ''=https'' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y' || 'true' }}" + # USE_CYTHON=1 matches upstream's own [tool.cibuildwheel] table for + # 0.7.2 (re-cythonize rather than build from the checked-in qoi.c). + # numpy is both a build-time header dependency (0.7.2's setup.py + # np.get_include(), 0.8.0's pyo3-numpy) and a runtime one + # (install_requires); only our registry has it for riscv64, and + # only-binary keeps a newer PyPI release from winning the + # resolution and compiling from sdist. + cibw-environment-linux: "${{ matrix.version == '0.7.2' && 'USE_CYTHON=1' || 'PATH=\"$PATH:$HOME/.cargo/bin\"' }} PIP_ONLY_BINARY=numpy,pillow" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: QOI_VERSION: ${{ matrix.version }} - steps: - - name: Checkout qoi v${{ env.QOI_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: kodonnell/qoi - ref: v${{ env.QOI_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # 0.8.0 rewrote the extension in Rust (PyO3 via maturin), replacing - # the setup.py+Cython build 0.7.2 still needs. maturin's own Rust - # auto-install (puccinialin) computes the wrong rustup target triple - # for riscv64 ("riscv64-unknown-linux-gnu" instead of - # "riscv64gc-unknown-linux-gnu") and fails, so a working toolchain - # has to be on PATH before it gets the chance to try, same as - # build-minijinja.yml. - CIBW_BEFORE_ALL_LINUX: ${{ matrix.version != '0.7.2' && 'curl --proto ''=https'' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y' || 'true' }} - # USE_CYTHON=1 matches upstream's own [tool.cibuildwheel] table for - # 0.7.2 (re-cythonize rather than build from the checked-in qoi.c). - # numpy is both a build-time header dependency (0.7.2's setup.py - # np.get_include(), 0.8.0's pyo3-numpy) and a runtime one - # (install_requires); only our registry has it for riscv64, and - # only-binary keeps a newer PyPI release from winning the - # resolution and compiling from sdist. - CIBW_ENVIRONMENT_LINUX: >- - ${{ matrix.version == '0.7.2' && 'USE_CYTHON=1' || 'PATH="$PATH:$HOME/.cargo/bin"' }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pillow + name: qoi-${{ env.QOI_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -108,16 +111,9 @@ jobs: print(whl, "ok") EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: qoi-${{ env.QOI_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish qoi ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-quadprog.yml b/.github/workflows/build-quadprog.yml index 15854160565c..ee1587684af1 100644 --- a/.github/workflows/build-quadprog.yml +++ b/.github/workflows/build-quadprog.yml @@ -58,9 +58,7 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # numpy (runtime) and scipy (test-only) have no riscv64 wheel on public PyPI. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy" cibw-test-requires: pytest scipy cibw-test-command: >- python -c "import quadprog; assert quadprog.__file__.endswith('.so'), quadprog.__file__" && diff --git a/.github/workflows/build-quantile-forest.yml b/.github/workflows/build-quantile-forest.yml index 42a6a9989e9c..6c6cdb19953c 100644 --- a/.github/workflows/build-quantile-forest.yml +++ b/.github/workflows/build-quantile-forest.yml @@ -48,35 +48,41 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build quantile-forest ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "quantile-forest" + version: "${{ matrix.version }}" + repository: "zillow/quantile-forest" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,scikit-learn" + cibw-test-requires: "pytest" + cibw-test-command: "pytest --doctest-modules --pyargs quantile_forest" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: QUANTILE_FOREST_VERSION: ${{ matrix.version }} - steps: - - name: Checkout quantile-forest v${{ env.QUANTILE_FOREST_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: zillow/quantile-forest - ref: v${{ env.QUANTILE_FOREST_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,scikit-learn - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest --doctest-modules --pyargs quantile_forest + name: quantile-forest-${{ env.QUANTILE_FOREST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -89,15 +95,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: quantile-forest-${{ env.QUANTILE_FOREST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish quantile-forest ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-questdb.yml b/.github/workflows/build-questdb.yml index 9498df9b4a20..f32707dbc2fa 100644 --- a/.github/workflows/build-questdb.yml +++ b/.github/workflows/build-questdb.yml @@ -49,54 +49,59 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build questdb ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "questdb" + version: "${{ matrix.version }}" + repository: "questdb/py-questdb-client" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" sparse-checkout init --cone + git -C "python-wheels" sparse-checkout set "patches/questdb" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply -v python-wheels/patches/questdb/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Replaces upstream's [tool.cibuildwheel.linux.environment], so its two keys are repeated. + cibw-environment-linux: "SETUP_DO_GIT_SUBMODULE_INIT=1 CARGO_TARGET_DIR=/tmp/qdb-cargo-target PIP_ONLY_BINARY=numpy" + # The registry has no cp314t pandas, which ci/pip_install_deps.py asserts. test.py + # self-skips without pandas and pyarrow, but not with pyarrow alone. + cibw-before-test: "${{ matrix.python == 'cp314t' && 'python -m pip install --only-binary :all: psutil' || 'python {project}/ci/pip_install_deps.py' }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: QUESTDB_VERSION: ${{ matrix.version }} - steps: - - name: Checkout py-questdb-client v${{ env.QUESTDB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: questdb/py-questdb-client - ref: v${{ env.QUESTDB_VERSION }} - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - sparse-checkout: patches/questdb - persist-credentials: false - - - name: Apply questdb patches - run: git apply -v python-wheels/patches/questdb/${{ env.QUESTDB_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces upstream's [tool.cibuildwheel.linux.environment], so its two keys are repeated. - CIBW_ENVIRONMENT: >- - SETUP_DO_GIT_SUBMODULE_INIT=1 - CARGO_TARGET_DIR=/tmp/qdb-cargo-target - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - # The registry has no cp314t pandas, which ci/pip_install_deps.py asserts. test.py - # self-skips without pandas and pyarrow, but not with pyarrow alone. - CIBW_BEFORE_TEST: >- - ${{ matrix.python == 'cp314t' - && 'python -m pip install --only-binary :all: psutil' - || 'python {project}/ci/pip_install_deps.py' }} + name: questdb-${{ env.QUESTDB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -110,15 +115,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: questdb-${{ env.QUESTDB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish questdb ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-quickjs-ng.yml b/.github/workflows/build-quickjs-ng.yml index 6a406408439c..d20deeeb76e2 100644 --- a/.github/workflows/build-quickjs-ng.yml +++ b/.github/workflows/build-quickjs-ng.yml @@ -50,6 +50,47 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build quickjs-ng ${{ matrix.version }} cp310-abi3-${{ matrix.libc }}_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # abi3 (pyproject.toml: [tool.distutils.bdist_wheel] py_limited_api = + # "cp310"), so the single cp310 build (the abi3 floor, gotcha 96) is + # loadable on every newer CPython; pyproject.toml's [tool.cibuildwheel] + # skips cp*t-* so there is no free-threaded build. + libc: [manylinux, musllinux] + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "quickjs-ng" + version: "${{ matrix.version }}" + repository: "genotrance/quickjs-ng" + ref: "v${{ matrix.version }}" + artifact-tag: "cp310-abi3-${{ matrix.libc }}_riscv64" + checkout-submodules: "recursive" + pre-build: |- + export QUICKJS_NG_VERSION='${{ matrix.version }}' + sed -i "s/^version = \".*\"/version = \"${QUICKJS_NG_VERSION}\"/" pyproject.toml + grep -qx "version = \"${QUICKJS_NG_VERSION}\"" pyproject.toml + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cp upstream-quickjs/LICENSE LICENSE.upstream-quickjs + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp310-${{ matrix.libc }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: @@ -61,45 +102,14 @@ jobs: # loadable on every newer CPython; pyproject.toml's [tool.cibuildwheel] # skips cp*t-* so there is no free-threaded build. libc: [manylinux, musllinux] - env: QUICKJS_NG_VERSION: ${{ matrix.version }} - steps: - - name: Checkout quickjs-ng v${{ env.QUICKJS_NG_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: genotrance/quickjs-ng - ref: v${{ env.QUICKJS_NG_VERSION }} - submodules: recursive - persist-credentials: false - - # The PyPI sdist omits upstream-quickjs/quickjs-c-atomics.h (setup.py's - # own get_c_sources() header list misses it), so quickjs.c fails to - # compile from that sdist on any platform without a prebuilt wheel; - # building from this checkout (submodule present on disk) sidesteps it. - # - # pyproject.toml carries a stale placeholder version; upstream's own - # build.yml stamps the real one from the tag the same way. - - name: Set version from tag - run: | - sed -i "s/^version = \".*\"/version = \"${QUICKJS_NG_VERSION}\"/" pyproject.toml - grep -qx "version = \"${QUICKJS_NG_VERSION}\"" pyproject.toml - - # upstream-quickjs/LICENSE (the vendored engine, statically compiled in) - # isn't covered by setup.py's own license-file globbing, which only - # picks up the root LICENSE (the wrapper's). - - name: Stage the vendored engine's licence for the wheel - run: cp upstream-quickjs/LICENSE LICENSE.upstream-quickjs - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: cp310-${{ matrix.libc }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} + name: quickjs-ng-${{ env.QUICKJS_NG_VERSION }}-cp310-abi3-${{ matrix.libc }}_riscv64 + path: wheelhouse - name: Check the extension and licences made it into the wheel run: | @@ -115,15 +125,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: quickjs-ng-${{ env.QUICKJS_NG_VERSION }}-cp310-abi3-${{ matrix.libc }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish quickjs-ng ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-quicksectx.yml b/.github/workflows/build-quicksectx.yml index 577bf2020d0f..75f72fe2e034 100644 --- a/.github/workflows/build-quicksectx.yml +++ b/.github/workflows/build-quicksectx.yml @@ -58,7 +58,7 @@ jobs: ref: ${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: CFLAGS='-O3 -g0 -mtune=generic -pipe -fPIC' LDFLAGS='-fPIC' + cibw-environment-linux: CFLAGS='-O3 -g0 -mtune=generic -pipe -fPIC' LDFLAGS='-fPIC' cibw-test-requires: pytest cibw-test-command: pytest {project}/tests diff --git a/.github/workflows/build-qutip.yml b/.github/workflows/build-qutip.yml index 22d59313e1f0..f9ae0aa9fc15 100644 --- a/.github/workflows/build-qutip.yml +++ b/.github/workflows/build-qutip.yml @@ -60,9 +60,7 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,matplotlib + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,matplotlib" cibw-test-environment: MPLBACKEND=Agg PYTHONUNBUFFERED=1 cibw-test-requires: >- pytest pytest-rerunfailures pytest-timeout ipython loky!=3.5.0 tqdm mpmath diff --git a/.github/workflows/build-rapidgzip.yml b/.github/workflows/build-rapidgzip.yml index 65275e76c815..b020470329d2 100644 --- a/.github/workflows/build-rapidgzip.yml +++ b/.github/workflows/build-rapidgzip.yml @@ -51,48 +51,55 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build rapidgzip ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "rapidgzip" + version: "${{ matrix.version }}" + repository: "mxmlnkn/rapidgzip" + ref: "rapidgzip-v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/rapidgzip/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-package-dir: "python/rapidgzip" + cibw-test-requires: "pytest" + cibw-test-command: "rapidgzip --version && python3 -X dev -u -m pytest {project}/src/tests/testGIL.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: RAPIDGZIP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout rapidgzip v${{ env.RAPIDGZIP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: mxmlnkn/rapidgzip - ref: rapidgzip-v${{ env.RAPIDGZIP_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch rapidgzip source - run: git apply python-wheels/patches/rapidgzip/${{ env.RAPIDGZIP_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - package-dir: python/rapidgzip - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_LINUX: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: >- - rapidgzip --version && - python3 -X dev -u -m pytest {project}/src/tests/testGIL.py + name: rapidgzip-${{ env.RAPIDGZIP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel carries the cxxopts and zlib-ng licenses run: | @@ -106,15 +113,9 @@ jobs: raise SystemExit(f"error: {entry} missing from {sys.argv[1]}: {licenses}") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: rapidgzip-${{ env.RAPIDGZIP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish rapidgzip ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-rapids-logger.yml b/.github/workflows/build-rapids-logger.yml index ae6fb710e3ec..d75b22c6633e 100644 --- a/.github/workflows/build-rapids-logger.yml +++ b/.github/workflows/build-rapids-logger.yml @@ -54,31 +54,36 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build rapids-logger ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "rapids-logger" + version: "${{ matrix.version }}" + repository: "rapidsai/rapids-logger" + ref: "v${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 180 + cibw-package-dir: "python/rapids-logger" + # wheel.py-api = "py3", so one build serves every interpreter. + cibw-build: "cp312-manylinux_riscv64" + cibw-test-command: "python -c \"import rapids_logger; rapids_logger.load_library()\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: RAPIDS_LOGGER_VERSION: ${{ matrix.version }} - steps: - - name: Checkout rapids-logger v${{ env.RAPIDS_LOGGER_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: rapidsai/rapids-logger - ref: v${{ env.RAPIDS_LOGGER_VERSION }} - persist-credentials: false - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: python/rapids-logger - output-dir: wheelhouse/ - # wheel.py-api = "py3", so one build serves every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_COMMAND: python -c "import rapids_logger; rapids_logger.load_library()" + name: rapids-logger-${{ env.RAPIDS_LOGGER_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries librapids_logger and hides fmt/spdlog symbols run: | @@ -95,15 +100,9 @@ jobs: done find "${extract_dir}" -name '*.so' - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: rapids-logger-${{ env.RAPIDS_LOGGER_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish rapids-logger ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-rapidyaml.yml b/.github/workflows/build-rapidyaml.yml index cfdf0c45e768..0f8bd335cd6e 100644 --- a/.github/workflows/build-rapidyaml.yml +++ b/.github/workflows/build-rapidyaml.yml @@ -59,7 +59,7 @@ jobs: checkout-submodules: recursive cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # Shallow checkout has no tag history for setuptools_scm to read. - cibw-environment: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_RAPIDYAML=${{ matrix.version }} + cibw-environment-linux: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_RAPIDYAML=${{ matrix.version }} cibw-test-requires: pytest cibw-test-sources: test cibw-test-command: pytest test diff --git a/.github/workflows/build-rebound.yml b/.github/workflows/build-rebound.yml index aef8ba602fde..4f3539b0df33 100644 --- a/.github/workflows/build-rebound.yml +++ b/.github/workflows/build-rebound.yml @@ -70,9 +70,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 # Upstream's FFP_CONTRACT_OFF is a runner env var, which never reaches the Linux build container. - cibw-environment: >- - FFP_CONTRACT_OFF=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "FFP_CONTRACT_OFF=1" cibw-test-environment: ${{ case(matrix.platform == 'manylinux', 'PIP_ONLY_BINARY=numpy,matplotlib,contourpy,kiwisolver,pillow', matrix.platform == 'musllinux', '', '') }} cibw-test-requires: ${{ case(matrix.platform == 'manylinux', 'pytest multiprocess matplotlib numpy', matrix.platform == 'musllinux', '', '') }} cibw-test-command: ${{ case(matrix.platform == 'manylinux', 'python -m unittest discover -v -s rebound.tests && python {project}/python_examples/dragforce/problem.py && python {project}/python_examples/megno_simple/problem.py && python {project}/python_examples/orbital_elements/problem.py && python {project}/python_examples/outersolarsystem/problem.py && python {project}/python_examples/simple_orbit/problem.py && python {project}/python_examples/longtermtest/problem.py && python {project}/python_examples/megno/problem.py', matrix.platform == 'musllinux', 'python -m unittest -v $(python -c "import pkgutil, rebound.tests as t; print(*(''rebound.tests.'' + m.name for m in pkgutil.iter_modules(t.__path__) if not m.name.startswith((''test_frequency_analysis'', ''test_plotting'', ''test_trace'', ''test_megno''))))") && python {project}/python_examples/dragforce/problem.py && python {project}/python_examples/orbital_elements/problem.py && python {project}/python_examples/outersolarsystem/problem.py && python {project}/python_examples/simple_orbit/problem.py', '') }} diff --git a/.github/workflows/build-rectangle-packer.yml b/.github/workflows/build-rectangle-packer.yml index 2ed2329ea1b2..72156d358449 100644 --- a/.github/workflows/build-rectangle-packer.yml +++ b/.github/workflows/build-rectangle-packer.yml @@ -48,35 +48,40 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build rectangle-packer ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "rectangle-packer" + version: "${{ matrix.version }}" + repository: "Penlect/rectangle-packer" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Only manylinux: our registry carries no musllinux riscv64 Cython wheel, + # so the build-time Cython dependency would need compiling from sdist there. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-command: "python -m unittest discover -v {project}/test" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: RECTANGLE_PACKER_VERSION: ${{ matrix.version }} - steps: - - name: Checkout rectangle-packer ${{ env.RECTANGLE_PACKER_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Penlect/rectangle-packer - ref: ${{ env.RECTANGLE_PACKER_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # Only manylinux: our registry carries no musllinux riscv64 Cython wheel, - # so the build-time Cython dependency would need compiling from sdist there. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_COMMAND: "python -m unittest discover -v {project}/test" + name: rectangle-packer-${{ env.RECTANGLE_PACKER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -88,16 +93,9 @@ jobs: assert licences == {"LICENSE.md"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: rectangle-packer-${{ env.RECTANGLE_PACKER_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish rectangle-packer ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-redislite.yml b/.github/workflows/build-redislite.yml index d78727fa856b..6f4b7f75f57a 100644 --- a/.github/workflows/build-redislite.yml +++ b/.github/workflows/build-redislite.yml @@ -60,49 +60,64 @@ jobs: matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} name: Build redislite ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "redislite" + version: "${{ matrix.version }}" + repository: "yahoo/redislite" + ref: "802f8a09fa23470942f8358dee1aa32dc975ea7a" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + export REDIS_VERSION=6.2.14 + export REDIS_SHA256=34e74856cbd66fdb3a684fb349d93961d8c7aa668b06f81fd93ff267d09bc277 + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply --verbose python-wheels/patches/redislite/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + set -eux + curl -sSfL -o redis.tar.gz "https://download.redis.io/releases/redis-${REDIS_VERSION}.tar.gz" + echo "${REDIS_SHA256} redis.tar.gz" | sha256sum -c - + mkdir redis.submodule + tar xzf redis.tar.gz --strip-components=1 -C redis.submodule + rm redis.tar.gz + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-test-requires: "pytest" + cibw-test-sources: "tests pytest.ini" + cibw-test-command: "pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: REDISLITE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout redislite ${{ env.REDISLITE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: yahoo/redislite - ref: ${{ env.REDISLITE_REF }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply --verbose python-wheels/patches/redislite/${{ env.REDISLITE_VERSION }}/*.patch - - # build_scripts/update_redis_server.py, with curl: download.redis.io answers 403 to Python-urllib. - - name: Download the Redis ${{ env.REDIS_VERSION }} sources into redis.submodule - run: | - set -eux - curl -sSfL -o redis.tar.gz "https://download.redis.io/releases/redis-${REDIS_VERSION}.tar.gz" - echo "${REDIS_SHA256} redis.tar.gz" | sha256sum -c - - mkdir redis.submodule - tar xzf redis.tar.gz --strip-components=1 -C redis.submodule - rm redis.tar.gz - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - output-dir: wheelhouse/ - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests pytest.ini - CIBW_TEST_COMMAND: pytest tests + name: redislite-${{ env.REDISLITE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the Redis binaries and licences made it into the wheel run: | @@ -118,15 +133,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: redislite-${{ env.REDISLITE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish redislite ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-regions.yml b/.github/workflows/build-regions.yml index 520ca91ba7f0..68c1b6dd2997 100644 --- a/.github/workflows/build-regions.yml +++ b/.github/workflows/build-regions.yml @@ -54,35 +54,37 @@ jobs: matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} name: Build regions ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "regions" + version: "${{ matrix.version }}" + repository: "astropy/regions" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION_FOR_REGIONS=${{ matrix.version }}" + cibw-test-extras: "test" + cibw-test-command: "pytest -p no:warnings --pyargs regions" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy,astropy,pyerfa,pyyaml,coverage,hypothesis" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 - + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: REGIONS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout regions v${{ env.REGIONS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: astropy/regions - ref: v${{ env.REGIONS_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_REGIONS=${{ env.REGIONS_VERSION }} - CIBW_TEST_EXTRAS: test - CIBW_TEST_COMMAND: pytest -p no:warnings --pyargs regions - CIBW_TEST_ENVIRONMENT: >- - PIP_ONLY_BINARY=numpy,scipy,astropy,pyerfa,pyyaml,coverage,hypothesis + name: regions-${{ env.REGIONS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -100,16 +102,9 @@ jobs: assert licences == {"LICENSE.rst"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: regions-${{ env.REGIONS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish regions ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-regopy.yml b/.github/workflows/build-regopy.yml index bb0c4edb941b..9240874a30a2 100644 --- a/.github/workflows/build-regopy.yml +++ b/.github/workflows/build-regopy.yml @@ -51,6 +51,32 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build regopy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "regopy" + version: "${{ matrix.version }}" + repository: "microsoft/rego-cpp" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 240 + cibw-package-dir: "wrappers/python" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # Upstream's wheels ship no licence: stage rego-cpp's own and the vendored OpenSSL's beside setup.py. + cibw-before-all: "${{ case(matrix.platform == 'manylinux', 'dnf makecache && dnf install -y openssl-devel', matrix.platform == 'musllinux', 'apk add openssl-dev', '') }} && cp {project}/LICENSE {package}/LICENSE && curl -fsSL --retry 5 -o {package}/LICENSE.openssl https://raw.githubusercontent.com/openssl/openssl/openssl-$(pkg-config --modversion openssl)/LICENSE.txt" + # librego_shared.so aborts in a static initialiser on dlopen with snmalloc on riscv64; + # upstream already builds without it on macOS. + cibw-environment-linux: "REGOCPP_REPO=LOCAL CMAKE_ARGS=-DREGOCPP_USE_SNMALLOC=OFF" + cibw-test-requires: "pytest" + cibw-test-command: "pytest -vv -ra --doctest-modules --pyargs regopy {package}/test" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 strategy: @@ -59,39 +85,12 @@ jobs: include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: REGOPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout rego-cpp ${{ env.REGOPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: microsoft/rego-cpp - ref: v${{ env.REGOPY_VERSION }} - persist-credentials: false - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: wrappers/python - output-dir: wheelhouse - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # Upstream's wheels ship no licence: stage rego-cpp's own and the vendored OpenSSL's beside setup.py. - CIBW_BEFORE_ALL: >- - ${{ case(matrix.platform == 'manylinux', 'dnf makecache && dnf install -y openssl-devel', matrix.platform == 'musllinux', 'apk add openssl-dev', '') }} && - cp {project}/LICENSE {package}/LICENSE && - curl -fsSL --retry 5 -o {package}/LICENSE.openssl - https://raw.githubusercontent.com/openssl/openssl/openssl-$(pkg-config --modversion openssl)/LICENSE.txt - # librego_shared.so aborts in a static initialiser on dlopen with snmalloc on riscv64; - # upstream already builds without it on macOS. - CIBW_ENVIRONMENT: >- - REGOCPP_REPO=LOCAL - CMAKE_ARGS=-DREGOCPP_USE_SNMALLOC=OFF - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest -vv -ra --doctest-modules --pyargs regopy {package}/test + name: regopy-${{ env.REGOPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the library and both licences run: | @@ -105,12 +104,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: regopy-${{ env.REGOPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -142,7 +135,7 @@ jobs: publish: name: Publish regopy ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-reproject.yml b/.github/workflows/build-reproject.yml index 42167299a7c7..e17e626568f0 100644 --- a/.github/workflows/build-reproject.yml +++ b/.github/workflows/build-reproject.yml @@ -57,45 +57,45 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build reproject ${{ matrix.version }} cp311-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "reproject" + version: "${{ matrix.version }}" + repository: "astropy/reproject" + ref: "v${{ matrix.version }}" + artifact-tag: "cp311-abi3-manylinux_riscv64" + timeout-minutes: 360 + # One abi3 wheel, built on cp311 -- the oldest interpreter its tag + # claims -- and re-tested on the newer ones via find_compatible_wheel. + cibw-build: "cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # astropy-healpix, numcodecs and google-crc32c (runtime dependencies) have + # no cp311 riscv64 wheel on any index, so the floor is built but not tested. + cibw-test-skip: "cp311-*" + # numpy is a build and a runtime requirement, and only our registry has + # it for riscv64; only-binary keeps a newer PyPI release from winning the + # resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION_FOR_REPROJECT=${{ matrix.version }}" + cibw-test-extras: "test" + cibw-test-command: "pytest -p no:warnings --pyargs reproject --log-cli-level=INFO" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy,astropy,astropy-healpix,pyerfa,pillow,pyyaml,numcodecs,google-crc32c" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: REPROJECT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout reproject v${{ env.REPROJECT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: astropy/reproject - ref: v${{ env.REPROJECT_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # One abi3 wheel, built on cp311 -- the oldest interpreter its tag - # claims -- and re-tested on the newer ones via find_compatible_wheel. - CIBW_BUILD: >- - cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - # astropy-healpix, numcodecs and google-crc32c (runtime dependencies) have - # no cp311 riscv64 wheel on any index, so the floor is built but not tested. - CIBW_TEST_SKIP: cp311-* - # numpy is a build and a runtime requirement, and only our registry has - # it for riscv64; only-binary keeps a newer PyPI release from winning the - # resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_REPROJECT=${{ env.REPROJECT_VERSION }} - CIBW_TEST_EXTRAS: test - CIBW_TEST_COMMAND: pytest -p no:warnings --pyargs reproject --log-cli-level=INFO - CIBW_TEST_ENVIRONMENT: >- - PIP_ONLY_BINARY=numpy,scipy,astropy,astropy-healpix,pyerfa,pillow,pyyaml,numcodecs,google-crc32c + name: reproject-${{ env.REPROJECT_VERSION }}-cp311-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -112,16 +112,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: reproject-${{ env.REPROJECT_VERSION }}-cp311-abi3-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish reproject ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-rfc3161-client.yml b/.github/workflows/build-rfc3161-client.yml index d31356105e27..ba84c346403a 100644 --- a/.github/workflows/build-rfc3161-client.yml +++ b/.github/workflows/build-rfc3161-client.yml @@ -49,6 +49,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build rfc3161-client ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # pyo3 is built with the `abi3-py39` feature ([tool.maturin] features + # in pyproject.toml), so one abi3 wheel serves every GIL-ful + # interpreter; pyo3 disables abi3 under Py_GIL_DISABLED, giving the + # free-threaded build its own wheel. + - tag: cp39-abi3 + build: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 + - tag: cp314t + build: cp314t-manylinux_riscv64 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "rfc3161-client" + version: "${{ matrix.version }}" + repository: "trailofbits/rfc3161-client" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.build }}" + # rfc3161-client ships no [tool.cibuildwheel]; install the Rust + # toolchain its maturin backend needs, plus full perl - the openssl + # crate's `vendored` feature builds OpenSSL from source and the + # image ships only perl-interpreter, whose Configure dies on a + # missing FindBin (gotcha 46). + cibw-before-all-linux: "dnf -y install perl && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest pretend" + cibw-test-command: "python -c \"import rfc3161_client._rust as m; assert m.__file__.endswith('.so'), m.__file__\" && python -m pytest {project}/test -q" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: @@ -64,40 +100,14 @@ jobs: build: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - tag: cp314t build: cp314t-manylinux_riscv64 - env: RFC3161_CLIENT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout rfc3161-client v${{ env.RFC3161_CLIENT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: trailofbits/rfc3161-client - ref: v${{ env.RFC3161_CLIENT_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # rfc3161-client ships no [tool.cibuildwheel]; install the Rust - # toolchain its maturin backend needs, plus full perl - the openssl - # crate's `vendored` feature builds OpenSSL from source and the - # image ships only perl-interpreter, whose Configure dies on a - # missing FindBin (gotcha 46). - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install perl && - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest pretend - CIBW_TEST_COMMAND: >- - python -c "import rfc3161_client._rust as m; assert m.__file__.endswith('.so'), m.__file__" && - python -m pytest {project}/test -q + name: rfc3161-client-${{ env.RFC3161_CLIENT_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check the extension and licence made it into the wheel run: | @@ -112,15 +122,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: rfc3161-client-${{ env.RFC3161_CLIENT_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish rfc3161-client ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-rhino3dm.yml b/.github/workflows/build-rhino3dm.yml index e71861eaac4d..69513bb0b46e 100644 --- a/.github/workflows/build-rhino3dm.yml +++ b/.github/workflows/build-rhino3dm.yml @@ -54,64 +54,71 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build rhino3dm ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - RHINO3DM_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout rhino3dm ${{ env.RHINO3DM_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: mcneel/rhino3dm - ref: ${{ env.RHINO3DM_REF }} - # opennurbs, draco and pybind11 are submodules, statically linked - # into the _rhino3dm extension. - submodules: recursive - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "rhino3dm" + version: "${{ matrix.version }}" + repository: "mcneel/rhino3dm" + ref: "56daf09ab774cc02b69a1de2e17a1c8746550778" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + git apply python-wheels/patches/rhino3dm/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - # GCC's riscv64 LTO codegen overflows a relocation linking the - # merged opennurbs+draco+bindings translation unit; see the patch. - - name: Patch rhino3dm source - run: git apply python-wheels/patches/rhino3dm/${{ env.RHINO3DM_VERSION }}/00*.patch + cp src/lib/opennurbs/LICENSE LICENSE.opennurbs + cp src/lib/draco/LICENSE LICENSE.draco + cp src/lib/pybind11/LICENSE LICENSE.pybind11 - # opennurbs, draco and pybind11 are compiled into the wheel, but - # upstream's own MANIFEST.in only ships rhino3dm's own LICENSE. - # setuptools' default license_files glob (LICEN[CS]E*) picks up files - # named this way at the root with no setup.py change. - - name: Stage the vendored dependencies' licences - run: | - cp src/lib/opennurbs/LICENSE LICENSE.opennurbs - cp src/lib/draco/LICENSE LICENSE.draco - cp src/lib/pybind11/LICENSE LICENSE.pybind11 + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py shells out to `cmake` directly; it is not a declared + # build requirement anywhere upstream, so it has to be on PATH + # before setup.py runs. + cibw-before-build: "pip install \"cmake>=3.16\"" + # cmake's riscv64 wheel on our registry lags PyPI's latest, which + # has none; PIP_ONLY_BINARY keeps pip from trying to build the + # newer sdist from source. + cibw-environment-linux: "PIP_ONLY_BINARY=cmake" + cibw-test-command: "cd {project}/tests/python && python -m unittest discover ." - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 180 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + RHINO3DM_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py shells out to `cmake` directly; it is not a declared - # build requirement anywhere upstream, so it has to be on PATH - # before setup.py runs. - CIBW_BEFORE_BUILD: pip install "cmake>=3.16" - # cmake's riscv64 wheel on our registry lags PyPI's latest, which - # has none; PIP_ONLY_BINARY keeps pip from trying to build the - # newer sdist from source. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=cmake - CIBW_TEST_COMMAND: cd {project}/tests/python && python -m unittest discover . + name: rhino3dm-${{ env.RHINO3DM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -127,15 +134,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: rhino3dm-${{ env.RHINO3DM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish rhino3dm ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-riskcal.yml b/.github/workflows/build-riskcal.yml index 388b7c805539..811a62b075da 100644 --- a/.github/workflows/build-riskcal.yml +++ b/.github/workflows/build-riskcal.yml @@ -58,7 +58,7 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" cibw-test-requires: pytest cibw-test-sources: tests # test_blackbox.py imports opacus (torch); the rest of the suite runs on the wheel. diff --git a/.github/workflows/build-riskfolio-lib.yml b/.github/workflows/build-riskfolio-lib.yml index ea964f21b8e9..6d4cbbfd46ca 100644 --- a/.github/workflows/build-riskfolio-lib.yml +++ b/.github/workflows/build-riskfolio-lib.yml @@ -56,79 +56,79 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build riskfolio-lib ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "riskfolio-lib" + version: "${{ matrix.version }}" + repository: "dcajasn/Riskfolio-Lib" + ref: "9eb32d350095b307bb4a3fef7e35d00c6488b283" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/riskfolio-lib/${{ matrix.version }}/0*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cp lib/eigen-3.4.0/COPYING.MPL2 COPYING.eigen + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # matplotlib (already pinned below) transitively pulls in pillow; PyPI's pillow + # is newer than our registry's ceiling, so an unbounded test install picks PyPI's + # sdist-only release and fails to build it (no libjpeg headers in the manylinux + # image). Pin pillow to our registry's wheel for the test install too. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,pandas,matplotlib,pillow,clarabel,scs,scikit-learn,statsmodels,arch,astropy,cvxpy,osqp,highspy,qdldl,sparsediffpy" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + # tests/test_portfolio.py's 6 Classic/HC optimization tests compare live solver + # output against frozen CSV snapshots with assert_array_almost_equal(decimal=6); + # upstream's own CI has this test file's step commented out on every OS/arch it + # builds (see Riskfolio-Lib's .github/workflows/build.yml), so those snapshots are + # untested against any live solver version, and HRP/HERC additionally run + # hierarchical-clustering tie-breaks that flip under tiny floating-point + # differences - not riscv64-specific, just never exercised anywhere, on an + # ill-conditioned covariance matrix (CI log shows scipy's LinAlgWarning plus + # CVXPY's "solution may be inaccurate" on the same inputs). Separately, + # test_hc_nco_optimization fails unconditionally on any platform: it calls + # HCPortfolio.optimization(covariance=...), a kwarg the method (method_cov=, not + # covariance=) has never accepted in 7.4.0 - verified against the pinned commit's + # own source - an upstream test/library mismatch, not a riscv64 issue. + cibw-test-command: "python -c \"import riskfolio; print(riskfolio.__version__)\" && python -m pytest tests -v -k \"not test_classic_minrisk_optimization and not test_classic_sharpe_optimization and not test_classic_riskparity_optimization and not test_worst_case_optimization and not test_hc_hrp_optimization and not test_hc_herc_optimization and not test_hc_nco_optimization\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: RISKFOLIO_LIB_VERSION: ${{ matrix.version }} - steps: - # dcajasn/Riskfolio-Lib publishes no tags; this is the commit that - # released riskfolio-lib 7.4.0 to PyPI (the next commit bumped to 7.4.1). - - name: Checkout riskfolio-lib v${{ env.RISKFOLIO_LIB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: dcajasn/Riskfolio-Lib - ref: 9eb32d350095b307bb4a3fef7e35d00c6488b283 - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch riskfolio-lib source - run: git apply python-wheels/patches/riskfolio-lib/${{ env.RISKFOLIO_LIB_VERSION }}/0*.patch - - # riskfolio.external.functions links Eigen 3.4.0, vendored at - # lib/eigen-3.4.0 without its own licence reaching the wheel. - - name: Stage the vendored dependency's licence - run: cp lib/eigen-3.4.0/COPYING.MPL2 COPYING.eigen - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # matplotlib (already pinned below) transitively pulls in pillow; PyPI's pillow - # is newer than our registry's ceiling, so an unbounded test install picks PyPI's - # sdist-only release and fails to build it (no libjpeg headers in the manylinux - # image). Pin pillow to our registry's wheel for the test install too. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas,matplotlib,pillow,clarabel,scs,scikit-learn,statsmodels,arch,astropy,cvxpy,osqp,highspy,qdldl,sparsediffpy - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - # tests/test_portfolio.py's 6 Classic/HC optimization tests compare live solver - # output against frozen CSV snapshots with assert_array_almost_equal(decimal=6); - # upstream's own CI has this test file's step commented out on every OS/arch it - # builds (see Riskfolio-Lib's .github/workflows/build.yml), so those snapshots are - # untested against any live solver version, and HRP/HERC additionally run - # hierarchical-clustering tie-breaks that flip under tiny floating-point - # differences - not riscv64-specific, just never exercised anywhere, on an - # ill-conditioned covariance matrix (CI log shows scipy's LinAlgWarning plus - # CVXPY's "solution may be inaccurate" on the same inputs). Separately, - # test_hc_nco_optimization fails unconditionally on any platform: it calls - # HCPortfolio.optimization(covariance=...), a kwarg the method (method_cov=, not - # covariance=) has never accepted in 7.4.0 - verified against the pinned commit's - # own source - an upstream test/library mismatch, not a riscv64 issue. - CIBW_TEST_COMMAND: >- - python -c "import riskfolio; print(riskfolio.__version__)" && - python -m pytest tests -v - -k "not test_classic_minrisk_optimization - and not test_classic_sharpe_optimization - and not test_classic_riskparity_optimization - and not test_worst_case_optimization - and not test_hc_hrp_optimization - and not test_hc_herc_optimization - and not test_hc_nco_optimization" + name: riskfolio-lib-${{ env.RISKFOLIO_LIB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and all licences run: | @@ -143,15 +143,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: riskfolio-lib-${{ env.RISKFOLIO_LIB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish riskfolio-lib ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-rjieba.yml b/.github/workflows/build-rjieba.yml index 36ec4aee2a29..ce315fe55f56 100644 --- a/.github/workflows/build-rjieba.yml +++ b/.github/workflows/build-rjieba.yml @@ -51,6 +51,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build rjieba ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # pyo3's abi3-py38 feature (Cargo.toml) gives one wheel for every + # GIL-ful interpreter; free-threaded builds disable abi3 and get + # their own (upstream's CI.yml builds them as a separate maturin + # pass with `-i python3.14t` for the same reason). + - tag: cp38-abi3 + # Built on cp312 -- the oldest interpreter in our matrix -- and + # re-tested on cp313/cp314 via find_compatible_wheel. + build: >- + cp312-manylinux_riscv64 cp313-manylinux_riscv64 + cp314-manylinux_riscv64 + - tag: cp314t + build: cp314t-manylinux_riscv64 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "rjieba" + version: "${{ matrix.version }}" + repository: "messense/rjieba-py" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/rjieba/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.build }}" + # rjieba ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import rjieba; assert rjieba.rjieba.__file__.endswith('.so'), rjieba.rjieba.__file__\" && python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: @@ -70,45 +121,14 @@ jobs: cp314-manylinux_riscv64 - tag: cp314t build: cp314t-manylinux_riscv64 - env: RJIEBA_VERSION: ${{ matrix.version }} - steps: - - name: Checkout rjieba v${{ env.RJIEBA_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: messense/rjieba-py - ref: v${{ env.RJIEBA_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Patch rjieba source - run: git apply python-wheels/patches/rjieba/${{ env.RJIEBA_VERSION }}/*.patch - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # rjieba ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import rjieba; assert rjieba.rjieba.__file__.endswith('.so'), rjieba.rjieba.__file__" && - python -m pytest -v tests + name: rjieba-${{ env.RJIEBA_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check the licence made it into the wheel run: | @@ -120,15 +140,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: rjieba-${{ env.RJIEBA_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish rjieba ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-rl-accel.yml b/.github/workflows/build-rl-accel.yml index c7ac7b5328b9..a79da85ae5a9 100644 --- a/.github/workflows/build-rl-accel.yml +++ b/.github/workflows/build-rl-accel.yml @@ -53,39 +53,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build rl-accel ${{ matrix.version }} cp37-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "rl-accel" + version: "${{ matrix.version }}" + repository: "MrBitBucket/rl-accel-mirror" + ref: "c40d10c99b5a1a7e88146bacab67c36541a371ee" + artifact-tag: "cp37-abi3-manylinux_riscv64" + # setup.py's bdist_wheel_abi3 always tags the wheel cp37-abi3 on Linux + # (gotcha 34 shape), so build once and let cibuildwheel reuse+retest the + # same wheel on cp313/cp314 (gotcha 96). No free-threaded wheel: cp314t + # can't target Py_LIMITED_API, same as upstream builds only cp313-*. + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + cibw-test-command: "python {project}/tests/testcs.py && python {project}/tests/testrc.py | tee /tmp/testrc.out && ! grep -q 'reference counts changed' /tmp/testrc.out" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: RL_ACCEL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout rl_accel ${{ env.RL_ACCEL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: MrBitBucket/rl-accel-mirror - ref: c40d10c99b5a1a7e88146bacab67c36541a371ee - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - # setup.py's bdist_wheel_abi3 always tags the wheel cp37-abi3 on Linux - # (gotcha 34 shape), so build once and let cibuildwheel reuse+retest the - # same wheel on cp313/cp314 (gotcha 96). No free-threaded wheel: cp314t - # can't target Py_LIMITED_API, same as upstream builds only cp313-*. - CIBW_BUILD: >- - cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_TEST_COMMAND: >- - python {project}/tests/testcs.py && - python {project}/tests/testrc.py | tee /tmp/testrc.out && - ! grep -q 'reference counts changed' /tmp/testrc.out + name: rl-accel-${{ env.RL_ACCEL_VERSION }}-cp37-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the wheel is abi3 and carries the compiled extension + LICENSE run: | @@ -100,15 +103,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: rl-accel-${{ env.RL_ACCEL_VERSION }}-cp37-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish rl-accel ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-rnet.yml b/.github/workflows/build-rnet.yml index f0dc080e9197..b02150aa3f6a 100644 --- a/.github/workflows/build-rnet.yml +++ b/.github/workflows/build-rnet.yml @@ -69,10 +69,7 @@ jobs: cibw-before-build-linux: >- printf 'version = 4\n\n[[package]]\nname = "wreq"\nversion = "5.3.0"\nsource = "registry+https://github.com/rust-lang/crates.io-index"\n\n[[package]]\nname = "wreq-util"\nversion = "2.2.6"\nsource = "registry+https://github.com/rust-lang/crates.io-index"\n' > Cargo.lock && cargo update --workspace - cibw-environment-linux: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CARGO_BUILD_JOBS=2 + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" CARGO_BUILD_JOBS=2" cibw-test-requires: pytest pytest-asyncio pytest-rerunfailures cibw-test-sources: tests README.md Cargo.toml LICENSE cibw-test-command: >- diff --git a/.github/workflows/build-roaringbitmap.yml b/.github/workflows/build-roaringbitmap.yml index 8fd9984d77ff..d3a3d781b18b 100644 --- a/.github/workflows/build-roaringbitmap.yml +++ b/.github/workflows/build-roaringbitmap.yml @@ -58,7 +58,7 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: ROARINGBITMAP_BUILD_WHEEL=1 + cibw-environment-linux: ROARINGBITMAP_BUILD_WHEEL=1 publish: name: Publish roaringbitmap ${{ matrix.version }} diff --git a/.github/workflows/build-roboticstoolbox-python.yml b/.github/workflows/build-roboticstoolbox-python.yml index 48fd9fc917a1..07ae8c96c60a 100644 --- a/.github/workflows/build-roboticstoolbox-python.yml +++ b/.github/workflows/build-roboticstoolbox-python.yml @@ -49,101 +49,99 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build roboticstoolbox-python ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "roboticstoolbox-python" + version: "${{ matrix.version }}" + repository: "petercorke/robotics-toolbox-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + curl -fsSL --retry 5 -o COPYING.eigen https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,pillow,matplotlib,contourpy,kiwisolver,quadprog,pyyaml" + # upstream's [dev] extra minus coal (no riscv64 wheel) and lint/coverage/notebook tooling; + # quadprog has no cp310/cp311 riscv64 wheel, so those skip the QP tests (skip_no_qp). + # ipython/pygments (upstream's own separate "tool" extra, not part of [dev]) are + # required too: tests/test_bin.py's TestRtbtool class genuinely needs them to start + # rtbtool itself, not just to skip gracefully (confirmed from the real cp312 CI log, + # job 130955489429 - 4 failures, each "rtbtool requires IPython and pygments, which + # are not installed"). Upstream's own CI gets these for free as a transitive + # dependency of [dev]'s nbmake/ipympl (deliberately excluded here as "notebook + # tooling"), masking that [dev] alone never actually lists them. + cibw-test-requires: "pytest pytest-timeout pyyaml sympy bdsim trimesh ipython pygments \"qpsolvers; python_version >= '3.12'\" \"quadprog; python_version >= '3.12'\"" + # src is needed too: tests/test_backend_capabilities.py's + # TestBaseRobotNoModuleLevelMPLImport class reads src/roboticstoolbox/robot/ + # BaseRobot.py's own source text directly (an AST check that it imports no top-level + # matplotlib), not via the installed package - confirmed from the real cp312 CI log + # (job 130955489429): FileNotFoundError on that relative path when only tests/ is + # shipped. + cibw-test-sources: "tests docs/notebooks src pyproject.toml" + # jaco's General6RIK symbolic derivation (sympy) is cached in a module-level dict + # keyed by the robot's DH parameters, not per-test, so whichever test in this file + # first calls self.jaco.analytic_ik() pays the full derivation cost - and that + # derivation takes well over upstream's 50s timeout on riscv64. Deselecting + # test_general (confirmed from the real cp310 CI log) just moved the "first caller" + # to test_generate, then to test_generated_c_is_for_embedded_use/ + # test_generated_python_agrees's shared path, and now (confirmed from the real + # cp312 CI log) to test_methods, the only remaining test in this class that touches + # self.jaco.analytic_ik(). Checked every other test in the real upstream + # test_analytic_ik.py (v1.5.0): none of the rest call analytic_ik() on jaco, only on + # puma/stanford (ClosedFormIK, not the slow General6RIK path) or on throwaway + # DHRobot/Planar2 fixtures that raise before any derivation - so this closes out the + # whole class rather than trading one slow test for the next. + # + # A fourth, unrelated test (test_fdyn_without_optional_arguments, scipy's RK + # integrator inside puma.fdyn()) then hit the same 50s ceiling on EVERY interpreter + # (confirmed from the real cp312 CI log, job 130860352399), not just one arch-specific + # outlier: this is riscv64 being generically slower at floating-point-heavy numeric + # work than upstream's own CI hardware, the same class of gap as the IK derivations + # above. Raising --timeout from upstream's 50s to 300s (kept below) gave every other + # test real headroom, but this one still ran past even that: 970s on cp314 (confirmed + # from the real CI log, job 130932228943) before pytest-timeout's own --timeout_method + # finally killed it. "thread" mode can only dump a stack and report a failure; it + # can't interrupt the call. rk_step()'s own traceback shows a plain Python/numpy loop + # (not a single uninterruptible C call), so the test isn't hanging - it's just doing + # far more wall-clock work than any practical timeout should wait out. Deselect it + # alongside the IK derivations rather than keep raising the ceiling for one test. + # + # That same cp314 run also showed 6 unexplained real failures (not timeouts) around + # 26% progress through the suite ("FF..FFF..F" in -q's dot output); the run was killed + # by the fdyn timeout above before pytest ever printed its summary, so their names + # never made it into the log. Added -v so a future run's own live log carries every + # test's name and outcome as it happens, not just in a final summary that a timeout + # kill can erase - needed to actually diagnose those 6 on the next failure instead of + # losing them again. + cibw-test-command: "python -c \"from roboticstoolbox.ets.fknm import _C_AVAILABLE as a; from roboticstoolbox.robot.frne import _C_AVAILABLE as b; assert a and b\" && python -m pytest tests --ignore=tests/test_blocks.py -m \"not slow\" --timeout=300 --timeout_method=thread --deselect \"tests/test_analytic_ik.py::TestAnalyticIK::test_general\" --deselect \"tests/test_analytic_ik.py::TestAnalyticIK::test_generate\" --deselect \"tests/test_analytic_ik.py::TestAnalyticIK::test_generated_c_is_for_embedded_use\" --deselect \"tests/test_analytic_ik.py::TestAnalyticIK::test_generated_python_agrees\" --deselect \"tests/test_analytic_ik.py::TestAnalyticIK::test_methods\" --deselect \"tests/test_dynamics_defaults.py::test_fdyn_without_optional_arguments\" -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: RTB_VERSION: ${{ matrix.version }} - steps: - - name: Checkout roboticstoolbox-python ${{ env.RTB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: petercorke/robotics-toolbox-python - ref: v${{ env.RTB_VERSION }} - persist-credentials: false - - # The vendored header-only Eigen has no LICENSE of its own in this tree. - - name: Stage Eigen's licence - run: curl -fsSL --retry 5 -o COPYING.eigen https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pillow,matplotlib,contourpy,kiwisolver,quadprog,pyyaml - # upstream's [dev] extra minus coal (no riscv64 wheel) and lint/coverage/notebook tooling; - # quadprog has no cp310/cp311 riscv64 wheel, so those skip the QP tests (skip_no_qp). - # ipython/pygments (upstream's own separate "tool" extra, not part of [dev]) are - # required too: tests/test_bin.py's TestRtbtool class genuinely needs them to start - # rtbtool itself, not just to skip gracefully (confirmed from the real cp312 CI log, - # job 130955489429 - 4 failures, each "rtbtool requires IPython and pygments, which - # are not installed"). Upstream's own CI gets these for free as a transitive - # dependency of [dev]'s nbmake/ipympl (deliberately excluded here as "notebook - # tooling"), masking that [dev] alone never actually lists them. - CIBW_TEST_REQUIRES: >- - pytest pytest-timeout pyyaml sympy bdsim trimesh ipython pygments - "qpsolvers; python_version >= '3.12'" "quadprog; python_version >= '3.12'" - # src is needed too: tests/test_backend_capabilities.py's - # TestBaseRobotNoModuleLevelMPLImport class reads src/roboticstoolbox/robot/ - # BaseRobot.py's own source text directly (an AST check that it imports no top-level - # matplotlib), not via the installed package - confirmed from the real cp312 CI log - # (job 130955489429): FileNotFoundError on that relative path when only tests/ is - # shipped. - CIBW_TEST_SOURCES: tests docs/notebooks src pyproject.toml - # jaco's General6RIK symbolic derivation (sympy) is cached in a module-level dict - # keyed by the robot's DH parameters, not per-test, so whichever test in this file - # first calls self.jaco.analytic_ik() pays the full derivation cost - and that - # derivation takes well over upstream's 50s timeout on riscv64. Deselecting - # test_general (confirmed from the real cp310 CI log) just moved the "first caller" - # to test_generate, then to test_generated_c_is_for_embedded_use/ - # test_generated_python_agrees's shared path, and now (confirmed from the real - # cp312 CI log) to test_methods, the only remaining test in this class that touches - # self.jaco.analytic_ik(). Checked every other test in the real upstream - # test_analytic_ik.py (v1.5.0): none of the rest call analytic_ik() on jaco, only on - # puma/stanford (ClosedFormIK, not the slow General6RIK path) or on throwaway - # DHRobot/Planar2 fixtures that raise before any derivation - so this closes out the - # whole class rather than trading one slow test for the next. - # - # A fourth, unrelated test (test_fdyn_without_optional_arguments, scipy's RK - # integrator inside puma.fdyn()) then hit the same 50s ceiling on EVERY interpreter - # (confirmed from the real cp312 CI log, job 130860352399), not just one arch-specific - # outlier: this is riscv64 being generically slower at floating-point-heavy numeric - # work than upstream's own CI hardware, the same class of gap as the IK derivations - # above. Raising --timeout from upstream's 50s to 300s (kept below) gave every other - # test real headroom, but this one still ran past even that: 970s on cp314 (confirmed - # from the real CI log, job 130932228943) before pytest-timeout's own --timeout_method - # finally killed it. "thread" mode can only dump a stack and report a failure; it - # can't interrupt the call. rk_step()'s own traceback shows a plain Python/numpy loop - # (not a single uninterruptible C call), so the test isn't hanging - it's just doing - # far more wall-clock work than any practical timeout should wait out. Deselect it - # alongside the IK derivations rather than keep raising the ceiling for one test. - # - # That same cp314 run also showed 6 unexplained real failures (not timeouts) around - # 26% progress through the suite ("FF..FFF..F" in -q's dot output); the run was killed - # by the fdyn timeout above before pytest ever printed its summary, so their names - # never made it into the log. Added -v so a future run's own live log carries every - # test's name and outcome as it happens, not just in a final summary that a timeout - # kill can erase - needed to actually diagnose those 6 on the next failure instead of - # losing them again. - CIBW_TEST_COMMAND: >- - python -c "from roboticstoolbox.ets.fknm import _C_AVAILABLE as a; from roboticstoolbox.robot.frne import _C_AVAILABLE as b; assert a and b" - && python -m pytest tests --ignore=tests/test_blocks.py -m "not slow" --timeout=300 --timeout_method=thread - --deselect "tests/test_analytic_ik.py::TestAnalyticIK::test_general" - --deselect "tests/test_analytic_ik.py::TestAnalyticIK::test_generate" - --deselect "tests/test_analytic_ik.py::TestAnalyticIK::test_generated_c_is_for_embedded_use" - --deselect "tests/test_analytic_ik.py::TestAnalyticIK::test_generated_python_agrees" - --deselect "tests/test_analytic_ik.py::TestAnalyticIK::test_methods" - --deselect "tests/test_dynamics_defaults.py::test_fdyn_without_optional_arguments" - -v + name: roboticstoolbox-python-${{ env.RTB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -159,15 +157,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: roboticstoolbox-python-${{ env.RTB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish roboticstoolbox-python ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-robust-laplacian.yml b/.github/workflows/build-robust-laplacian.yml index fc71bfda14da..a977b9faec19 100644 --- a/.github/workflows/build-robust-laplacian.yml +++ b/.github/workflows/build-robust-laplacian.yml @@ -53,74 +53,77 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build robust-laplacian ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "robust-laplacian" + version: "${{ matrix.version }}" + repository: "nmwsharp/robust-laplacians-py" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-submodules: "recursive" + pre-build: |- + set -euo pipefail + curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/45fab4087eaaff234227a10cf7845e8b07f28a98/LICENSE" -o LICENSE.pybind11 + { + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/81bdde705cc69776fd63c870581ee0c793d48873/COPYING.README" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/81bdde705cc69776fd63c870581ee0c793d48873/COPYING.MPL2" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/81bdde705cc69776fd63c870581ee0c793d48873/COPYING.BSD" + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/81bdde705cc69776fd63c870581ee0c793d48873/COPYING.LGPL" + } > LICENSE.eigen + cp deps/geometry-central/LICENSE LICENSE.geometry-central + cp deps/geometry-central/deps/happly/LICENSE LICENSE.happly + # nanoflann (BSD) and nanort (MIT) are vendored straight into + # geometry-central (no submodule of their own); jc_voronoi (MIT) is + # vendored straight into this repo. All three carry their licence + # as a header comment instead of a LICENSE file. + sed -n '1,30p' deps/geometry-central/deps/nanoflann/include/nanoflann.hpp > LICENSE.nanoflann + sed -n '5,28p' deps/geometry-central/deps/nanort/include/nanort/nanort.h > LICENSE.nanort + sed -n '1479,1500p' deps/jc_voronoi/include/jc_voronoi/jc_voronoi.h > LICENSE.jc_voronoi + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-config-file: ".github/workflows/cibuildwheel_config.toml" + # scikit-build-core's own pip-installed cmake/ninja (which upstream's + # before-all forces by removing the image's cmake) both have riscv64 + # wheels on our registry already, so upstream's config needs no + # riscv64-specific override here. + # The upstream build's default Release config (scikit-build-core's + # own default) crashes the in-wheel test with a SIGSEGV and no + # Python traceback on every interpreter leg; RelWithDebInfo (-O2 + # instead of -O3) does not. No further root cause was found after + # a native gdb backtrace came back clean under it too (nothing to + # see because nothing crashed) - see gotcha 662. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,cmake,ninja SKBUILD_CMAKE_BUILD_TYPE=RelWithDebInfo" + cibw-test-requires: "scipy" + cibw-test-command: "python {project}/test/robust_laplacian_test.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: ROBUST_LAPLACIAN_VERSION: ${{ matrix.version }} - steps: - - name: Checkout robust-laplacians-py v${{ env.ROBUST_LAPLACIAN_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: nmwsharp/robust-laplacians-py - ref: v${{ env.ROBUST_LAPLACIAN_VERSION }} - submodules: 'recursive' - persist-credentials: false - - # CMakeLists.txt compiles deps/{pybind11,eigen,geometry-central} and - # geometry-central's own deps/{happly,nanoflann,nanort} into the - # extension; upstream's own wheel ships only its own LICENSE (MIT). - # Stage each one's licence at the root for scikit-build-core's default - # wheel.license-files glob (gotcha 32/44, same as build-libigl.yml). - - name: Stage the vendored dependencies' licences - run: | - set -euo pipefail - curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/${{ env.PYBIND11_SHA }}/LICENSE" -o LICENSE.pybind11 - { - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/${{ env.EIGEN_SHA }}/COPYING.README" - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/${{ env.EIGEN_SHA }}/COPYING.MPL2" - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/${{ env.EIGEN_SHA }}/COPYING.BSD" - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/${{ env.EIGEN_SHA }}/COPYING.LGPL" - } > LICENSE.eigen - cp deps/geometry-central/LICENSE LICENSE.geometry-central - cp deps/geometry-central/deps/happly/LICENSE LICENSE.happly - # nanoflann (BSD) and nanort (MIT) are vendored straight into - # geometry-central (no submodule of their own); jc_voronoi (MIT) is - # vendored straight into this repo. All three carry their licence - # as a header comment instead of a LICENSE file. - sed -n '1,30p' deps/geometry-central/deps/nanoflann/include/nanoflann.hpp > LICENSE.nanoflann - sed -n '5,28p' deps/geometry-central/deps/nanort/include/nanort/nanort.h > LICENSE.nanort - sed -n '1479,1500p' deps/jc_voronoi/include/jc_voronoi/jc_voronoi.h > LICENSE.jc_voronoi - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - config-file: '.github/workflows/cibuildwheel_config.toml' - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # scikit-build-core's own pip-installed cmake/ninja (which upstream's - # before-all forces by removing the image's cmake) both have riscv64 - # wheels on our registry already, so upstream's config needs no - # riscv64-specific override here. - # The upstream build's default Release config (scikit-build-core's - # own default) crashes the in-wheel test with a SIGSEGV and no - # Python traceback on every interpreter leg; RelWithDebInfo (-O2 - # instead of -O3) does not. No further root cause was found after - # a native gdb backtrace came back clean under it too (nothing to - # see because nothing crashed) - see gotcha 662. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,cmake,ninja - SKBUILD_CMAKE_BUILD_TYPE=RelWithDebInfo - CIBW_TEST_REQUIRES: scipy - CIBW_TEST_COMMAND: python {project}/test/robust_laplacian_test.py + name: robust-laplacian-${{ env.ROBUST_LAPLACIAN_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -138,15 +141,9 @@ jobs: assert licences == expected, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: robust-laplacian-${{ env.ROBUST_LAPLACIAN_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish robust-laplacian ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-rtree.yml b/.github/workflows/build-rtree.yml index 05a9655e599b..9a02cd562c65 100644 --- a/.github/workflows/build-rtree.yml +++ b/.github/workflows/build-rtree.yml @@ -50,49 +50,54 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build rtree ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "rtree" + version: "${{ matrix.version }}" + repository: "Toblerity/rtree" + ref: "${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 360 + pre-build: |- + sidx="$(sed -n 's/^VERSION=//p' scripts/install_libspatialindex.sh)" + base="https://raw.githubusercontent.com/libspatialindex/libspatialindex/${sidx}" + curl -fsSL --retry 5 "${base}/COPYING" -o LICENSE.libspatialindex + curl -fsSL --retry 5 "${base}/AUTHORS" -o AUTHORS.libspatialindex + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # `scripts/repair_wheel.py` retags the wheel py3-none, so one build serves every interpreter. + cibw-build: "cp312-manylinux_riscv64" + # Upstream builds cp39 only, so `before-all`'s `wheel` lands on the interpreter that + # then runs `repair_wheel.py`; this builds cp312, so install it beside the build. + cibw-before-build: "yum install -y cmake libffi-devel && pip install wheel && sh {project}/scripts/install_libspatialindex.sh" + # Upstream drives pytest through a tox config that sets `ignore_outcome`, so a failing + # suite cannot fail the job. This runs the same tests the project's own CI jobs run. + # pytest 9 breaks the suite's class-scoped fixtures, on every architecture. + cibw-test-requires: "pytest<9 numpy" + cibw-test-sources: "tests pyproject.toml" + cibw-test-command: "python -m pytest -Werror -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: RTREE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout rtree ${{ env.RTREE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Toblerity/rtree - ref: ${{ env.RTREE_VERSION }} - persist-credentials: false - - # The wheel bundles libspatialindex, but upstream ships only rtree's own licence. - - name: Stage the libspatialindex licence - run: | - sidx="$(sed -n 's/^VERSION=//p' scripts/install_libspatialindex.sh)" - base="https://raw.githubusercontent.com/libspatialindex/libspatialindex/${sidx}" - curl -fsSL --retry 5 "${base}/COPYING" -o LICENSE.libspatialindex - curl -fsSL --retry 5 "${base}/AUTHORS" -o AUTHORS.libspatialindex - - # musllinux is dropped: numpy, which the test suite imports, has no musl riscv64 wheel. - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # `scripts/repair_wheel.py` retags the wheel py3-none, so one build serves every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream builds cp39 only, so `before-all`'s `wheel` lands on the interpreter that - # then runs `repair_wheel.py`; this builds cp312, so install it beside the build. - CIBW_BEFORE_BUILD: >- - yum install -y cmake libffi-devel && - pip install wheel && - sh {project}/scripts/install_libspatialindex.sh - # Upstream drives pytest through a tox config that sets `ignore_outcome`, so a failing - # suite cannot fail the job. This runs the same tests the project's own CI jobs run. - # pytest 9 breaks the suite's class-scoped fixtures, on every architecture. - CIBW_TEST_REQUIRES: 'pytest<9 numpy' - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_COMMAND: python -m pytest -Werror -v tests + name: rtree-${{ env.RTREE_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the bundled library and licences made it into the wheel run: | @@ -108,15 +113,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: rtree-${{ env.RTREE_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish rtree ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ruckig.yml b/.github/workflows/build-ruckig.yml index c75ce82775f4..66a91ca4a94c 100644 --- a/.github/workflows/build-ruckig.yml +++ b/.github/workflows/build-ruckig.yml @@ -50,36 +50,40 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build ruckig ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ruckig" + version: "${{ matrix.version }}" + repository: "pantor/ruckig" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-test-command: "python {project}/examples/01_position.py && python {project}/examples/02_position_offline.py && python {project}/examples/05_velocity.py && python {project}/examples/06_stop.py && python {project}/examples/07_minimum_duration.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: RUCKIG_VERSION: ${{ matrix.version }} - steps: - - name: Checkout ruckig v${{ env.RUCKIG_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pantor/ruckig - ref: v${{ env.RUCKIG_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_TEST_COMMAND: >- - python {project}/examples/01_position.py && - python {project}/examples/02_position_offline.py && - python {project}/examples/05_velocity.py && - python {project}/examples/06_stop.py && - python {project}/examples/07_minimum_duration.py + name: ruckig-${{ env.RUCKIG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -94,15 +98,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ruckig-${{ env.RUCKIG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish ruckig ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ruptures.yml b/.github/workflows/build-ruptures.yml index 4a5e640fcb77..78f60df386ce 100644 --- a/.github/workflows/build-ruptures.yml +++ b/.github/workflows/build-ruptures.yml @@ -66,10 +66,7 @@ jobs: cibw-before-build: >- pip install "setuptools>=42" wheel "Cython>=0.28.5" "setuptools_scm[toml]>=3.4" numpy scipy - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_RUPTURES=${{ matrix.version }} + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy SETUPTOOLS_SCM_PRETEND_VERSION_FOR_RUPTURES=${{ matrix.version }}" cibw-test-requires: pytest cibw-test-command: pytest {project}/tests timeout-minutes: 120 diff --git a/.github/workflows/build-rustworkx.yml b/.github/workflows/build-rustworkx.yml index 11396b8926fd..18b6543d8248 100644 --- a/.github/workflows/build-rustworkx.yml +++ b/.github/workflows/build-rustworkx.yml @@ -49,6 +49,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build rustworkx ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # pyo3 carries abi3-py310 unconditionally in Cargo.toml, so every + # CPython build is abi3 already and the free-threaded build needs no + # extra flag either (pyo3 disables abi3 under Py_GIL_DISABLED). + - tag: cp310-abi3 + build: >- + cp310-manylinux_riscv64 cp311-manylinux_riscv64 + cp312-manylinux_riscv64 cp313-manylinux_riscv64 + cp314-manylinux_riscv64 + - tag: cp314t + build: cp314t-manylinux_riscv64 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "rustworkx" + version: "${{ matrix.version }}" + repository: "Qiskit/rustworkx" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: 360 + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.build }}" + # Replaces (not merges into) upstream's own [tool.cibuildwheel.linux] + # environment table, so its PATH/CARGO_NET_GIT_FETCH_WITH_CLI are + # repeated here alongside our registry. + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\" CARGO_NET_GIT_FETCH_WITH_CLI=\"true\"" + # Upstream's own repair-wheel-command also runs abi3audit via pipx, + # which the riscv64 image doesn't carry; cibuildwheel's own default + # audit-command already abi3audits every abi3-tagged wheel natively + # after this repair step runs, so drop the pipx layer here. + cibw-repair-wheel-command-linux: "auditwheel repair -w {dest_dir} {wheel}" + # numpy has no riscv64 wheel on public PyPI; without this, before-test's + # `pip install numpy<2.5.0` would source-build it in the container. + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: @@ -66,41 +108,14 @@ jobs: cp314-manylinux_riscv64 - tag: cp314t build: cp314t-manylinux_riscv64 - env: RUSTWORKX_VERSION: ${{ matrix.version }} - steps: - - name: Checkout rustworkx ${{ env.RUSTWORKX_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Qiskit/rustworkx - ref: ${{ env.RUSTWORKX_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces (not merges into) upstream's own [tool.cibuildwheel.linux] - # environment table, so its PATH/CARGO_NET_GIT_FETCH_WITH_CLI are - # repeated here alongside our registry. - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - CARGO_NET_GIT_FETCH_WITH_CLI="true" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream's own repair-wheel-command also runs abi3audit via pipx, - # which the riscv64 image doesn't carry; cibuildwheel's own default - # audit-command already abi3audits every abi3-tagged wheel natively - # after this repair step runs, so drop the pipx layer here. - CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair -w {dest_dir} {wheel} - # numpy has no riscv64 wheel on public PyPI; without this, before-test's - # `pip install numpy<2.5.0` would source-build it in the container. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy + name: rustworkx-${{ env.RUSTWORKX_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check wheel contains the compiled extension run: | @@ -110,15 +125,9 @@ jobs: unzip -l "$whl" | grep '\.so$' done - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: rustworkx-${{ env.RUSTWORKX_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish rustworkx ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-s3torchconnectorclient.yml b/.github/workflows/build-s3torchconnectorclient.yml index 628a0f583fa9..140233868f3f 100644 --- a/.github/workflows/build-s3torchconnectorclient.yml +++ b/.github/workflows/build-s3torchconnectorclient.yml @@ -50,96 +50,91 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build s3torchconnectorclient ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - S3TORCHCONNECTORCLIENT_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout s3-connector-for-pytorch v${{ env.S3TORCHCONNECTORCLIENT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: awslabs/s3-connector-for-pytorch - ref: v${{ env.S3TORCHCONNECTORCLIENT_VERSION }} - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "s3torchconnectorclient" + version: "${{ matrix.version }}" + repository: "awslabs/s3-connector-for-pytorch" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + git apply -v python-wheels/patches/s3torchconnectorclient/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Apply patches - run: git apply -v python-wheels/patches/s3torchconnectorclient/${{ env.S3TORCHCONNECTORCLIENT_VERSION }}/*.patch + cat > collect-crt-licenses.sh <<'EOF' + #!/bin/bash + set -euo pipefail + project="${1:?usage: collect-crt-licenses.sh }" + repo_root="$(dirname "$project")" + cp "$repo_root/LICENSE" "$project/LICENSE" + cp "$repo_root/NOTICE" "$project/NOTICE" + cargo fetch --manifest-path "$project/Cargo.toml" + crt_sys_src="$(find "${CARGO_HOME:-$HOME/.cargo}/registry/src" -mindepth 2 -maxdepth 2 -type d -name 'mountpoint-s3-crt-sys-*' | head -1)" + for lib in aws-lc s2n-tls aws-c-common aws-c-cal aws-c-io aws-c-compression aws-c-http aws-c-sdkutils aws-c-auth aws-checksums aws-c-s3; do + lib_license="$(find "$crt_sys_src/crt/$lib" -maxdepth 1 -name 'LICENSE*' | head -1)" + cp "$lib_license" "$project/LICENSE.$lib" + done + EOF - # THIRD-PARTY-LICENSES is generated by upstream's own ORT-based CI job - # (generate_third_party_licenses.yml) and is never checked into the repo, so a plain - # checkout has no equivalent to stage. The patch above points license-files at LICENSE.* - # instead; this collects the licence actually shipped by each statically-linked CRT - # library, read from the same mountpoint-s3-crt-sys crate source cargo fetches for the - # real build, rather than re-implementing upstream's ORT scan. - # - # Upstream's own pyproject.toml carries a `before-build` that copies the repo-root - # LICENSE/NOTICE into the s3torchconnectorclient package dir, since license-files - # resolves relative to pyproject.toml, not the repo root. Setting CIBW_BEFORE_BUILD - # below overrides that `before-build` entirely (cibuildwheel's env var wins over the - # config file), so this collector also stages LICENSE/NOTICE itself to make up for it. - - name: Write the CRT licence collector - run: | - cat > collect-crt-licenses.sh <<'EOF' - #!/bin/bash - set -euo pipefail - project="${1:?usage: collect-crt-licenses.sh }" - repo_root="$(dirname "$project")" - cp "$repo_root/LICENSE" "$project/LICENSE" - cp "$repo_root/NOTICE" "$project/NOTICE" - cargo fetch --manifest-path "$project/Cargo.toml" - crt_sys_src="$(find "${CARGO_HOME:-$HOME/.cargo}/registry/src" -mindepth 2 -maxdepth 2 -type d -name 'mountpoint-s3-crt-sys-*' | head -1)" - for lib in aws-lc s2n-tls aws-c-common aws-c-cal aws-c-io aws-c-compression aws-c-http aws-c-sdkutils aws-c-auth aws-checksums aws-c-s3; do - lib_license="$(find "$crt_sys_src/crt/$lib" -maxdepth 1 -name 'LICENSE*' | head -1)" - cp "$lib_license" "$project/LICENSE.$lib" - done - EOF + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "s3torchconnectorclient" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # The image ships no Rust toolchain for the setuptools-rust/pyo3 extension; rustup + # provisions a native riscv64gc-unknown-linux-gnu one (gotcha 10). fuse/fuse-devel and + # clang/clang-devel (libclang for mountpoint-s3-crt-sys's bindgen) match upstream's own + # manylinux_2_28 before-all, minus its gcc-toolset, which this image's own gcc replaces. + cibw-before-all-linux: "dnf -y install fuse fuse-devel clang clang-devel && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-before-build: "bash collect-crt-licenses.sh {project}/s3torchconnectorclient" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # Drops the four CI_*-prefixed integration/e2e commands from upstream's own + # test-command list: they need real AWS S3 buckets this CI has no credentials for. + # The client's own unit tests and the connector's own exercise the "mock" S3 client + # feature instead, so neither needs network access. + cibw-test-requires: "./s3torchconnector[test]" + # PyPI's newest Pillow (the client's own test extra) is sdist-only on riscv64, so take + # the registry's wheel. The container does not inherit the runner's CI variable, so set + # it to get Hypothesis' built-in ci profile (no per-example deadline) on slow runners. + cibw-test-environment: "PIP_ONLY_BINARY=pillow CI=true" + cibw-test-sources: "s3torchconnectorclient/python/tst s3torchconnector" + cibw-test-command: "pytest -v s3torchconnectorclient/python/tst/unit && pytest -v s3torchconnector/tst/unit --ignore s3torchconnector/tst/unit/lightning --ignore s3torchconnector/tst/unit/dcp" - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 180 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + S3TORCHCONNECTORCLIENT_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: s3torchconnectorclient - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # The image ships no Rust toolchain for the setuptools-rust/pyo3 extension; rustup - # provisions a native riscv64gc-unknown-linux-gnu one (gotcha 10). fuse/fuse-devel and - # clang/clang-devel (libclang for mountpoint-s3-crt-sys's bindgen) match upstream's own - # manylinux_2_28 before-all, minus its gcc-toolset, which this image's own gcc replaces. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install fuse fuse-devel clang clang-devel && - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_BEFORE_BUILD: bash collect-crt-licenses.sh {project}/s3torchconnectorclient - CIBW_ENVIRONMENT_LINUX: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Drops the four CI_*-prefixed integration/e2e commands from upstream's own - # test-command list: they need real AWS S3 buckets this CI has no credentials for. - # The client's own unit tests and the connector's own exercise the "mock" S3 client - # feature instead, so neither needs network access. - CIBW_TEST_REQUIRES: ./s3torchconnector[test] - # PyPI's newest Pillow (the client's own test extra) is sdist-only on riscv64, so take - # the registry's wheel. The container does not inherit the runner's CI variable, so set - # it to get Hypothesis' built-in ci profile (no per-example deadline) on slow runners. - CIBW_TEST_ENVIRONMENT: >- - PIP_ONLY_BINARY=pillow - CI=true - CIBW_TEST_SOURCES: s3torchconnectorclient/python/tst s3torchconnector - CIBW_TEST_COMMAND: >- - pytest -v s3torchconnectorclient/python/tst/unit && - pytest -v s3torchconnector/tst/unit --ignore s3torchconnector/tst/unit/lightning --ignore s3torchconnector/tst/unit/dcp + name: s3torchconnectorclient-${{ env.S3TORCHCONNECTORCLIENT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and the vendored licences made it into the wheel run: | @@ -160,15 +155,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: s3torchconnectorclient-${{ env.S3TORCHCONNECTORCLIENT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish s3torchconnectorclient ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-samplerate.yml b/.github/workflows/build-samplerate.yml index c1c476c77761..37e74b518f0f 100644 --- a/.github/workflows/build-samplerate.yml +++ b/.github/workflows/build-samplerate.yml @@ -53,47 +53,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build samplerate ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "samplerate" + version: "${{ matrix.version }}" + repository: "tuxu/python-samplerate" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-fetch-depth: 0 + pre-build: |- + curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/f5fbe867d2d26e4a0a9177a51f6e568868ad3dc8/LICENSE" -o LICENSE.pybind11 + curl -fsSL --retry 5 "https://raw.githubusercontent.com/libsndfile/libsamplerate/c96f5e3de9c4488f4e6c97f59f5245f22fda22f7/COPYING" -o LICENSE.libsamplerate + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy has no riscv64 wheel on public PyPI; keep pip on our registry's copy. + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + cibw-test-requires: "pytest numpy" + cibw-test-command: "pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SAMPLERATE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout samplerate v${{ env.SAMPLERATE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: tuxu/python-samplerate - ref: v${{ env.SAMPLERATE_VERSION }} - # setuptools-scm derives the version from the tag; needs full history. - fetch-depth: 0 - persist-credentials: false - - # pybind11 (header-only, templates compiled into the .so) and libsamplerate - # (statically linked) are fetched from source by CMake FetchContent; - # upstream's own wheel ships neither licence, so stage them at the root for - # setuptools' default LICEN[CS]E* glob to pick up (gotcha 32/44). - - name: Stage the vendored pybind11 and libsamplerate licences - run: | - curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/${{ env.PYBIND11_SHA }}/LICENSE" -o LICENSE.pybind11 - curl -fsSL --retry 5 "https://raw.githubusercontent.com/libsndfile/libsamplerate/${{ env.LIBSAMPLERATE_SHA }}/COPYING" -o LICENSE.libsamplerate - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # numpy has no riscv64 wheel on public PyPI; keep pip on our registry's copy. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy - CIBW_TEST_REQUIRES: pytest numpy - CIBW_TEST_COMMAND: pytest {project}/tests + name: samplerate-${{ env.SAMPLERATE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and the licences made it into the wheel run: | @@ -108,15 +112,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: samplerate-${{ env.SAMPLERATE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish samplerate ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-scikit-allel.yml b/.github/workflows/build-scikit-allel.yml index cfe13f3d9d63..e148ef3c09c5 100644 --- a/.github/workflows/build-scikit-allel.yml +++ b/.github/workflows/build-scikit-allel.yml @@ -50,50 +50,54 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build scikit-allel ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "scikit-allel" + version: "${{ matrix.version }}" + repository: "cggh/scikit-allel" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-fetch-depth: 0 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy is a declared build-system requirement (pyproject.toml) and, despite + # not being listed there as a runtime dependency either, an implicit one too + # (the compiled extensions call numpy's C API at import time). Only our + # registry has it for riscv64; only-binary keeps a newer PyPI release from + # winning the resolution and then compiling from sdist. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + # The full upstream suite (allel/test) needs the `tabix` binary and sample + # VCF/GFF fixtures that aren't part of the wheel; smoke-import the three + # compiled extensions instead, proving the riscv64 .so's actually load. + cibw-test-command: "python -c \"import allel.opt.model, allel.opt.stats, allel.opt.io_vcf_read\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SCIKIT_ALLEL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout scikit-allel ${{ env.SCIKIT_ALLEL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: cggh/scikit-allel - ref: v${{ env.SCIKIT_ALLEL_VERSION }} - fetch-depth: 0 # setuptools_scm derives the version from `git describe` - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy is a declared build-system requirement (pyproject.toml) and, despite - # not being listed there as a runtime dependency either, an implicit one too - # (the compiled extensions call numpy's C API at import time). Only our - # registry has it for riscv64; only-binary keeps a newer PyPI release from - # winning the resolution and then compiling from sdist. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy - # The full upstream suite (allel/test) needs the `tabix` binary and sample - # VCF/GFF fixtures that aren't part of the wheel; smoke-import the three - # compiled extensions instead, proving the riscv64 .so's actually load. - CIBW_TEST_COMMAND: python -c "import allel.opt.model, allel.opt.stats, allel.opt.io_vcf_read" + name: scikit-allel-${{ env.SCIKIT_ALLEL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -106,16 +110,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: scikit-allel-${{ env.SCIKIT_ALLEL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish scikit-allel ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-scikit-bio.yml b/.github/workflows/build-scikit-bio.yml index c8c1878c1785..d26fd9b9d8a0 100644 --- a/.github/workflows/build-scikit-bio.yml +++ b/.github/workflows/build-scikit-bio.yml @@ -51,48 +51,58 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build scikit-bio ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "scikit-bio" + version: "${{ matrix.version }}" + repository: "scikit-bio/scikit-bio" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/scikit-bio/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Without this, pip resolves the runtime dep pandas>=1.5.0 to PyPI's newest + # release, which our registry hasn't built yet and whose sdist fails on + # riscv64 (xsimd has no generic/scalar load_unaligned/reduce_add/broadcast + # there). PIP_PREFER_BINARY makes it take our registry's older wheel-backed + # pandas instead (gotcha 354; test-phase only, per gotcha 12). + cibw-test-environment: "PIP_PREFER_BINARY=1" + cibw-test-command: "python -m skbio.test" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SCIKIT_BIO_VERSION: ${{ matrix.version }} - steps: - - name: Checkout scikit-bio ${{ env.SCIKIT_BIO_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: scikit-bio/scikit-bio - ref: ${{ env.SCIKIT_BIO_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch scikit-bio source - run: git apply python-wheels/patches/scikit-bio/${{ env.SCIKIT_BIO_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Without this, pip resolves the runtime dep pandas>=1.5.0 to PyPI's newest - # release, which our registry hasn't built yet and whose sdist fails on - # riscv64 (xsimd has no generic/scalar load_unaligned/reduce_add/broadcast - # there). PIP_PREFER_BINARY makes it take our registry's older wheel-backed - # pandas instead (gotcha 354; test-phase only, per gotcha 12). - CIBW_TEST_ENVIRONMENT: PIP_PREFER_BINARY=1 - CIBW_TEST_COMMAND: python -m skbio.test + name: scikit-bio-${{ env.SCIKIT_BIO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extensions made it into the wheel run: | @@ -104,12 +114,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: scikit-bio-${{ env.SCIKIT_BIO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -144,7 +148,7 @@ jobs: publish: name: Publish scikit-bio ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-scikit-learn-extra.yml b/.github/workflows/build-scikit-learn-extra.yml index 887f75388dac..a4d514f51ff7 100644 --- a/.github/workflows/build-scikit-learn-extra.yml +++ b/.github/workflows/build-scikit-learn-extra.yml @@ -50,44 +50,54 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build scikit-learn-extra ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "scikit-learn-extra" + version: "${{ matrix.version }}" + repository: "scikit-learn-contrib/scikit-learn-extra" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/scikit-learn-extra/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,scikit-learn" + cibw-test-requires: "pytest" + cibw-test-command: "pytest --pyargs sklearn_extra" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SCIKIT_LEARN_EXTRA_VERSION: ${{ matrix.version }} - steps: - - name: Checkout scikit-learn-extra v${{ env.SCIKIT_LEARN_EXTRA_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: scikit-learn-contrib/scikit-learn-extra - ref: v${{ env.SCIKIT_LEARN_EXTRA_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/scikit-learn-extra/${{ env.SCIKIT_LEARN_EXTRA_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,scikit-learn - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest --pyargs sklearn_extra + name: scikit-learn-extra-${{ env.SCIKIT_LEARN_EXTRA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -100,15 +110,9 @@ jobs: assert licences, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: scikit-learn-extra-${{ env.SCIKIT_LEARN_EXTRA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish scikit-learn-extra ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-scikit-surprise.yml b/.github/workflows/build-scikit-surprise.yml index ff184ac323c6..8bf74c4100f8 100644 --- a/.github/workflows/build-scikit-surprise.yml +++ b/.github/workflows/build-scikit-surprise.yml @@ -48,38 +48,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build scikit-surprise ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "scikit-surprise" + version: "${{ matrix.version }}" + repository: "NicolasHug/Surprise" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,pandas" + # pypi.riseproject.dev has no cp314t pandas wheel, and three test modules import pandas unconditionally. + cibw-test-requires: "pytest ${{ matrix.python != 'cp314t' && 'pandas' || '' }}" + cibw-test-command: "pytest {project}/tests -v ${{ matrix.python == 'cp314t' && '--ignore={project}/tests/test_NMF.py --ignore={project}/tests/test_dataset.py --ignore={project}/tests/test_zero_ratings.py' || '' }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SCIKIT_SURPRISE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout scikit-surprise v${{ env.SCIKIT_SURPRISE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: NicolasHug/Surprise - ref: v${{ env.SCIKIT_SURPRISE_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas - # pypi.riseproject.dev has no cp314t pandas wheel, and three test modules import pandas unconditionally. - CIBW_TEST_REQUIRES: pytest ${{ matrix.python != 'cp314t' && 'pandas' || '' }} - CIBW_TEST_COMMAND: >- - pytest {project}/tests -v - ${{ matrix.python == 'cp314t' && '--ignore={project}/tests/test_NMF.py --ignore={project}/tests/test_dataset.py --ignore={project}/tests/test_zero_ratings.py' || '' }} + name: scikit-surprise-${{ env.SCIKIT_SURPRISE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -91,15 +95,9 @@ jobs: assert any(".dist-info/licenses/" in n for n in names), names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: scikit-surprise-${{ env.SCIKIT_SURPRISE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish scikit-surprise ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-scikit-survival.yml b/.github/workflows/build-scikit-survival.yml index abc67956f4d3..a29bf0307e48 100644 --- a/.github/workflows/build-scikit-survival.yml +++ b/.github/workflows/build-scikit-survival.yml @@ -50,55 +50,61 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build scikit-survival ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "scikit-survival" + version: "${{ matrix.version }}" + repository: "sebp/scikit-survival" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/scikit-survival/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's build[uv] crashes the audit step on the riscv runner (gotcha 13). + cibw-build-frontend: "build" + # The patched tree would otherwise get a dirty setuptools_scm version (gotcha 31). + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy,scikit-learn,pandas,ecos,osqp,numexpr SETUPTOOLS_SCM_PRETEND_VERSION_FOR_SCIKIT_SURVIVAL=${{ matrix.version }}" + cibw-test-groups: "test" + # polars 1.43 (released after 0.28.0) deprecates cat.get_categories(), which the suite's filterwarnings=error turns into failures. + cibw-test-requires: "polars<1.43" + # riscv64 rounding moves a ~2.7e7 cumulative hazard by 6e-13 relative, past this test's 5-decimal absolute check. + cibw-test-command: "pytest --strict-markers -m 'not slow' -k 'not test_fit_and_predict_linear_regression' --deselect 'tests/test_coxnet.py::TestCoxnetBaselineModel::test_baseline_predict[predict_cumulative_hazard_function-False]' {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SCIKIT_SURVIVAL_VERSION: ${{ matrix.version }} - steps: - - name: Checkout scikit-survival v${{ env.SCIKIT_SURVIVAL_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: sebp/scikit-survival - ref: v${{ env.SCIKIT_SURVIVAL_VERSION }} - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/scikit-survival/${{ env.SCIKIT_SURVIVAL_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's build[uv] crashes the audit step on the riscv runner (gotcha 13). - CIBW_BUILD_FRONTEND: build - # The patched tree would otherwise get a dirty setuptools_scm version (gotcha 31). - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,scikit-learn,pandas,ecos,osqp,numexpr - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_SCIKIT_SURVIVAL=${{ env.SCIKIT_SURVIVAL_VERSION }} - CIBW_TEST_GROUPS: test - # polars 1.43 (released after 0.28.0) deprecates cat.get_categories(), which the suite's filterwarnings=error turns into failures. - CIBW_TEST_REQUIRES: polars<1.43 - # riscv64 rounding moves a ~2.7e7 cumulative hazard by 6e-13 relative, past this test's 5-decimal absolute check. - CIBW_TEST_COMMAND: >- - pytest --strict-markers -m 'not slow' -k 'not test_fit_and_predict_linear_regression' - --deselect 'tests/test_coxnet.py::TestCoxnetBaselineModel::test_baseline_predict[predict_cumulative_hazard_function-False]' - {project}/tests + name: scikit-survival-${{ env.SCIKIT_SURVIVAL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -111,15 +117,9 @@ jobs: assert licences == {"COPYING", "COPYING.MPL2", "COPYING.APACHE"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: scikit-survival-${{ env.SCIKIT_SURVIVAL_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish scikit-survival ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-scipp.yml b/.github/workflows/build-scipp.yml index 276944262e58..ee5159c3cfb7 100644 --- a/.github/workflows/build-scipp.yml +++ b/.github/workflows/build-scipp.yml @@ -54,79 +54,73 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build scipp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "scipp" + version: "${{ matrix.version }}" + repository: "scipp/scipp" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/scipp/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + set -euxo pipefail + curl -fsSL --retry 5 "https://raw.githubusercontent.com/llnl/units/v0.13.1/LICENSE" -o LICENSE.units + curl -fsSL --retry 5 "https://raw.githubusercontent.com/boostorg/boost/boost-1.90.0/LICENSE_1_0.txt" -o LICENSE.boost + curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2" -o LICENSE.eigen + curl -fsSL --retry 5 "https://raw.githubusercontent.com/uxlfoundation/oneTBB/v2023.0.0/LICENSE.txt" -o LICENSE.tbb + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # pip resolves cmake>=3.28 (our registry's newest is 4.0.3); CPM-fetched + # dependencies' own cmake_minimum_required predates CMake 4's floor. The + # patched (dirty) checkout would otherwise read as 26.8.1.dev0+g. + cibw-environment-linux: "CMAKE_POLICY_VERSION_MINIMUM=3.5 SETUPTOOLS_SCM_PRETEND_VERSION_FOR_SCIPP=${{ matrix.version }}" + cibw-test-extras: "test" + cibw-test-requires: "scipy graphviz pooch hypothesis" + cibw-test-command: "python -c \"import importlib.metadata as m; f = {p.name for p in m.files('scipp') if '.dist-info/licenses/' in str(p)}; assert f == {'LICENSE', 'LICENSE.units', 'LICENSE.boost', 'LICENSE.eigen', 'LICENSE.tbb'}, f\" && pytest --ignore {project}/tests/plotting --ignore {project}/tests/hypothesis/ --ignore {project}/tests/experimental/ {project}/tests" + # These have no (or lagging) riscv64 wheels on public PyPI; keep pip on our + # registry's copies instead of building a newer sdist in the test venv. + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy,matplotlib,contourpy,kiwisolver,pillow,psutil,hypothesis" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SCIPP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout scipp/scipp v${{ env.SCIPP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: scipp/scipp - ref: ${{ env.SCIPP_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Patch scipp source - run: git apply python-wheels/patches/scipp/${{ env.SCIPP_VERSION }}/00*.patch - - # pyproject.toml's build-system.requires pins pybind11 to no version at all, so - # pip resolves whatever is newest at build time - and scipp 26.8.0's own - # lib/python/dtype.cpp/bind_data_access.h now use pybind11 3.x-only API - # (dtype::normalized_num/num_of, py::make_scalar), so pinning pybind11<3 no - # longer even compiles. The actual bug this pin used to work around (pybind11 - # 3.x loosening float's conversion check to accept int, so a double/int64_t - # overload pair registered double-first now dispatches a plain Python int to - # the double overload instead of int64_t, silently promoting int-valued - # scalars/results to float64 throughout scipp's Python layer - what actually - # failed 22 of upstream's own tests, not a riscv64 codegen issue) is fixed at - # the source instead: see patches/scipp/26.8.0/0002-*, which registers the - # int64_t overload first. - - # pyproject.toml's license-files is an explicit ["LICENSE"] list (patched to also - # match LICENSE.*), so scikit-build-core's default licence glob never runs. The CPM - # dependencies ship no licence in upstream's own wheel; stage the ones actually - # compiled or linked into it at the root (GoogleTest is test-only). - - name: Stage vendored dependency licences - run: | - set -euxo pipefail - curl -fsSL --retry 5 "https://raw.githubusercontent.com/llnl/units/v0.13.1/LICENSE" -o LICENSE.units - curl -fsSL --retry 5 "https://raw.githubusercontent.com/boostorg/boost/boost-1.90.0/LICENSE_1_0.txt" -o LICENSE.boost - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2" -o LICENSE.eigen - curl -fsSL --retry 5 "https://raw.githubusercontent.com/uxlfoundation/oneTBB/v2023.0.0/LICENSE.txt" -o LICENSE.tbb - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # pip resolves cmake>=3.28 (our registry's newest is 4.0.3); CPM-fetched - # dependencies' own cmake_minimum_required predates CMake 4's floor. The - # patched (dirty) checkout would otherwise read as 26.8.1.dev0+g. - CIBW_ENVIRONMENT: >- - CMAKE_POLICY_VERSION_MINIMUM=3.5 - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_SCIPP=${{ env.SCIPP_VERSION }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_EXTRAS: test - CIBW_TEST_REQUIRES: scipy graphviz pooch hypothesis - CIBW_TEST_COMMAND: >- - python -c "import importlib.metadata as m; f = {p.name for p in m.files('scipp') if '.dist-info/licenses/' in str(p)}; assert f == {'LICENSE', 'LICENSE.units', 'LICENSE.boost', 'LICENSE.eigen', 'LICENSE.tbb'}, f" - && pytest --ignore {project}/tests/plotting --ignore {project}/tests/hypothesis/ --ignore {project}/tests/experimental/ {project}/tests - # These have no (or lagging) riscv64 wheels on public PyPI; keep pip on our - # registry's copies instead of building a newer sdist in the test venv. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,scipy,matplotlib,contourpy,kiwisolver,pillow,psutil,hypothesis + name: scipp-${{ env.SCIPP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -138,15 +132,9 @@ jobs: assert exts, "no compiled extension in wheel" EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: scipp-${{ env.SCIPP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish scipp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-scout-apm.yml b/.github/workflows/build-scout-apm.yml index ef0d64f42432..a5f6a0649b90 100644 --- a/.github/workflows/build-scout-apm.yml +++ b/.github/workflows/build-scout-apm.yml @@ -59,7 +59,6 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # _objtrace is Extension(optional=True) with a pure fallback, so assert the .so # loaded before running its tests (CLAUDE.md gotcha 20). On 3.14t/3.15t it re-enables # the GIL, as upstream's wheels do; pytest.ini's filterwarnings=error would fail on that. diff --git a/.github/workflows/build-scrypt.yml b/.github/workflows/build-scrypt.yml index 57774332bbb9..395ead71302c 100644 --- a/.github/workflows/build-scrypt.yml +++ b/.github/workflows/build-scrypt.yml @@ -48,40 +48,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build scrypt ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "scrypt" + version: "${{ matrix.version }}" + repository: "holgern/py-scrypt" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py links libcrypto (openssl/aes.h software fallback path); + # openssl-devel isn't in the base image. auditwheel then vendors its + # runtime .so, so its licence has to travel with the wheel too, along + # with the vendored scrypt-1.3.3 C library's own COPYRIGHT - neither + # is covered by the top-level LICENSE (different copyright holders). + cibw-before-all-linux: "dnf -y install openssl-devel && cp /usr/share/licenses/openssl-libs/LICENSE.txt {project}/LICENSE.openssl && cp {project}/scrypt-1.3.3/COPYRIGHT {project}/LICENSE.scrypt-1.3.3" + cibw-test-requires: "pytest" + cibw-test-command: "pytest --pyargs scrypt" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SCRYPT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout scrypt ${{ env.SCRYPT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: holgern/py-scrypt - ref: v${{ env.SCRYPT_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py links libcrypto (openssl/aes.h software fallback path); - # openssl-devel isn't in the base image. auditwheel then vendors its - # runtime .so, so its licence has to travel with the wheel too, along - # with the vendored scrypt-1.3.3 C library's own COPYRIGHT - neither - # is covered by the top-level LICENSE (different copyright holders). - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install openssl-devel && - cp /usr/share/licenses/openssl-libs/LICENSE.txt {project}/LICENSE.openssl && - cp {project}/scrypt-1.3.3/COPYRIGHT {project}/LICENSE.scrypt-1.3.3 - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest --pyargs scrypt + name: scrypt-${{ env.SCRYPT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and every licence run: | @@ -97,15 +102,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: scrypt-${{ env.SCRYPT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish scrypt ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-scs.yml b/.github/workflows/build-scs.yml index e618133aaf02..4e3cef2f70db 100644 --- a/.github/workflows/build-scs.yml +++ b/.github/workflows/build-scs.yml @@ -50,51 +50,57 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build scs ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "scs" + version: "${{ matrix.version }}" + repository: "bodono/scs-python" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/scs/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's per-image before-all, for the riscv64 image; the submodule + # half is already done by the checkout above. Also stages OpenBLAS' + # licence, which auditwheel bundles the library without. + cibw-before-all-linux: "dnf -y install openblas-devel && cp /usr/share/licenses/openblas/LICENSE {project}/LICENSE.openblas" + # numpy (build and test) and scipy (test) have no riscv64 wheels on PyPI. + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SCS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout scs ${{ env.SCS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: bodono/scs-python - ref: ${{ env.SCS_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch scs source - run: git apply python-wheels/patches/scs/${{ env.SCS_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's per-image before-all, for the riscv64 image; the submodule - # half is already done by the checkout above. Also stages OpenBLAS' - # licence, which auditwheel bundles the library without. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install openblas-devel && - cp /usr/share/licenses/openblas/LICENSE {project}/LICENSE.openblas - # numpy (build and test) and scipy (test) have no riscv64 wheels on PyPI. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy + name: scs-${{ env.SCS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extensions and all licences run: | @@ -113,12 +119,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: scs-${{ env.SCS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -154,7 +154,7 @@ jobs: publish: name: Publish scs ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-segyio.yml b/.github/workflows/build-segyio.yml index f24c9e9458a6..c529edd18b01 100644 --- a/.github/workflows/build-segyio.yml +++ b/.github/workflows/build-segyio.yml @@ -48,39 +48,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build segyio ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "segyio" + version: "${{ matrix.version }}" + repository: "equinor/segyio" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + cp License.md python/LICENSE + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "python" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SEGYIO_VERSION: ${{ matrix.version }} - steps: - - name: Checkout segyio v${{ env.SEGYIO_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: equinor/segyio - ref: v${{ env.SEGYIO_VERSION }} - persist-credentials: false - - - name: Stage LICENSE beside pyproject.toml - # License.md lives at the repo root; scikit-build-core's default - # license-files glob only looks inside package-dir (python/). - run: cp License.md python/LICENSE - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: python - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + name: segyio-${{ env.SEGYIO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -95,15 +101,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: segyio-${{ env.SEGYIO_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish segyio ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-sgp4.yml b/.github/workflows/build-sgp4.yml index 348443a07f98..19f0dee1eec0 100644 --- a/.github/workflows/build-sgp4.yml +++ b/.github/workflows/build-sgp4.yml @@ -69,7 +69,7 @@ jobs: # Upstream's own wheel job (unlike its sdist job) forces the # accelerated C++ extension to build rather than silently falling # back to the pure-Python implementation. - cibw-environment: PYTHON_SGP4_COMPILE=always + cibw-environment-linux: PYTHON_SGP4_COMPILE=always publish: name: Publish sgp4 ${{ matrix.version }} diff --git a/.github/workflows/build-simplejpeg.yml b/.github/workflows/build-simplejpeg.yml index 4cba40ab3da8..af1879dce9f0 100644 --- a/.github/workflows/build-simplejpeg.yml +++ b/.github/workflows/build-simplejpeg.yml @@ -52,46 +52,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build simplejpeg ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "simplejpeg" + version: "${{ matrix.version }}" + repository: "jfolz/simplejpeg" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/simplejpeg/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's before-all installs nasm to assemble libjpeg-turbo's x86 SIMD kernels; + # the patch above disables SIMD on riscv64 (no such kernels), so it's not needed here. + cibw-before-all-linux: "true" + cibw-before-build: "curl -fsSL -o {project}/LICENSE.libjpeg-turbo https://raw.githubusercontent.com/libjpeg-turbo/libjpeg-turbo/3.1.2/LICENSE.md" + cibw-environment-linux: "PIP_ONLY_BINARY=:all:" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: SIMPLEJPEG_VERSION: ${{ matrix.version }} - steps: - - name: Checkout simplejpeg v${{ env.SIMPLEJPEG_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: jfolz/simplejpeg - ref: ${{ env.SIMPLEJPEG_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch simplejpeg source - run: git apply python-wheels/patches/simplejpeg/${{ env.SIMPLEJPEG_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's before-all installs nasm to assemble libjpeg-turbo's x86 SIMD kernels; - # the patch above disables SIMD on riscv64 (no such kernels), so it's not needed here. - CIBW_BEFORE_ALL_LINUX: "true" - CIBW_BEFORE_BUILD: curl -fsSL -o {project}/LICENSE.libjpeg-turbo https://raw.githubusercontent.com/libjpeg-turbo/libjpeg-turbo/3.1.2/LICENSE.md - CIBW_ENVIRONMENT: >- - PIP_ONLY_BINARY=:all: - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + name: simplejpeg-${{ env.SIMPLEJPEG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel contents run: | @@ -105,15 +112,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: simplejpeg-${{ env.SIMPLEJPEG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish simplejpeg ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-simplejson.yml b/.github/workflows/build-simplejson.yml index 5a674455d8cf..019bedd16db2 100644 --- a/.github/workflows/build-simplejson.yml +++ b/.github/workflows/build-simplejson.yml @@ -49,35 +49,40 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build simplejson ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "simplejson" + version: "${{ matrix.version }}" + repository: "simplejson/simplejson" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # `{project}` is only read for the index.rst doctest; the suite itself ships + # in the wheel. cibuildwheel exports CIBUILDWHEEL=1, which makes setup.py + # treat the C speedups as required and the suite assert they loaded. + cibw-test-command: "python -m simplejson.tests._cibw_runner \"{project}\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: SIMPLEJSON_VERSION: ${{ matrix.version }} - steps: - - name: Checkout simplejson v${{ env.SIMPLEJSON_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: simplejson/simplejson - ref: v${{ env.SIMPLEJSON_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # `{project}` is only read for the index.rst doctest; the suite itself ships - # in the wheel. cibuildwheel exports CIBUILDWHEEL=1, which makes setup.py - # treat the C speedups as required and the suite assert they loaded. - CIBW_TEST_COMMAND: >- - python -m simplejson.tests._cibw_runner "{project}" + name: simplejson-${{ env.SIMPLEJSON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C speedups made it into the wheel run: | @@ -89,15 +94,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: simplejson-${{ env.SIMPLEJSON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish simplejson ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-simplepyble.yml b/.github/workflows/build-simplepyble.yml index 1e4f3326f081..0899af60feb6 100644 --- a/.github/workflows/build-simplepyble.yml +++ b/.github/workflows/build-simplepyble.yml @@ -51,121 +51,129 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build simplepyble ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "simplepyble" + version: "${{ matrix.version }}" + repository: "simpleble/simpleble" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + export SIMPLEPYBLE_VERSION='${{ matrix.version }}' + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" sparse-checkout init --cone + git -C "python-wheels" sparse-checkout set "patches/simplepyble" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + patches="$PWD/python-wheels/patches/simplepyble/$SIMPLEPYBLE_VERSION" + if [ -d "$patches" ]; then + git apply "$patches"/*.patch + fi + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of every shared library + # auditwheel vendors out of the build image alongside libdbus-1. + # setuptools' default LICENSE* glob copies them into the wheel. + set -euo pipefail + + project="${1:?usage: collect-licenses.sh }" + + # ldd is transitive, so libdbus-1 alone covers its whole closure; + # ldd does not list the root itself, so resolve that too. + mapfile -t libs < <( + { + ldd /usr/lib64/libdbus-1.so | tr ' ' '\n' | grep '^/' + readlink -f /usr/lib64/libdbus-1.so + } | sort -u + ) + + # `rpm -qf` reports unowned files on stdout, so keep only bare package names. + # glibc and the gcc runtime are on auditwheel's manylinux allowlist and + # are never vendored into the wheel. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc)$' + ) + + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + + # Some subpackages leave the licence to a sibling of the same source RPM. + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi + + # Others mark it %doc rather than %license, and the image installs no docs. + if [ -z "${files[0]:-}" ]; then + dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi + + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done + + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "dnf install -y dbus-devel && bash {project}/collect-licenses.sh {project}" + cibw-test-requires: "pytest" + # upstream's suite targets the Plain (mock) backend; only these two are backend-independent. + # Since 1.3.0 the module has an autouse fixture that fetches a Bluetooth adapter, + # which needs the system D-Bus (absent in the build container) for this Linux + # backend, so the two tests are called directly instead of through pytest. + cibw-test-command: "python -c \"import sys; sys.path.insert(0, '{project}/simplepyble/test'); import test_simpleble as t; t.test_configuration_parity(); t.test_platform_enums()\" && python -c \"import simplepyble; assert simplepyble.get_operating_system() == simplepyble.OperatingSystem.LINUX\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: SIMPLEPYBLE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout simpleble v${{ env.SIMPLEPYBLE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: simpleble/simpleble - ref: v${{ env.SIMPLEPYBLE_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - sparse-checkout: patches/simplepyble - persist-credentials: false - - # 1.3.0's setup.py lists license_files=["LICENSE.md"] explicitly, which drops the - # LICENSE. files staged below for the libraries auditwheel vendors; the patch - # widens it. Earlier releases use setuptools' default glob and have no patch. - - name: Patch simplepyble source - run: | - patches="$PWD/python-wheels/patches/simplepyble/$SIMPLEPYBLE_VERSION" - if [ -d "$patches" ]; then - git apply "$patches"/*.patch - fi - - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of every shared library - # auditwheel vendors out of the build image alongside libdbus-1. - # setuptools' default LICENSE* glob copies them into the wheel. - set -euo pipefail - - project="${1:?usage: collect-licenses.sh }" - - # ldd is transitive, so libdbus-1 alone covers its whole closure; - # ldd does not list the root itself, so resolve that too. - mapfile -t libs < <( - { - ldd /usr/lib64/libdbus-1.so | tr ' ' '\n' | grep '^/' - readlink -f /usr/lib64/libdbus-1.so - } | sort -u - ) - - # `rpm -qf` reports unowned files on stdout, so keep only bare package names. - # glibc and the gcc runtime are on auditwheel's manylinux allowlist and - # are never vendored into the wheel. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc)$' - ) - - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - - # Some subpackages leave the licence to a sibling of the same source RPM. - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi - - # Others mark it %doc rather than %license, and the image installs no docs. - if [ -z "${files[0]:-}" ]; then - dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi - - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done - - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - dnf install -y dbus-devel && - bash {project}/collect-licenses.sh {project} - CIBW_TEST_REQUIRES: pytest - # upstream's suite targets the Plain (mock) backend; only these two are backend-independent. - # Since 1.3.0 the module has an autouse fixture that fetches a Bluetooth adapter, - # which needs the system D-Bus (absent in the build container) for this Linux - # backend, so the two tests are called directly instead of through pytest. - CIBW_TEST_COMMAND: >- - python -c "import sys; sys.path.insert(0, '{project}/simplepyble/test'); - import test_simpleble as t; t.test_configuration_parity(); t.test_platform_enums()" && - python -c "import simplepyble; assert simplepyble.get_operating_system() == simplepyble.OperatingSystem.LINUX" + name: simplepyble-${{ env.SIMPLEPYBLE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the extension and every vendored library's licence run: | @@ -193,12 +201,6 @@ jobs: assert vendored <= have_pkgs, vendored - have_pkgs EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: simplepyble-${{ env.SIMPLEPYBLE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -234,7 +236,7 @@ jobs: publish: name: Publish simplepyble ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-simplification.yml b/.github/workflows/build-simplification.yml index 547ac97d61ee..f97f757f7516 100644 --- a/.github/workflows/build-simplification.yml +++ b/.github/workflows/build-simplification.yml @@ -56,6 +56,67 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build simplification ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # scikit-build-core builds a single cp311-abi3 wheel (pyproject.toml's + # wheel.py-api) covering CPython 3.11+; built on cp311, the oldest + # interpreter the tag claims, and re-tested on the newer ones. + - tag: cp311-abi3 + build: >- + cp311-manylinux_riscv64 cp312-manylinux_riscv64 + cp313-manylinux_riscv64 cp314-manylinux_riscv64 + timeout: 90 + - tag: cp314t + build: cp314t-manylinux_riscv64 + timeout: 60 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "simplification" + version: "${{ matrix.version }}" + repository: "urschrei/simplification" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: "${{ matrix.timeout }}" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/simplification/${{ matrix.version }}/00*.patch + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.build }}" + # cibuildwheel's build[uv] frontend (upstream's pyproject.toml default) + # crashes the audit step: it asserts a host `uv`, which the self-hosted + # riscv64 runner doesn't have (gotcha 13). + cibw-build-frontend: "build" + # Upstream downloads a prebuilt librdp.so from urschrei/rdp's releases; + # there is no riscv64 asset, so build it from source instead (gotcha 77) + # and stage it (plus the cbindgen header CMakeLists.txt also installs) + # where CMakeLists.txt's find_library/cutil.pyx expect them. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && git clone --depth 1 --branch v0.15.0 https://github.com/urschrei/rdp /tmp/rdp && cd /tmp/rdp && $HOME/.cargo/bin/cargo build --release --features headers && cp target/release/librdp.so include/header.h {project}/src/simplification/" + # numpy/cython have riscv64 wheels only on our registry; cython-cmake + # and scikit-build-core are pure Python and resolve from public PyPI. + # PATH: from 2.0.0 the build backend is maturin, which looks for cargo on + # PATH and otherwise tries to rustup-install into a temp dir (and fails: + # "Target triple not supported by rustup: riscv64-unknown-linux-gnu"); + # CIBW_BEFORE_ALL_LINUX's rustup puts it in ~/.cargo/bin. + cibw-environment-linux: "PATH=$HOME/.cargo/bin:$PATH" + cibw-test-environment: "PIP_ONLY_BINARY=numpy" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: ${{ matrix.timeout }} strategy: @@ -74,62 +135,14 @@ jobs: - tag: cp314t build: cp314t-manylinux_riscv64 timeout: 60 - env: SIMPLIFICATION_VERSION: ${{ matrix.version }} - steps: - - name: Checkout simplification v${{ env.SIMPLIFICATION_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: urschrei/simplification - ref: v${{ env.SIMPLIFICATION_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - # The wheel bundles librdp.so (see CIBW_BEFORE_ALL_LINUX below), which is - # MIT-licensed; the wheel ships only simplification's own licence unless - # rdp's is added to license-files too. - - name: Patch simplification source - run: | - git apply python-wheels/patches/simplification/${{ env.SIMPLIFICATION_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cibuildwheel's build[uv] frontend (upstream's pyproject.toml default) - # crashes the audit step: it asserts a host `uv`, which the self-hosted - # riscv64 runner doesn't have (gotcha 13). - CIBW_BUILD_FRONTEND: build - # Upstream downloads a prebuilt librdp.so from urschrei/rdp's releases; - # there is no riscv64 asset, so build it from source instead (gotcha 77) - # and stage it (plus the cbindgen header CMakeLists.txt also installs) - # where CMakeLists.txt's find_library/cutil.pyx expect them. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && - git clone --depth 1 --branch ${{ env.RDP_TAG }} - https://github.com/urschrei/rdp /tmp/rdp && - cd /tmp/rdp && - $HOME/.cargo/bin/cargo build --release --features headers && - cp target/release/librdp.so include/header.h {project}/src/simplification/ - # numpy/cython have riscv64 wheels only on our registry; cython-cmake - # and scikit-build-core are pure Python and resolve from public PyPI. - # PATH: from 2.0.0 the build backend is maturin, which looks for cargo on - # PATH and otherwise tries to rustup-install into a temp dir (and fails: - # "Target triple not supported by rustup: riscv64-unknown-linux-gnu"); - # CIBW_BEFORE_ALL_LINUX's rustup puts it in ~/.cargo/bin. - CIBW_ENVIRONMENT_LINUX: >- - PATH=$HOME/.cargo/bin:$PATH - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy + name: simplification-${{ env.SIMPLIFICATION_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents if: ${{ matrix.tag == 'cp311-abi3' }} @@ -146,15 +159,9 @@ jobs: assert licences == {"LICENSE.md", "LICENSE_rdp"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: simplification-${{ env.SIMPLIFICATION_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish simplification ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-simsimd.yml b/.github/workflows/build-simsimd.yml index 3d4d9143af2d..53c4928cc648 100644 --- a/.github/workflows/build-simsimd.yml +++ b/.github/workflows/build-simsimd.yml @@ -49,32 +49,39 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build simsimd ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "simsimd" + version: "${{ matrix.version }}" + repository: "ashvardanian/SimSIMD" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Replaces upstream's `environment` table, which only sets SIMSIMD_IN_QEMU + # to skip half-precision and complex tests: we build on real hardware. + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SIMSIMD_VERSION: ${{ matrix.version }} - steps: - - name: Checkout simsimd v${{ env.SIMSIMD_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ashvardanian/SimSIMD - ref: v${{ env.SIMSIMD_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces upstream's `environment` table, which only sets SIMSIMD_IN_QEMU - # to skip half-precision and complex tests: we build on real hardware. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + name: simsimd-${{ env.SIMSIMD_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extension run: | @@ -86,12 +93,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: simsimd-${{ env.SIMSIMD_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -127,7 +128,7 @@ jobs: publish: name: Publish simsimd ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-singlestoredb.yml b/.github/workflows/build-singlestoredb.yml index e675fb7684ee..830b8fac9b0d 100644 --- a/.github/workflows/build-singlestoredb.yml +++ b/.github/workflows/build-singlestoredb.yml @@ -63,10 +63,7 @@ jobs: # Upstream's cibuildwheel 2.16 never ran abi3audit; accel.c calls _PyUnicode_AsUTF8 on every arch. cibw-audit-command: '' # Upstream's test_basics needs a live SingleStore cluster; the dummy URL only stops conftest starting one. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pandas,pyarrow,polars-runtime-32 - SINGLESTOREDB_URL=mysql://root:root@127.0.0.1:3306/db + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,pandas,pyarrow,polars-runtime-32 SINGLESTOREDB_URL=mysql://root:root@127.0.0.1:3306/db" cibw-test-requires: pytest pytest-xdist parameterized numpy pandas polars pyarrow cibw-test-command: >- python -c "import _singlestoredb_accel" && diff --git a/.github/workflows/build-skia-pathops.yml b/.github/workflows/build-skia-pathops.yml index 2bb7e7f330e4..70e1648a6750 100644 --- a/.github/workflows/build-skia-pathops.yml +++ b/.github/workflows/build-skia-pathops.yml @@ -59,56 +59,63 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build skia-pathops ${{ matrix.version }} cp310-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "skia-pathops" + version: "${{ matrix.version }}" + repository: "fonttools/skia-pathops" + ref: "v${{ matrix.version }}" + artifact-tag: "cp310-abi3-manylinux_riscv64" + timeout-minutes: 360 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/skia-pathops/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + cibw-environment-linux: "BUILD_SKIA_FROM_SOURCE=0 SKIA_LIBRARY_DIR=build/download SETUPTOOLS_SCM_PRETEND_VERSION_FOR_SKIA_PATHOPS=${{ matrix.version }}" + # skia-builder publishes no riscv64 libskia and Skia's bin/fetch-gn has no + # riscv64 CIPD gn, so build gn from source at fetch-gn's pinned revision + # and run skia-builder's build_skia.py in-container to fill build/download. + cibw-before-all-linux: |- + set -e + dnf -y install libstdc++-static + python3 -m pip install ninja + git clone https://gn.googlesource.com/gn /tmp/gn + git -C /tmp/gn checkout b2afae122eeb6ce09c52d63f67dc53fc517dbdc8 + (cd /tmp/gn && CXX=g++ python3 build/gen.py --allow-warnings && ninja -C out gn) + install -m 0755 /tmp/gn/out/gn src/cpp/skia-builder/skia/bin/gn + python3 src/cpp/skia-builder/build_skia.py --no-sync-deps --no-fetch-gn build/download + cibw-test-extras: "testing" + cibw-test-command: "pytest {project}/tests" + cibw-repair-wheel-command-linux: "auditwheel repair -w {dest_dir} {wheel}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: SKIA_PATHOPS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout skia-pathops v${{ env.SKIA_PATHOPS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: fonttools/skia-pathops - ref: v${{ env.SKIA_PATHOPS_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch skia-pathops source - run: git apply python-wheels/patches/skia-pathops/${{ env.SKIA_PATHOPS_VERSION }}/*.patch - - - name: Build and Test Wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - BUILD_SKIA_FROM_SOURCE=0 SKIA_LIBRARY_DIR=build/download - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_SKIA_PATHOPS=${{ env.SKIA_PATHOPS_VERSION }} - # skia-builder publishes no riscv64 libskia and Skia's bin/fetch-gn has no - # riscv64 CIPD gn, so build gn from source at fetch-gn's pinned revision - # and run skia-builder's build_skia.py in-container to fill build/download. - CIBW_BEFORE_ALL_LINUX: | - set -e - dnf -y install libstdc++-static - python3 -m pip install ninja - git clone https://gn.googlesource.com/gn /tmp/gn - git -C /tmp/gn checkout ${{ env.GN_REVISION }} - (cd /tmp/gn && CXX=g++ python3 build/gen.py --allow-warnings && ninja -C out gn) - install -m 0755 /tmp/gn/out/gn src/cpp/skia-builder/skia/bin/gn - python3 src/cpp/skia-builder/build_skia.py --no-sync-deps --no-fetch-gn build/download - CIBW_TEST_EXTRAS: testing - CIBW_TEST_COMMAND: pytest {project}/tests - CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair -w {dest_dir} {wheel} + name: skia-pathops-${{ env.SKIA_PATHOPS_VERSION }}-cp310-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the wheel ships both licences run: | @@ -123,15 +130,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: skia-pathops-${{ env.SKIA_PATHOPS_VERSION }}-cp310-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish skia-pathops ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-sleipnirgroup-jormungandr.yml b/.github/workflows/build-sleipnirgroup-jormungandr.yml index 64187e730c8b..d051d6b1ccd4 100644 --- a/.github/workflows/build-sleipnirgroup-jormungandr.yml +++ b/.github/workflows/build-sleipnirgroup-jormungandr.yml @@ -51,79 +51,84 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build sleipnirgroup-jormungandr ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "sleipnirgroup-jormungandr" + version: "${{ matrix.version }}" + repository: "SleipnirGroup/Sleipnir" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-fetch-depth: 0 + pre-build: |- + git fetch --tags --force origin + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/sleipnirgroup-jormungandr/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + python3 ./tools/update_version.py --release + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # pybind11_mkdoc generates the bindings' docstrings at build time and + # needs a system clang++/libclang (AppStream ships both on Rocky 10). + cibw-before-all-linux: "dnf -y --enablerepo=crb install clang clang-devel && curl -fsSL --retry 5 \"https://gitlab.com/libeigen/eigen/-/raw/406f412fa43706c60c678b04ed30338e6c93503d/COPYING.README\" > /project/LICENSE.eigen && curl -fsSL --retry 5 \"https://gitlab.com/libeigen/eigen/-/raw/406f412fa43706c60c678b04ed30338e6c93503d/COPYING.MPL2\" >> /project/LICENSE.eigen && curl -fsSL --retry 5 \"https://gitlab.com/libeigen/eigen/-/raw/406f412fa43706c60c678b04ed30338e6c93503d/COPYING.BSD\" >> /project/LICENSE.eigen && curl -fsSL --retry 5 \"https://raw.githubusercontent.com/gharveymn/small_vector/efcab60e5360b699f45d2a44dcb9a79bba40c356/LICENSE\" -o /project/LICENSE.small_vector && curl -fsSL --retry 5 \"https://raw.githubusercontent.com/wjakob/nanobind/v3.0.1/LICENSE\" -o /project/LICENSE.nanobind" + # numpy, matplotlib and pillow (python/pyproject.toml's runtime deps, + # pulled in when the test step installs the built wheel) have riscv64 + # wheels on our registry that trail the latest PyPI release; without + # PIP_ONLY_BINARY pip resolves the newest sdist-only release instead, + # and pillow's then fails to build from source for lack of libjpeg + # headers in the manylinux image (gotcha 422). + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,matplotlib,pillow" + cibw-test-requires: "pytest" + cibw-test-sources: "python/test examples pyproject.toml" + # test_max_iterations_exceeded/test_timeout/test_problem_spy each + # need a genuinely non-default Problem.solve() keyword argument + # (max_iterations=0 / timeout=0.0 / spy=True) that can't be + # dropped like 0003's patch drops diagnostics=True/False + # elsewhere, so they still hit the std::bad_cast in gotcha 710. + cibw-test-command: "pytest -k \"not (test_max_iterations_exceeded or test_timeout or test_problem_spy)\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: JORMUNGANDR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout Sleipnir v${{ env.JORMUNGANDR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: SleipnirGroup/Sleipnir - ref: v${{ env.JORMUNGANDR_VERSION }} - fetch-depth: 0 - persist-credentials: false - - # https://github.com/actions/checkout/issues/882 - - run: git fetch --tags --force origin - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - # 0003 drops the diagnostics=True/False keyword argument from - # python/test's own Problem.solve() calls wherever the test doesn't - # actually need a non-default option: on manylinux_2_39_riscv64 - # (GCC 14.3.1), *any* keyword argument to solve() throws - # std::bad_cast (gotcha 710, superseding 693's diagnostics-specific - # theory), while a bare solve() always succeeds. - run: git apply python-wheels/patches/sleipnirgroup-jormungandr/${{ env.JORMUNGANDR_VERSION }}/*.patch - - - run: python3 ./tools/update_version.py --release - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # pybind11_mkdoc generates the bindings' docstrings at build time and - # needs a system clang++/libclang (AppStream ships both on Rocky 10). - CIBW_BEFORE_ALL_LINUX: >- - dnf -y --enablerepo=crb install clang clang-devel && - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/406f412fa43706c60c678b04ed30338e6c93503d/COPYING.README" > /project/LICENSE.eigen && - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/406f412fa43706c60c678b04ed30338e6c93503d/COPYING.MPL2" >> /project/LICENSE.eigen && - curl -fsSL --retry 5 "https://gitlab.com/libeigen/eigen/-/raw/406f412fa43706c60c678b04ed30338e6c93503d/COPYING.BSD" >> /project/LICENSE.eigen && - curl -fsSL --retry 5 "https://raw.githubusercontent.com/gharveymn/small_vector/efcab60e5360b699f45d2a44dcb9a79bba40c356/LICENSE" -o /project/LICENSE.small_vector && - curl -fsSL --retry 5 "https://raw.githubusercontent.com/wjakob/nanobind/v3.0.1/LICENSE" -o /project/LICENSE.nanobind - # numpy, matplotlib and pillow (python/pyproject.toml's runtime deps, - # pulled in when the test step installs the built wheel) have riscv64 - # wheels on our registry that trail the latest PyPI release; without - # PIP_ONLY_BINARY pip resolves the newest sdist-only release instead, - # and pillow's then fails to build from source for lack of libjpeg - # headers in the manylinux image (gotcha 422). - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,matplotlib,pillow - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: python/test examples pyproject.toml - # test_max_iterations_exceeded/test_timeout/test_problem_spy each - # need a genuinely non-default Problem.solve() keyword argument - # (max_iterations=0 / timeout=0.0 / spy=True) that can't be - # dropped like 0003's patch drops diagnostics=True/False - # elsewhere, so they still hit the std::bad_cast in gotcha 710. - CIBW_TEST_COMMAND: >- - pytest -k "not (test_max_iterations_exceeded or test_timeout or test_problem_spy)" + name: sleipnirgroup-jormungandr-${{ env.JORMUNGANDR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -136,12 +141,6 @@ jobs: assert licences == {"LICENSE.txt", "LICENSE.eigen", "LICENSE.small_vector", "LICENSE.nanobind"}, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: sleipnirgroup-jormungandr-${{ env.JORMUNGANDR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -174,7 +173,7 @@ jobs: publish: name: Publish sleipnirgroup-jormungandr ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-slh-dsa.yml b/.github/workflows/build-slh-dsa.yml index 7ea0132d7b82..73dbad5cc95d 100644 --- a/.github/workflows/build-slh-dsa.yml +++ b/.github/workflows/build-slh-dsa.yml @@ -49,37 +49,42 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build slh-dsa ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "slh-dsa" + version: "${{ matrix.version }}" + repository: "colinxu2020/slhdsa" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import slhdsa.lowlevel.wots as m; assert m.__file__.endswith('.so'), m.__file__\" && pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SLH_DSA_VERSION: ${{ matrix.version }} - steps: - - name: Checkout slhdsa v${{ env.SLH_DSA_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: colinxu2020/slhdsa - ref: v${{ env.SLH_DSA_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import slhdsa.lowlevel.wots as m; assert m.__file__.endswith('.so'), m.__file__" - && pytest tests + name: slh-dsa-${{ env.SLH_DSA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel is mypyc-compiled, not the pure-Python fallback run: | @@ -93,15 +98,9 @@ jobs: assert licenses == ["COPYING", "COPYING.LESSER"], licenses EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: slh-dsa-${{ env.SLH_DSA_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish slh-dsa ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-slixmpp.yml b/.github/workflows/build-slixmpp.yml index f8d7e29b4eb9..f8719d7c84b3 100644 --- a/.github/workflows/build-slixmpp.yml +++ b/.github/workflows/build-slixmpp.yml @@ -50,55 +50,70 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build slixmpp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "slixmpp" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + export SLIXMPP_VERSION='${{ matrix.version }}' + git clone --depth 1 --branch "slix-${SLIXMPP_VERSION}" \ + https://codeberg.org/poezio/slixmpp.git slixmpp-src + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "slixmpp-src" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # No Rust in the image; the sole extension (slixmpp.jid, a pyo3 + # accelerator for the JID parser) is `optional = true`, so a + # toolchain or crate failure here would still fall back to the + # pure-Python slixmpp/jid.py rather than failing the build. + cibw-before-all-linux: "curl -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # pluginsdict.py imports every XEP plugin unconditionally, so + # xep_0363 (aiohttp) and xep_0454 (cryptography) must both be + # importable just to collect tests, not only for the doctest walk; + # aiodns/pyasn1/pyasn1-modules are the project's own runtime deps + # and install with the wheel. cryptography has no riscv64 wheel on + # public PyPI, hence the registry above - and none at all on + # musllinux (registry included), which is why musllinux is dropped. + cibw-test-requires: "aiohttp cryptography" + # test_chores.py reads doap.xml and lists slixmpp/plugins/xep_* from + # disk (not from the installed wheel) relative to tests/..; stage + # just the plugins directory listing (no __init__.py in it) so it + # doesn't shadow the installed package's `import slixmpp`. Sources + # are relative to the job workspace (gotcha 5), not package-dir, so + # they keep the slixmpp-src/ prefix; cd into it to match. + cibw-test-sources: "slixmpp-src/tests slixmpp-src/run_tests.py slixmpp-src/doap.xml slixmpp-src/slixmpp/plugins" + cibw-test-command: "cd slixmpp-src && python run_tests.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SLIXMPP_VERSION: ${{ matrix.version }} - steps: - # codeberg.org isn't github.com, so actions/checkout can't reach it. - - name: Checkout slixmpp ${{ env.SLIXMPP_VERSION }} - run: | - git clone --depth 1 --branch "slix-${SLIXMPP_VERSION}" \ - https://codeberg.org/poezio/slixmpp.git slixmpp-src - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: slixmpp-src - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # No Rust in the image; the sole extension (slixmpp.jid, a pyo3 - # accelerator for the JID parser) is `optional = true`, so a - # toolchain or crate failure here would still fall back to the - # pure-Python slixmpp/jid.py rather than failing the build. - CIBW_BEFORE_ALL_LINUX: curl -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # pluginsdict.py imports every XEP plugin unconditionally, so - # xep_0363 (aiohttp) and xep_0454 (cryptography) must both be - # importable just to collect tests, not only for the doctest walk; - # aiodns/pyasn1/pyasn1-modules are the project's own runtime deps - # and install with the wheel. cryptography has no riscv64 wheel on - # public PyPI, hence the registry above - and none at all on - # musllinux (registry included), which is why musllinux is dropped. - CIBW_TEST_REQUIRES: aiohttp cryptography - # test_chores.py reads doap.xml and lists slixmpp/plugins/xep_* from - # disk (not from the installed wheel) relative to tests/..; stage - # just the plugins directory listing (no __init__.py in it) so it - # doesn't shadow the installed package's `import slixmpp`. Sources - # are relative to the job workspace (gotcha 5), not package-dir, so - # they keep the slixmpp-src/ prefix; cd into it to match. - CIBW_TEST_SOURCES: slixmpp-src/tests slixmpp-src/run_tests.py slixmpp-src/doap.xml slixmpp-src/slixmpp/plugins - CIBW_TEST_COMMAND: cd slixmpp-src && python run_tests.py + name: slixmpp-${{ env.SLIXMPP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the pyo3 JID accelerator built (not just the pure-Python fallback) run: | @@ -110,15 +125,9 @@ jobs: print(whl, "accelerated" if has_ext else "pure-Python fallback (optional extension did not build)") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: slixmpp-${{ env.SLIXMPP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish slixmpp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-slycot.yml b/.github/workflows/build-slycot.yml index f0698ded2c2a..6092569de7a0 100644 --- a/.github/workflows/build-slycot.yml +++ b/.github/workflows/build-slycot.yml @@ -54,38 +54,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build slycot ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "slycot" + version: "${{ matrix.version }}" + repository: "python-control/Slycot" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + checkout-submodules: "recursive" + checkout-fetch-depth: 0 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "CMAKE_ARGS='-DSLYCOT_BUNDLE_OPENBLAS=ON'" + cibw-before-build: "python {project}/build-tools/cibw_before_build.py 0.3.31.22.0 {project}" + cibw-repair-wheel-command-linux: "LD_LIBRARY_PATH=./build-libs auditwheel repair -w {dest_dir} {wheel}" + cibw-test-extras: "test" + cibw-test-command: "pytest --pyargs slycot" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SLYCOT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout python-control/Slycot v${{ env.SLYCOT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: python-control/Slycot - ref: v${{ env.SLYCOT_VERSION }} - submodules: recursive - fetch-depth: 0 - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: CMAKE_ARGS='-DSLYCOT_BUNDLE_OPENBLAS=ON' PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_BEFORE_BUILD: python {project}/build-tools/cibw_before_build.py 0.3.31.22.0 {project} - CIBW_REPAIR_WHEEL_COMMAND_LINUX: LD_LIBRARY_PATH=./build-libs auditwheel repair -w {dest_dir} {wheel} - CIBW_TEST_EXTRAS: test - CIBW_TEST_COMMAND: pytest --pyargs slycot + name: slycot-${{ env.SLYCOT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and licences made it into the wheel run: | @@ -100,15 +107,9 @@ jobs: print(whl, "ok", licences) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: slycot-${{ env.SLYCOT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish slycot ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-small-gicp.yml b/.github/workflows/build-small-gicp.yml index afc903582312..70c895a79415 100644 --- a/.github/workflows/build-small-gicp.yml +++ b/.github/workflows/build-small-gicp.yml @@ -48,42 +48,49 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build small-gicp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "small-gicp" + version: "${{ matrix.version }}" + repository: "koide3/small_gicp" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + set -euo pipefail + pybind11=$(curl -fsSL --retry 5 https://pypi.org/pypi/pybind11/json | python3 -c 'import json, sys; print(json.load(sys.stdin)["info"]["version"])') + curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/v${pybind11}/LICENSE" -o LICENSE.pybind11 + curl -fsSL --retry 5 https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 -o LICENSE.eigen + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy SKBUILD_WHEEL_LICENSE_FILES=\"LICENSE;LICENSE.eigen;LICENSE.pybind11\"" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SMALL_GICP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout small_gicp v${{ env.SMALL_GICP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: koide3/small_gicp - ref: v${{ env.SMALL_GICP_VERSION }} - persist-credentials: false - - # Eigen (fetched by CMakeLists.txt) and pybind11 are compiled into the extension; upstream ships neither notice. - - name: Stage the bundled dependencies' licences - run: | - set -euo pipefail - pybind11=$(curl -fsSL --retry 5 https://pypi.org/pypi/pybind11/json | python3 -c 'import json, sys; print(json.load(sys.stdin)["info"]["version"])') - curl -fsSL --retry 5 "https://raw.githubusercontent.com/pybind/pybind11/v${pybind11}/LICENSE" -o LICENSE.pybind11 - curl -fsSL --retry 5 https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 -o LICENSE.eigen - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy - SKBUILD_WHEEL_LICENSE_FILES="LICENSE;LICENSE.eigen;LICENSE.pybind11" + name: small-gicp-${{ env.SMALL_GICP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -101,13 +108,6 @@ jobs: assert licences == {"LICENSE", "LICENSE.eigen", "LICENSE.pybind11"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: small-gicp-${{ env.SMALL_GICP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -141,7 +141,7 @@ jobs: publish: name: Publish small-gicp ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-smoldot-light.yml b/.github/workflows/build-smoldot-light.yml index 7f9172c3b358..fd8a9e918510 100644 --- a/.github/workflows/build-smoldot-light.yml +++ b/.github/workflows/build-smoldot-light.yml @@ -51,52 +51,60 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build smoldot-light ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "smoldot-light" + version: "${{ matrix.version }}" + repository: "JAMdotTech/py-smoldot-light" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/smoldot-light/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # py-smoldot-light ships no [tool.cibuildwheel]; the Rust toolchain + # its maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # smoldot's own executor/vm.rs only enables its wasmtime/Cranelift JIT + # backend for x86_64/aarch64/s390x; riscv64 already falls back to its + # portable wasmi interpreter, the same path upstream's own armv7l/i686/ + # ppc64le wheels use, so no feature flags are needed here. + cibw-test-command: "python -c \"import smoldot_light.smoldot_light as m; assert m.__file__.endswith('.so'), m.__file__\" && python -c \"import time; from smoldot_light import SmoldotClient; c=SmoldotClient(); spec=open('{project}/chains/polkadot.json').read(); cid=c.add_chain(spec); c.json_rpc_request(cid, '{\\\"id\\\":1,\\\"jsonrpc\\\":\\\"2.0\\\",\\\"method\\\":\\\"system_name\\\",\\\"params\\\":[]}'); time.sleep(2); resp=c.drain_responses(cid, max=10); assert resp and 'py-smoldot-light' in resp[0], resp; print('OK:', resp)\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SMOLDOT_LIGHT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout py-smoldot-light v${{ env.SMOLDOT_LIGHT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: JAMdotTech/py-smoldot-light - ref: v${{ env.SMOLDOT_LIGHT_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch source - run: git apply python-wheels/patches/smoldot-light/${{ env.SMOLDOT_LIGHT_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # py-smoldot-light ships no [tool.cibuildwheel]; the Rust toolchain - # its maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - # smoldot's own executor/vm.rs only enables its wasmtime/Cranelift JIT - # backend for x86_64/aarch64/s390x; riscv64 already falls back to its - # portable wasmi interpreter, the same path upstream's own armv7l/i686/ - # ppc64le wheels use, so no feature flags are needed here. - CIBW_TEST_COMMAND: >- - python -c "import smoldot_light.smoldot_light as m; assert m.__file__.endswith('.so'), m.__file__" && - python -c "import time; from smoldot_light import SmoldotClient; c=SmoldotClient(); spec=open('{project}/chains/polkadot.json').read(); cid=c.add_chain(spec); c.json_rpc_request(cid, '{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"system_name\",\"params\":[]}'); time.sleep(2); resp=c.drain_responses(cid, max=10); assert resp and 'py-smoldot-light' in resp[0], resp; print('OK:', resp)" + name: smoldot-light-${{ env.SMOLDOT_LIGHT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel ships both licences run: | @@ -107,16 +115,9 @@ jobs: assert licences == {"LICENSE", "LICENSE.smoldot"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: smoldot-light-${{ env.SMOLDOT_LIGHT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish smoldot-light ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-snowflake-connector-python.yml b/.github/workflows/build-snowflake-connector-python.yml index 4a5f48b9b273..0720e4cfe03e 100644 --- a/.github/workflows/build-snowflake-connector-python.yml +++ b/.github/workflows/build-snowflake-connector-python.yml @@ -51,6 +51,87 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build snowflake-connector-python ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + # execnet's receiver thread segfaults intermittently under the + # free-threaded interpreter, so run this one in-process. + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "snowflake-connector-python" + version: "${{ matrix.version }}" + repository: "snowflakedb/snowflake-connector-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + pre-build: |- + export WIREMOCK_VERSION=3.11.0 + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + # ci/build_linux.sh keeps only the host platform's prebuilt minicore blob; + # there is none for riscv64, and a foreign-arch .so breaks auditwheel repair + # (a missing one is non-fatal - _utils._CoreLoader._load swallows it). + rm -rf src/snowflake/connector/minicore/*/ + # cibuildwheel 4 dropped the cpython-freethreading enable group and errors + # out on the stale name; free-threaded builds are always selectable now. + sed -i '/^enable = \["cpython-freethreading"\]$/d' pyproject.toml + curl -fsSL --retry 5 --retry-all-errors \ + "https://repo1.maven.org/maven2/org/wiremock/wiremock-standalone/${WIREMOCK_VERSION}/wiremock-standalone-${WIREMOCK_VERSION}.jar" \ + --output .wiremock/wiremock-standalone.jar + git apply python-wheels/patches/snowflake-connector-python/${{ matrix.version }}/00*.patch + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Replaces upstream's AUDITWHEEL_PLAT=manylinux2014_$(uname -m); there is no + # manylinux2014 policy for riscv64, so keep the image's manylinux_2_39_riscv64. + # Upstream disables cibuildwheel's repair because ci/build_linux.sh runs + # auditwheel itself; restore the default so the wheel gets a manylinux tag. + cibw-repair-wheel-command: "auditwheel repair -w {dest_dir} {wheel}" + # Upstream sets test-skip = "*" (wheels are tested in a separate CI job). + cibw-test-skip: '' + # Test phase only (gotcha 12): wheels-only, so installing the built wheel + # backtracks cryptography to the newest riscv64 wheel on our registry + # instead of source-building the latest sdist (which needs a rustup + # target triple that does not exist for riscv64). + cibw-test-environment: "PIP_ONLY_BINARY=:all:" + # A JRE for the Wiremock server the auth/oauth/proxy unit tests spin up. + cibw-before-all: "dnf install -y java-21-openjdk-headless" + # The [development] extra minus mitmproxy, whose aioquic/pylsqpack deps + # have no riscv64 wheels (its fixtures skip when mitmdump is absent). + cibw-test-requires: "pytest<7.5.0 pytest-asyncio pytest-timeout pytest-rerunfailures<16.0 pytest-xdist more-itertools numpy responses azure-identity" + # Mirrors tox's py3XX-unit-parallel-ci env, minus coverage. Dropped: + # aio/ - aiohttp+aioboto extras have no riscv64 wheels + # test_ocsp - live OCSP responders, incl. an unreachable preprod + # host, so it stalls on TCP timeouts + # test_proxies - 2-3 Wiremock JVMs per test streaming large results; + # tens of minutes even on x86 + # ssl_..._handshake - real TLS handshake against an external host + # The first three -k names need a native minicore blob, which upstream + # ships for eight platforms but not riscv64; the last five chmod a path + # and expect the EACCES that root - which cibuildwheel runs the tests + # as - never gets. test_auth_keypair_ecdsa_unsupported_curve generates a + # SECP192R1 key as test setup; our riscv64 cryptography wheel's OpenSSL + # build has no legacy provider, so cryptography itself raises + # UnsupportedAlgorithm before the connector's own curve check runs. + # test_retry_connection_reset_error resets a loopback connection and expects the + # connector's RetryRequest; on this riscv64 runner the reset surfaces as + # OSError EINVAL from the test's own socket setup instead (failed twice in a + # row on cp313 while the other 1777 unit tests pass). + cibw-test-command: "python -c \"from snowflake.connector.nanoarrow_arrow_iterator import PyArrowRowIterator\" && pytest -m \"unit and not sso and not pandas and not lambda and not aio\" -k \"not (TestCoreLoader and test_e2e) and not test_get_present_binaries_contains_expected_paths and not test_pruner_agrees_with_runtime_loader and not test_warn_config_file_owner and not test_log_debug_config_file_parent_dir_permissions and not test_read_only and not test_config_file_inaccessible_path and not test_put_error and not test_auth_keypair_ecdsa_unsupported_curve and not test_retry_connection_reset_error\" ${{ case(matrix.python == 'cp312', '-n auto --dist loadfile', matrix.python == 'cp313', '-n auto --dist loadfile', matrix.python == 'cp314', '-n auto --dist loadfile', endsWith(matrix.python, 't'), '-n 0', '') }} --ignore {package}/test/unit/aio --ignore {package}/test/unit/test_ocsp.py --ignore {package}/test/unit/test_proxies.py --ignore {package}/test/unit/test_ssl_partial_chain_handshake.py {package}/test/unit" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: @@ -59,102 +140,14 @@ jobs: # execnet's receiver thread segfaults intermittently under the # free-threaded interpreter, so run this one in-process. include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SNOWFLAKE_CONNECTOR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout snowflake-connector-python v${{ env.SNOWFLAKE_CONNECTOR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: snowflakedb/snowflake-connector-python - ref: v${{ env.SNOWFLAKE_CONNECTOR_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Prepare the checkout - run: | - # ci/build_linux.sh keeps only the host platform's prebuilt minicore blob; - # there is none for riscv64, and a foreign-arch .so breaks auditwheel repair - # (a missing one is non-fatal — _utils._CoreLoader._load swallows it). - rm -rf src/snowflake/connector/minicore/*/ - # cibuildwheel 4 dropped the cpython-freethreading enable group and errors - # out on the stale name; free-threaded builds are always selectable now. - sed -i '/^enable = \["cpython-freethreading"\]$/d' pyproject.toml - curl -fsSL --retry 5 --retry-all-errors \ - "https://repo1.maven.org/maven2/org/wiremock/wiremock-standalone/${WIREMOCK_VERSION}/wiremock-standalone-${WIREMOCK_VERSION}.jar" \ - --output .wiremock/wiremock-standalone.jar - git apply python-wheels/patches/snowflake-connector-python/${{ env.SNOWFLAKE_CONNECTOR_VERSION }}/00*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces upstream's AUDITWHEEL_PLAT=manylinux2014_$(uname -m); there is no - # manylinux2014 policy for riscv64, so keep the image's manylinux_2_39_riscv64. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream disables cibuildwheel's repair because ci/build_linux.sh runs - # auditwheel itself; restore the default so the wheel gets a manylinux tag. - CIBW_REPAIR_WHEEL_COMMAND: auditwheel repair -w {dest_dir} {wheel} - # Upstream sets test-skip = "*" (wheels are tested in a separate CI job). - CIBW_TEST_SKIP: '' - # Test phase only (gotcha 12): wheels-only, so installing the built wheel - # backtracks cryptography to the newest riscv64 wheel on our registry - # instead of source-building the latest sdist (which needs a rustup - # target triple that does not exist for riscv64). - CIBW_TEST_ENVIRONMENT: "PIP_ONLY_BINARY=:all:" - # A JRE for the Wiremock server the auth/oauth/proxy unit tests spin up. - CIBW_BEFORE_ALL: dnf install -y java-21-openjdk-headless - # The [development] extra minus mitmproxy, whose aioquic/pylsqpack deps - # have no riscv64 wheels (its fixtures skip when mitmdump is absent). - CIBW_TEST_REQUIRES: >- - pytest<7.5.0 pytest-asyncio pytest-timeout pytest-rerunfailures<16.0 - pytest-xdist more-itertools numpy responses azure-identity - # Mirrors tox's py3XX-unit-parallel-ci env, minus coverage. Dropped: - # aio/ - aiohttp+aioboto extras have no riscv64 wheels - # test_ocsp - live OCSP responders, incl. an unreachable preprod - # host, so it stalls on TCP timeouts - # test_proxies - 2-3 Wiremock JVMs per test streaming large results; - # tens of minutes even on x86 - # ssl_..._handshake - real TLS handshake against an external host - # The first three -k names need a native minicore blob, which upstream - # ships for eight platforms but not riscv64; the last five chmod a path - # and expect the EACCES that root - which cibuildwheel runs the tests - # as - never gets. test_auth_keypair_ecdsa_unsupported_curve generates a - # SECP192R1 key as test setup; our riscv64 cryptography wheel's OpenSSL - # build has no legacy provider, so cryptography itself raises - # UnsupportedAlgorithm before the connector's own curve check runs. - # test_retry_connection_reset_error resets a loopback connection and expects the - # connector's RetryRequest; on this riscv64 runner the reset surfaces as - # OSError EINVAL from the test's own socket setup instead (failed twice in a - # row on cp313 while the other 1777 unit tests pass). - CIBW_TEST_COMMAND: >- - python -c "from snowflake.connector.nanoarrow_arrow_iterator import PyArrowRowIterator" && - pytest -m "unit and not sso and not pandas and not lambda and not aio" - -k "not (TestCoreLoader and test_e2e) - and not test_get_present_binaries_contains_expected_paths - and not test_pruner_agrees_with_runtime_loader - and not test_warn_config_file_owner - and not test_log_debug_config_file_parent_dir_permissions - and not test_read_only - and not test_config_file_inaccessible_path - and not test_put_error - and not test_auth_keypair_ecdsa_unsupported_curve - and not test_retry_connection_reset_error" - ${{ case(matrix.python == 'cp312', '-n auto --dist loadfile', matrix.python == 'cp313', '-n auto --dist loadfile', matrix.python == 'cp314', '-n auto --dist loadfile', endsWith(matrix.python, 't'), '-n 0', '') }} - --ignore {package}/test/unit/aio - --ignore {package}/test/unit/test_ocsp.py - --ignore {package}/test/unit/test_proxies.py - --ignore {package}/test/unit/test_ssl_partial_chain_handshake.py - {package}/test/unit + name: snowflake-connector-python-${{ env.SNOWFLAKE_CONNECTOR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the Cython extension made it into the wheel run: | @@ -166,15 +159,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: snowflake-connector-python-${{ env.SNOWFLAKE_CONNECTOR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish snowflake-connector-python ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-soxr.yml b/.github/workflows/build-soxr.yml index a88d6730f6d8..10dc7e4be076 100644 --- a/.github/workflows/build-soxr.yml +++ b/.github/workflows/build-soxr.yml @@ -72,7 +72,6 @@ jobs: checkout-submodules: recursive checkout-fetch-depth: 0 cibw-build: ${{ matrix.build }} - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # numpy has no riscv64 wheel on public PyPI; keep pip on our registry's copy. cibw-test-environment: PIP_ONLY_BINARY=numpy timeout-minutes: 120 diff --git a/.github/workflows/build-spacy-pkuseg.yml b/.github/workflows/build-spacy-pkuseg.yml index f056e0170bc8..d49bc31e28b6 100644 --- a/.github/workflows/build-spacy-pkuseg.yml +++ b/.github/workflows/build-spacy-pkuseg.yml @@ -53,65 +53,65 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build spacy-pkuseg ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - SPACY_PKUSEG_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout spacy-pkuseg ${{ env.SPACY_PKUSEG_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: explosion/spacy-pkuseg - ref: release-v${{ env.SPACY_PKUSEG_VERSION }} - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "spacy-pkuseg" + version: "${{ matrix.version }}" + repository: "explosion/spacy-pkuseg" + ref: "release-v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + patches="$PWD/python-wheels/patches/spacy-pkuseg/${{ matrix.version }}" + if [ -d "$patches" ]; then + git apply "$patches"/*.patch + fi - - name: Patch spacy-pkuseg source - # Only some versions need patching (the older tag needed the removed free-threaded-support option commented out; newer tags dropped it), so a missing directory is not an error. - run: | - patches="$PWD/python-wheels/patches/spacy-pkuseg/${{ env.SPACY_PKUSEG_VERSION }}" - if [ -d "$patches" ]; then - git apply "$patches"/*.patch - fi + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # cython and numpy (build) and numpy and srsly (runtime) have no riscv64 + # wheels on public PyPI; both environments resolve them from our registry. + # The extensions do not declare free-threading support, so importing them under + # cp314t re-enables the GIL with a RuntimeWarning that -Werror turns fatal; + # asking for the GIL up front is the same outcome without the warning. Ignored + # on the GIL builds. + cibw-test-environment: "PYTHON_GIL=1" + # Upstream leaves cibuildwheel's test-command empty and runs the suite from + # tests.yml instead; that is the pytest line below. The bundled suite only + # imports the package, so the checks before it exercise the extensions. + cibw-test-requires: "pytest" + cibw-test-command: "python -c \"import math, numpy as np; from spacy_pkuseg.inference import run_viterbi; from spacy_pkuseg.feature_extractor import get_slice_str; score, states = run_viterbi(np.array([[0., 3.], [2., 0.], [0., 5.]]), np.array([[0., 1.], [.5, 0.]])); assert list(states) == [1, 0, 1], states; assert abs(score - math.exp(11.5)) < 1e-6 * score, score; assert get_slice_str('abcdef', 1, 3, 6) == 'bcd'\" && python -m pytest --pyargs spacy_pkuseg -Werror" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + SPACY_PKUSEG_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cython and numpy (build) and numpy and srsly (runtime) have no riscv64 - # wheels on public PyPI; both environments resolve them from our registry. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # The extensions do not declare free-threading support, so importing them under - # cp314t re-enables the GIL with a RuntimeWarning that -Werror turns fatal; - # asking for the GIL up front is the same outcome without the warning. Ignored - # on the GIL builds. - CIBW_TEST_ENVIRONMENT: PYTHON_GIL=1 - # Upstream leaves cibuildwheel's test-command empty and runs the suite from - # tests.yml instead; that is the pytest line below. The bundled suite only - # imports the package, so the checks before it exercise the extensions. - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: >- - python -c "import math, numpy as np; - from spacy_pkuseg.inference import run_viterbi; - from spacy_pkuseg.feature_extractor import get_slice_str; - score, states = run_viterbi(np.array([[0., 3.], [2., 0.], [0., 5.]]), np.array([[0., 1.], [.5, 0.]])); - assert list(states) == [1, 0, 1], states; - assert abs(score - math.exp(11.5)) < 1e-6 * score, score; - assert get_slice_str('abcdef', 1, 3, 6) == 'bcd'" - && python -m pytest --pyargs spacy_pkuseg -Werror + name: spacy-pkuseg-${{ env.SPACY_PKUSEG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension modules made it into the wheel run: | @@ -126,15 +126,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: spacy-pkuseg-${{ env.SPACY_PKUSEG_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish spacy-pkuseg ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-spacy-transformers.yml b/.github/workflows/build-spacy-transformers.yml index c68efb24674f..1ba2c8bf9cd7 100644 --- a/.github/workflows/build-spacy-transformers.yml +++ b/.github/workflows/build-spacy-transformers.yml @@ -51,60 +51,64 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build spacy-transformers ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "spacy-transformers" + version: "${{ matrix.version }}" + repository: "explosion/spacy-transformers" + ref: "release-v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 360 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # test_multiprocessing's Language.pipe(n_process=2) pickles the transformer's + # tensors through /dev/shm, overrunning Docker's 64MB default (gotcha 613). + cibw-container-engine: "docker; create_args: --shm-size=2g" + # numpy (build and runtime) and spacy/srsly/torch (runtime) have no + # riscv64 wheels on public PyPI; both environments resolve them from + # our registry. spacy-alignments (runtime) has no riscv64 wheel + # anywhere yet, so its sdist is compiled instead - it needs a Rust + # toolchain, installed below, but is never actually imported by this + # package or its tests. + cibw-environment-linux: "PATH=$PATH:$HOME/.cargo/bin" + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + # Upstream leaves cibuildwheel's test-command empty and runs the + # suite from tests.yml instead; this is that invocation, minus the + # sdist build/mypy steps, which check packaging and typing, not the + # wheel. tests.yml installs requirements.txt's + # transformers[sentencepiece], an extra setup.cfg's install_requires + # omits; one test needs that backend, so it's added explicitly here. + cibw-test-requires: "pytest pytest-cov sentencepiece" + cibw-test-command: "python -m pytest --pyargs spacy_transformers" + # transformers<4.53.3 (spacy-transformers' own pin) requires + # tokenizers>=0.21,<0.22; unconstrained, pip picks the highest + # matching point release (0.21.2/0.21.4), which has no riscv64 + # wheel anywhere, and source-builds it, where rustc SIGABRTs on + # these runners (gotcha 228). Forcing binary-only makes pip fall + # back to our registry's 0.21.1 wheel instead. + cibw-test-environment: "PIP_ONLY_BINARY=tokenizers" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SPACY_TRANSFORMERS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout spacy-transformers ${{ env.SPACY_TRANSFORMERS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: explosion/spacy-transformers - ref: release-v${{ env.SPACY_TRANSFORMERS_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # test_multiprocessing's Language.pipe(n_process=2) pickles the transformer's - # tensors through /dev/shm, overrunning Docker's 64MB default (gotcha 613). - CIBW_CONTAINER_ENGINE: "docker; create_args: --shm-size=2g" - # numpy (build and runtime) and spacy/srsly/torch (runtime) have no - # riscv64 wheels on public PyPI; both environments resolve them from - # our registry. spacy-alignments (runtime) has no riscv64 wheel - # anywhere yet, so its sdist is compiled instead - it needs a Rust - # toolchain, installed below, but is never actually imported by this - # package or its tests. - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PATH=$PATH:$HOME/.cargo/bin - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - # Upstream leaves cibuildwheel's test-command empty and runs the - # suite from tests.yml instead; this is that invocation, minus the - # sdist build/mypy steps, which check packaging and typing, not the - # wheel. tests.yml installs requirements.txt's - # transformers[sentencepiece], an extra setup.cfg's install_requires - # omits; one test needs that backend, so it's added explicitly here. - CIBW_TEST_REQUIRES: pytest pytest-cov sentencepiece - CIBW_TEST_COMMAND: python -m pytest --pyargs spacy_transformers - # transformers<4.53.3 (spacy-transformers' own pin) requires - # tokenizers>=0.21,<0.22; unconstrained, pip picks the highest - # matching point release (0.21.2/0.21.4), which has no riscv64 - # wheel anywhere, and source-builds it, where rustc SIGABRTs on - # these runners (gotcha 228). Forcing binary-only makes pip fall - # back to our registry's 0.21.1 wheel instead. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=tokenizers + name: spacy-transformers-${{ env.SPACY_TRANSFORMERS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension modules made it into the wheel run: | @@ -118,15 +122,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: spacy-transformers-${{ env.SPACY_TRANSFORMERS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish spacy-transformers ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-sparsediffpy.yml b/.github/workflows/build-sparsediffpy.yml index 4dfd91f09a2a..d13057d06ad1 100644 --- a/.github/workflows/build-sparsediffpy.yml +++ b/.github/workflows/build-sparsediffpy.yml @@ -51,52 +51,59 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build sparsediffpy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "sparsediffpy" + version: "${{ matrix.version }}" + repository: "SparseDifferentiation/SparseDiffPy" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/sparsediffpy/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # CMakeLists.txt find_package(BLAS)s unconditionally on Linux; stage its + # licence beside ours since auditwheel will vendor libopenblas.so.0 in. + cibw-before-all-linux: "dnf -y install openblas-devel && cp /usr/share/licenses/openblas/LICENSE {project}/LICENSE.openblas" + # numpy has riscv64 wheels only on our registry. + # Upstream ships no test suite for this package; build one C node, + # the smallest real exercise of the extension. + cibw-test-command: "python -c \"from sparsediffpy import _sparsediffengine as e; assert e.make_variable(2, 1, 0, 1)\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SPARSEDIFFPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout sparsediffpy v${{ env.SPARSEDIFFPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: SparseDifferentiation/SparseDiffPy - ref: v${{ env.SPARSEDIFFPY_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Patch sparsediffpy source - run: git apply python-wheels/patches/sparsediffpy/${{ env.SPARSEDIFFPY_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # CMakeLists.txt find_package(BLAS)s unconditionally on Linux; stage its - # licence beside ours since auditwheel will vendor libopenblas.so.0 in. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install openblas-devel && - cp /usr/share/licenses/openblas/LICENSE {project}/LICENSE.openblas - # numpy has riscv64 wheels only on our registry. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream ships no test suite for this package; build one C node, - # the smallest real exercise of the extension. - CIBW_TEST_COMMAND: >- - python -c "from sparsediffpy import _sparsediffengine as e; assert e.make_variable(2, 1, 0, 1)" + name: sparsediffpy-${{ env.SPARSEDIFFPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and both licences run: | @@ -112,12 +119,6 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: sparsediffpy-${{ env.SPARSEDIFFPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -149,7 +150,7 @@ jobs: publish: name: Publish sparsediffpy ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-spatial-access.yml b/.github/workflows/build-spatial-access.yml index 9a938e0a1968..536207cdf814 100644 --- a/.github/workflows/build-spatial-access.yml +++ b/.github/workflows/build-spatial-access.yml @@ -49,55 +49,61 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build spatial-access ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "spatial-access" + version: "${{ matrix.version }}" + repository: "GeoDaCenter/spatial_access" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # The released sdist ships a stale _p2pExtension.cpp pre-generated by an old + # Cython against old CPython internals (PyTypeObject/PyFrameObject layout) and + # fails to compile on current CPython. Rebuilding it here with a current Cython + # from the full checkout (which, unlike the PyPI sdist, carries the pyx_src/ + # templates MANIFEST.in leaves out of the release tarball) fixes that cleanly. + cibw-before-build: |- + set -e + pip install "cython>=3" jinja2 + bash cythonize_extension.sh + # The wheel's Requires-Dist pulls the full GIS chain (fiona needs a system GDAL); + # install it bare since the suite below only imports the extension (gotcha 122). + cibw-test-environment: "PIP_NO_DEPS=1" + cibw-before-test-linux: "PIP_NO_DEPS=0 pip install pytest" + # tests/test_networkUtility.py is the only suite that imports nothing but the + # compiled extension itself; the rest of tests/ pulls in spatial_access's full GIS + # dependency chain (geopandas, fiona, osmnet, ...), out of scope here. A sibling + # suite, tests/test_pyTransitMatrix.py, is also extension-only but 6 of its 7 + # cases fail identically against the real, officially-released PyPI wheel + # (spatial_access-1.0.2-cp310-cp310-manylinux_2_17_x86_64...whl installed with + # --no-deps on x86_64) -- a pre-existing upstream bug in compute()/ + # getDestsInRange(), not a riscv64 or rebuild regression, so it is left out + # rather than carrying a wheel-vs-test mismatch or a non-upstream behavior patch. + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest tests/test_networkUtility.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SPATIAL_ACCESS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout spatial_access ${{ env.SPATIAL_ACCESS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: GeoDaCenter/spatial_access - ref: v${{ env.SPATIAL_ACCESS_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # The released sdist ships a stale _p2pExtension.cpp pre-generated by an old - # Cython against old CPython internals (PyTypeObject/PyFrameObject layout) and - # fails to compile on current CPython. Rebuilding it here with a current Cython - # from the full checkout (which, unlike the PyPI sdist, carries the pyx_src/ - # templates MANIFEST.in leaves out of the release tarball) fixes that cleanly. - CIBW_BEFORE_BUILD: | - set -e - pip install "cython>=3" jinja2 - bash cythonize_extension.sh - # The wheel's Requires-Dist pulls the full GIS chain (fiona needs a system GDAL); - # install it bare since the suite below only imports the extension (gotcha 122). - CIBW_TEST_ENVIRONMENT: PIP_NO_DEPS=1 - CIBW_BEFORE_TEST_LINUX: PIP_NO_DEPS=0 pip install pytest - # tests/test_networkUtility.py is the only suite that imports nothing but the - # compiled extension itself; the rest of tests/ pulls in spatial_access's full GIS - # dependency chain (geopandas, fiona, osmnet, ...), out of scope here. A sibling - # suite, tests/test_pyTransitMatrix.py, is also extension-only but 6 of its 7 - # cases fail identically against the real, officially-released PyPI wheel - # (spatial_access-1.0.2-cp310-cp310-manylinux_2_17_x86_64...whl installed with - # --no-deps on x86_64) -- a pre-existing upstream bug in compute()/ - # getDestsInRange(), not a riscv64 or rebuild regression, so it is left out - # rather than carrying a wheel-vs-test mismatch or a non-upstream behavior patch. - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest tests/test_networkUtility.py + name: spatial-access-${{ env.SPATIAL_ACCESS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension module made it into the wheel run: | @@ -109,15 +115,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: spatial-access-${{ env.SPATIAL_ACCESS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish spatial-access ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-spatialgeometry.yml b/.github/workflows/build-spatialgeometry.yml index 58059a10296c..0a17a5439774 100644 --- a/.github/workflows/build-spatialgeometry.yml +++ b/.github/workflows/build-spatialgeometry.yml @@ -48,45 +48,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build spatialgeometry ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "spatialgeometry" + version: "${{ matrix.version }}" + repository: "jhavl/spatialgeometry" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + curl -fsSL --retry 5 -o COPYING.eigen https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,pillow,matplotlib,contourpy,kiwisolver" + # spatialmath-python (a CIBW_TEST_REQUIRES dep) pulls in matplotlib, whose own + # runtime deps (pillow, contourpy, kiwisolver) lack a riscv64 wheel on PyPI's + # newest release -- PIP_ONLY_BINARY above forces pip onto our registry's wheels + # instead of a source build (CLAUDE.md gotcha 291; pillow's sdist build fails + # with `RequiredDependencyException: jpeg`, no libjpeg headers in the image). + cibw-test-requires: "pytest numpy spatialmath-python trimesh" + cibw-test-sources: "tests pyproject.toml" + cibw-test-command: "python -m pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SPATIALGEOMETRY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout spatialgeometry ${{ env.SPATIALGEOMETRY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: jhavl/spatialgeometry - ref: v${{ env.SPATIALGEOMETRY_VERSION }} - persist-credentials: false - - # The vendored header-only Eigen has no LICENSE of its own in this tree. - - name: Stage Eigen's licence - run: curl -fsSL --retry 5 -o COPYING.eigen https://gitlab.com/libeigen/eigen/-/raw/3.4.0/COPYING.MPL2 - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pillow,matplotlib,contourpy,kiwisolver - # spatialmath-python (a CIBW_TEST_REQUIRES dep) pulls in matplotlib, whose own - # runtime deps (pillow, contourpy, kiwisolver) lack a riscv64 wheel on PyPI's - # newest release -- PIP_ONLY_BINARY above forces pip onto our registry's wheels - # instead of a source build (CLAUDE.md gotcha 291; pillow's sdist build fails - # with `RequiredDependencyException: jpeg`, no libjpeg headers in the image). - CIBW_TEST_REQUIRES: pytest numpy spatialmath-python trimesh - CIBW_TEST_SOURCES: tests pyproject.toml - CIBW_TEST_COMMAND: python -m pytest {project}/tests + name: spatialgeometry-${{ env.SPATIALGEOMETRY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -102,15 +110,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: spatialgeometry-${{ env.SPATIALGEOMETRY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish spatialgeometry ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-spconv.yml b/.github/workflows/build-spconv.yml index 370c3e8be040..e6bed9e19e89 100644 --- a/.github/workflows/build-spconv.yml +++ b/.github/workflows/build-spconv.yml @@ -61,7 +61,7 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: 'CUMM_CUDA_VERSION= SPCONV_DISABLE_JIT=1 PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/' + cibw-environment-linux: "CUMM_CUDA_VERSION= SPCONV_DISABLE_JIT=1" # Real riscv64 CI (run 44202562155, job 134460257373): all 4 legs built, repaired # and installed fine, then died at this step with ModuleNotFoundError on # spconv.core_cc.cumm.conv. Confirmed against upstream's own setup.py (cloned diff --git a/.github/workflows/build-spglib.yml b/.github/workflows/build-spglib.yml index 8869af477c13..5f4799eeaf34 100644 --- a/.github/workflows/build-spglib.yml +++ b/.github/workflows/build-spglib.yml @@ -60,7 +60,6 @@ jobs: checkout-fetch-depth: 0 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # numpy has no riscv64 wheel on public PyPI; pull it from our registry instead. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-environment: PIP_ONLY_BINARY=numpy timeout-minutes: 90 diff --git a/.github/workflows/build-spiceypy.yml b/.github/workflows/build-spiceypy.yml index a1f4f97efe06..0668dc651fae 100644 --- a/.github/workflows/build-spiceypy.yml +++ b/.github/workflows/build-spiceypy.yml @@ -51,59 +51,64 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build spiceypy ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "spiceypy" + version: "${{ matrix.version }}" + repository: "AndrewAnnex/SpiceyPy" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + pre-build: |- + export MIRROR_BASE=https://raw.githubusercontent.com/AndrewAnnex/cspice-release-mirror/refs/heads/main/artifacts + export CSPICE_ARCHIVE=N67_lin_x64_cspice.tar.gz + set -euo pipefail + curl -fsSL "${MIRROR_BASE}/${CSPICE_ARCHIVE}" -o "${CSPICE_ARCHIVE}" + curl -fsSL "${MIRROR_BASE}/${CSPICE_ARCHIVE}.sha256" -o "${CSPICE_ARCHIVE}.sha256" + expected="$(tr -d '[:space:]' < "${CSPICE_ARCHIVE}.sha256")" + actual="$(sha256sum "${CSPICE_ARCHIVE}" | awk '{print $1}')" + test "$expected" = "$actual" + mkdir -p cspice-src-cache + tar xzf "${CSPICE_ARCHIVE}" -C cspice-src-cache + test -d cspice-src-cache/cspice/src/cspice + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-extras: "uv" + cibw-environment-linux: "CSPICE_SRC=/project/cspice-src-cache/cspice SPICEYPY_CSPICE_PREFIX=/project/cspice-prefix CMAKE_BUILD_PARALLEL_LEVEL=\"$(nproc)\"" + # dependency-groups=dev also pulls in black/twine/build/scikit-build-core, + # packaging/lint tools the test command never calls; black has no riscv64 + # wheel for cp310/cp311 on PyPI or our registry and would otherwise have to + # mypyc-compile from source on every job. + cibw-test-groups: '' + cibw-test-requires: "numpy>=1.23.5 pandas>=2.2.2 pytest>=7.0.0 pytest-benchmark coverage>=7.0.0" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SPICEYPY_VERSION: ${{ matrix.version }} - steps: - - name: Checkout SpiceyPy v${{ env.SPICEYPY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: AndrewAnnex/SpiceyPy - ref: v${{ env.SPICEYPY_VERSION }} - persist-credentials: false - - # Upstream's own CI provisions CSPICE the same way for its Linux wheels - # (aarch64 included): the C source is architecture-independent, so the - # x86_64 mirror archive is reused here too. The mirror exists because - # NAIF's own server has had TLS/reliability issues in upstream's CI. - - name: Provision CSPICE source from mirror - run: | - set -euo pipefail - curl -fsSL "${MIRROR_BASE}/${CSPICE_ARCHIVE}" -o "${CSPICE_ARCHIVE}" - curl -fsSL "${MIRROR_BASE}/${CSPICE_ARCHIVE}.sha256" -o "${CSPICE_ARCHIVE}.sha256" - expected="$(tr -d '[:space:]' < "${CSPICE_ARCHIVE}.sha256")" - actual="$(sha256sum "${CSPICE_ARCHIVE}" | awk '{print $1}')" - test "$expected" = "$actual" - mkdir -p cspice-src-cache - tar xzf "${CSPICE_ARCHIVE}" -C cspice-src-cache - test -d cspice-src-cache/cspice/src/cspice - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - extras: "uv" - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_LINUX: >- - CSPICE_SRC=/project/cspice-src-cache/cspice - SPICEYPY_CSPICE_PREFIX=/project/cspice-prefix - CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # dependency-groups=dev also pulls in black/twine/build/scikit-build-core, - # packaging/lint tools the test command never calls; black has no riscv64 - # wheel for cp310/cp311 on PyPI or our registry and would otherwise have to - # mypyc-compile from source on every job. - CIBW_TEST_GROUPS: "" - CIBW_TEST_REQUIRES: "numpy>=1.23.5 pandas>=2.2.2 pytest>=7.0.0 pytest-benchmark coverage>=7.0.0" + name: spiceypy-${{ env.SPICEYPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extension and CSPICE run: | @@ -116,15 +121,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: spiceypy-${{ env.SPICEYPY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish spiceypy ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-spookyhash.yml b/.github/workflows/build-spookyhash.yml index adeea22e08ea..9d435496ecfb 100644 --- a/.github/workflows/build-spookyhash.yml +++ b/.github/workflows/build-spookyhash.yml @@ -63,7 +63,7 @@ jobs: cibw-test-sources: tests # gotcha 97: hypothesis went Rust-abi3 upstream; riscv64 cp314t needs our registry's build, # and PIP_ONLY_BINARY keeps pip from preferring a newer PyPI sdist (gotcha 30). - cibw-test-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=hypothesis + cibw-test-environment: "PIP_ONLY_BINARY=hypothesis" cibw-test-command: >- python -c "import _spookyhash; assert _spookyhash.__file__.endswith('.so'), _spookyhash.__file__" && pytest {project} diff --git a/.github/workflows/build-squirrel-lang-sq305.yml b/.github/workflows/build-squirrel-lang-sq305.yml index a2e48d0906d1..0ff27c1485d1 100644 --- a/.github/workflows/build-squirrel-lang-sq305.yml +++ b/.github/workflows/build-squirrel-lang-sq305.yml @@ -49,35 +49,39 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build squirrel-lang-sq305 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "squirrel-lang-sq305" + version: "${{ matrix.version }}" + repository: "shabbywu/squirrel-py" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "true" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "SQUIRREL_PY_VARIANT=sq305 SQUIRREL_PY_PACKAGE_NAME=squirrel-lang-sq305" + cibw-before-build: "cp libs/SQUIRREL305/COPYRIGHT {project}/LICENSE.squirrel-core.txt" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: SQUIRREL_LANG_SQ305_VERSION: ${{ matrix.version }} - steps: - - name: Checkout squirrel-py v${{ env.SQUIRREL_LANG_SQ305_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: shabbywu/squirrel-py - ref: v${{ env.SQUIRREL_LANG_SQ305_VERSION }} - submodules: true - persist-credentials: false - - # The project builds the sq32 and sq305 variants of the same tree from these - # two env vars (setup.py); pypi.riseproject.dev only tracks the sq305 one. - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: SQUIRREL_PY_VARIANT=sq305 SQUIRREL_PY_PACKAGE_NAME=squirrel-lang-sq305 - CIBW_BEFORE_BUILD: cp libs/SQUIRREL305/COPYRIGHT {project}/LICENSE.squirrel-core.txt + name: squirrel-lang-sq305-${{ env.SQUIRREL_LANG_SQ305_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the bundled licences made it into the wheel run: | @@ -91,15 +95,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: squirrel-lang-sq305-${{ env.SQUIRREL_LANG_SQ305_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish squirrel-lang-sq305 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-srsly.yml b/.github/workflows/build-srsly.yml index b193b9f39d33..7304f8648c2c 100644 --- a/.github/workflows/build-srsly.yml +++ b/.github/workflows/build-srsly.yml @@ -52,60 +52,64 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build srsly ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - SRSLY_VERSION: ${{ matrix.version }} - - steps: - # Releases are tagged release-v*; the plain v* tag is only created afterwards. - - name: Checkout srsly ${{ env.SRSLY_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: explosion/srsly - ref: release-v${{ env.SRSLY_VERSION }} - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "srsly" + version: "${{ matrix.version }}" + repository: "explosion/srsly" + ref: "release-v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + git apply python-wheels/patches/srsly/${{ matrix.version }}/00*.patch - # The wheel ships the vendored ruamel.yaml but not its licence. - - name: Patch srsly source - run: | - git apply python-wheels/patches/srsly/${{ env.SRSLY_VERSION }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # The extensions do not declare free-threading support, so importing them under + # cp314t re-enables the GIL with a RuntimeWarning that -Werror turns fatal; + # asking for the GIL up front is the same outcome without the warning. Ignored + # on the GIL builds. + cibw-test-environment: "PYTHON_GIL=1" + # The suite ships in the wheel, so upstream runs it with --pyargs. From + # requirements.txt, psutil is only used by the skipped cloudpickle tests and + # nothing left has a pytest-timeout marker. + cibw-test-requires: "pytest>=4.6.5 mock>=2.0.0,<3.0.0 numpy>=1.15.0" + # srsly/tests/cloudpickle was left behind by the cloudpickle 3.1.2 bump in the + # release commit and no longer imports (srsly.cloudpickle.compat and + # cloudpickle.cell_set are both gone); it fails the same way on every + # architecture. The licence check guards the patch above. + cibw-test-command: "python -c \"import importlib.metadata as m; f = sorted(p.name for p in m.files('srsly') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'LICENSE.ruamel_yaml'], f\" && python -m pytest --pyargs srsly -Werror --ignore=\"$(python -c 'import srsly, os; print(os.path.join(os.path.dirname(srsly.__file__), \"tests\", \"cloudpickle\"))')\"" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + SRSLY_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # The extensions do not declare free-threading support, so importing them under - # cp314t re-enables the GIL with a RuntimeWarning that -Werror turns fatal; - # asking for the GIL up front is the same outcome without the warning. Ignored - # on the GIL builds. - CIBW_TEST_ENVIRONMENT: PYTHON_GIL=1 - # The suite ships in the wheel, so upstream runs it with --pyargs. From - # requirements.txt, psutil is only used by the skipped cloudpickle tests and - # nothing left has a pytest-timeout marker. - CIBW_TEST_REQUIRES: pytest>=4.6.5 mock>=2.0.0,<3.0.0 numpy>=1.15.0 - # srsly/tests/cloudpickle was left behind by the cloudpickle 3.1.2 bump in the - # release commit and no longer imports (srsly.cloudpickle.compat and - # cloudpickle.cell_set are both gone); it fails the same way on every - # architecture. The licence check guards the patch above. - CIBW_TEST_COMMAND: >- - python -c "import importlib.metadata as m; f = sorted(p.name for p in m.files('srsly') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'LICENSE.ruamel_yaml'], f" && - python -m pytest --pyargs srsly -Werror - --ignore="$(python -c 'import srsly, os; print(os.path.join(os.path.dirname(srsly.__file__), "tests", "cloudpickle"))')" + name: srsly-${{ env.SRSLY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension modules made it into the wheel run: | @@ -120,15 +124,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: srsly-${{ env.SRSLY_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish srsly ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ssh-python.yml b/.github/workflows/build-ssh-python.yml index d35541d75ea1..457988dc266e 100644 --- a/.github/workflows/build-ssh-python.yml +++ b/.github/workflows/build-ssh-python.yml @@ -49,108 +49,113 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build ssh-python ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ssh-python" + version: "${{ matrix.version }}" + repository: "ParallelSSH/ssh-python" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of libssh (built from the + # vendored libssh/ tree) and of every shared library auditwheel vendors + # out of the build image alongside it (OpenSSL and the krb5 GSSAPI stack). + # setuptools' default LICEN[CS]E* glob copies them into the wheel. + set -euo pipefail + + project="${1:?usage: collect-licenses.sh }" + + cp "$project/libssh/COPYING" "$project/LICENSE.libssh" + cp "$project/libssh/BSD" "$project/LICENSE.libssh.BSD" + + mapfile -t libs < <( + for root in /usr/lib64/libgssapi_krb5.so /usr/lib64/libcrypto.so; do + ldd "$root" | tr ' ' '\n' | grep '^/' + readlink -f "$root" + done | sort -u + ) + + # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' + ) + + for pkg in "${pkgs[@]}"; do + rpm -q --qf '%{NAME}: %{LICENSE}\n' "$pkg" + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi + + if [ -z "${files[0]:-}" ]; then + dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi + + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done + + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Replaces upstream's custom image, which builds OpenSSL 3.4.0 and krb5 + # 1.21.3 from source (gotcha 46) and preinstalls libssh (SYSTEM_LIBSSH=1): + # Rocky 10's own openssl-devel/krb5-devel are current, and setup.py's + # default embedded build compiles the same vendored libssh/ tree with the + # same WITH_GSSAPI=ON cmake flags. + cibw-before-all-linux: "dnf -y install openssl-devel krb5-devel zlib-devel && bash {project}/collect-licenses.sh {project}" + cibw-test-requires: "pytest pytest-rerunfailures" + # tests/ is a package whose sibling ssh/ source dir would shadow the + # installed wheel (gotcha 25); setup.cfg carries upstream's pytest addopts. + cibw-test-sources: "tests setup.cfg" + cibw-test-command: "python -c 'from ssh.session import Session; Session()' && python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SSH_PYTHON_VERSION: ${{ matrix.version }} - steps: - - name: Checkout ssh-python ${{ env.SSH_PYTHON_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: ParallelSSH/ssh-python - ref: ${{ env.SSH_PYTHON_VERSION }} - persist-credentials: false - - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of libssh (built from the - # vendored libssh/ tree) and of every shared library auditwheel vendors - # out of the build image alongside it (OpenSSL and the krb5 GSSAPI stack). - # setuptools' default LICEN[CS]E* glob copies them into the wheel. - set -euo pipefail - - project="${1:?usage: collect-licenses.sh }" - - cp "$project/libssh/COPYING" "$project/LICENSE.libssh" - cp "$project/libssh/BSD" "$project/LICENSE.libssh.BSD" - - mapfile -t libs < <( - for root in /usr/lib64/libgssapi_krb5.so /usr/lib64/libcrypto.so; do - ldd "$root" | tr ' ' '\n' | grep '^/' - readlink -f "$root" - done | sort -u - ) - - # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' - ) - - for pkg in "${pkgs[@]}"; do - rpm -q --qf '%{NAME}: %{LICENSE}\n' "$pkg" - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi - - if [ -z "${files[0]:-}" ]; then - dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi - - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done - - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Replaces upstream's custom image, which builds OpenSSL 3.4.0 and krb5 - # 1.21.3 from source (gotcha 46) and preinstalls libssh (SYSTEM_LIBSSH=1): - # Rocky 10's own openssl-devel/krb5-devel are current, and setup.py's - # default embedded build compiles the same vendored libssh/ tree with the - # same WITH_GSSAPI=ON cmake flags. - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install openssl-devel krb5-devel zlib-devel && - bash {project}/collect-licenses.sh {project} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest pytest-rerunfailures - # tests/ is a package whose sibling ssh/ source dir would shadow the - # installed wheel (gotcha 25); setup.cfg carries upstream's pytest addopts. - CIBW_TEST_SOURCES: tests setup.cfg - CIBW_TEST_COMMAND: >- - python -c 'from ssh.session import Session; Session()' && - python -m pytest tests + name: ssh-python-${{ env.SSH_PYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extensions, libssh and the licences run: | @@ -167,12 +172,6 @@ jobs: assert {"openssl-libs", "krb5-libs", "libcom_err", "keyutils-libs"} <= pkgs, pkgs EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ssh-python-${{ env.SSH_PYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -206,7 +205,7 @@ jobs: publish: name: Publish ssh-python ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ssh2-python.yml b/.github/workflows/build-ssh2-python.yml index 95aeac1379b2..8d2dadd8598c 100644 --- a/.github/workflows/build-ssh2-python.yml +++ b/.github/workflows/build-ssh2-python.yml @@ -51,64 +51,70 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build ssh2-python ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ssh2-python" + version: "${{ matrix.version }}" + repository: "ParallelSSH/ssh2-python" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/ssh2-python/${{ matrix.version }}/*.patch + # versioneer's `git describe --tags --dirty` has no pretend-version escape + # hatch the way setuptools_scm does (gotcha 315); hide just the patched + # file from dirty-detection instead of poisoning the wheel version. + git update-index --skip-worktree setup.py + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py's build_ssh2() always cmake-builds the libssh2 tree checked + # into libssh2/ against CRYPTO_BACKEND=OpenSSL (the SYSTEM_LIBSSH2 escape + # is unused here); upstream's own manylinux image builds OpenSSL 3.4.0 + # from source first, which fails on riscv64 (no FindBin.pm, gotcha 46). + # Rocky 10's own openssl-devel is already current, so use that instead + # (mirrors build-uamqp.yml/build-pylibsrtp.yml). + cibw-before-all-linux: "dnf -y install openssl-devel zlib-devel && cp libssh2/COPYING {project}/LICENSE.libssh2 && cp /usr/share/licenses/openssl-libs/LICENSE.txt {project}/LICENSE.openssl" + cibw-test-requires: "pytest pytest-rerunfailures" + # tests/ is a package (has __init__.py); {project}/tests would run pytest + # against the checkout, whose sibling ssh2/ source dir (no .so files, only + # .py/.pxd) shadows the installed wheel (gotcha 25). test-sources copies + # just tests/ into an otherwise-empty cwd, so a path relative to it imports + # the wheel instead. + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SSH2_PYTHON_VERSION: ${{ matrix.version }} - steps: - - name: Checkout ssh2-python ${{ env.SSH2_PYTHON_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ParallelSSH/ssh2-python - ref: ${{ env.SSH2_PYTHON_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch ssh2-python source - run: | - git apply python-wheels/patches/ssh2-python/${{ env.SSH2_PYTHON_VERSION }}/*.patch - # versioneer's `git describe --tags --dirty` has no pretend-version escape - # hatch the way setuptools_scm does (gotcha 315); hide just the patched - # file from dirty-detection instead of poisoning the wheel version. - git update-index --skip-worktree setup.py - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py's build_ssh2() always cmake-builds the libssh2 tree checked - # into libssh2/ against CRYPTO_BACKEND=OpenSSL (the SYSTEM_LIBSSH2 escape - # is unused here); upstream's own manylinux image builds OpenSSL 3.4.0 - # from source first, which fails on riscv64 (no FindBin.pm, gotcha 46). - # Rocky 10's own openssl-devel is already current, so use that instead - # (mirrors build-uamqp.yml/build-pylibsrtp.yml). - CIBW_BEFORE_ALL_LINUX: >- - dnf -y install openssl-devel zlib-devel && - cp libssh2/COPYING {project}/LICENSE.libssh2 && - cp /usr/share/licenses/openssl-libs/LICENSE.txt {project}/LICENSE.openssl - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest pytest-rerunfailures - # tests/ is a package (has __init__.py); {project}/tests would run pytest - # against the checkout, whose sibling ssh2/ source dir (no .so files, only - # .py/.pxd) shadows the installed wheel (gotcha 25). test-sources copies - # just tests/ into an otherwise-empty cwd, so a path relative to it imports - # the wheel instead. - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest tests + name: ssh2-python-${{ env.SSH2_PYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extensions, libssh2 and both licences run: | @@ -124,15 +130,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ssh2-python-${{ env.SSH2_PYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish ssh2-python ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-sslpsk-pmd3.yml b/.github/workflows/build-sslpsk-pmd3.yml index bccc81092b9b..5fff2f327066 100644 --- a/.github/workflows/build-sslpsk-pmd3.yml +++ b/.github/workflows/build-sslpsk-pmd3.yml @@ -50,16 +50,101 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build sslpsk-pmd3 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "sslpsk-pmd3" + version: "${{ matrix.version }}" + repository: "doronz88/sslpsk-pmd3" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + mkdir -p tests + cat > tests/test_psk.py <<'EOF' + import socket + import ssl + import threading + + import sslpsk_pmd3 + + PSK = bytes.fromhex('c033f52671c61c8128f7f8a40be88038bcf2b07a6eb3095c36e3759f0cf40837') + IDENTITY = b'client1' + HINT = b'server-hint' + + + def context(protocol): + ctx = sslpsk_pmd3.SSLPSKContext(protocol) + ctx.maximum_version = ssl.TLSVersion.TLSv1_2 + ctx.set_ciphers('PSK') + return ctx + + + server_ctx = context(ssl.PROTOCOL_TLS_SERVER) + server_ctx.hint = HINT + server_ctx.psk = lambda identity: PSK if identity == IDENTITY else b'' + + seen_hints = [] + client_ctx = context(ssl.PROTOCOL_TLS_CLIENT) + client_ctx.check_hostname = False + client_ctx.verify_mode = ssl.CERT_NONE + client_ctx.psk = lambda hint: seen_hints.append(hint) or (PSK, IDENTITY) + + server_raw, client_raw = socket.socketpair() + server_errors = [] + + + def serve(): + try: + with server_ctx.wrap_socket(server_raw, server_side=True) as conn: + conn.sendall(conn.recv(64).upper()) + except Exception as exc: + server_errors.append(exc) + + + thread = threading.Thread(target=serve) + thread.start() + with client_ctx.wrap_socket(client_raw) as conn: + cipher, version, _ = conn.cipher() + conn.sendall(b'abcdefghi') + reply = conn.recv(64) + thread.join() + + assert not server_errors, server_errors + assert reply == b'ABCDEFGHI', reply + assert version == 'TLSv1.2' and 'PSK' in cipher, (cipher, version) + assert seen_hints == [HINT], seen_hints + print(ssl.OPENSSL_VERSION, sslpsk_pmd3.sslpsk._sslpsk.__name__, cipher, version, 'ok') + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # openssl-dev, not upstream's libressl-dev: the extension must link the OpenSSL that Python's _ssl uses. + cibw-before-all-linux: "yum install -y openssl-devel || apk add --upgrade openssl-dev" + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_SSLPSK_PMD3=${{ matrix.version }}" + # The extension sets callbacks on the SSL* owned by Python's _ssl, so a private libssl copy of another version silently breaks PSK. + cibw-repair-wheel-command-linux: "auditwheel repair --exclude libssl.so.3 --exclude libcrypto.so.3 -w {dest_dir} {wheel}" + cibw-test-command: "python {project}/tests/test_psk.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: SSLPSK_PMD3_VERSION: ${{ matrix.version }} - steps: - name: Checkout sslpsk-pmd3 v${{ env.SSLPSK_PMD3_VERSION }} uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -128,18 +213,11 @@ jobs: print(ssl.OPENSSL_VERSION, sslpsk_pmd3.sslpsk._sslpsk.__name__, cipher, version, 'ok') EOF - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # openssl-dev, not upstream's libressl-dev: the extension must link the OpenSSL that Python's _ssl uses. - CIBW_BEFORE_ALL_LINUX: yum install -y openssl-devel || apk add --upgrade openssl-dev - CIBW_ENVIRONMENT: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_SSLPSK_PMD3=${{ env.SSLPSK_PMD3_VERSION }} - # The extension sets callbacks on the SSL* owned by Python's _ssl, so a private libssl copy of another version silently breaks PSK. - CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair --exclude libssl.so.3 --exclude libcrypto.so.3 -w {dest_dir} {wheel} - CIBW_TEST_COMMAND: python {project}/tests/test_psk.py + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: sslpsk-pmd3-${{ env.SSLPSK_PMD3_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Test against the runner's own Python and OpenSSL if: matrix.python == 'cp312' && matrix.platform == 'manylinux' @@ -147,15 +225,9 @@ jobs: python3 -m zipfile -e wheelhouse/*.whl "$RUNNER_TEMP/site" PYTHONPATH="$RUNNER_TEMP/site" python3 tests/test_psk.py - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: sslpsk-pmd3-${{ env.SSLPSK_PMD3_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish sslpsk-pmd3 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-statsforecast.yml b/.github/workflows/build-statsforecast.yml index b2054f3f332f..ae0de069bb25 100644 --- a/.github/workflows/build-statsforecast.yml +++ b/.github/workflows/build-statsforecast.yml @@ -48,6 +48,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build statsforecast ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + # statsmodels (a hard, unguarded runtime dep) has no riscv64 wheel + # for cp314 or cp314t on pypi.riseproject.dev yet + # (build-statsmodels.yml's own matrix is cp312/cp313 only); pandas + # is also missing for cp314t. Build still runs for both. + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "statsforecast" + version: "${{ matrix.version }}" + repository: "Nixtla/statsforecast" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "recursive" + pre-build: |- + cp external_libs/eigen/COPYING.MPL2 COPYING.eigen + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # coreforecast (a hard runtime dep) has no riscv64 wheel published + # yet, so it is deliberately left off PIP_ONLY_BINARY: pip falls + # back to building its sdist, which bundles its own vendored deps. + # polars is pinned to the newest version pypi.riseproject.dev has + # built for riscv64 (the "polars" package on PyPI is a thin + # py3-none-any shim requiring polars-runtime-32==). + cibw-test-environment: "PIP_ONLY_BINARY=numpy,pandas,statsmodels,matplotlib,scikit-learn MPLBACKEND=Agg" + cibw-test-skip: "${{ case(matrix.python == 'cp314', '*', endsWith(matrix.python, 't'), '*', '') }}" + # scikit-learn is an unguarded import inside MFLES's optimizer path + # (statsforecast/mfles.py), not just SklearnModel's own tests. + cibw-test-requires: "pytest matplotlib scikit-learn polars==1.44.1" + cibw-test-sources: "tests" + # test_tbats_selection_and_forecast asserts fitted values against an + # x86_64-computed golden array at rtol=1e-6; riscv64's BLAS/LAPACK + # kernels converge the BATS optimizer to a different (max 3.7% + # relative difference) but still-valid fit -- a cross-platform + # optimizer-convergence divergence, not a code defect (same root + # cause class as gotcha 170's BLAS-divergence case, different + # mechanism: convergence point vs. dtype). + cibw-test-command: "python -m pytest tests --ignore=tests/test_adapters_prophet.py --ignore=tests/test_distributed_fugue.py --deselect \"tests/test_tbats.py::test_tbats_selection_and_forecast\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: @@ -58,59 +108,14 @@ jobs: # (build-statsmodels.yml's own matrix is cp312/cp313 only); pandas # is also missing for cp314t. Build still runs for both. include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: STATSFORECAST_VERSION: ${{ matrix.version }} - steps: - - name: Checkout statsforecast v${{ env.STATSFORECAST_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Nixtla/statsforecast - ref: v${{ env.STATSFORECAST_VERSION }} - submodules: recursive - persist-credentials: false - - # external_libs/eigen is a header-only submodule compiled into the - # wheel, but upstream's own wheel ships only its own LICENSE. Stage - # eigen's at the root for setuptools' default license-files glob - # (COPYING*) to pick up. - - name: Stage the vendored dependency's licence - run: cp external_libs/eigen/COPYING.MPL2 COPYING.eigen - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # coreforecast (a hard runtime dep) has no riscv64 wheel published - # yet, so it is deliberately left off PIP_ONLY_BINARY: pip falls - # back to building its sdist, which bundles its own vendored deps. - # polars is pinned to the newest version pypi.riseproject.dev has - # built for riscv64 (the "polars" package on PyPI is a thin - # py3-none-any shim requiring polars-runtime-32==). - CIBW_TEST_ENVIRONMENT: >- - PIP_ONLY_BINARY=numpy,pandas,statsmodels,matplotlib,scikit-learn - MPLBACKEND=Agg - CIBW_TEST_SKIP: ${{ case(matrix.python == 'cp314', '*', endsWith(matrix.python, 't'), '*', '') }} - # scikit-learn is an unguarded import inside MFLES's optimizer path - # (statsforecast/mfles.py), not just SklearnModel's own tests. - CIBW_TEST_REQUIRES: pytest matplotlib scikit-learn polars==1.44.1 - CIBW_TEST_SOURCES: tests - # test_tbats_selection_and_forecast asserts fitted values against an - # x86_64-computed golden array at rtol=1e-6; riscv64's BLAS/LAPACK - # kernels converge the BATS optimizer to a different (max 3.7% - # relative difference) but still-valid fit -- a cross-platform - # optimizer-convergence divergence, not a code defect (same root - # cause class as gotcha 170's BLAS-divergence case, different - # mechanism: convergence point vs. dtype). - CIBW_TEST_COMMAND: >- - python -m pytest tests - --ignore=tests/test_adapters_prophet.py - --ignore=tests/test_distributed_fugue.py - --deselect "tests/test_tbats.py::test_tbats_selection_and_forecast" + name: statsforecast-${{ env.STATSFORECAST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -125,15 +130,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: statsforecast-${{ env.STATSFORECAST_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish statsforecast ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-statsmodels.yml b/.github/workflows/build-statsmodels.yml index 0768d040e58a..66b6abdc7157 100644 --- a/.github/workflows/build-statsmodels.yml +++ b/.github/workflows/build-statsmodels.yml @@ -48,64 +48,65 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build statsmodels ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "statsmodels" + version: "${{ matrix.version }}" + repository: "statsmodels/statsmodels" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 720 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/statsmodels/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # PIP_ONLY_BINARY keeps numpy/scipy/pandas on our registry's riscv64 wheels + # instead of source-building the newer releases PyPI offers; setuptools_scm + # is pinned because the patched tree is dirty at the tag. statsmodels' + # meson.build calls setuptools_scm.get_version() directly with no dist_name, + # so only the unscoped var (not _FOR_STATSMODELS) is honored. + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION=${{ matrix.version }} PIP_ONLY_BINARY=numpy,scipy,pandas MKL_NUM_THREADS=1 OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1" + cibw-repair-wheel-command-linux: "auditwheel repair --strip -w {dest_dir} {wheel}" + # pytest 9.1 made strict_parametrization_ids the default, which rejects the + # duplicate parametrize ids in statsmodels' test_moment_helpers at collection. + cibw-test-requires: "pytest<9.1 pytest-xdist pytest-randomly threadpoolctl pytest-run-parallel" + # test_seasonal_order[estimated] asserts a maximum-likelihood fit that + # upstream itself logs as non-convergent lands within 1e-4 of the truth; + # riscv64's BLAS stops it at 1.9e-3 where aarch64 reaches 2.4e-8. + cibw-test-command: "python -c \"import numpy; numpy.show_runtime(); import statsmodels; statsmodels.test(['-m', '(not slow and not example)', '-n', '2', '-k', 'not (test_seasonal_order and estimated)', '--randomly-dont-reset-seed'], exit=True)\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 720 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: STATSMODELS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout statsmodels v${{ env.STATSMODELS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: statsmodels/statsmodels - ref: v${{ env.STATSMODELS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch statsmodels source - run: git apply python-wheels/patches/statsmodels/${{ env.STATSMODELS_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # PIP_ONLY_BINARY keeps numpy/scipy/pandas on our registry's riscv64 wheels - # instead of source-building the newer releases PyPI offers; setuptools_scm - # is pinned because the patched tree is dirty at the tag. statsmodels' - # meson.build calls setuptools_scm.get_version() directly with no dist_name, - # so only the unscoped var (not _FOR_STATSMODELS) is honored. - CIBW_ENVIRONMENT: >- - SETUPTOOLS_SCM_PRETEND_VERSION=${{ env.STATSMODELS_VERSION }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas - MKL_NUM_THREADS=1 - OMP_NUM_THREADS=1 - OPENBLAS_NUM_THREADS=1 - CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair --strip -w {dest_dir} {wheel} - # pytest 9.1 made strict_parametrization_ids the default, which rejects the - # duplicate parametrize ids in statsmodels' test_moment_helpers at collection. - CIBW_TEST_REQUIRES: 'pytest<9.1 pytest-xdist pytest-randomly threadpoolctl pytest-run-parallel' - # test_seasonal_order[estimated] asserts a maximum-likelihood fit that - # upstream itself logs as non-convergent lands within 1e-4 of the truth; - # riscv64's BLAS stops it at 1.9e-3 where aarch64 reaches 2.4e-8. - CIBW_TEST_COMMAND: >- - python -c "import numpy; numpy.show_runtime(); import statsmodels; - statsmodels.test(['-m', '(not slow and not example)', '-n', '2', - '-k', 'not (test_seasonal_order and estimated)', - '--randomly-dont-reset-seed'], exit=True)" + name: statsmodels-${{ env.STATSMODELS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the compiled extensions run: | @@ -117,15 +118,9 @@ jobs: assert any(n.endswith("LICENSE.txt") for n in names), names EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: statsmodels-${{ env.STATSMODELS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish statsmodels ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-streaming-form-data.yml b/.github/workflows/build-streaming-form-data.yml index 6874a7b3315f..9a9e48142a28 100644 --- a/.github/workflows/build-streaming-form-data.yml +++ b/.github/workflows/build-streaming-form-data.yml @@ -60,7 +60,7 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # Only manylinux: moto pulls in cryptography, which has no musllinux # riscv64 wheel, so a musllinux wheel could be neither installed nor tested. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=cryptography + cibw-environment-linux: "PIP_ONLY_BINARY=cryptography" cibw-test-sources: tests cibw-test-requires: pytest>=8.3.4 pytest-asyncio>=0.23.0 requests-toolbelt>=1.0.0 moto>=5.0.22 cibw-test-command: python -m pytest tests diff --git a/.github/workflows/build-symusic.yml b/.github/workflows/build-symusic.yml index d9ed9324b651..392ba17ec690 100644 --- a/.github/workflows/build-symusic.yml +++ b/.github/workflows/build-symusic.yml @@ -51,68 +51,79 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build symusic ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - SYMUSIC_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout symusic v${{ env.SYMUSIC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Yikai-Liao/symusic - ref: v${{ env.SYMUSIC_VERSION }} - submodules: recursive - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "symusic" + version: "${{ matrix.version }}" + repository: "Yikai-Liao/symusic" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + git apply python-wheels/patches/symusic/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Apply patches - run: git apply python-wheels/patches/symusic/${{ env.SYMUSIC_VERSION }}/*.patch + cp 3rdparty/fmt/LICENSE LICENSE.fmt + cp 3rdparty/minimidi/LICENSE LICENSE.minimidi + cp 3rdparty/pdqsort/license.txt LICENSE.pdqsort + cp 3rdparty/zpp_bits/LICENSE LICENSE.zpp_bits + cp 3rdparty/nanobind/LICENSE LICENSE.nanobind + cp 3rdparty/prestosynth/3rdparty/mio/LICENSE LICENSE.mio + cp 3rdparty/prestosynth/3rdparty/libsamplerate/COPYING LICENSE.libsamplerate + cp 3rdparty/prestosynth/3rdparty/eigen/COPYING.MPL2 LICENSE.eigen + cp 3rdparty/prestosynth/3rdparty/gcem/LICENSE LICENSE.gcem + cp 3rdparty/prestosynth/3rdparty/gcem/NOTICE.txt NOTICE.gcem - # 3rdparty/{fmt,minimidi,pdqsort,zpp_bits,nanobind} and prestosynth's own - # 3rdparty/{mio,libsamplerate,eigen,gcem} are compiled into - # symusic/core*.so; the wheel otherwise carries only symusic's own - # LICENSE. scikit-build-core's default license-files glob only looks at - # the project root, so stage each one under a matching name. - - name: Stage the vendored dependencies' licences - run: | - cp 3rdparty/fmt/LICENSE LICENSE.fmt - cp 3rdparty/minimidi/LICENSE LICENSE.minimidi - cp 3rdparty/pdqsort/license.txt LICENSE.pdqsort - cp 3rdparty/zpp_bits/LICENSE LICENSE.zpp_bits - cp 3rdparty/nanobind/LICENSE LICENSE.nanobind - cp 3rdparty/prestosynth/3rdparty/mio/LICENSE LICENSE.mio - cp 3rdparty/prestosynth/3rdparty/libsamplerate/COPYING LICENSE.libsamplerate - cp 3rdparty/prestosynth/3rdparty/eigen/COPYING.MPL2 LICENSE.eigen - cp 3rdparty/prestosynth/3rdparty/gcem/LICENSE LICENSE.gcem - cp 3rdparty/prestosynth/3rdparty/gcem/NOTICE.txt NOTICE.gcem + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # cmake ships in the image but ninja does not, so scikit-build-core + # pulls ninja from pip; our registry lags PyPI's latest for both, so + # pin pip to our riscv64 wheels rather than PyPI's newest sdist-only + # versions (gotcha 84). + cibw-environment-linux: "PIP_ONLY_BINARY=cmake,ninja" + cibw-test-requires: "pytest mypy pretty_midi" + cibw-test-sources: "tests" + cibw-test-command: "cd {project} && python -m pytest -v tests" + # numpy has no riscv64 wheel on public PyPI; keep pip on our registry's copy. + cibw-test-environment: "PIP_ONLY_BINARY=numpy" - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + SYMUSIC_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # cmake ships in the image but ninja does not, so scikit-build-core - # pulls ninja from pip; our registry lags PyPI's latest for both, so - # pin pip to our riscv64 wheels rather than PyPI's newest sdist-only - # versions (gotcha 84). - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=cmake,ninja - CIBW_TEST_REQUIRES: pytest mypy pretty_midi - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: cd {project} && python -m pytest -v tests - # numpy has no riscv64 wheel on public PyPI; keep pip on our registry's copy. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy + name: symusic-${{ env.SYMUSIC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -136,15 +147,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: symusic-${{ env.SYMUSIC_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish symusic ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-systemrdl-compiler.yml b/.github/workflows/build-systemrdl-compiler.yml index 82f40d990148..29949a91f1b8 100644 --- a/.github/workflows/build-systemrdl-compiler.yml +++ b/.github/workflows/build-systemrdl-compiler.yml @@ -59,7 +59,7 @@ jobs: artifact-tag: cp37-abi3-manylinux_riscv64 cibw-build: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 # Upstream passes this as a step env, which never reaches a Linux build container. - cibw-environment: SYSTEMRDL_REQUIRE_BINARY_BUILD=1 + cibw-environment-linux: SYSTEMRDL_REQUIRE_BINARY_BUILD=1 # The RDL Perl preprocessor needs Safe.pm, absent from the image's minimal perl. cibw-before-test: dnf -y install perl-Safe cibw-test-requires: pytest parameterized diff --git a/.github/workflows/build-ta-lib.yml b/.github/workflows/build-ta-lib.yml index d8c2736927d5..525679d1ecd4 100644 --- a/.github/workflows/build-ta-lib.yml +++ b/.github/workflows/build-ta-lib.yml @@ -50,83 +50,84 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build ta-lib ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: - TA_LIB_VERSION: ${{ matrix.version }} - - steps: - - name: Checkout ta-lib-python v${{ env.TA_LIB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ta-lib/ta-lib-python - ref: v${{ env.TA_LIB_VERSION }} - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "ta-lib" + version: "${{ matrix.version }}" + repository: "ta-lib/ta-lib-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + git apply python-wheels/patches/ta-lib/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" - - name: Patch ta-lib-python source - run: git apply python-wheels/patches/ta-lib/${{ env.TA_LIB_VERSION }}/*.patch + talib_c_ver="$(sed -n 's/^ TALIB_C_VER: *//p' .github/workflows/wheels.yml)" + test -n "$talib_c_ver" + echo "TALIB_C_VER=${talib_c_ver}" >> "$GITHUB_ENV" - # The TA-Lib C library version tracked by each ta-lib-python release - # changes independently of TA_LIB_VERSION (0.8.0 needs C 0.8.1, not - # 0.7.1); read it straight from upstream's own workflow at this tag. - - name: Determine the TA-Lib C library version this release needs - run: | - talib_c_ver="$(sed -n 's/^ TALIB_C_VER: *//p' .github/workflows/wheels.yml)" - test -n "$talib_c_ver" - echo "TALIB_C_VER=${talib_c_ver}" >> "$GITHUB_ENV" + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: |- + curl -fsSL -o talib-$TALIB_C_VER.tar.gz https://github.com/TA-Lib/ta-lib/archive/refs/tags/v$TALIB_C_VER.tar.gz + mkdir -p ta-lib-$TALIB_C_VER + tar xzf talib-$TALIB_C_VER.tar.gz --strip-components=1 -C ta-lib-$TALIB_C_VER + cd ta-lib-$TALIB_C_VER + mkdir -p include/ta-lib/ + cp include/*.h include/ta-lib/ + cmake -S . -B _build -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/project/ta-lib-install + cmake --build _build -j"$(nproc)" + cmake --install _build + cp LICENSE /project/LICENSE.ta-lib-c + cibw-environment-linux: "CFLAGS=-D_GNU_SOURCE TA_LIBRARY_PATH=/project/ta-lib-install/lib TA_INCLUDE_PATH=/project/ta-lib-install/include PIP_NO_BUILD_ISOLATION=false PIP_ONLY_BINARY=numpy,pandas" + cibw-environment-pass-linux: "TALIB_C_VER" + cibw-repair-wheel-command-linux: "LD_LIBRARY_PATH=\"/project/ta-lib-install/lib:$LD_LIBRARY_PATH\" auditwheel repair -w {dest_dir} {wheel}" + cibw-build-frontend: "build" + # polars now has a riscv64 wheel on the registry; added so + # test_stream.py::test_a_result_pickles' inline `import polars` + # doesn't ModuleNotFoundError. test_polars.py itself stays + # ignored below (untouched, out of scope for this fix). + cibw-test-requires: "pytest pandas polars" + # PyPI's newest polars-runtime-32 has no riscv64 wheel; without this pip builds its sdist. + cibw-test-environment: "PIP_ONLY_BINARY=numpy,pandas,polars,polars-runtime-32" + cibw-test-command: "cd .. && pytest -k \"not RSI and not threading\" --ignore={project}/tests/test_polars.py {project}/tests" - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + env: + TA_LIB_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_PASS_LINUX: TALIB_C_VER CFLAGS - CFLAGS: -D_GNU_SOURCE - CIBW_BEFORE_ALL_LINUX: | - curl -fsSL -o talib-$TALIB_C_VER.tar.gz https://github.com/TA-Lib/ta-lib/archive/refs/tags/v$TALIB_C_VER.tar.gz - mkdir -p ta-lib-$TALIB_C_VER - tar xzf talib-$TALIB_C_VER.tar.gz --strip-components=1 -C ta-lib-$TALIB_C_VER - cd ta-lib-$TALIB_C_VER - mkdir -p include/ta-lib/ - cp include/*.h include/ta-lib/ - cmake -S . -B _build -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/project/ta-lib-install - cmake --build _build -j"$(nproc)" - cmake --install _build - cp LICENSE /project/LICENSE.ta-lib-c - CIBW_ENVIRONMENT_LINUX: >- - TA_LIBRARY_PATH=/project/ta-lib-install/lib - TA_INCLUDE_PATH=/project/ta-lib-install/include - PIP_NO_BUILD_ISOLATION=false - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pandas - CIBW_REPAIR_WHEEL_COMMAND_LINUX: | - LD_LIBRARY_PATH="/project/ta-lib-install/lib:$LD_LIBRARY_PATH" auditwheel repair -w {dest_dir} {wheel} - CIBW_BUILD_FRONTEND: build - # polars now has a riscv64 wheel on the registry; added so - # test_stream.py::test_a_result_pickles' inline `import polars` - # doesn't ModuleNotFoundError. test_polars.py itself stays - # ignored below (untouched, out of scope for this fix). - CIBW_TEST_REQUIRES: pytest pandas polars - # PyPI's newest polars-runtime-32 has no riscv64 wheel; without this pip builds its sdist. - CIBW_TEST_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pandas,polars,polars-runtime-32 - CIBW_TEST_COMMAND: >- - cd .. && - pytest -k "not RSI and not threading" --ignore={project}/tests/test_polars.py {project}/tests + name: ta-lib-${{ env.TA_LIB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and both licences run: | @@ -140,15 +141,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ta-lib-${{ env.TA_LIB_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish ta-lib ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-tables.yml b/.github/workflows/build-tables.yml index 34e4a2e1fd1e..5e8301acdb64 100644 --- a/.github/workflows/build-tables.yml +++ b/.github/workflows/build-tables.yml @@ -54,6 +54,95 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build tables ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # setup.py's bdist_wheel_abi3 hardcodes the wheel tag to cp311-abi3 + # regardless of which Py_LIMITED_API-built interpreter compiles it, so + # the produced wheel is the same upstream ships. The build floor here is + # cp312, not cp311 like upstream: numexpr (a runtime dependency) only has + # a riscv64 build on this registry from cp312 onward (see + # build-numexpr.yml), and cibuildwheel's abi3 handling builds once on the + # lowest requested identifier and reuses that wheel to test the rest. + - tag: cp311-abi3 + build: >- + cp312-manylinux_riscv64 cp313-manylinux_riscv64 + cp314-manylinux_riscv64 + timeout: 420 + - tag: cp314t + build: cp314t-manylinux_riscv64 + timeout: 180 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "tables" + version: "${{ matrix.version }}" + repository: "PyTables/PyTables" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: "${{ matrix.timeout }}" + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/tables/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.build }}" + # Neutralizes pyproject.toml's own before-build, which installs from + # hash-pinned lockfiles with no riscv64 wheels; build-system.requires + # (Cython, numpy, blosc2, ...) resolves normally instead. + cibw-before-build: "true" + # zlib/bzip2-devel, then HDF5 from source, mirroring PyTables' own + # ci/github/get_hdf5.sh (Linux branch) and wheels.yml's HDF5_VERSION. + # No libaec/szip: upstream doesn't enable szip on Linux either. + # LICENSES/BZIP2.txt: bzip2, unlike zlib, isn't on the manylinux policy + # allow-list, so auditwheel vendors it into the wheel; PyTables' own + # license-files glob (LICENSES/*.txt) already covers HDF5/zlib/blosc's + # licenses but ships no bzip2 one, so add it the same way netcdf4's port + # does for its own vendored bzip2 copy. + cibw-before-all-linux: |- + set -ex + dnf -y install zlib-devel bzip2-devel + mkdir -p /tmp/hdf5 + curl -fsSL "https://github.com/HDFGroup/hdf5/archive/refs/tags/$HDF5_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/hdf5 + cmake -S /tmp/hdf5 -B /tmp/hdf5/build \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_INSTALL_PREFIX=/usr/local \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D BUILD_TESTING=OFF \ + -D BUILD_STATIC_LIBS=OFF \ + -D HDF5_BUILD_EXAMPLES=OFF \ + -D HDF5_BUILD_TOOLS=OFF \ + -D HDF5_BUILD_UTILS=OFF \ + -D HDF5_ENABLE_ZLIB_SUPPORT=ON + cmake --build /tmp/hdf5/build -j "$(nproc)" + cmake --install /tmp/hdf5/build + ldconfig + cp /usr/share/licenses/bzip2-libs/LICENSE "{project}/LICENSES/BZIP2.txt" + cibw-environment-linux: "HDF5_DIR=/usr/local HDF5_VERSION=2.2.0 DISABLE_AVX2=true CFLAGS=-g0 PIP_ONLY_BINARY=numpy,blosc2,numexpr" + # blosc2's shared lib lives inside the separately-installed blosc2 + # wheel (a runtime dependency, already on this registry); tables loads + # it via ctypes at import time (tables/__init__.py's _load_blosc2()), + # so auditwheel must not vendor a second copy of it (gotcha 17). + cibw-repair-wheel-command-linux: "auditwheel repair -w {dest_dir} {wheel} --exclude 'libblosc2.so*'" + # Mirrors upstream's own test_wheels job (wheels.yml): no lzo in the + # check list because upstream's Linux wheels don't build with lzo + # either (their before-all doesn't install lzo-devel). + cibw-test-command: "python -c \"import tables; keys = 'zlib bzip2 blosc blosc2'.split(); missing = [key for key in keys if tables.which_lib_version(key) is None]; assert missing == [], missing\" && python -m tables.tests.test_all -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: ${{ matrix.timeout }} strategy: @@ -76,88 +165,14 @@ jobs: - tag: cp314t build: cp314t-manylinux_riscv64 timeout: 180 - env: TABLES_VERSION: ${{ matrix.version }} - steps: - - name: Checkout PyTables v${{ env.TABLES_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: PyTables/PyTables - ref: v${{ env.TABLES_VERSION }} - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # hdf5-blosc2/src/blosc2_filter.c is a plain vendored copy (not a git - # submodule) written against the pre-3.0 c-blosc2 API: it fails to - # compile against any current blosc2 (BLOSC2_MAX_DIM was renamed to - # B2ND_MAX_DIM in c-blosc2 3.0, which every blosc2 >= 3.2.0 bundles, - # including the one this registry publishes). See gotcha 269. - - name: Patch tables source - run: git apply python-wheels/patches/tables/${{ env.TABLES_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Neutralizes pyproject.toml's own before-build, which installs from - # hash-pinned lockfiles with no riscv64 wheels; build-system.requires - # (Cython, numpy, blosc2, ...) resolves normally instead. - CIBW_BEFORE_BUILD: 'true' - # zlib/bzip2-devel, then HDF5 from source, mirroring PyTables' own - # ci/github/get_hdf5.sh (Linux branch) and wheels.yml's HDF5_VERSION. - # No libaec/szip: upstream doesn't enable szip on Linux either. - # LICENSES/BZIP2.txt: bzip2, unlike zlib, isn't on the manylinux policy - # allow-list, so auditwheel vendors it into the wheel; PyTables' own - # license-files glob (LICENSES/*.txt) already covers HDF5/zlib/blosc's - # licenses but ships no bzip2 one, so add it the same way netcdf4's port - # does for its own vendored bzip2 copy. - CIBW_BEFORE_ALL_LINUX: | - set -ex - dnf -y install zlib-devel bzip2-devel - mkdir -p /tmp/hdf5 - curl -fsSL "https://github.com/HDFGroup/hdf5/archive/refs/tags/$HDF5_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/hdf5 - cmake -S /tmp/hdf5 -B /tmp/hdf5/build \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_INSTALL_PREFIX=/usr/local \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D BUILD_TESTING=OFF \ - -D BUILD_STATIC_LIBS=OFF \ - -D HDF5_BUILD_EXAMPLES=OFF \ - -D HDF5_BUILD_TOOLS=OFF \ - -D HDF5_BUILD_UTILS=OFF \ - -D HDF5_ENABLE_ZLIB_SUPPORT=ON - cmake --build /tmp/hdf5/build -j "$(nproc)" - cmake --install /tmp/hdf5/build - ldconfig - cp /usr/share/licenses/bzip2-libs/LICENSE "{project}/LICENSES/BZIP2.txt" - CIBW_ENVIRONMENT_LINUX: >- - HDF5_DIR=/usr/local - HDF5_VERSION=${{ env.HDF5_VERSION }} - DISABLE_AVX2=true - CFLAGS=-g0 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,blosc2,numexpr - # blosc2's shared lib lives inside the separately-installed blosc2 - # wheel (a runtime dependency, already on this registry); tables loads - # it via ctypes at import time (tables/__init__.py's _load_blosc2()), - # so auditwheel must not vendor a second copy of it (gotcha 17). - CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- - auditwheel repair -w {dest_dir} {wheel} --exclude 'libblosc2.so*' - # Mirrors upstream's own test_wheels job (wheels.yml): no lzo in the - # check list because upstream's Linux wheels don't build with lzo - # either (their before-all doesn't install lzo-devel). - CIBW_TEST_COMMAND: >- - python -c "import tables; keys = 'zlib bzip2 blosc blosc2'.split(); missing = [key for key in keys if tables.which_lib_version(key) is None]; assert missing == [], missing" && - python -m tables.tests.test_all -v + name: tables-${{ env.TABLES_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check the wheel ships the extensions and the bundled licences run: | @@ -202,15 +217,9 @@ jobs: assert licences == expected_licences, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: tables-${{ env.TABLES_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish tables ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-tabmat.yml b/.github/workflows/build-tabmat.yml index dad8e8473412..f13f391575fe 100644 --- a/.github/workflows/build-tabmat.yml +++ b/.github/workflows/build-tabmat.yml @@ -61,9 +61,7 @@ jobs: # numpy/scipy are build- and run-time requirements; only our registry has # them for riscv64, and only-binary keeps a newer PyPI release from # winning resolution and compiling from sdist. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,scipy" timeout-minutes: 120 publish: diff --git a/.github/workflows/build-temporalio.yml b/.github/workflows/build-temporalio.yml index 419378f9c212..34403917c0d0 100644 --- a/.github/workflows/build-temporalio.yml +++ b/.github/workflows/build-temporalio.yml @@ -67,11 +67,7 @@ jobs: # Repeats upstream's [tool.cibuildwheel.linux] environment (an env var replaces # that table wholesale). PROTOC_INCLUDE is needed because protoc 3.19 resolves # google/protobuf/*.proto from disk rather than from the binary. - cibw-environment: >- - PATH=$PATH:$HOME/.cargo/bin - CARGO_NET_GIT_FETCH_WITH_CLI=true - PROTOC_INCLUDE=/usr/include - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PATH=$PATH:$HOME/.cargo/bin CARGO_NET_GIT_FETCH_WITH_CLI=true PROTOC_INCLUDE=/usr/include" # TEMPORAL_INTEGRATION_TEST makes upstream's conftest assert the wheel is what # gets imported. only-binary keeps cryptography/pydantic-core resolving to our # registry's riscv64 wheels instead of source builds (CLAUDE.md gotcha 12). diff --git a/.github/workflows/build-tesserocr.yml b/.github/workflows/build-tesserocr.yml index ee69b85100e4..56b452ed1e2c 100644 --- a/.github/workflows/build-tesserocr.yml +++ b/.github/workflows/build-tesserocr.yml @@ -55,148 +55,145 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build tesserocr ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "tesserocr" + version: "${{ matrix.version }}" + repository: "sirfz/tesserocr" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/tesserocr/${{ matrix.version }}/0001-*.patch + git apply python-wheels/patches/tesserocr/${{ matrix.version }}/0003-*.patch + for p in python-wheels/patches/tesserocr/${{ matrix.version }}/0004-*.patch; do + [ -e "$p" ] || continue + git apply "$p" + done + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # Neither manylinux_riscv64 nor musllinux_riscv64 ships tesseract/leptonica + # devel packages (no riscv64 EPEL, and Rocky 10 carries neither at all); built + # from source at upstream's own pinned versions instead of yum-installing them, + # same shape as upstream's linux-install-tesseract.sh but via dnf/apk. + cibw-before-all-linux: |- + set -ex + if command -v apk > /dev/null; then + apk add --no-cache cmake pkgconf libpng-dev jpeg-dev tiff-dev libwebp-dev zlib-dev + else + dnf install -y cmake pkgconfig libpng-devel libjpeg-turbo-devel libtiff-devel libwebp-devel zlib-devel + fi + mkdir -p /tmp/leptonica /tmp/tesseract + curl -fsSL "https://github.com/DanBloomberg/leptonica/releases/download/$LEPTONICA_VERSION/leptonica-$LEPTONICA_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/leptonica + curl -fsSL "https://github.com/tesseract-ocr/tesseract/archive/refs/tags/$TESSERACT_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/tesseract + # Vendored from a tarball, not a git checkout, so `patch -p1` + # rather than `git apply` (gotcha precedent: build-rerun-sdk.yml's + # lance-core/lance-linalg crates). + patch -p1 -d /tmp/tesseract < python-wheels/patches/tesserocr/${{ matrix.version }}/0002-tesseract-osdetect-guard-against-unset-script-id.patch + cmake -S /tmp/leptonica -B /tmp/leptonica/build \ + -D CMAKE_BUILD_TYPE=RelWithDebInfo \ + -D CMAKE_INSTALL_PREFIX=/usr/local \ + -D CMAKE_INSTALL_LIBDIR=lib \ + -D BUILD_SHARED_LIBS=ON \ + -D ENABLE_GIF=OFF \ + -D ENABLE_OPENJPEG=OFF + cmake --build /tmp/leptonica/build -j"$(nproc)" + cmake --install /tmp/leptonica/build + # Upstream's own workaround: leptonica's .pc file bakes the version into + # its name (lept_X.Y.Z.pc) instead of the lept.pc setup.py looks for. + mv /usr/local/lib/pkgconfig/lept_*.pc /usr/local/lib/pkgconfig/lept.pc + cmake -S /tmp/tesseract -B /tmp/tesseract/build \ + -D CMAKE_BUILD_TYPE=RelWithDebInfo \ + -D CMAKE_INSTALL_PREFIX=/usr/local \ + -D CMAKE_INSTALL_LIBDIR=/usr/local/lib \ + -D BUILD_SHARED_LIBS=ON \ + -D OPENMP_BUILD=OFF \ + -D BUILD_TRAINING_TOOLS=OFF + cmake --build /tmp/tesseract/build -j"$(nproc)" + cmake --install /tmp/tesseract/build + ldconfig || true + mkdir -p /usr/local/share/tessdata + curl -fsSL -o /usr/local/share/tessdata/eng.traineddata https://github.com/tesseract-ocr/tessdata_fast/raw/main/eng.traineddata + curl -fsSL -o /usr/local/share/tessdata/osd.traineddata https://github.com/tesseract-ocr/tessdata_fast/raw/main/osd.traineddata + # LEPTONICA_VERSION/TESSERACT_VERSION must be restated here: CIBW_BEFORE_ALL_LINUX + # runs inside the manylinux container via `sh -c`, which does not inherit the + # job's plain `env:` (only what CIBW_ENVIRONMENT passes through). + cibw-environment-linux: "LEPTONICA_VERSION=1.85.0 TESSERACT_VERSION=5.5.1 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig TESSDATA_PREFIX=/usr/local/share/tessdata PIP_ONLY_BINARY=cysignals" + # setup.py cythonizes inside build_ext (no [build-system] table to declare + # Cython as a build requirement), so build isolation is disabled and Cython + # + cysignals are preinstalled into the same environment pip builds in. + cibw-before-build: "pip install \"Cython>=3.0.0,<3.2.0\" cysignals setuptools wheel" + cibw-build-frontend: "pip; args: --no-build-isolation" + # Pillow, not just cysignals: pypi.riseproject.dev has never published a + # musllinux_riscv64 Pillow wheel (manylinux_riscv64 only, plus a legacy + # untagged linux_riscv64 wheel for cp39-cp312 that pip happens to accept + # on musl too), so forcing binary-only here made cp313/cp314/cp314t-musllinux + # fail outright with "Could not find a version that satisfies the + # requirement Pillow (from versions: none)" -- confirmed via + # `curl -s https://pypi.riseproject.dev/simple/pillow/`. Left off + # PIP_ONLY_BINARY so pip falls back to Pillow's sdist there; the + # jpeg/png/tiff/webp/zlib -dev packages this step's apk/dnf install + # already puts in the same container (for leptonica/tesseract) are + # exactly what Pillow's setup.py auto-detects and needs for that build. + cibw-test-requires: "pytest Pillow" + cibw-test-sources: "tests" + # From 2.12.0 upstream's [tool.cibuildwheel] sets test-environment + # TESSDATA_PREFIX=.test-tessdata (a dir of its own test models, not + # staged here via CIBW_TEST_SOURCES), which would override the + # CIBW_ENVIRONMENT value above and leave tesseract with no tessdata + # ("Failed to init API ... invalid tessdata path: ./"). Point it at + # the tessdata CIBW_BEFORE_ALL_LINUX installed, and keep the + # OMP_THREAD_LIMIT=1 upstream sets alongside it. + cibw-test-environment: "TESSDATA_PREFIX=/usr/local/share/tessdata OMP_THREAD_LIMIT=1" + # A relative path, not {project}/tests: tesserocr has no src/ layout, so + # {project}/tests would put {project} (the full checkout) on pytest's + # rootdir-inserted sys.path and shadow the installed wheel with the + # uncompiled tesserocr/ source tree (no .so) instead. + # Upstream's own CI (build.yml) doesn't run this suite at all -- its + # "Test wheel" step is a bare `import tesserocr` smoke test -- so + # test_init's Init(oem=OEM.TESSERACT_ONLY) call is a gap upstream + # itself never had to close: it needs the legacy-engine model data + # that tessdata_fast's traineddata (LSTM-only) doesn't ship. + # test_detect_os's own brittle final assertion is patched out + # instead of deselecting the whole test (patches/tesserocr/2.11.0/ + # 0003-*), since it's the exact test that was crashing before + # 0002's fix and is worth keeping as regression coverage. + cibw-test-command: "python -m pytest tests -v --deselect \"tests/test_api.py::TestTessBaseApi::test_init\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: TESSEROCR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout tesserocr v${{ env.TESSEROCR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: sirfz/tesserocr - ref: v${{ env.TESSEROCR_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch tesserocr source - # 0001-*/0003-*/0004-*: git apply against this checkout. 0002-* targets the - # vendored tesseract tarball (no .git dir) fetched later in - # CIBW_BEFORE_ALL_LINUX, applied there with `patch -p1` instead -- - # excluded from this glob. 0004-* only exists from 2.12.0 (tests/test_threads.py - # is new there), hence the existence check. - run: | - git apply python-wheels/patches/tesserocr/${{ env.TESSEROCR_VERSION }}/0001-*.patch - git apply python-wheels/patches/tesserocr/${{ env.TESSEROCR_VERSION }}/0003-*.patch - for p in python-wheels/patches/tesserocr/${{ env.TESSEROCR_VERSION }}/0004-*.patch; do - [ -e "$p" ] || continue - git apply "$p" - done - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # Neither manylinux_riscv64 nor musllinux_riscv64 ships tesseract/leptonica - # devel packages (no riscv64 EPEL, and Rocky 10 carries neither at all); built - # from source at upstream's own pinned versions instead of yum-installing them, - # same shape as upstream's linux-install-tesseract.sh but via dnf/apk. - CIBW_BEFORE_ALL_LINUX: | - set -ex - if command -v apk > /dev/null; then - apk add --no-cache cmake pkgconf libpng-dev jpeg-dev tiff-dev libwebp-dev zlib-dev - else - dnf install -y cmake pkgconfig libpng-devel libjpeg-turbo-devel libtiff-devel libwebp-devel zlib-devel - fi - mkdir -p /tmp/leptonica /tmp/tesseract - curl -fsSL "https://github.com/DanBloomberg/leptonica/releases/download/$LEPTONICA_VERSION/leptonica-$LEPTONICA_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/leptonica - curl -fsSL "https://github.com/tesseract-ocr/tesseract/archive/refs/tags/$TESSERACT_VERSION.tar.gz" | tar xz --strip-components=1 -C /tmp/tesseract - # Vendored from a tarball, not a git checkout, so `patch -p1` - # rather than `git apply` (gotcha precedent: build-rerun-sdk.yml's - # lance-core/lance-linalg crates). - patch -p1 -d /tmp/tesseract < python-wheels/patches/tesserocr/${{ env.TESSEROCR_VERSION }}/0002-tesseract-osdetect-guard-against-unset-script-id.patch - cmake -S /tmp/leptonica -B /tmp/leptonica/build \ - -D CMAKE_BUILD_TYPE=RelWithDebInfo \ - -D CMAKE_INSTALL_PREFIX=/usr/local \ - -D CMAKE_INSTALL_LIBDIR=lib \ - -D BUILD_SHARED_LIBS=ON \ - -D ENABLE_GIF=OFF \ - -D ENABLE_OPENJPEG=OFF - cmake --build /tmp/leptonica/build -j"$(nproc)" - cmake --install /tmp/leptonica/build - # Upstream's own workaround: leptonica's .pc file bakes the version into - # its name (lept_X.Y.Z.pc) instead of the lept.pc setup.py looks for. - mv /usr/local/lib/pkgconfig/lept_*.pc /usr/local/lib/pkgconfig/lept.pc - cmake -S /tmp/tesseract -B /tmp/tesseract/build \ - -D CMAKE_BUILD_TYPE=RelWithDebInfo \ - -D CMAKE_INSTALL_PREFIX=/usr/local \ - -D CMAKE_INSTALL_LIBDIR=/usr/local/lib \ - -D BUILD_SHARED_LIBS=ON \ - -D OPENMP_BUILD=OFF \ - -D BUILD_TRAINING_TOOLS=OFF - cmake --build /tmp/tesseract/build -j"$(nproc)" - cmake --install /tmp/tesseract/build - ldconfig || true - mkdir -p /usr/local/share/tessdata - curl -fsSL -o /usr/local/share/tessdata/eng.traineddata https://github.com/tesseract-ocr/tessdata_fast/raw/main/eng.traineddata - curl -fsSL -o /usr/local/share/tessdata/osd.traineddata https://github.com/tesseract-ocr/tessdata_fast/raw/main/osd.traineddata - # LEPTONICA_VERSION/TESSERACT_VERSION must be restated here: CIBW_BEFORE_ALL_LINUX - # runs inside the manylinux container via `sh -c`, which does not inherit the - # job's plain `env:` (only what CIBW_ENVIRONMENT passes through). - CIBW_ENVIRONMENT: >- - LEPTONICA_VERSION=${{ env.LEPTONICA_VERSION }} - TESSERACT_VERSION=${{ env.TESSERACT_VERSION }} - PKG_CONFIG_PATH=/usr/local/lib/pkgconfig - TESSDATA_PREFIX=/usr/local/share/tessdata - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=cysignals - # setup.py cythonizes inside build_ext (no [build-system] table to declare - # Cython as a build requirement), so build isolation is disabled and Cython - # + cysignals are preinstalled into the same environment pip builds in. - CIBW_BEFORE_BUILD: pip install "Cython>=3.0.0,<3.2.0" cysignals setuptools wheel - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - # Pillow, not just cysignals: pypi.riseproject.dev has never published a - # musllinux_riscv64 Pillow wheel (manylinux_riscv64 only, plus a legacy - # untagged linux_riscv64 wheel for cp39-cp312 that pip happens to accept - # on musl too), so forcing binary-only here made cp313/cp314/cp314t-musllinux - # fail outright with "Could not find a version that satisfies the - # requirement Pillow (from versions: none)" -- confirmed via - # `curl -s https://pypi.riseproject.dev/simple/pillow/`. Left off - # PIP_ONLY_BINARY so pip falls back to Pillow's sdist there; the - # jpeg/png/tiff/webp/zlib -dev packages this step's apk/dnf install - # already puts in the same container (for leptonica/tesseract) are - # exactly what Pillow's setup.py auto-detects and needs for that build. - CIBW_TEST_REQUIRES: pytest Pillow - CIBW_TEST_SOURCES: tests - # From 2.12.0 upstream's [tool.cibuildwheel] sets test-environment - # TESSDATA_PREFIX=.test-tessdata (a dir of its own test models, not - # staged here via CIBW_TEST_SOURCES), which would override the - # CIBW_ENVIRONMENT value above and leave tesseract with no tessdata - # ("Failed to init API ... invalid tessdata path: ./"). Point it at - # the tessdata CIBW_BEFORE_ALL_LINUX installed, and keep the - # OMP_THREAD_LIMIT=1 upstream sets alongside it. - CIBW_TEST_ENVIRONMENT: >- - TESSDATA_PREFIX=/usr/local/share/tessdata - OMP_THREAD_LIMIT=1 - # A relative path, not {project}/tests: tesserocr has no src/ layout, so - # {project}/tests would put {project} (the full checkout) on pytest's - # rootdir-inserted sys.path and shadow the installed wheel with the - # uncompiled tesserocr/ source tree (no .so) instead. - # Upstream's own CI (build.yml) doesn't run this suite at all -- its - # "Test wheel" step is a bare `import tesserocr` smoke test -- so - # test_init's Init(oem=OEM.TESSERACT_ONLY) call is a gap upstream - # itself never had to close: it needs the legacy-engine model data - # that tessdata_fast's traineddata (LSTM-only) doesn't ship. - # test_detect_os's own brittle final assertion is patched out - # instead of deselecting the whole test (patches/tesserocr/2.11.0/ - # 0003-*), since it's the exact test that was crashing before - # 0002's fix and is worth keeping as regression coverage. - CIBW_TEST_COMMAND: >- - python -m pytest tests -v - --deselect "tests/test_api.py::TestTessBaseApi::test_init" + name: tesserocr-${{ env.TESSEROCR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel is compiled and carries the vendored licences run: | @@ -210,15 +207,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: tesserocr-${{ env.TESSEROCR_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish tesserocr ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-tetgen.yml b/.github/workflows/build-tetgen.yml index ff921a63507c..43a02fa1da91 100644 --- a/.github/workflows/build-tetgen.yml +++ b/.github/workflows/build-tetgen.yml @@ -53,34 +53,36 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build tetgen ${{ matrix.version }} manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "tetgen" + version: "${{ matrix.version }}" + repository: "pyvista/tetgen" + ref: "v${{ matrix.version }}" + artifact-tag: "manylinux_riscv64" + timeout-minutes: 120 + # Every test imports pyvista, whose vtk dependency has riscv64 wheels for cp312+ only. + cibw-test-skip: "cp310-* cp311-*" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,vtk,pymeshfix,matplotlib,pillow,contourpy,kiwisolver,fonttools" + cibw-build: '' + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: TETGEN_VERSION: ${{ matrix.version }} - steps: - - name: Checkout tetgen v${{ env.TETGEN_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pyvista/tetgen - ref: v${{ env.TETGEN_VERSION }} - persist-credentials: false - - - name: Build and test wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # build/skip come from upstream's own pyproject.toml [tool.cibuildwheel]: - # cp310/cp311 each get a real extension, cp312+ collapse into one - # cp312-abi3 wheel (STABLE_ABI in src/CMakeLists.txt), same as upstream's - # own 6-wheel (3 abi tags x 2 archs) PyPI release. - CIBW_ARCHS: riscv64 - # Every test imports pyvista, whose vtk dependency has riscv64 wheels for cp312+ only. - CIBW_TEST_SKIP: "cp310-* cp311-*" - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,vtk,pymeshfix,matplotlib,pillow,contourpy,kiwisolver,fonttools + name: tetgen-${{ env.TETGEN_VERSION }}-manylinux_riscv64 + path: wheelhouse - name: Check the extension and license made it into the wheel run: | @@ -94,15 +96,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: tetgen-${{ env.TETGEN_VERSION }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish tetgen ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-text2num.yml b/.github/workflows/build-text2num.yml index 992187cdbb10..6cf54a763bcb 100644 --- a/.github/workflows/build-text2num.yml +++ b/.github/workflows/build-text2num.yml @@ -49,42 +49,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build text2num ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "text2num" + version: "${{ matrix.version }}" + repository: "allo-media/text2num" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # text2num ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # Test each wheel the way upstream's CI.yml does. + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import text_to_num._text2num as ext; assert ext.__file__.endswith('.so'), ext.__file__\" && python -m unittest -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: TEXT2NUM_VERSION: ${{ matrix.version }} - steps: - - name: Checkout text2num v${{ env.TEXT2NUM_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: allo-media/text2num - ref: v${{ env.TEXT2NUM_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # text2num ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - # Test each wheel the way upstream's CI.yml does. - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import text_to_num._text2num as ext; assert ext.__file__.endswith('.so'), ext.__file__" && - python -m unittest -v + name: text2num-${{ env.TEXT2NUM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the licence made it into the wheel run: | @@ -96,15 +99,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: text2num-${{ env.TEXT2NUM_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish text2num ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-texterrors.yml b/.github/workflows/build-texterrors.yml index 639a9b19b414..6348345862ee 100644 --- a/.github/workflows/build-texterrors.yml +++ b/.github/workflows/build-texterrors.yml @@ -58,7 +58,6 @@ jobs: ref: v${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # Upstream's test-wheels job runs `pytest -v .` from the checkout after installing the wheel. cibw-test-requires: pytest cibw-test-sources: tests pytest.ini diff --git a/.github/workflows/build-textual-speedups.yml b/.github/workflows/build-textual-speedups.yml index cb81f4ec2599..bf19f32b63cb 100644 --- a/.github/workflows/build-textual-speedups.yml +++ b/.github/workflows/build-textual-speedups.yml @@ -51,154 +51,166 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build textual-speedups ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "textual-speedups" + version: "${{ matrix.version }}" + repository: "willmcgugan/textual-speedups" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/textual-speedups/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + mkdir -p tests + cat > tests/test_geometry.py <<'EOF' + import importlib.metadata + + from textual_speedups import Offset, Region, Size, Spacing + + + def test_offset(): + assert repr(Offset(3, 4)) == "Offset(x=3, y=4)" + assert tuple(Offset(3, 4)) == (3, 4) + assert Offset(3, 4) == Offset(3, 4) != Offset(4, 3) + assert Offset(0, 0).is_origin and not Offset(1, 0).is_origin + assert Offset(3, 4) + (1, 2) == Offset(4, 6) + assert Offset(3, 4) - (1, 2) == Offset(2, 2) + assert Offset(3, 4) * 2 == Offset(6, 8) + assert -Offset(3, 4) == Offset(-3, -4) + assert Offset(-3, -4).clamped == Offset(0, 0) + assert Offset(3, 4).transpose == (4, 3) + assert Offset(0, 0).get_distance_to(Offset(3, 4)) == 5.0 + assert Offset(0, 0).blend(Offset(10, 20), 0.5) == Offset(5, 10) + assert Offset(-2, 99).clamp(4, 6) == Offset(0, 5) + + + def test_size(): + size = Size(5, 3) + assert repr(size) == "Size(width=5, height=3)" + assert tuple(size) == (5, 3) and size.area == 15 + assert size.region == Region(0, 0, 5, 3) + assert list(size.line_range) == [0, 1, 2] + assert (size.with_width(7), size.with_height(7)) == (Size(7, 3), Size(5, 7)) + assert size + (1, 2) == Size(6, 5) + assert size - (1, 2) == Size(4, 1) + assert size.contains(4, 2) and not size.contains(5, 2) + assert size.contains_point((1, 1)) + assert size.clamp_offset(Offset(99, -9)) == Offset(4, 0) + + + def test_region_geometry(): + region = Region(2, 3, 5, 7) + assert repr(region) == "Region(x=2, y=3, width=5, height=7)" + assert (region.right, region.bottom, region.area) == (7, 10, 35) + assert (region.offset, region.size) == (Offset(2, 3), Size(5, 7)) + assert region.corners == (2, 3, 7, 10) + assert region.center == (4.5, 6.5) + assert region.bottom_right == Offset(7, 10) + assert region.bottom_right_inclusive == Offset(6, 9) + assert (region.top_right, region.bottom_left) == (Offset(7, 3), Offset(2, 10)) + assert (region.column_span, region.line_span) == ((2, 7), (3, 10)) + assert list(region.column_range) == [2, 3, 4, 5, 6] + assert region.reset_offset == Region(0, 0, 5, 7) + + + def test_region_operations(): + region = Region(2, 3, 5, 7) + assert region.union(Region(0, 0, 1, 1)) == Region(0, 0, 7, 10) + assert region.intersection(Region(0, 0, 4, 5)) == Region(2, 3, 2, 2) + assert region.overlaps(Region(0, 0, 4, 5)) + assert region.contains_region(Region(3, 4, 1, 1)) and region.contains(3, 4) + assert region.expand((1, 1)) == Region(1, 2, 7, 9) + assert region.grow((1, 2, 3, 4)) == Region(-2, 2, 11, 11) + assert region.shrink((1, 1, 1, 1)) == Region(3, 4, 3, 5) + assert region.crop_size((3, 3)) == Region(2, 3, 3, 3) + assert region.at_offset((0, 0)) == Region(0, 0, 5, 7) + assert region.translate((1, 1)) == Region(3, 4, 5, 7) + assert region.split_horizontal(2) == (Region(2, 3, 5, 2), Region(2, 5, 5, 5)) + assert region.split_vertical(2) == (Region(2, 3, 2, 7), Region(4, 3, 3, 7)) + assert region.split(2, 2) == ( + Region(2, 3, 2, 2), + Region(4, 3, 3, 2), + Region(2, 5, 2, 5), + Region(4, 5, 3, 5), + ) + assert Region(10, 10, 2, 2).translate_inside(Region(0, 0, 8, 8)) == Region(6, 6, 2, 2) + assert Region(0, 0, 10, 10).get_spacing_between(Region(2, 2, 5, 5)) == Spacing(2, 3, 3, 2) + + + def test_region_constructors(): + assert Region.from_corners(1, 2, 5, 6) == Region(1, 2, 4, 4) + assert Region.from_offset((1, 2), (3, 4)) == Region(1, 2, 3, 4) + assert Region.from_union([Region(0, 0, 2, 2), Region(4, 4, 1, 1)]) == Region(0, 0, 5, 5) + + + def test_spacing(): + spacing = Spacing(1, 2, 3, 4) + assert repr(spacing) == "Spacing(top=1, right=2, bottom=3, left=4)" + assert (spacing.width, spacing.height) == (6, 4) + assert (spacing.top_left, spacing.bottom_right) == ((4, 1), (2, 3)) + assert spacing.totals == (6, 4) + assert spacing.css == "1 2 3 4" + assert Spacing.all(3) == Spacing(3, 3, 3, 3) + assert Spacing.unpack((1, 2)) == Spacing(1, 2, 1, 2) + assert spacing.grow_maximum(Spacing(2, 2, 2, 2)) == Spacing(2, 2, 3, 4) + assert spacing + (1, 1, 1, 1) == Spacing(2, 3, 4, 5) + + + def test_license_is_packaged(): + files = importlib.metadata.files("textual-speedups") + licenses = [str(path) for path in files if ".dist-info/licenses/" in str(path)] + assert [path.rsplit("/", 1)[-1] for path in licenses] == ["LICENSE"], licenses + EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # textual-speedups ships no [tool.cibuildwheel], so the Rust toolchain + # its maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: TEXTUAL_SPEEDUPS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout textual-speedups v${{ env.TEXTUAL_SPEEDUPS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: willmcgugan/textual-speedups - ref: v${{ env.TEXTUAL_SPEEDUPS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Patch textual-speedups source - run: git apply python-wheels/patches/textual-speedups/${{ env.TEXTUAL_SPEEDUPS_VERSION }}/*.patch - - - name: Stage the smoke tests - # Upstream ships no test suite and its CI only builds, so exercise the - # four classes the module exports against known values instead. - run: | - mkdir -p tests - cat > tests/test_geometry.py <<'EOF' - import importlib.metadata - - from textual_speedups import Offset, Region, Size, Spacing - - - def test_offset(): - assert repr(Offset(3, 4)) == "Offset(x=3, y=4)" - assert tuple(Offset(3, 4)) == (3, 4) - assert Offset(3, 4) == Offset(3, 4) != Offset(4, 3) - assert Offset(0, 0).is_origin and not Offset(1, 0).is_origin - assert Offset(3, 4) + (1, 2) == Offset(4, 6) - assert Offset(3, 4) - (1, 2) == Offset(2, 2) - assert Offset(3, 4) * 2 == Offset(6, 8) - assert -Offset(3, 4) == Offset(-3, -4) - assert Offset(-3, -4).clamped == Offset(0, 0) - assert Offset(3, 4).transpose == (4, 3) - assert Offset(0, 0).get_distance_to(Offset(3, 4)) == 5.0 - assert Offset(0, 0).blend(Offset(10, 20), 0.5) == Offset(5, 10) - assert Offset(-2, 99).clamp(4, 6) == Offset(0, 5) - - - def test_size(): - size = Size(5, 3) - assert repr(size) == "Size(width=5, height=3)" - assert tuple(size) == (5, 3) and size.area == 15 - assert size.region == Region(0, 0, 5, 3) - assert list(size.line_range) == [0, 1, 2] - assert (size.with_width(7), size.with_height(7)) == (Size(7, 3), Size(5, 7)) - assert size + (1, 2) == Size(6, 5) - assert size - (1, 2) == Size(4, 1) - assert size.contains(4, 2) and not size.contains(5, 2) - assert size.contains_point((1, 1)) - assert size.clamp_offset(Offset(99, -9)) == Offset(4, 0) - - - def test_region_geometry(): - region = Region(2, 3, 5, 7) - assert repr(region) == "Region(x=2, y=3, width=5, height=7)" - assert (region.right, region.bottom, region.area) == (7, 10, 35) - assert (region.offset, region.size) == (Offset(2, 3), Size(5, 7)) - assert region.corners == (2, 3, 7, 10) - assert region.center == (4.5, 6.5) - assert region.bottom_right == Offset(7, 10) - assert region.bottom_right_inclusive == Offset(6, 9) - assert (region.top_right, region.bottom_left) == (Offset(7, 3), Offset(2, 10)) - assert (region.column_span, region.line_span) == ((2, 7), (3, 10)) - assert list(region.column_range) == [2, 3, 4, 5, 6] - assert region.reset_offset == Region(0, 0, 5, 7) - - - def test_region_operations(): - region = Region(2, 3, 5, 7) - assert region.union(Region(0, 0, 1, 1)) == Region(0, 0, 7, 10) - assert region.intersection(Region(0, 0, 4, 5)) == Region(2, 3, 2, 2) - assert region.overlaps(Region(0, 0, 4, 5)) - assert region.contains_region(Region(3, 4, 1, 1)) and region.contains(3, 4) - assert region.expand((1, 1)) == Region(1, 2, 7, 9) - assert region.grow((1, 2, 3, 4)) == Region(-2, 2, 11, 11) - assert region.shrink((1, 1, 1, 1)) == Region(3, 4, 3, 5) - assert region.crop_size((3, 3)) == Region(2, 3, 3, 3) - assert region.at_offset((0, 0)) == Region(0, 0, 5, 7) - assert region.translate((1, 1)) == Region(3, 4, 5, 7) - assert region.split_horizontal(2) == (Region(2, 3, 5, 2), Region(2, 5, 5, 5)) - assert region.split_vertical(2) == (Region(2, 3, 2, 7), Region(4, 3, 3, 7)) - assert region.split(2, 2) == ( - Region(2, 3, 2, 2), - Region(4, 3, 3, 2), - Region(2, 5, 2, 5), - Region(4, 5, 3, 5), - ) - assert Region(10, 10, 2, 2).translate_inside(Region(0, 0, 8, 8)) == Region(6, 6, 2, 2) - assert Region(0, 0, 10, 10).get_spacing_between(Region(2, 2, 5, 5)) == Spacing(2, 3, 3, 2) - - - def test_region_constructors(): - assert Region.from_corners(1, 2, 5, 6) == Region(1, 2, 4, 4) - assert Region.from_offset((1, 2), (3, 4)) == Region(1, 2, 3, 4) - assert Region.from_union([Region(0, 0, 2, 2), Region(4, 4, 1, 1)]) == Region(0, 0, 5, 5) - - - def test_spacing(): - spacing = Spacing(1, 2, 3, 4) - assert repr(spacing) == "Spacing(top=1, right=2, bottom=3, left=4)" - assert (spacing.width, spacing.height) == (6, 4) - assert (spacing.top_left, spacing.bottom_right) == ((4, 1), (2, 3)) - assert spacing.totals == (6, 4) - assert spacing.css == "1 2 3 4" - assert Spacing.all(3) == Spacing(3, 3, 3, 3) - assert Spacing.unpack((1, 2)) == Spacing(1, 2, 1, 2) - assert spacing.grow_maximum(Spacing(2, 2, 2, 2)) == Spacing(2, 2, 3, 4) - assert spacing + (1, 1, 1, 1) == Spacing(2, 3, 4, 5) - - - def test_license_is_packaged(): - files = importlib.metadata.files("textual-speedups") - licenses = [str(path) for path in files if ".dist-info/licenses/" in str(path)] - assert [path.rsplit("/", 1)[-1] for path in licenses] == ["LICENSE"], licenses - EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # textual-speedups ships no [tool.cibuildwheel], so the Rust toolchain - # its maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest -v tests + name: textual-speedups-${{ env.TEXTUAL_SPEEDUPS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension made it into the wheel run: | @@ -214,15 +226,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: textual-speedups-${{ env.TEXTUAL_SPEEDUPS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish textual-speedups ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-texture2ddecoder.yml b/.github/workflows/build-texture2ddecoder.yml index ed3860884043..e4a5c9a4b944 100644 --- a/.github/workflows/build-texture2ddecoder.yml +++ b/.github/workflows/build-texture2ddecoder.yml @@ -76,7 +76,7 @@ jobs: # The [tests] extra pulls in Pillow, which ships no riscv64 wheel on public # PyPI; ours is what the test env installs. PIP_ONLY_BINARY keeps pip from # falling back to a from-source build (it needs libjpeg headers we lack). - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=Pillow + cibw-environment-linux: "PIP_ONLY_BINARY=Pillow" timeout-minutes: 90 publish: diff --git a/.github/workflows/build-tfparse.yml b/.github/workflows/build-tfparse.yml index 08ee490f38d4..1fb386ad608b 100644 --- a/.github/workflows/build-tfparse.yml +++ b/.github/workflows/build-tfparse.yml @@ -66,7 +66,7 @@ jobs: echo "3b8fd5112340b72587e42c619f43270f1bc21f63cfdb587e6b72e0336580727c /tmp/go.tar.gz" | sha256sum -c && tar -zxf /tmp/go.tar.gz -C /usr/local/ && rm /tmp/go.tar.gz - cibw-environment-linux: 'PATH="/usr/local/go/bin:$PATH" PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/' + cibw-environment-linux: "PATH=\"/usr/local/go/bin:$PATH\"" # Upstream's own tests shell out to the terraform CLI (pytest-terraform's # TerraformRunner.init()) to fetch provider plugins -- Hashicorp ships no # riscv64 terraform build, so that suite can't run here. Exercise the diff --git a/.github/workflows/build-thinc.yml b/.github/workflows/build-thinc.yml index cf737a4047cc..98a0cb494ce3 100644 --- a/.github/workflows/build-thinc.yml +++ b/.github/workflows/build-thinc.yml @@ -51,6 +51,91 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build thinc ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # 9.1.1 pins `cython>=0.25,<3.0`, and Cython 0.29 emits calls to the + # pre-3.13 `_PyLong_AsByteArray` signature, so cp313+ cannot compile. + # Upstream ships cp39-cp312 wheels for this release for the same reason; + # 10.0.0 moved to Cython 3 and builds on every interpreter. + python: ["cp312", "cp313", "cp314"] + exclude: + - version: 9.1.1 + python: cp313 + - version: 9.1.1 + python: cp314 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "thinc" + version: "${{ matrix.version }}" + repository: "explosion/thinc" + ref: '' + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + timeout-minutes: 300 + pre-build: |- + export THINC_VERSION='${{ matrix.version }}' + for ref in "release-v$THINC_VERSION" "v$THINC_VERSION" "$THINC_VERSION"; do + git ls-remote --exit-code --tags https://github.com/explosion/thinc "refs/tags/$ref" >/dev/null && break + done + test -n "$ref" + + git fetch -q --no-tags origin "$ref" + git checkout -q --detach FETCH_HEAD + + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + patches="$PWD/python-wheels/patches/thinc/$THINC_VERSION" + if [ -d "$patches" ]; then + git apply "$patches"/*.patch + fi + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cat > resolve-build-requires.py <<'REQ_EOF' + import sys + import tomllib + + with open(sys.argv[1], "rb") as f: + requires = tomllib.load(f)["build-system"]["requires"] + old_cython = any( + r.lower().startswith("cython") and "<3" in r.replace(" ", "") + for r in requires + ) + for r in requires: + print("numpy>=2.0.0,<2.5.0" if old_cython and r.lower().startswith("numpy") else r) + REQ_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + # numpy has no riscv64 wheel on public PyPI; the build and the test + # environment both resolve it from our registry. + # build-system.requires of the checkout, with numpy capped below 2.5.0 for a + # Cython<3 release (see "Stage the build-requirements script"). + cibw-before-build: "python {project}/resolve-build-requires.py {project}/pyproject.toml > /tmp/build-requirements.txt && pip install wheel -r /tmp/build-requirements.txt" + cibw-build-frontend: "build; args: --no-isolation" + cibw-test-requires: "pytest>=8.2.0 hypothesis>=3.27.0,<6.72.2 mock>=2.0.0,<3.0.0" + # setup.cfg registers the `slow` marker; without it -Werror turns + # PytestUnknownMarkWarning into a collection error. + cibw-test-sources: "setup.cfg" + cibw-test-command: "python -m pytest --pyargs thinc -Werror" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 300 strategy: @@ -67,88 +152,14 @@ jobs: python: cp313 - version: 9.1.1 python: cp314 - env: THINC_VERSION: ${{ matrix.version }} - steps: - # Upstream tagged 9.x releases `release-vX.Y.Z` and 10.0.0 `v10.0.0`; use whichever exists. - - name: Resolve upstream tag - id: tag - run: | - for ref in "release-v$VERSION" "v$VERSION" "$VERSION"; do - if git ls-remote --exit-code --tags https://github.com/explosion/thinc "refs/tags/$ref" >/dev/null; then - echo "ref=$ref" >> "$GITHUB_OUTPUT" - exit 0 - fi - done - echo "no tag for $VERSION in explosion/thinc" >&2 - exit 1 - env: - VERSION: ${{ env.THINC_VERSION }} - - - name: Checkout thinc ${{ env.THINC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: explosion/thinc - ref: ${{ steps.tag.outputs.ref }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # Only some versions need patching (9.1.1 needed the removed free-threaded-support - # option commented out; 10.0.0 dropped it), so a missing directory is not an error. - - name: Patch thinc source - run: | - patches="$PWD/python-wheels/patches/thinc/$THINC_VERSION" - if [ -d "$patches" ]; then - git apply "$patches"/*.patch - fi - - # Installs the checkout's own build-system.requires; for a Cython<3 release it also - # caps numpy, whose 2.5.0 replaced the legacy numpy/__init__.pxd with a hard - # "requires Cython 3.0.0 or newer" abort. - - name: Stage the build-requirements script - run: | - cat > resolve-build-requires.py <<'REQ_EOF' - import sys - import tomllib - - with open(sys.argv[1], "rb") as f: - requires = tomllib.load(f)["build-system"]["requires"] - old_cython = any( - r.lower().startswith("cython") and "<3" in r.replace(" ", "") - for r in requires - ) - for r in requires: - print("numpy>=2.0.0,<2.5.0" if old_cython and r.lower().startswith("numpy") else r) - REQ_EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # numpy has no riscv64 wheel on public PyPI; the build and the test - # environment both resolve it from our registry. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # build-system.requires of the checkout, with numpy capped below 2.5.0 for a - # Cython<3 release (see "Stage the build-requirements script"). - CIBW_BEFORE_BUILD: >- - python {project}/resolve-build-requires.py {project}/pyproject.toml > /tmp/build-requirements.txt - && pip install wheel -r /tmp/build-requirements.txt - CIBW_BUILD_FRONTEND: "build; args: --no-isolation" - CIBW_TEST_REQUIRES: pytest>=8.2.0 hypothesis>=3.27.0,<6.72.2 mock>=2.0.0,<3.0.0 - # setup.cfg registers the `slow` marker; without it -Werror turns - # PytestUnknownMarkWarning into a collection error. - CIBW_TEST_SOURCES: setup.cfg - CIBW_TEST_COMMAND: python -m pytest --pyargs thinc -Werror + name: thinc-${{ env.THINC_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Check the extension modules made it into the wheel run: | @@ -170,15 +181,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: thinc-${{ env.THINC_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish thinc ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-thrift.yml b/.github/workflows/build-thrift.yml index a8f38ed19a86..781333a93cb5 100644 --- a/.github/workflows/build-thrift.yml +++ b/.github/workflows/build-thrift.yml @@ -49,53 +49,54 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build thrift ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "thrift" + version: "${{ matrix.version }}" + repository: "apache/thrift" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + cp LICENSE NOTICE lib/py/ + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "lib/py" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # test-sources paths are relative to cibuildwheel's cwd (the checkout root), + # not to package-dir, and are staged at that same relative path. + # test_sslsocket.py loads its certificates from /test/keys + # (three levels above lib/py/test), so stage that directory too. + cibw-test-sources: "lib/py/test test/keys" + # Upstream's own wheel test is the fastbinary import; the rest is its + # `make check` list minus the cases needing code generated by the thrift + # compiler (thrift_TNonblockingServer, thrift_TSerializer, + # test_recursion_depth, test_compiler), which the wheel build does not build. + cibw-test-command: "python -c \"import thrift, thrift.protocol.fastbinary\" || exit 1; rc=0; for t in thrift_json thrift_transport test_sslsocket test_socket thrift_TBinaryProtocol thrift_TZlibTransport thrift_TCompactProtocol test_immutable_exception; do python lib/py/test/$t.py || rc=1; done; exit $rc" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: THRIFT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout thrift v${{ env.THRIFT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: apache/thrift - ref: v${{ env.THRIFT_VERSION }} - persist-credentials: false - - - name: Stage LICENSE and NOTICE beside setup.py - # Apache-2.0 sections 4(a) and 4(d) require both to travel with the binary, - # but upstream's wheel ships neither; setuptools' default license_files glob - # picks them up once they sit in the project directory. - run: cp LICENSE NOTICE lib/py/ - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: lib/py - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # test-sources paths are relative to cibuildwheel's cwd (the checkout root), - # not to package-dir, and are staged at that same relative path. - # test_sslsocket.py loads its certificates from /test/keys - # (three levels above lib/py/test), so stage that directory too. - CIBW_TEST_SOURCES: lib/py/test test/keys - # Upstream's own wheel test is the fastbinary import; the rest is its - # `make check` list minus the cases needing code generated by the thrift - # compiler (thrift_TNonblockingServer, thrift_TSerializer, - # test_recursion_depth, test_compiler), which the wheel build does not build. - CIBW_TEST_COMMAND: >- - python -c "import thrift, thrift.protocol.fastbinary" || exit 1; - rc=0; - for t in thrift_json thrift_transport test_sslsocket test_socket - thrift_TBinaryProtocol thrift_TZlibTransport thrift_TCompactProtocol - test_immutable_exception; do python lib/py/test/$t.py || rc=1; done; - exit $rc + name: thrift-${{ env.THRIFT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and the licences made it into the wheel run: | @@ -109,15 +110,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: thrift-${{ env.THRIFT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish thrift ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-thriftpy2.yml b/.github/workflows/build-thriftpy2.yml index 1d9e6259e053..4c6296f5459d 100644 --- a/.github/workflows/build-thriftpy2.yml +++ b/.github/workflows/build-thriftpy2.yml @@ -50,56 +50,60 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build thriftpy2 ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "thriftpy2" + version: "${{ matrix.version }}" + repository: "Thriftpy/thriftpy2" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # aiohttp (needed only by test_aio_http.py) has no riscv64 wheels for + # cp314/cp314t or for musllinux on our registry; drop that one file + # rather than pull in a from-source aiohttp build across the matrix. + cibw-test-requires: "pytest>=6.1.1,<8.2.0 pytest-reraise pytest-asyncio" + # On cp314t only, also drop the tests that fork a server via bare + # multiprocessing.Process then sleep(0.1) for it to be ready: CPython + # warns "use of fork() may lead to deadlocks" for a multi-threaded + # parent, and free-threaded CPython's extra runtime threads make that + # race the fixed sleep, so these intermittently see + # ConnectionRefusedError. The GIL builds (cp312/cp313/cp314) run them + # unmodified. One of the ignored files + # (test_all_protocols_binary_field.py) is the only one that calls + # multiprocessing.set_start_method('fork') at import time; on the + # other interpreters that side effect makes 'fork' the process-wide + # default for the whole pytest session. Skipping that file on + # cp314t leaves CPython 3.14's own new default, 'forkserver', in + # effect, which (unlike 'fork') pickles the Process target instead + # of just inheriting it via COW - so test_apache_json.py::test_client + # then fails to pickle its locally-defined run_server()/Handler + # (gotcha 283). Deselect just those two parametrized cases on + # cp314t; the test file's other, non-multiprocessing tests still run. + cibw-test-command: "cd {project}/tests && pytest -v --ignore=test_aio_http.py ${{ matrix.python == 'cp314t' && '--ignore=test_buffered_transport.py --ignore=test_all_protocols_binary_field.py --ignore=test_multiplexed.py --ignore=test_oneway.py --ignore=test_http.py --ignore=test_out_of_order_fields.py --ignore=test_rpc.py --ignore=test_protocol_cybinary.py --ignore=test_tracking.py --deselect \"tests/test_apache_json.py::test_client[server_func0]\" --deselect \"tests/test_apache_json.py::test_client[server_func1]\"' || '' }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: THRIFTPY2_VERSION: ${{ matrix.version }} - steps: - - name: Checkout thriftpy2 v${{ env.THRIFTPY2_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Thriftpy/thriftpy2 - ref: v${{ env.THRIFTPY2_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # aiohttp (needed only by test_aio_http.py) has no riscv64 wheels for - # cp314/cp314t or for musllinux on our registry; drop that one file - # rather than pull in a from-source aiohttp build across the matrix. - CIBW_TEST_REQUIRES: pytest>=6.1.1,<8.2.0 pytest-reraise pytest-asyncio - # On cp314t only, also drop the tests that fork a server via bare - # multiprocessing.Process then sleep(0.1) for it to be ready: CPython - # warns "use of fork() may lead to deadlocks" for a multi-threaded - # parent, and free-threaded CPython's extra runtime threads make that - # race the fixed sleep, so these intermittently see - # ConnectionRefusedError. The GIL builds (cp312/cp313/cp314) run them - # unmodified. One of the ignored files - # (test_all_protocols_binary_field.py) is the only one that calls - # multiprocessing.set_start_method('fork') at import time; on the - # other interpreters that side effect makes 'fork' the process-wide - # default for the whole pytest session. Skipping that file on - # cp314t leaves CPython 3.14's own new default, 'forkserver', in - # effect, which (unlike 'fork') pickles the Process target instead - # of just inheriting it via COW — so test_apache_json.py::test_client - # then fails to pickle its locally-defined run_server()/Handler - # (gotcha 283). Deselect just those two parametrized cases on - # cp314t; the test file's other, non-multiprocessing tests still run. - CIBW_TEST_COMMAND: >- - cd {project}/tests && pytest -v --ignore=test_aio_http.py - ${{ matrix.python == 'cp314t' && '--ignore=test_buffered_transport.py --ignore=test_all_protocols_binary_field.py --ignore=test_multiplexed.py --ignore=test_oneway.py --ignore=test_http.py --ignore=test_out_of_order_fields.py --ignore=test_rpc.py --ignore=test_protocol_cybinary.py --ignore=test_tracking.py --deselect "tests/test_apache_json.py::test_client[server_func0]" --deselect "tests/test_apache_json.py::test_client[server_func1]"' || '' }} + name: thriftpy2-${{ env.THRIFTPY2_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the C extensions made it into the wheel run: | @@ -111,15 +115,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: thriftpy2-${{ env.THRIFTPY2_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish thriftpy2 ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-timezonefinder.yml b/.github/workflows/build-timezonefinder.yml index eae44cba5084..56a042e56f7d 100644 --- a/.github/workflows/build-timezonefinder.yml +++ b/.github/workflows/build-timezonefinder.yml @@ -72,10 +72,7 @@ jobs: # wheel for cp311 on our registry yet, so cp311 skips the test below; # PIP_ONLY_BINARY keeps pip on our registry's cffi/numpy/h3 builds # rather than a newer sourceless PyPI release (gotcha 30). - cibw-environment: >- - BUILD_ABI3=true - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=cffi,numpy,h3 + cibw-environment-linux: "BUILD_ABI3=true PIP_ONLY_BINARY=cffi,numpy,h3" # Upstream's own repair-wheel-command also runs abi3audit via uvx, # which the riscv64 image doesn't carry; cibuildwheel's own default # audit-command already abi3audits every abi3-tagged wheel natively diff --git a/.github/workflows/build-tippecanoe.yml b/.github/workflows/build-tippecanoe.yml index 06831db643c7..4fca065e1b82 100644 --- a/.github/workflows/build-tippecanoe.yml +++ b/.github/workflows/build-tippecanoe.yml @@ -50,6 +50,48 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build tippecanoe ${{ matrix.version }} py2.py3-none-${{ matrix.libc }}_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + libc: [manylinux, musllinux] + include: + # The manylinux GCC links non-PIE at riscv64's 0x10000 (= mmap_min_addr); the segment + # auditwheel's patchelf prepends for the RPATH lands below it and the CLIs die at exec + # (gotcha 595). Alpine's GCC links PIE by default, so musllinux is unaffected. + - libc: manylinux + ldflags: -Wl,-Ttext-segment=0x200000 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "tippecanoe" + version: "${{ matrix.version }}" + repository: "nightlark/tippecanoe-pypi" + ref: "${{ matrix.version }}" + artifact-tag: "py2.py3-none-${{ matrix.libc }}_riscv64" + checkout-fetch-depth: 0 + # wheel.py-api = "py2.py3", so one build serves every interpreter. + cibw-build: "cp312-${{ matrix.libc }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # felt/tippecanoe's Makefile links sqlite3 and zlib; the image carries zlib + # already, so only sqlite needs installing. felt/tippecanoe's own LICENSE.md + # covers the CLI this wheel bundles; upstream's own wheels ship only this + # repo's LICENSE/NOTICE and never add it, so pull it in ourselves (gotcha 44: + # a LICEN[CS]E*-named file at the root needs no packaging change to be + # picked up). + cibw-before-all-linux: |- + if command -v dnf > /dev/null; then + dnf install -y sqlite sqlite-devel + elif command -v apk > /dev/null; then + apk add sqlite-dev + fi + curl -sL https://raw.githubusercontent.com/felt/tippecanoe/${{ matrix.version }}/LICENSE.md -o {project}/LICENSE.felt-tippecanoe + cibw-environment-linux: "LDFLAGS=\"${{ matrix.ldflags }}\"" + cibw-test-command: "python -c \"import importlib.metadata as m; f = sorted(p.name for p in m.files('tippecanoe') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'LICENSE.felt-tippecanoe', 'NOTICE'], f\" && tippecanoe --version" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: @@ -63,47 +105,14 @@ jobs: # (gotcha 595). Alpine's GCC links PIE by default, so musllinux is unaffected. - libc: manylinux ldflags: -Wl,-Ttext-segment=0x200000 - env: TIPPECANOE_VERSION: ${{ matrix.version }} - steps: - # This repo (not felt/tippecanoe, which has no Python packaging) is upstream for - # the `tippecanoe` PyPI distribution; its CMakeLists.txt downloads and `make`s the - # felt/tippecanoe CLI (source, not pre-built) at this same tag during the build. - - name: Checkout tippecanoe-pypi ${{ env.TIPPECANOE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: nightlark/tippecanoe-pypi - ref: ${{ env.TIPPECANOE_VERSION }} - fetch-depth: 0 - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # wheel.py-api = "py2.py3", so one build serves every interpreter. - only: cp312-${{ matrix.libc }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # felt/tippecanoe's Makefile links sqlite3 and zlib; the image carries zlib - # already, so only sqlite needs installing. felt/tippecanoe's own LICENSE.md - # covers the CLI this wheel bundles; upstream's own wheels ship only this - # repo's LICENSE/NOTICE and never add it, so pull it in ourselves (gotcha 44: - # a LICEN[CS]E*-named file at the root needs no packaging change to be - # picked up). - CIBW_BEFORE_ALL_LINUX: | - if command -v dnf > /dev/null; then - dnf install -y sqlite sqlite-devel - elif command -v apk > /dev/null; then - apk add sqlite-dev - fi - curl -sL https://raw.githubusercontent.com/felt/tippecanoe/${{ env.TIPPECANOE_VERSION }}/LICENSE.md -o {project}/LICENSE.felt-tippecanoe - CIBW_ENVIRONMENT_LINUX: LDFLAGS="${{ matrix.ldflags }}" - CIBW_TEST_COMMAND: >- - python -c "import importlib.metadata as m; f = sorted(p.name for p in m.files('tippecanoe') if '.dist-info/licenses/' in str(p)); assert f == ['LICENSE', 'LICENSE.felt-tippecanoe', 'NOTICE'], f" - && tippecanoe --version + name: tippecanoe-${{ env.TIPPECANOE_VERSION }}-py2.py3-none-${{ matrix.libc }}_riscv64 + path: wheelhouse - name: Check the wheel carries the binaries and both licences run: | @@ -116,15 +125,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: tippecanoe-${{ env.TIPPECANOE_VERSION }}-py2.py3-none-${{ matrix.libc }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish tippecanoe ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-tl2cgen.yml b/.github/workflows/build-tl2cgen.yml index 9c1d653726c9..800826be42bc 100644 --- a/.github/workflows/build-tl2cgen.yml +++ b/.github/workflows/build-tl2cgen.yml @@ -60,73 +60,80 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build tl2cgen ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "tl2cgen" + version: "${{ matrix.version }}" + repository: "dmlc/tl2cgen" + ref: "${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 180 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/tl2cgen/${{ matrix.version }}/0001-*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cp LICENSE python/LICENSE + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "python" + # The custom hatchling build hook tags the wheel py3-none- + # itself (sysconfig.get_platform()), so one build serves every interpreter. + cibw-build: "cp312-manylinux_riscv64" + # CMAKE_POLICY_VERSION_MINIMUM covers the vendored fmtlib's old cmake_minimum_required. + # `-include cstdint`: the FetchContent'd Treelite 4.1.2 (src/gtil/postprocessor.h) + # relies on arriving transitively, which GCC 13+'s libstdc++ no longer does. + cibw-environment-linux: "CMAKE_POLICY_VERSION_MINIMUM=3.5 CXXFLAGS=\"-include cstdint\"" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy" + cibw-test-sources: "tests/example_data" + # test_basic.py itself is not run: check_predictor() builds its DMatrix + # from a SciPy CSR matrix via np.array(..., copy=False, dtype=cast), + # which numpy 2 (the only line with a riscv64 wheel) rejects outright + # on any platform -- a tl2cgen/numpy2 gap, not a riscv64 one. + # DMatrix-from-dense-ndarray with no dtype override asks for no such cast. + cibw-test-command: |- + python3 - <<'PYEOF' + import numpy as np + import treelite, tl2cgen + + model = treelite.frontend.load_xgboost_model_legacy_binary( + 'tests/example_data/mushroom/mushroom.model') + tl2cgen.export_lib(model, toolchain='gcc', libpath='/tmp/mushroom.so', verbose=True) + predictor = tl2cgen.Predictor(libpath='/tmp/mushroom.so', verbose=True) + data = np.random.rand(5, predictor.num_feature).astype('float32') + out = predictor.predict(tl2cgen.DMatrix(data)) + assert out.size == 5 and np.isfinite(out).all(), out + print(out.flatten()) + PYEOF + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: TL2CGEN_VERSION: ${{ matrix.version }} - steps: - - name: Checkout tl2cgen ${{ env.TL2CGEN_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: dmlc/tl2cgen - ref: ${{ env.TL2CGEN_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # cmake/ExternalLibs.cmake FetchContents RapidJSON at the same v1.1.0 - # pin Treelite (also FetchContent'd here) uses; v1.1.0 fails to compile - # under GCC 14. See the patch for the override mechanism. - - name: Patch tl2cgen source - run: git apply python-wheels/patches/tl2cgen/${{ env.TL2CGEN_VERSION }}/0001-*.patch - - # hatchling's default license-files glob is rooted at pyproject.toml's - # own directory (python/), which has no LICENSE of its own -- only the - # repository root does. - - name: Stage licence text for packaging - run: cp LICENSE python/LICENSE - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: python - output-dir: wheelhouse/ - # The custom hatchling build hook tags the wheel py3-none- - # itself (sysconfig.get_platform()), so one build serves every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # CMAKE_POLICY_VERSION_MINIMUM covers the vendored fmtlib's old cmake_minimum_required. - # `-include cstdint`: the FetchContent'd Treelite 4.1.2 (src/gtil/postprocessor.h) - # relies on arriving transitively, which GCC 13+'s libstdc++ no longer does. - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ CMAKE_POLICY_VERSION_MINIMUM=3.5 CXXFLAGS="-include cstdint" - CIBW_TEST_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ PIP_ONLY_BINARY=numpy,scipy - CIBW_TEST_SOURCES: tests/example_data - # test_basic.py itself is not run: check_predictor() builds its DMatrix - # from a SciPy CSR matrix via np.array(..., copy=False, dtype=cast), - # which numpy 2 (the only line with a riscv64 wheel) rejects outright - # on any platform -- a tl2cgen/numpy2 gap, not a riscv64 one. - # DMatrix-from-dense-ndarray with no dtype override asks for no such cast. - CIBW_TEST_COMMAND: | - python3 - <<'PYEOF' - import numpy as np - import treelite, tl2cgen - - model = treelite.frontend.load_xgboost_model_legacy_binary( - 'tests/example_data/mushroom/mushroom.model') - tl2cgen.export_lib(model, toolchain='gcc', libpath='/tmp/mushroom.so', verbose=True) - predictor = tl2cgen.Predictor(libpath='/tmp/mushroom.so', verbose=True) - data = np.random.rand(5, predictor.num_feature).astype('float32') - out = predictor.predict(tl2cgen.DMatrix(data)) - assert out.size == 5 and np.isfinite(out).all(), out - print(out.flatten()) - PYEOF + name: tl2cgen-${{ env.TL2CGEN_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries libtl2cgen and a vendored libgomp run: | @@ -140,12 +147,6 @@ jobs: print("\n".join(n for n in names if ".so" in n)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: tl2cgen-${{ env.TL2CGEN_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -175,7 +176,7 @@ jobs: publish: name: Publish tl2cgen ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-tokie.yml b/.github/workflows/build-tokie.yml index 2770f0488e34..5e6e0d615334 100644 --- a/.github/workflows/build-tokie.yml +++ b/.github/workflows/build-tokie.yml @@ -49,58 +49,59 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build tokie ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "tokie" + version: "${{ matrix.version }}" + repository: "chonkie-inc/tokie" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + cp LICENSE-APACHE LICENSE-MIT crates/tokie-python/ + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "crates/tokie-python" + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # tokie ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + # test-sources resolves against the checkout root, not package-dir. + cibw-test-sources: "crates/tokie-python/tests" + # Upstream never wires this suite into its own CI (only the Rust + # accuracy suite runs there); it downloads tokenizer.json files from + # the Hugging Face Hub for every test, same shape as + # build-fastokens.yml and build-hf-xet.yml already rely on. + cibw-test-command: "python -c \"import tokie; assert tokie.tokie.__file__.endswith('.so'), tokie.tokie.__file__\" && cd crates/tokie-python && python -m pytest tests -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: TOKIE_VERSION: ${{ matrix.version }} - steps: - # Checked out at the workspace root: crates/tokie-python is a member of - # the tokie Cargo workspace and builds against the sibling tokie/pretokie - # crates. - - name: Checkout tokie v${{ env.TOKIE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: chonkie-inc/tokie - ref: v${{ env.TOKIE_VERSION }} - persist-credentials: false - - - name: Copy repo-root licences into the pyproject directory - # crates/tokie-python/pyproject.toml has a [project] table, so maturin's - # licence auto-glob (LICEN[CS]E*) roots at that directory, not the repo - # root where LICENSE-APACHE/LICENSE-MIT actually live (CLAUDE.md gotcha 146). - run: cp LICENSE-APACHE LICENSE-MIT crates/tokie-python/ - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: crates/tokie-python - output-dir: wheelhouse/ - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # tokie ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | - sh -s -- -y --profile minimal - CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' - CIBW_TEST_REQUIRES: pytest - # test-sources resolves against the checkout root, not package-dir. - CIBW_TEST_SOURCES: crates/tokie-python/tests - # Upstream never wires this suite into its own CI (only the Rust - # accuracy suite runs there); it downloads tokenizer.json files from - # the Hugging Face Hub for every test, same shape as - # build-fastokens.yml and build-hf-xet.yml already rely on. - CIBW_TEST_COMMAND: >- - python -c "import tokie; assert tokie.tokie.__file__.endswith('.so'), tokie.tokie.__file__" && - cd crates/tokie-python && python -m pytest tests -v + name: tokie-${{ env.TOKIE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the licences made it into the wheel run: | @@ -113,15 +114,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: tokie-${{ env.TOKIE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish tokie ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-toktok-rs.yml b/.github/workflows/build-toktok-rs.yml index 4b1a665fee86..a0b33602ddb4 100644 --- a/.github/workflows/build-toktok-rs.yml +++ b/.github/workflows/build-toktok-rs.yml @@ -69,9 +69,7 @@ jobs: cibw-before-all-linux: >- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal - cibw-environment-linux: >- - PATH="$PATH:$HOME/.cargo/bin" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" cibw-test-environment: >- PIP_ONLY_BINARY=:all: cibw-test-requires: pytest numpy tiktoken diff --git a/.github/workflows/build-toons.yml b/.github/workflows/build-toons.yml index e588fc95b167..e17eb90dcb32 100644 --- a/.github/workflows/build-toons.yml +++ b/.github/workflows/build-toons.yml @@ -49,6 +49,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build toons ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + include: + # pyo3's abi3-py37 feature gives one wheel for every GIL-ful + # interpreter; free-threaded builds disable abi3 and get their own + # (matches the cp37-abi3 + cp314-cp314t split upstream publishes). + - tag: cp37-abi3 + # Built on cp312 -- our floor -- and re-tested on the newer + # GIL-ful interpreters via find_compatible_wheel. + build: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 + - tag: cp314t + build: cp314t-manylinux_riscv64 + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "toons" + version: "${{ matrix.version }}" + repository: "alesanfra/toons" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.tag }}-manylinux_riscv64" + timeout-minutes: 90 + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + cibw-build: "${{ matrix.build }}" + # toons ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + # Test each wheel the way upstream does - run its pytest suite. All + # test deps are stdlib; tests live inside the checkout cibuildwheel + # builds, so reference them via {package}, not {project} (gotcha 5). + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest -v {package}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: @@ -65,37 +104,14 @@ jobs: build: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - tag: cp314t build: cp314t-manylinux_riscv64 - env: TOONS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout toons ${{ env.TOONS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: alesanfra/toons - ref: ${{ env.TOONS_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - env: - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - CIBW_BUILD: ${{ matrix.build }} - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # toons ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' - # Test each wheel the way upstream does - run its pytest suite. All - # test deps are stdlib; tests live inside the checkout cibuildwheel - # builds, so reference them via {package}, not {project} (gotcha 5). - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest -v {package}/tests + name: toons-${{ env.TOONS_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 + path: wheelhouse - name: Check the extension and license made it into the wheel run: | @@ -108,15 +124,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: toons-${{ env.TOONS_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish toons ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-toppra.yml b/.github/workflows/build-toppra.yml index 943f5f12d125..7a91ffc7c68c 100644 --- a/.github/workflows/build-toppra.yml +++ b/.github/workflows/build-toppra.yml @@ -47,57 +47,52 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build toppra ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "toppra" + version: "${{ matrix.version }}" + repository: "hungpham2511/toppra" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + cp LICENSE python/ + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "./python" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's tox env runs `invoke install-solvers` (tasks.py), which builds their qpOASES fork for the qpoases/hotqpoases solver wrappers. + cibw-before-test: "pip install cython numpy setuptools && git clone https://github.com/hungpham2511/qpOASES.git /tmp/tox-qpoases && git -C /tmp/tox-qpoases checkout fa86c1ce7782c8f4e6784c67b54a71760cd3a334 && mkdir /tmp/tox-qpoases/bin && make -C /tmp/tox-qpoases -j\"$(nproc)\" && pip install --no-build-isolation /tmp/tox-qpoases/interfaces/python" + # python/requirements.txt minus cvxpy (no riscv64 wheel yet) and its PyYAML/msgpack ceilings, which predate cp312; pandas ships no cp314t riscv64 wheel. + cibw-test-requires: "pytest cvxopt msgpack pyyaml tabulate ${{ matrix.python != 'cp314t' && 'pandas' || '' }}" + cibw-test-sources: "tests pytest.ini" + cibw-test-command: "pytest tests --ignore=tests/tests/constraint/test_joint_velocity.py --ignore=tests/tests/lpsolvers/seidel/test_lp2d.py --ignore=tests/tests/solverwrapper/test_basic_can_linear.py --ignore=tests/tests/solverwrapper/test_basic_conic_can_linear.py ${{ matrix.python == 'cp314t' && '--ignore=tests/tests/retime/robustness' || '' }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: TOPPRA_VERSION: ${{ matrix.version }} - steps: - - name: Checkout toppra ${{ env.TOPPRA_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: hungpham2511/toppra - ref: ${{ env.TOPPRA_VERSION }} - persist-credentials: false - - # setup.py lives in python/, so setuptools' default licence glob never sees the root LICENSE (gotcha 86). - - name: Stage the project licence next to setup.py - run: cp LICENSE python/ - - - name: Build and test wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: ./python - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Upstream's tox env runs `invoke install-solvers` (tasks.py), which builds their qpOASES fork for the qpoases/hotqpoases solver wrappers. - CIBW_BEFORE_TEST: >- - pip install cython numpy setuptools && - git clone https://github.com/hungpham2511/qpOASES.git /tmp/tox-qpoases && - git -C /tmp/tox-qpoases checkout fa86c1ce7782c8f4e6784c67b54a71760cd3a334 && - mkdir /tmp/tox-qpoases/bin && - make -C /tmp/tox-qpoases -j"$(nproc)" && - pip install --no-build-isolation /tmp/tox-qpoases/interfaces/python - # python/requirements.txt minus cvxpy (no riscv64 wheel yet) and its PyYAML/msgpack ceilings, which predate cp312; pandas ships no cp314t riscv64 wheel. - CIBW_TEST_REQUIRES: >- - pytest cvxopt msgpack pyyaml tabulate - ${{ matrix.python != 'cp314t' && 'pandas' || '' }} - CIBW_TEST_SOURCES: tests pytest.ini - CIBW_TEST_COMMAND: >- - pytest tests - --ignore=tests/tests/constraint/test_joint_velocity.py - --ignore=tests/tests/lpsolvers/seidel/test_lp2d.py - --ignore=tests/tests/solverwrapper/test_basic_can_linear.py - --ignore=tests/tests/solverwrapper/test_basic_conic_can_linear.py - ${{ matrix.python == 'cp314t' && '--ignore=tests/tests/retime/robustness' || '' }} + name: toppra-${{ matrix.version }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships both compiled extensions and the licence run: | @@ -110,15 +105,9 @@ jobs: print("ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: toppra-${{ matrix.version }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish toppra ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-torchcodec.yml b/.github/workflows/build-torchcodec.yml index 1e2493fbe796..77f4e3cc424a 100644 --- a/.github/workflows/build-torchcodec.yml +++ b/.github/workflows/build-torchcodec.yml @@ -57,6 +57,110 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build torchcodec ${{ matrix.version }} cp${{ matrix.python-version }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # Match torch's own riscv64 matrix on the registry: torchcodec's pybind11 module is + # per-ABI, so there is no single abi3 wheel even though it targets torch's stable ABI. + # See https://pypi.riseproject.dev/python-wheels/development.html#target-python-versions + python-version: [312, 313, 314, 314t] + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "torchcodec" + version: "${{ matrix.version }}" + repository: "pytorch/torchcodec" + ref: "v${{ matrix.version }}" + artifact-tag: "cp${{ matrix.python-version }}-manylinux_riscv64" + timeout-minutes: 360 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/torchcodec/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "cp${{ matrix.python-version }}-manylinux_riscv64" + # setup is scikit-build-core driving CMake, which resolves Torch_DIR by running + # `import torch` in the build interpreter; torch only exists on our registry, so it + # cannot be declared in build-system.requires and isolation has to be off. + cibw-build-frontend: "pip; args: --no-build-isolation" + # auditwheel grafts libjpeg-turbo/libpng/libwebp/zlib into the wheel, so their + # licence texts have to travel with it (the rpm that owns each bundled .so is + # resolved rather than hardcoded; %license files are dropped by the image's + # tsflags=nodocs and come back with an explicit reinstall). LICENSE.* is what the + # patched pyproject.toml globs into .dist-info/licenses/. + cibw-before-all: |- + set -ex + dnf install -y --setopt=tsflags= pkgconfig libjpeg-turbo-devel libpng-devel libwebp-devel zlib-devel + devel=$(rpm -q --whatprovides --qf '%{NAME}\n' libjpeg-turbo-devel libpng-devel libwebp-devel zlib-devel | sort -u) + libs=$(rpm -ql $devel | grep -E '\.so$' | xargs -r readlink -f) + pkgs=$(rpm -qf --qf '%{NAME}\n' $libs | grep -E '^[A-Za-z0-9._+-]+$' | sort -u) + dnf reinstall -y --setopt=tsflags= $pkgs || true + for p in $pkgs; do + for f in /usr/share/licenses/$p/*; do + [ -f "$f" ] || continue + cp "$f" "{project}/LICENSE.$p.${f##*/}" + done + done + ls {project}/LICENSE.* + mkdir -p /tmp/ffmpeg + curl -fsSL "https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n${FFMPEG_VERSION}.tar.gz" | tar xz --strip-components=1 -C /tmp/ffmpeg + cd /tmp/ffmpeg + ./configure --prefix=/usr/local --disable-static --enable-shared --enable-pic --disable-doc + make -j"$(nproc)" install + ldconfig + cibw-before-build: "pip install --only-binary=:all: torch>=2.11 \"scikit-build-core>=0.10\" pybind11 ninja setuptools wheel" + # I_CONFIRM_THIS_IS_NOT_A_LICENSE_VIOLATION is upstream's own escape hatch for + # wheels built against an FFmpeg that is not their S3 one; the guard exists to stop + # a GPL FFmpeg being linked, and the build above is LGPL. + # AVIF and HEIC are off because neither can be had on riscv64: libavif comes from + # the same S3 bucket and libheif is packaged in neither Rocky 10 nor a riscv64 EPEL. + # decode_avif/decode_heic then raise an actionable error instead of failing the build. + cibw-environment-linux: "FFMPEG_VERSION=6.1.6 BUILD_VERSION=${{ matrix.version }} I_CONFIRM_THIS_IS_NOT_A_LICENSE_VIOLATION=1 TORCHCODEC_BUILD_AVIF=0 TORCHCODEC_BUILD_HEIC=0 TORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR=1 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" + # Same exclude list as upstream's packaging/repair_wheel.py: FFmpeg is a runtime + # dependency the user supplies, and libtorch/libc10/libgomp come from the torch + # wheel, which is imported (RTLD_GLOBAL) before torchcodec loads its own libraries. + cibw-repair-wheel-command: "auditwheel repair -w {dest_dir} {wheel} --exclude 'libavcodec*' --exclude 'libavdevice*' --exclude 'libavfilter*' --exclude 'libavformat*' --exclude 'libavutil*' --exclude 'libswresample*' --exclude 'libswscale*' --exclude 'libpostproc*' --exclude 'libtorch*' --exclude 'libc10*' --exclude libgomp.so.1" + # pytest<9.2: from 9.2 pytest.approx() iterates its expected value to look for + # Decimals, and the sampler tests pass it a 0-d torch tensor ("iteration over a + # 0-d tensor"). + cibw-test-requires: "torch>=2.11 numpy pytest<9.2 pillow" + # pyproject.toml is staged alongside test/ purely for its [tool.pytest.ini_options] + # (the needs_* markers and the 'not slow' default); src/ deliberately is not, which + # is what upstream's packaging/remove_src.sh achieves before its own test jobs. + cibw-test-sources: "test pyproject.toml" + # FAIL_WITHOUT_ turns a missing image codec from a silent skip into a + # failure, for the three we do build. test_transform_ops.py imports torchvision at + # module scope and pypi.riseproject.dev has no riscv64 torchvision yet. + # Upstream tests against conda-forge's GPL FFmpeg; the LGPL build above has only + # FFmpeg's built-in codecs - no H.264/HEVC/VP9/AV1/MP3 encoder at all (libx264 and + # libx265 need --enable-gpl) and an AV1 decoder that only works through a hwaccel - + # so the tests that mux a real video, shell out to the ffmpeg CLI or ask for MP3 are + # dropped, smoke_test.py included: it encodes H.264 yuv444p to build every one of its + # fixtures. test_logging.py asserts an empty subprocess stderr, which torch's + # libcpuinfo pollutes on this runner by reading core_id -1 from /sys. + # test_seek_on_non_seekable_source_raises (0.17.0) is dropped for the same + # reason, and because it hangs: the ffmpeg CLI that should stream libx264 into + # its named pipe exits at once, so opening the pipe for reading blocks for + # good (every leg sat there until the 6 hour job limit). + # test_color_tags_describe_the_samples (0.17.0, new non-regression test) hits + # the same gap (gotcha 429): it encodes with pixel_format="yuv444p" and no + # explicit codec, so our GPL-less FFmpeg falls back to the container's built-in + # mpeg4 encoder, which only supports yuv420p - + # "Specified pixel format yuv444p is not supported by the mpeg4 encoder". + cibw-test-command: "FAIL_WITHOUT_JPEG=1 FAIL_WITHOUT_PNG=1 FAIL_WITHOUT_WEBP=1 pytest --ignore=test/test_transform_ops.py --ignore=test/smoke_test.py --ignore=test/test_logging.py -k \"not test_get_frame_at_av1 and not ((test_audio_against_cli or test_multiple_audio_formats or test_audio_to_file_vs_to_file_like) and mp3) and not (test_add_video_and_encode_frames or test_add_audio_and_video_and_encode or test_multiple_video_streams_and_audio or test_video_round_trip or test_video_to_file_vs_to_file_like or test_video_contiguity or test_video_against_ffmpeg_cli or test_fragmented_mp4 or test_codec_parameter_utilized or test_codec_spec_vs_impl_equivalence or test_extra_options_errors or test_extra_options_utilized or test_crf_out_of_range_errors or test_invalid_preset_errors or test_to_file_like_real_file_video or (test_to_file_like_custom_file_object and not audio) or test_add_audio_unsupported_num_channels_errors or test_add_audio_invalid_out_sample_rate_errors or test_seek_on_non_seekable_source_raises or test_color_tags_describe_the_samples)\" test" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 360 strategy: @@ -67,142 +171,14 @@ jobs: # per-ABI, so there is no single abi3 wheel even though it targets torch's stable ABI. # See https://pypi.riseproject.dev/python-wheels/development.html#target-python-versions python-version: [312, 313, 314, 314t] - env: TORCHCODEC_VERSION: ${{ matrix.version }} - steps: - - name: Checkout torchcodec v${{ env.TORCHCODEC_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pytorch/torchcodec - ref: v${{ env.TORCHCODEC_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - - name: Patch torchcodec source - run: git apply python-wheels/patches/torchcodec/${{ env.TORCHCODEC_VERSION }}/00*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_BUILD: "cp${{ matrix.python-version }}-manylinux_riscv64" - # setup is scikit-build-core driving CMake, which resolves Torch_DIR by running - # `import torch` in the build interpreter; torch only exists on our registry, so it - # cannot be declared in build-system.requires and isolation has to be off. - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - # auditwheel grafts libjpeg-turbo/libpng/libwebp/zlib into the wheel, so their - # licence texts have to travel with it (the rpm that owns each bundled .so is - # resolved rather than hardcoded; %license files are dropped by the image's - # tsflags=nodocs and come back with an explicit reinstall). LICENSE.* is what the - # patched pyproject.toml globs into .dist-info/licenses/. - CIBW_BEFORE_ALL: | - set -ex - dnf install -y --setopt=tsflags= pkgconfig libjpeg-turbo-devel libpng-devel libwebp-devel zlib-devel - devel=$(rpm -q --whatprovides --qf '%{NAME}\n' libjpeg-turbo-devel libpng-devel libwebp-devel zlib-devel | sort -u) - libs=$(rpm -ql $devel | grep -E '\.so$' | xargs -r readlink -f) - pkgs=$(rpm -qf --qf '%{NAME}\n' $libs | grep -E '^[A-Za-z0-9._+-]+$' | sort -u) - dnf reinstall -y --setopt=tsflags= $pkgs || true - for p in $pkgs; do - for f in /usr/share/licenses/$p/*; do - [ -f "$f" ] || continue - cp "$f" "{project}/LICENSE.$p.${f##*/}" - done - done - ls {project}/LICENSE.* - mkdir -p /tmp/ffmpeg - curl -fsSL "https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n${FFMPEG_VERSION}.tar.gz" | tar xz --strip-components=1 -C /tmp/ffmpeg - cd /tmp/ffmpeg - ./configure --prefix=/usr/local --disable-static --enable-shared --enable-pic --disable-doc - make -j"$(nproc)" install - ldconfig - CIBW_BEFORE_BUILD: >- - pip install --only-binary=:all: - torch>=2.11 "scikit-build-core>=0.10" pybind11 ninja setuptools wheel - # I_CONFIRM_THIS_IS_NOT_A_LICENSE_VIOLATION is upstream's own escape hatch for - # wheels built against an FFmpeg that is not their S3 one; the guard exists to stop - # a GPL FFmpeg being linked, and the build above is LGPL. - # AVIF and HEIC are off because neither can be had on riscv64: libavif comes from - # the same S3 bucket and libheif is packaged in neither Rocky 10 nor a riscv64 EPEL. - # decode_avif/decode_heic then raise an actionable error instead of failing the build. - CIBW_ENVIRONMENT: >- - FFMPEG_VERSION=${{ env.FFMPEG_VERSION }} - BUILD_VERSION=${{ env.TORCHCODEC_VERSION }} - I_CONFIRM_THIS_IS_NOT_A_LICENSE_VIOLATION=1 - TORCHCODEC_BUILD_AVIF=0 - TORCHCODEC_BUILD_HEIC=0 - TORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR=1 - PKG_CONFIG_PATH=/usr/local/lib/pkgconfig - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # Same exclude list as upstream's packaging/repair_wheel.py: FFmpeg is a runtime - # dependency the user supplies, and libtorch/libc10/libgomp come from the torch - # wheel, which is imported (RTLD_GLOBAL) before torchcodec loads its own libraries. - CIBW_REPAIR_WHEEL_COMMAND: >- - auditwheel repair -w {dest_dir} {wheel} - --exclude 'libavcodec*' - --exclude 'libavdevice*' - --exclude 'libavfilter*' - --exclude 'libavformat*' - --exclude 'libavutil*' - --exclude 'libswresample*' - --exclude 'libswscale*' - --exclude 'libpostproc*' - --exclude 'libtorch*' - --exclude 'libc10*' - --exclude libgomp.so.1 - # pytest<9.2: from 9.2 pytest.approx() iterates its expected value to look for - # Decimals, and the sampler tests pass it a 0-d torch tensor ("iteration over a - # 0-d tensor"). - CIBW_TEST_REQUIRES: torch>=2.11 numpy pytest<9.2 pillow - # pyproject.toml is staged alongside test/ purely for its [tool.pytest.ini_options] - # (the needs_* markers and the 'not slow' default); src/ deliberately is not, which - # is what upstream's packaging/remove_src.sh achieves before its own test jobs. - CIBW_TEST_SOURCES: test pyproject.toml - # FAIL_WITHOUT_ turns a missing image codec from a silent skip into a - # failure, for the three we do build. test_transform_ops.py imports torchvision at - # module scope and pypi.riseproject.dev has no riscv64 torchvision yet. - # Upstream tests against conda-forge's GPL FFmpeg; the LGPL build above has only - # FFmpeg's built-in codecs - no H.264/HEVC/VP9/AV1/MP3 encoder at all (libx264 and - # libx265 need --enable-gpl) and an AV1 decoder that only works through a hwaccel - - # so the tests that mux a real video, shell out to the ffmpeg CLI or ask for MP3 are - # dropped, smoke_test.py included: it encodes H.264 yuv444p to build every one of its - # fixtures. test_logging.py asserts an empty subprocess stderr, which torch's - # libcpuinfo pollutes on this runner by reading core_id -1 from /sys. - # test_seek_on_non_seekable_source_raises (0.17.0) is dropped for the same - # reason, and because it hangs: the ffmpeg CLI that should stream libx264 into - # its named pipe exits at once, so opening the pipe for reading blocks for - # good (every leg sat there until the 6 hour job limit). - # test_color_tags_describe_the_samples (0.17.0, new non-regression test) hits - # the same gap (gotcha 429): it encodes with pixel_format="yuv444p" and no - # explicit codec, so our GPL-less FFmpeg falls back to the container's built-in - # mpeg4 encoder, which only supports yuv420p - - # "Specified pixel format yuv444p is not supported by the mpeg4 encoder". - CIBW_TEST_COMMAND: >- - FAIL_WITHOUT_JPEG=1 FAIL_WITHOUT_PNG=1 FAIL_WITHOUT_WEBP=1 pytest - --ignore=test/test_transform_ops.py - --ignore=test/smoke_test.py - --ignore=test/test_logging.py - -k "not test_get_frame_at_av1 - and not ((test_audio_against_cli or test_multiple_audio_formats - or test_audio_to_file_vs_to_file_like) and mp3) - and not (test_add_video_and_encode_frames or test_add_audio_and_video_and_encode - or test_multiple_video_streams_and_audio or test_video_round_trip - or test_video_to_file_vs_to_file_like or test_video_contiguity - or test_video_against_ffmpeg_cli or test_fragmented_mp4 - or test_codec_parameter_utilized or test_codec_spec_vs_impl_equivalence - or test_extra_options_errors or test_extra_options_utilized - or test_crf_out_of_range_errors or test_invalid_preset_errors - or test_to_file_like_real_file_video - or (test_to_file_like_custom_file_object and not audio) - or test_add_audio_unsupported_num_channels_errors - or test_add_audio_invalid_out_sample_rate_errors - or test_seek_on_non_seekable_source_raises - or test_color_tags_describe_the_samples)" - test + name: torchcodec-${{ env.TORCHCODEC_VERSION }}-cp${{ matrix.python-version }}-manylinux_riscv64 + path: wheelhouse - name: Check the wheel bundles the image codecs and no FFmpeg run: | @@ -220,15 +196,9 @@ jobs: print("\n".join(n for n in names if ".so" in n or "licenses/" in n)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: torchcodec-${{ env.TORCHCODEC_VERSION }}-cp${{ matrix.python-version }}-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish torchcodec ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-torchrl.yml b/.github/workflows/build-torchrl.yml index e618efb5b66b..f9ab9562fba2 100644 --- a/.github/workflows/build-torchrl.yml +++ b/.github/workflows/build-torchrl.yml @@ -87,9 +87,7 @@ jobs: # package version (v0.14.1 -> 0.14.1), so no translation is needed. # PIP_EXTRA_INDEX_URL lets torch/tensordict (and the before-build # torch itself) resolve from our registry inside the container. - cibw-environment: >- - BUILD_VERSION=${{ matrix.version }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "BUILD_VERSION=${{ matrix.version }}" # torchrl's extension links libtorch/libc10/libgomp etc., which are # provided by the torch wheel at runtime (torch is imported before # torchrl and loads them RTLD_GLOBAL). Exclude them from the repair diff --git a/.github/workflows/build-torchtext.yml b/.github/workflows/build-torchtext.yml index 1080593e66b3..b4723f9b5807 100644 --- a/.github/workflows/build-torchtext.yml +++ b/.github/workflows/build-torchtext.yml @@ -54,87 +54,87 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build torchtext ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "torchtext" + version: "${{ matrix.version }}" + repository: "pytorch/text" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 180 + checkout-submodules: "recursive" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/torchtext/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cp third_party/re2/LICENSE LICENSE.re2 + cp third_party/double-conversion/LICENSE LICENSE.double-conversion + cp third_party/utf8proc/LICENSE.md LICENSE.utf8proc.md + cp third_party/sentencepiece/LICENSE LICENSE.sentencepiece + for dep in absl darts_clone esaxx protobuf-lite; do + cp "third_party/sentencepiece/third_party/$dep/LICENSE" "LICENSE.sentencepiece-$dep" + done + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py imports torch at module scope and declares no [build-system], so torch is + # preinstalled from our registry and isolation is off; setup.py also runs + # `git submodule update` on the root-owned copy of the checkout. + cibw-build-frontend: "pip; args: --no-build-isolation" + cibw-before-build: "git config --global --add safe.directory '*' && pip install --only-binary=:all: torch==2.14.0 setuptools wheel ninja" + # PYTORCH_VERSION is appended to setup.py's `torch>=`, so the upper bound keeps + # pip off a torch whose C++ ABI the extension was not built against. + # The vendored re2/sentencepiece/utf8proc/double-conversion predate CMake 3.5. + cibw-environment-linux: "BUILD_VERSION=${{ matrix.version }} PYTORCH_VERSION=\"2.14.0,<2.15\" CMAKE_POLICY_VERSION_MINIMUM=3.5" + # libtorch/libc10 come from the torch wheel, and libtorchtext.so is loaded by + # torchtext itself before _torchtext is imported. + cibw-repair-wheel-command: "auditwheel repair -w {dest_dir} {wheel} --exclude libtorchtext.so --exclude 'libtorch*' --exclude 'libc10*' --exclude libgomp.so.1" + cibw-test-requires: "torch==2.14.0 numpy pytest parameterized expecttest regex" + cibw-test-sources: "test" + # The save/load tests call a bare torch.load() on pickled torchtext objects, written + # for torch 2.3; torch>=2.6 defaults it to weights_only=True, which rejects them. + cibw-test-environment: "TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1" + # Upstream's wheel job runs only the smoke test; the unit tests that exercise the + # C++ vocab/tokenizer ops run too. datasets/models/data need network downloads or + # spacy/nltk, which upstream's conda-based unit-test job installs. + cibw-test-command: "python test/smoke_tests/smoke_tests.py && pytest test/torchtext_unittest/test_vocab.py test/torchtext_unittest/test_functional.py test/torchtext_unittest/test_transforms.py test/torchtext_unittest/csrc" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: TORCHTEXT_VERSION: ${{ matrix.version }} - steps: - - name: Checkout torchtext v${{ env.TORCHTEXT_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: pytorch/text - ref: v${{ env.TORCHTEXT_VERSION }} - submodules: recursive - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch torchtext source - run: git apply python-wheels/patches/torchtext/${{ env.TORCHTEXT_VERSION }}/00*.patch - - # The wheel statically links these vendored libraries; setuptools' default - # license_files glob picks up LICENSE.* at the project root. - - name: Stage the vendored libraries' licences - run: | - cp third_party/re2/LICENSE LICENSE.re2 - cp third_party/double-conversion/LICENSE LICENSE.double-conversion - cp third_party/utf8proc/LICENSE.md LICENSE.utf8proc.md - cp third_party/sentencepiece/LICENSE LICENSE.sentencepiece - for dep in absl darts_clone esaxx protobuf-lite; do - cp "third_party/sentencepiece/third_party/$dep/LICENSE" "LICENSE.sentencepiece-$dep" - done - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - # setup.py imports torch at module scope and declares no [build-system], so torch is - # preinstalled from our registry and isolation is off; setup.py also runs - # `git submodule update` on the root-owned copy of the checkout. - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - CIBW_BEFORE_BUILD: >- - git config --global --add safe.directory '*' && - pip install --only-binary=:all: torch==${{ env.TORCH_VERSION }} setuptools wheel ninja - # PYTORCH_VERSION is appended to setup.py's `torch>=`, so the upper bound keeps - # pip off a torch whose C++ ABI the extension was not built against. - # The vendored re2/sentencepiece/utf8proc/double-conversion predate CMake 3.5. - CIBW_ENVIRONMENT: >- - BUILD_VERSION=${{ env.TORCHTEXT_VERSION }} - PYTORCH_VERSION="${{ env.TORCH_VERSION }},<2.15" - CMAKE_POLICY_VERSION_MINIMUM=3.5 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # libtorch/libc10 come from the torch wheel, and libtorchtext.so is loaded by - # torchtext itself before _torchtext is imported. - CIBW_REPAIR_WHEEL_COMMAND: >- - auditwheel repair -w {dest_dir} {wheel} - --exclude libtorchtext.so - --exclude 'libtorch*' - --exclude 'libc10*' - --exclude libgomp.so.1 - CIBW_TEST_REQUIRES: torch==${{ env.TORCH_VERSION }} numpy pytest parameterized expecttest regex - CIBW_TEST_SOURCES: test - # The save/load tests call a bare torch.load() on pickled torchtext objects, written - # for torch 2.3; torch>=2.6 defaults it to weights_only=True, which rejects them. - CIBW_TEST_ENVIRONMENT: TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 - # Upstream's wheel job runs only the smoke test; the unit tests that exercise the - # C++ vocab/tokenizer ops run too. datasets/models/data need network downloads or - # spacy/nltk, which upstream's conda-based unit-test job installs. - CIBW_TEST_COMMAND: >- - python test/smoke_tests/smoke_tests.py && - pytest test/torchtext_unittest/test_vocab.py - test/torchtext_unittest/test_functional.py - test/torchtext_unittest/test_transforms.py - test/torchtext_unittest/csrc + name: torchtext-${{ env.TORCHTEXT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel carries the vendored licences and no libtorch run: | @@ -151,15 +151,9 @@ jobs: raise SystemExit(f"error: {unwanted} must not be bundled in {sys.argv[1]}") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: torchtext-${{ env.TORCHTEXT_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish torchtext ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-torchvision.yml b/.github/workflows/build-torchvision.yml index f1857fe1d32c..a5ce63dc0257 100644 --- a/.github/workflows/build-torchvision.yml +++ b/.github/workflows/build-torchvision.yml @@ -90,9 +90,7 @@ jobs: # BUILD_VERSION pins a clean wheel version; without it setup.py # keeps version.txt's own dev suffix (0.29.0a0). The tag maps 1:1 to # the package version (v0.29.0 -> 0.29.0), so no translation needed. - cibw-environment: >- - BUILD_VERSION=${{ matrix.version }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + cibw-environment-linux: "BUILD_VERSION=${{ matrix.version }}" # torchvision's extension links libtorch/libc10/libgomp etc., which # are provided by the torch wheel at runtime (torch is imported # before torchvision and loads them RTLD_GLOBAL). Exclude them from diff --git a/.github/workflows/build-tosa-tools.yml b/.github/workflows/build-tosa-tools.yml index 7c0246984e75..25e388b8bf6b 100644 --- a/.github/workflows/build-tosa-tools.yml +++ b/.github/workflows/build-tosa-tools.yml @@ -48,91 +48,106 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build tosa-tools ${{ matrix.version }} manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "tosa-tools" + version: "${{ matrix.version }}" + repository: "${{ github.repository }}" + ref: "${{ github.sha }}" + artifact-tag: "cibw-wheels-manylinux_riscv64" + timeout-minutes: 1440 + pre-build: |- + export TOSA_TOOLS_VERSION='${{ matrix.version }}' + IFS=. read -r year month patch <<< "${TOSA_TOOLS_VERSION}" + printf -v ref 'v%s.%02d.%s' "${year}" "${month}" "${patch}" + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + git clone --depth 1 --branch "$ref" https://gitlab.arm.com/tosa/tosa-tools.git tosa-tools + echo "LLVM_COMMIT=$(sed -n 's/^ *value: "\([0-9a-f]*\)".*/\1/p' tosa-tools/ci/vars/llvm-sha.yml)" >> "$GITHUB_ENV" + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + set -euo pipefail + curl -fsSL --retry 5 "https://raw.githubusercontent.com/llvm/llvm-project/${LLVM_COMMIT}/mlir/LICENSE.TXT" -o LICENSE.llvm + curl -fsSL --retry 5 https://raw.githubusercontent.com/google/flatbuffers/v25.2.10/LICENSE -o LICENSE.flatbuffers + curl -fsSL --retry 5 https://raw.githubusercontent.com/google/googletest/v1.14.0/LICENSE -o LICENSE.googletest + curl -fsSL --retry 5 https://raw.githubusercontent.com/pybind/pybind11/v3.0.4/LICENSE -o LICENSE.pybind11 + curl -fsSL --retry 5 https://raw.githubusercontent.com/nlohmann/json/v3.11.3/LICENSE.MIT -o LICENSE.nlohmann-json + curl -fsSL --retry 5 https://raw.githubusercontent.com/jarro2783/cxxopts/v3.3.1/LICENSE -o LICENSE.cxxopts + cp reference_model/reference_model/src/ops/math/COPYRIGHT LICENSE.musl + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_TOSA_TOOLS=${{ matrix.version }} SKBUILD_WHEEL_LICENSE_FILES=\"LICENSES/Apache-2.0.txt;LICENSE.*\"" + cibw-environment-pass-linux: "LLVM_COMMIT" + cibw-package-dir: "tosa-tools" + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # Upstream's cmdflow.py builds all of LLVM/MLIR for every backend. Build only the + # libraries tosa-opt links (its CMake LIBS, closed over their link interfaces), for + # the host backend, to fit the riscv64 runner; no zstd, as upstream's tosa-opt has none. + cibw-before-all-linux: |- + set -euxo pipefail + manylinux-install-clang -v v22.1.6.0 + rm -rf /var/cache/dnf /project/llvm-project + curl -fL --retry 5 --retry-all-errors --retry-delay 10 -o /tmp/llvm.tar.gz "https://codeload.github.com/llvm/llvm-project/tar.gz/${LLVM_COMMIT}" + tar -xzf /tmp/llvm.tar.gz -C /project + rm /tmp/llvm.tar.gz + mv /project/llvm-project-* /project/llvm-project + cd /project/llvm-project + cmake -S llvm -B build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_APPEND_VC_REV=OFF -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_ENABLE_ASSERTIONS=ON \ + -DLLVM_TARGETS_TO_BUILD=host -DLLVM_ENABLE_ZSTD=OFF + targets="$(/opt/python/cp312-cp312/bin/python - MLIRParser MLIRSupport MLIRIR MLIROptLib MLIRPass MLIRTosaDialect MLIRTosaTransforms MLIRFuncDialect <<'EOF' + import re, sys + text = open("build/lib/cmake/llvm/LLVMExports.cmake").read() + open("build/lib/cmake/mlir/MLIRTargets.cmake").read() + kind = dict(re.findall(r"^add_library\((\S+) (\S+) IMPORTED\)", text, re.M)) + deps = dict(re.findall(r'set_target_properties\((\S+) PROPERTIES\n INTERFACE_LINK_LIBRARIES "([^"]*)"', text)) + todo, seen = sys.argv[1:], set() + while todo: + name = todo.pop() + if name in kind and name not in seen: + seen.add(name) + todo += re.findall(r"[\w-]+", deps.get(name, "")) + print(" ".join(sorted(n for n in seen if kind[n] != "INTERFACE"))) + EOF + )" + cmake --build build -j "$(nproc)" --target mlir-headers mlir-tblgen ${targets} + cibw-config-settings: "cmake.define.TOSA_ENABLE_PROJECTS=serialization,reference_model,mlir_translator cmake.define.MLIR_TOSA_OPT=ON cmake.define.MLIR_DIR=/project/llvm-project/build/lib/cmake/mlir cmake.define.LLVM_DIR=/project/llvm-project/build/lib/cmake/llvm" + cibw-test-command: "python -c \"import tosa_reference_model, tosa_serializer; print(tosa_reference_model.__file__); print(tosa_serializer.__file__)\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 1440 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: TOSA_TOOLS_VERSION: ${{ matrix.version }} - steps: - # Upstream zero-pads the month in its tags (v2026.08.0), not in the wheel version. - - id: tag - run: | - IFS=. read -r year month patch <<< "${TOSA_TOOLS_VERSION}" - printf 'ref=v%s.%02d.%s\n' "${year}" "${month}" "${patch}" >> "$GITHUB_OUTPUT" - - - name: Checkout tosa-tools ${{ steps.tag.outputs.ref }} - run: | - git clone --depth 1 --branch "${{ steps.tag.outputs.ref }}" https://gitlab.arm.com/tosa/tosa-tools.git tosa-tools - echo "LLVM_COMMIT=$(sed -n 's/^ *value: "\([0-9a-f]*\)".*/\1/p' tosa-tools/ci/vars/llvm-sha.yml)" >> "$GITHUB_ENV" - - # The wheel links LLVM/MLIR, FlatBuffers, googletest, pybind11, nlohmann/json, cxxopts - # and musl-derived libm code; upstream's wheel ships none of their notices. - - name: Stage the bundled dependencies' licences - working-directory: tosa-tools - run: | - set -euo pipefail - curl -fsSL --retry 5 "https://raw.githubusercontent.com/llvm/llvm-project/${LLVM_COMMIT}/mlir/LICENSE.TXT" -o LICENSE.llvm - curl -fsSL --retry 5 https://raw.githubusercontent.com/google/flatbuffers/v25.2.10/LICENSE -o LICENSE.flatbuffers - curl -fsSL --retry 5 https://raw.githubusercontent.com/google/googletest/v1.14.0/LICENSE -o LICENSE.googletest - curl -fsSL --retry 5 https://raw.githubusercontent.com/pybind/pybind11/v3.0.4/LICENSE -o LICENSE.pybind11 - curl -fsSL --retry 5 https://raw.githubusercontent.com/nlohmann/json/v3.11.3/LICENSE.MIT -o LICENSE.nlohmann-json - curl -fsSL --retry 5 https://raw.githubusercontent.com/jarro2783/cxxopts/v3.3.1/LICENSE -o LICENSE.cxxopts - cp reference_model/reference_model/src/ops/math/COPYRIGHT LICENSE.musl - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - package-dir: tosa-tools - output-dir: wheelhouse - env: - CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT_PASS_LINUX: LLVM_COMMIT - # Upstream's cmdflow.py builds all of LLVM/MLIR for every backend. Build only the - # libraries tosa-opt links (its CMake LIBS, closed over their link interfaces), for - # the host backend, to fit the riscv64 runner; no zstd, as upstream's tosa-opt has none. - CIBW_BEFORE_ALL_LINUX: | - set -euxo pipefail - manylinux-install-clang -v v22.1.6.0 - rm -rf /var/cache/dnf /project/llvm-project - curl -fL --retry 5 --retry-all-errors --retry-delay 10 -o /tmp/llvm.tar.gz "https://codeload.github.com/llvm/llvm-project/tar.gz/${LLVM_COMMIT}" - tar -xzf /tmp/llvm.tar.gz -C /project - rm /tmp/llvm.tar.gz - mv /project/llvm-project-* /project/llvm-project - cd /project/llvm-project - cmake -S llvm -B build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_APPEND_VC_REV=OFF -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_ENABLE_ASSERTIONS=ON \ - -DLLVM_TARGETS_TO_BUILD=host -DLLVM_ENABLE_ZSTD=OFF - targets="$(/opt/python/cp312-cp312/bin/python - MLIRParser MLIRSupport MLIRIR MLIROptLib MLIRPass MLIRTosaDialect MLIRTosaTransforms MLIRFuncDialect <<'EOF' - import re, sys - text = open("build/lib/cmake/llvm/LLVMExports.cmake").read() + open("build/lib/cmake/mlir/MLIRTargets.cmake").read() - kind = dict(re.findall(r"^add_library\((\S+) (\S+) IMPORTED\)", text, re.M)) - deps = dict(re.findall(r'set_target_properties\((\S+) PROPERTIES\n INTERFACE_LINK_LIBRARIES "([^"]*)"', text)) - todo, seen = sys.argv[1:], set() - while todo: - name = todo.pop() - if name in kind and name not in seen: - seen.add(name) - todo += re.findall(r"[\w-]+", deps.get(name, "")) - print(" ".join(sorted(n for n in seen if kind[n] != "INTERFACE"))) - EOF - )" - cmake --build build -j "$(nproc)" --target mlir-headers mlir-tblgen ${targets} - CIBW_CONFIG_SETTINGS: >- - cmake.define.TOSA_ENABLE_PROJECTS=serialization,reference_model,mlir_translator - cmake.define.MLIR_TOSA_OPT=ON - cmake.define.MLIR_DIR=/project/llvm-project/build/lib/cmake/mlir - cmake.define.LLVM_DIR=/project/llvm-project/build/lib/cmake/llvm - CIBW_ENVIRONMENT: >- - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_TOSA_TOOLS=${{ env.TOSA_TOOLS_VERSION }} - SKBUILD_WHEEL_LICENSE_FILES="LICENSES/Apache-2.0.txt;LICENSE.*" - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_COMMAND: 'python -c "import tosa_reference_model, tosa_serializer; print(tosa_reference_model.__file__); print(tosa_serializer.__file__)"' + name: tosa-tools-${{ env.TOSA_TOOLS_VERSION }}-cibw-wheels-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -150,12 +165,6 @@ jobs: "LICENSE.nlohmann-json", "LICENSE.pybind11"}, (whl, licences) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: tosa-tools-${{ env.TOSA_TOOLS_VERSION }}-cibw-wheels-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - test_wheels: needs: [setup, build_wheels] if: needs.setup.outputs.versions != '[]' @@ -213,7 +222,7 @@ jobs: publish: name: Publish tosa-tools ${{ matrix.version }} - needs: [setup, build_wheels, test_wheels] + needs: [setup, build_wheels, test_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-transformations.yml b/.github/workflows/build-transformations.yml index edf085e30fda..930bdc90f5f3 100644 --- a/.github/workflows/build-transformations.yml +++ b/.github/workflows/build-transformations.yml @@ -70,10 +70,7 @@ jobs: # numpy is a build and a runtime requirement, and only our registry has # it for riscv64; only-binary keeps a newer PyPI release from winning the # resolution and then compiling from sdist. - cibw-environment: >- - CG_LIMITED_API=1 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "CG_LIMITED_API=1 PIP_ONLY_BINARY=numpy" cibw-test-requires: numpy pytest cibw-test-command: python -m pytest --doctest-modules --pyargs transformations timeout-minutes: 60 diff --git a/.github/workflows/build-treelite.yml b/.github/workflows/build-treelite.yml index 463bfbfe57ce..10f5c038c2c0 100644 --- a/.github/workflows/build-treelite.yml +++ b/.github/workflows/build-treelite.yml @@ -56,43 +56,49 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build treelite ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "treelite" + version: "${{ matrix.version }}" + repository: "dmlc/treelite" + ref: "${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 180 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/treelite/${{ matrix.version }}/0001-*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "python" + # wheel.py-api = "py3", so one build serves every interpreter. + cibw-build: "cp312-manylinux_riscv64" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: TREELITE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout treelite ${{ env.TREELITE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: dmlc/treelite - ref: ${{ env.TREELITE_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - # pyproject.toml has no license-files key, and python/ (unlike the repo - # root and cpp_src/) has no LICENSE for scikit-build-core's default glob - # to find, so every upstream wheel ships none. - - name: Patch treelite source - run: git apply python-wheels/patches/treelite/${{ env.TREELITE_VERSION }}/0001-*.patch - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: python - output-dir: wheelhouse/ - # wheel.py-api = "py3", so one build serves every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn + name: treelite-${{ env.TREELITE_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries libtreelite and a vendored libgomp run: | @@ -106,12 +112,6 @@ jobs: print("\n".join(n for n in names if ".so" in n)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: treelite-${{ env.TREELITE_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -141,7 +141,7 @@ jobs: publish: name: Publish treelite ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-trollimage.yml b/.github/workflows/build-trollimage.yml index c50d77310d06..f4b54308e0c4 100644 --- a/.github/workflows/build-trollimage.yml +++ b/.github/workflows/build-trollimage.yml @@ -48,43 +48,45 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build trollimage ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "trollimage" + version: "${{ matrix.version }}" + repository: "pytroll/trollimage" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,pillow,pandas,pyproj,rasterio,pyresample,pykdtree,shapely" + # xarray hard-depends on pandas, which has no cp314t riscv64 wheel yet, so + # that leg runs upstream's own version/extension-import check only. + cibw-test-requires: "${{ matrix.python != 'cp314t' && 'pytest pyresample pyproj rasterio xarray dask[array]' || '' }}" + # test_save/test_save_jpeg (TestRegularImage) assert that writing into a + # chmod(0o444) tempdir raises IOError; the manylinux container runs the + # test phase as root, which ignores that permission bit on every arch. + cibw-test-command: "python -c \"import trollimage; assert 'unknown' not in trollimage.__version__, 'incorrect version found'; from trollimage import _colorspaces\" ${{ matrix.python != 'cp314t' && '&& python -m pytest -v --pyargs trollimage.tests -k \"not (TestRegularImage and test_save)\"' || '' }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: TROLLIMAGE_VERSION: ${{ matrix.version }} - steps: - - name: Checkout trollimage v${{ env.TROLLIMAGE_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: pytroll/trollimage - ref: v${{ env.TROLLIMAGE_VERSION }} - persist-credentials: false - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pillow,pandas,pyproj,rasterio,pyresample,pykdtree,shapely - # xarray hard-depends on pandas, which has no cp314t riscv64 wheel yet, so - # that leg runs upstream's own version/extension-import check only. - CIBW_TEST_REQUIRES: >- - ${{ matrix.python != 'cp314t' && 'pytest pyresample pyproj rasterio xarray dask[array]' || '' }} - # test_save/test_save_jpeg (TestRegularImage) assert that writing into a - # chmod(0o444) tempdir raises IOError; the manylinux container runs the - # test phase as root, which ignores that permission bit on every arch. - CIBW_TEST_COMMAND: >- - python -c "import trollimage; assert 'unknown' not in trollimage.__version__, 'incorrect version found'; from trollimage import _colorspaces" - ${{ matrix.python != 'cp314t' && '&& python -m pytest -v --pyargs trollimage.tests -k "not (TestRegularImage and test_save)"' || '' }} + name: trollimage-${{ env.TROLLIMAGE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -97,16 +99,9 @@ jobs: assert licences == {"LICENSE.txt", "LICENSE_RIO_COLOR.txt"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: trollimage-${{ env.TROLLIMAGE_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish trollimage ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-type-enforced.yml b/.github/workflows/build-type-enforced.yml index f057a98c31f0..5d19fe3fc5bc 100644 --- a/.github/workflows/build-type-enforced.yml +++ b/.github/workflows/build-type-enforced.yml @@ -65,7 +65,7 @@ jobs: cibw-before-all-linux: ${{ matrix.platform == 'manylinux' && 'yum remove -y cmake' || '' }} # Fail the build instead of silently shipping a pure-Python wheel if the # C++ extension fails to compile, same as upstream's own CI does. - cibw-environment: TYPE_ENFORCED_REQUIRE_CPP="1" + cibw-environment-linux: TYPE_ENFORCED_REQUIRE_CPP="1" cibw-test-environment: TYPE_ENFORCED_REQUIRE_CPP="1" timeout-minutes: 60 diff --git a/.github/workflows/build-uamqp.yml b/.github/workflows/build-uamqp.yml index 7df6c2a3a861..f744cb48b6fb 100644 --- a/.github/workflows/build-uamqp.yml +++ b/.github/workflows/build-uamqp.yml @@ -49,73 +49,74 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build uamqp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "uamqp" + version: "${{ matrix.version }}" + repository: "Azure/azure-uamqp-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # setup.py's build_ext runs `cmake` against the vendored + # src/vendor/azure-uamqp-c tree itself (not scikit-build-core), and + # links the result against system OpenSSL; upstream's own + # pyproject.toml sets [tool.cibuildwheel.linux] before-build to + # build OpenSSL 3.0.15 from source for manylinux2014's ancient one + # (and that build fails here anyway: the image's perl has no + # FindBin, gotcha 46). CIBW_BEFORE_ALL_LINUX would not have + # replaced it -- before-all and before-build are separate hooks + # (gotcha 225); CIBW_BEFORE_BUILD_LINUX replaces that list wholesale; + # the riscv64 image is Rocky 10 with a current openssl-devel, so + # use that instead (mirrors build-aioquic.yml). The vendored C + # tree's own LICENSE (Azure IoT SDKs, MIT) differs textually from + # uamqp's own and lives under src/vendor/, so setuptools' + # root-only glob won't pick it up on its own (gotcha 44); stage a + # copy at the root. + cibw-before-build-linux: "dnf -y install openssl-devel && cp /usr/share/licenses/openssl-libs/LICENSE.txt {project}/LICENSE.openssl && cp src/vendor/azure-uamqp-c/LICENSE {project}/LICENSE.azure-uamqp-c" + # Cython has a riscv64 wheel only on our registry. + # deps/azure-macro-utils-c declares cmake_minimum_required(2.8.11), + # which CMake 4 (the pip-resolved cmake build dependency) refuses + # outright; CMAKE_POLICY_VERSION_MINIMUM is a no-op for the + # already-3.5+ top-level project and unblocks that vendored one + # (gotcha 207). CIBW_ENVIRONMENT replaces upstream's own + # [tool.cibuildwheel.linux] environment table wholesale (gotcha + # 107), so restore its CFLAGS: GCC 14 turns + # -Wincompatible-pointer-types into a hard error by default, and + # the generated c_uamqp.c hits it (upstream already carries this + # same fix for its own CI, gotcha 226). + cibw-environment-linux: "CMAKE_POLICY_VERSION_MINIMUM=3.5 CFLAGS=\"-Wno-error=incompatible-pointer-types -Wunused-function\"" + # Mirror the non-live half of upstream's own suite (tests/, not + # samples/): the ManyLinux job's `samples` doctest run needs live + # Event Hub/Service Bus credentials and only executes on Microsoft's + # internal pipeline (`condition: ne(...TeamProject..., 'public')`). + # tests/ exercises the built c_uamqp extension directly. + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -m pytest {project}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: UAMQP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout azure-uamqp-python v${{ env.UAMQP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Azure/azure-uamqp-python - ref: v${{ env.UAMQP_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py's build_ext runs `cmake` against the vendored - # src/vendor/azure-uamqp-c tree itself (not scikit-build-core), and - # links the result against system OpenSSL; upstream's own - # pyproject.toml sets [tool.cibuildwheel.linux] before-build to - # build OpenSSL 3.0.15 from source for manylinux2014's ancient one - # (and that build fails here anyway: the image's perl has no - # FindBin, gotcha 46). CIBW_BEFORE_ALL_LINUX would not have - # replaced it -- before-all and before-build are separate hooks - # (gotcha 225); CIBW_BEFORE_BUILD_LINUX replaces that list wholesale; - # the riscv64 image is Rocky 10 with a current openssl-devel, so - # use that instead (mirrors build-aioquic.yml). The vendored C - # tree's own LICENSE (Azure IoT SDKs, MIT) differs textually from - # uamqp's own and lives under src/vendor/, so setuptools' - # root-only glob won't pick it up on its own (gotcha 44); stage a - # copy at the root. - CIBW_BEFORE_BUILD_LINUX: >- - dnf -y install openssl-devel && - cp /usr/share/licenses/openssl-libs/LICENSE.txt {project}/LICENSE.openssl && - cp src/vendor/azure-uamqp-c/LICENSE {project}/LICENSE.azure-uamqp-c - # Cython has a riscv64 wheel only on our registry. - # deps/azure-macro-utils-c declares cmake_minimum_required(2.8.11), - # which CMake 4 (the pip-resolved cmake build dependency) refuses - # outright; CMAKE_POLICY_VERSION_MINIMUM is a no-op for the - # already-3.5+ top-level project and unblocks that vendored one - # (gotcha 207). CIBW_ENVIRONMENT replaces upstream's own - # [tool.cibuildwheel.linux] environment table wholesale (gotcha - # 107), so restore its CFLAGS: GCC 14 turns - # -Wincompatible-pointer-types into a hard error by default, and - # the generated c_uamqp.c hits it (upstream already carries this - # same fix for its own CI, gotcha 226). - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CMAKE_POLICY_VERSION_MINIMUM=3.5 - CFLAGS="-Wno-error=incompatible-pointer-types -Wunused-function" - # Mirror the non-live half of upstream's own suite (tests/, not - # samples/): the ManyLinux job's `samples` doctest run needs live - # Event Hub/Service Bus credentials and only executes on Microsoft's - # internal pipeline (`condition: ne(...TeamProject..., 'public')`). - # tests/ exercises the built c_uamqp extension directly. - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: python -m pytest {project}/tests + name: uamqp-${{ env.UAMQP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the extension and licences made it into the wheel run: | @@ -130,15 +131,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: uamqp-${{ env.UAMQP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish uamqp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-ujson.yml b/.github/workflows/build-ujson.yml index 687f1370376d..175b6eaa8955 100644 --- a/.github/workflows/build-ujson.yml +++ b/.github/workflows/build-ujson.yml @@ -59,7 +59,6 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 checkout-fetch-depth: 0 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-requires: pytest cibw-test-command: pytest {package}/tests timeout-minutes: 90 diff --git a/.github/workflows/build-ukkonen.yml b/.github/workflows/build-ukkonen.yml index 7b0d852918bc..522d074217f6 100644 --- a/.github/workflows/build-ukkonen.yml +++ b/.github/workflows/build-ukkonen.yml @@ -69,7 +69,6 @@ jobs: artifact-tag: ${{ matrix.tag }}-manylinux_riscv64 cibw-build: ${{ matrix.build }} # cffi, needed to build and to import the extension, has no riscv64 wheel on PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-requires: pytest cibw-test-sources: tests cibw-test-command: >- diff --git a/.github/workflows/build-ulid-transform.yml b/.github/workflows/build-ulid-transform.yml index b631ff8c13ac..d47bdfe6dca6 100644 --- a/.github/workflows/build-ulid-transform.yml +++ b/.github/workflows/build-ulid-transform.yml @@ -59,7 +59,7 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-musllinux-riscv64-image: quay.io/pypa/musllinux_1_2_riscv64 - cibw-environment: REQUIRE_EXTENSION=1 + cibw-environment-linux: REQUIRE_EXTENSION=1 cibw-test-requires: pytest cibw-test-sources: tests cibw-test-command: >- diff --git a/.github/workflows/build-unicorn.yml b/.github/workflows/build-unicorn.yml index b7b625b75ca5..5543582ae223 100644 --- a/.github/workflows/build-unicorn.yml +++ b/.github/workflows/build-unicorn.yml @@ -57,45 +57,50 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build unicorn ${{ matrix.version }} cp37-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "unicorn" + version: "${{ matrix.version }}" + repository: "unicorn-engine/unicorn" + ref: "${{ matrix.version }}" + artifact-tag: "cp37-abi3-manylinux_riscv64" + timeout-minutes: 180 + checkout-fetch-depth: 0 + pre-build: |- + cp COPYING COPYING.LGPL2 COPYING_GLIB AUTHORS.TXT bindings/python/ + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "bindings/python" + cibw-build: "cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # setup.py shells out to `cmake` directly; it's not a declared build dep. + cibw-before-build: "pip install cmake" + cibw-build-frontend: "build" + # capstone==6.0.0a2 (upstream's test extra) has no riscv64 wheel anywhere; + # our registry carries 5.0.9, and the regress tests only use its stable + # Cs()/CS_ARCH_* surface. + cibw-test-requires: "capstone==5.0.9" + cibw-test-command: "python -m unittest discover -v {project}/tests/regress \"*.py\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: UNICORN_VERSION: ${{ matrix.version }} - steps: - - name: Checkout unicorn ${{ env.UNICORN_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: unicorn-engine/unicorn - ref: ${{ env.UNICORN_VERSION }} - fetch-depth: 0 - persist-credentials: false - - # Upstream's own wheel carries no licence file at all and pyproject.toml - # mislabels the project BSD; the root COPYING* is the real GPL-2.0/LGPL-2.0 - # text (README: "Distributed under free software license GPLv2"). Landing - # them under bindings/python lets setuptools' default license_files glob - # pick them up with no packaging change. - - name: Stage upstream's licence files for the wheel - run: cp COPYING COPYING.LGPL2 COPYING_GLIB AUTHORS.TXT bindings/python/ - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: bindings/python - output-dir: wheelhouse/ - env: - CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # setup.py shells out to `cmake` directly; it's not a declared build dep. - CIBW_BEFORE_BUILD: pip install cmake - CIBW_BUILD_FRONTEND: build - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # capstone==6.0.0a2 (upstream's test extra) has no riscv64 wheel anywhere; - # our registry carries 5.0.9, and the regress tests only use its stable - # Cs()/CS_ARCH_* surface. - CIBW_TEST_REQUIRES: capstone==5.0.9 - CIBW_TEST_COMMAND: python -m unittest discover -v {project}/tests/regress "*.py" + name: unicorn-${{ env.UNICORN_VERSION }}-cp37-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the licence files made it into the wheel run: | @@ -108,15 +113,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: unicorn-${{ env.UNICORN_VERSION }}-cp37-abi3-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish unicorn ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-vispy.yml b/.github/workflows/build-vispy.yml index e50971ae4e40..a4c207d2336f 100644 --- a/.github/workflows/build-vispy.yml +++ b/.github/workflows/build-vispy.yml @@ -61,9 +61,7 @@ jobs: # numpy is a build- and runtime dependency; only our registry has it # for riscv64, and PIP_ONLY_BINARY keeps a newer PyPI release from # winning the resolution and then compiling from sdist. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy + cibw-environment-linux: "PIP_ONLY_BINARY=numpy" timeout-minutes: 60 publish: diff --git a/.github/workflows/build-vllm-router.yml b/.github/workflows/build-vllm-router.yml index 8dcd5f53c7b7..3f086346e9f4 100644 --- a/.github/workflows/build-vllm-router.yml +++ b/.github/workflows/build-vllm-router.yml @@ -54,57 +54,61 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build vllm-router ${{ matrix.version }} cp38-abi3-manylinux_riscv64 - runs-on: ubuntu-24.04-riscv - timeout-minutes: 720 - - env: - VLLM_ROUTER_VERSION: ${{ matrix.version }} - strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - steps: - - name: Checkout vllm-router v${{ env.VLLM_ROUTER_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: vllm-project/router - ref: v${{ env.VLLM_ROUTER_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "vllm-router" + version: "${{ matrix.version }}" + repository: "vllm-project/router" + ref: "v${{ matrix.version }}" + artifact-tag: "cp38-abi3-manylinux_riscv64" + timeout-minutes: 720 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD - - name: Apply patches - run: git apply "$GITHUB_WORKSPACE"/python-wheels/patches/vllm-router/${{ env.VLLM_ROUTER_VERSION }}/*.patch + git apply "$GITHUB_WORKSPACE"/python-wheels/patches/vllm-router/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # cp312 first so cibuildwheel compiles the abi3 wheel there and only retests + # it on cp313/cp314 (gotcha 96/633); the image ships no cp38 to build on. + cibw-build: "cp312-manylinux_riscv64" + # No Rust in the manylinux image; install it and put cargo on PATH. reqwest's + # default-tls feature needs OpenSSL headers; the zmq crate's vendored libzmq + # build needs cmake. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && dnf -y install openssl-devel cmake" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest pytest-asyncio" + cibw-test-sources: "py_test" + cibw-test-command: "python -c \"import vllm_router; from vllm_router_rs import PolicyType, Router; print('Rust extension: OK')\" && python -m vllm_router.launch_router --help > /dev/null && echo \"Entry point: OK\" && python -m pytest -v py_test/unit" - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + verify_wheels: + needs: [setup, build_wheel] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + timeout-minutes: 720 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + env: + VLLM_ROUTER_VERSION: ${{ matrix.version }} + steps: + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - # cp312 first so cibuildwheel compiles the abi3 wheel there and only retests - # it on cp313/cp314 (gotcha 96/633); the image ships no cp38 to build on. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # No Rust in the manylinux image; install it and put cargo on PATH. reqwest's - # default-tls feature needs OpenSSL headers; the zmq crate's vendored libzmq - # build needs cmake. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && - dnf -y install openssl-devel cmake - CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' - CIBW_TEST_REQUIRES: pytest pytest-asyncio - CIBW_TEST_SOURCES: py_test - CIBW_TEST_COMMAND: >- - python -c "import vllm_router; from vllm_router_rs import PolicyType, Router; - print('Rust extension: OK')" && - python -m vllm_router.launch_router --help > /dev/null && echo "Entry point: OK" && - python -m pytest -v py_test/unit + name: vllm-router-${{ env.VLLM_ROUTER_VERSION }}-cp38-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries the Apache-2.0 licence run: | @@ -115,15 +119,9 @@ jobs: print(sys.argv[1], "->", [n for n in names if ".dist-info/licenses/" in n]) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: vllm-router-${{ env.VLLM_ROUTER_VERSION }}-cp38-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish vllm-router ${{ matrix.version }} - needs: [setup, build_wheel] + needs: [setup, build_wheel, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-vmprof.yml b/.github/workflows/build-vmprof.yml index 652418ee26a2..d9ced73264d7 100644 --- a/.github/workflows/build-vmprof.yml +++ b/.github/workflows/build-vmprof.yml @@ -53,69 +53,68 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build vmprof ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "vmprof" + version: "${{ matrix.version }}" + repository: "vmprof/vmprof-python" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/vmprof/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # Upstream's before-build is a plain `dnf install -y libunwind-devel`, which + # works on their manylinux_2_28 (AlmaLinux 8) images. RHEL 10 (what + # manylinux_2_39 riscv64 is built on) dropped libunwind to EPEL, and manylinux + # enables no EPEL on riscv64, so the package simply doesn't exist here + # (CLAUDE.md gotcha 140). Build it from source instead: 1.8.3 has riscv64 + # support since 1.7.0 and `--libdir=/usr/lib64` is load-bearing since + # autotools otherwise installs to /usr/lib, off the riscv64 linker/pkg-config + # path. + cibw-before-build-linux: "cd /tmp && curl -fsSLO https://github.com/libunwind/libunwind/releases/download/v1.8.3/libunwind-1.8.3.tar.gz && tar xf libunwind-1.8.3.tar.gz && cd libunwind-1.8.3 && ./configure --prefix=/usr --libdir=/usr/lib64 --disable-documentation --disable-tests --disable-minidebuginfo --disable-zlibdebuginfo && make -j\"$(nproc)\" install" + cibw-test-groups: "test" + # Native (C-stack) profiling is compiled in only for x86/x86_64/ppc64 + # (VMP_SUPPORTS_NATIVE_PROFILING in src/vmprof.h); on riscv64, as on + # aarch64, `native=True` is a silent no-op, so test_gzip_call never sees + # its native frame. Upstream already skips the other native-only tests + # with `skipif("not hasattr(_vmprof, 'resolve_addr')")` (they SKIP here + # too); this one lacks that guard, and upstream never runs the suite on + # aarch64 (CIBW_TEST_SKIP). + cibw-test-command: "cd {package} && pytest vmprof jitlog -vv --deselect vmprof/test/test_run.py::TestNative::test_gzip_call" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: VMPROF_VERSION: ${{ matrix.version }} - steps: - - name: Checkout vmprof ${{ env.VMPROF_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: vmprof/vmprof-python - ref: ${{ env.VMPROF_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - # vmprof_eval's per-arch callee-saved register stash ends in - # `#error "platform not supported"` and has no riscv64 branch. - - name: Patch vmprof source - run: git apply python-wheels/patches/vmprof/${{ env.VMPROF_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Upstream's before-build is a plain `dnf install -y libunwind-devel`, which - # works on their manylinux_2_28 (AlmaLinux 8) images. RHEL 10 (what - # manylinux_2_39 riscv64 is built on) dropped libunwind to EPEL, and manylinux - # enables no EPEL on riscv64, so the package simply doesn't exist here - # (CLAUDE.md gotcha 140). Build it from source instead: 1.8.3 has riscv64 - # support since 1.7.0 and `--libdir=/usr/lib64` is load-bearing since - # autotools otherwise installs to /usr/lib, off the riscv64 linker/pkg-config - # path. - CIBW_BEFORE_BUILD_LINUX: >- - cd /tmp && - curl -fsSLO https://github.com/libunwind/libunwind/releases/download/v${{ env.LIBUNWIND_VERSION }}/libunwind-${{ env.LIBUNWIND_VERSION }}.tar.gz && - tar xf libunwind-${{ env.LIBUNWIND_VERSION }}.tar.gz && - cd libunwind-${{ env.LIBUNWIND_VERSION }} && - ./configure --prefix=/usr --libdir=/usr/lib64 --disable-documentation - --disable-tests --disable-minidebuginfo --disable-zlibdebuginfo && - make -j"$(nproc)" install - CIBW_TEST_GROUPS: test - # Native (C-stack) profiling is compiled in only for x86/x86_64/ppc64 - # (VMP_SUPPORTS_NATIVE_PROFILING in src/vmprof.h); on riscv64, as on - # aarch64, `native=True` is a silent no-op, so test_gzip_call never sees - # its native frame. Upstream already skips the other native-only tests - # with `skipif("not hasattr(_vmprof, 'resolve_addr')")` (they SKIP here - # too); this one lacks that guard, and upstream never runs the suite on - # aarch64 (CIBW_TEST_SKIP). - CIBW_TEST_COMMAND: >- - cd {package} && pytest vmprof jitlog -vv - --deselect vmprof/test/test_run.py::TestNative::test_gzip_call + name: vmprof-${{ env.VMPROF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel ships the extension and licence run: | @@ -132,15 +131,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: vmprof-${{ env.VMPROF_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish vmprof ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-wandb.yml b/.github/workflows/build-wandb.yml index 373bb23f2cf1..5204449b7fe0 100644 --- a/.github/workflows/build-wandb.yml +++ b/.github/workflows/build-wandb.yml @@ -58,54 +58,58 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build wandb ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "wandb" + version: "${{ matrix.version }}" + repository: "wandb/wandb" + ref: "v${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/wandb/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + # The build hook emits an ABI-independent py3-none-* wheel, so one + # CPython selector covers every interpreter. + cibw-build: "cp312-manylinux_riscv64" + cibw-before-all-linux: |- + export DOWNLOAD_GOVERSION=$( grep '^go' core/go.mod | cut -d' ' -f2 ) && curl -L https://golang.org/dl/go$DOWNLOAD_GOVERSION.linux-riscv64.tar.gz > go.tar.gz && tar -C /usr/local/ -xzf go.tar.gz && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | + sh -s -- -y --profile minimal --default-toolchain 1.88.0 + # NOTE: the Linux build environment lives in [tool.cibuildwheel.linux] + # in pyproject.toml. Do not set CIBW_ENVIRONMENT_LINUX here: it would + # replace that table, including the PATH entries for Go and cargo. + cibw-test-command: "WANDB_MODE=offline python -c \"import wandb; run = wandb.init(); run.finish()\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv # musllinux is dropped: rustup ships no riscv64 musl host toolchain, and the # musl wheels additionally need CGO, i.e. a riscv64 musl C toolchain. - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: WANDB_VERSION: ${{ matrix.version }} # wandb pulls protobuf and PyYAML at test time; neither publishes riscv64 # wheels on PyPI. PIP_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/ - steps: - - name: Checkout wandb v${{ env.WANDB_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: wandb/wandb - ref: v${{ env.WANDB_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch wandb source - run: git apply python-wheels/patches/wandb/${{ env.WANDB_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # The build hook emits an ABI-independent py3-none-* wheel, so one - # CPython selector covers every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: > - export DOWNLOAD_GOVERSION=$( grep '^go' core/go.mod | cut -d' ' -f2 ) && - curl -L https://golang.org/dl/go$DOWNLOAD_GOVERSION.linux-riscv64.tar.gz > go.tar.gz && - tar -C /usr/local/ -xzf go.tar.gz && - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | - sh -s -- -y --profile minimal --default-toolchain ${{ env.RUST_TOOLCHAIN }} - # NOTE: the Linux build environment lives in [tool.cibuildwheel.linux] - # in pyproject.toml. Do not set CIBW_ENVIRONMENT_LINUX here: it would - # replace that table, including the PATH entries for Go and cargo. - CIBW_ENVIRONMENT_PASS_LINUX: PIP_EXTRA_INDEX_URL - CIBW_TEST_COMMAND: >- - WANDB_MODE=offline python -c "import wandb; run = wandb.init(); run.finish()" + name: wandb-${{ env.WANDB_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries riscv64 Go and Rust binaries run: | @@ -153,15 +157,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: wandb-${{ env.WANDB_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish wandb ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-webp.yml b/.github/workflows/build-webp.yml index a833768d6a86..630d83541cba 100644 --- a/.github/workflows/build-webp.yml +++ b/.github/workflows/build-webp.yml @@ -48,54 +48,53 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build webp ${{ matrix.version }} cp39-abi3-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "webp" + version: "${{ matrix.version }}" + repository: "anibali/pywebp" + ref: "v${{ matrix.version }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 90 + # abi3 (py_limited_api=cp38 in setup.py): cp39 is the riscv64 image's + # oldest interpreter, but the output wheel is still tagged cp38-abi3. + cibw-build: "cp39-manylinux_riscv64" + cibw-build-frontend: "build" + cibw-project-requires-python: ">=3.8" + # libwebp's Conan recipe tool_requires cmake/[>=3.17], and conancenter's + # cmake/4.x recipe is Invalid on riscv64 (binaries for x86_64/armv8 + # only), so declare the image's own CMake as a platform tool. builder.py + # regenerates the default profile with `conan profile detect -f`, so this + # goes in a separate profile that includes it, selected via + # CONAN_DEFAULT_PROFILE (Conan reads [platform_tool_requires] from the + # host profile here; the build profile alone is not enough). + cibw-before-all: "mkdir -p ~/.conan2/profiles && printf 'include(default)\\n\\n[platform_tool_requires]\\ncmake/%s\\n' \"$(cmake --version | head -n1 | cut -d' ' -f3)\" > ~/.conan2/profiles/riscv64" + cibw-environment-linux: "CONAN_DEFAULT_PROFILE=riscv64 PYWEBP_COMPILE_TARGET=riscv64 PIP_ONLY_BINARY=numpy,Pillow,cffi" + cibw-test-requires: "pytest" + cibw-test-command: "pytest --import-mode=importlib {package}/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} - env: WEBP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout webp v${{ env.WEBP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: anibali/pywebp - ref: v${{ env.WEBP_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - # abi3 (py_limited_api=cp38 in setup.py): cp39 is the riscv64 image's - # oldest interpreter, but the output wheel is still tagged cp38-abi3. - only: cp39-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BUILD_FRONTEND: build - CIBW_PROJECT_REQUIRES_PYTHON: '>=3.8' - # libwebp's Conan recipe tool_requires cmake/[>=3.17], and conancenter's - # cmake/4.x recipe is Invalid on riscv64 (binaries for x86_64/armv8 - # only), so declare the image's own CMake as a platform tool. builder.py - # regenerates the default profile with `conan profile detect -f`, so this - # goes in a separate profile that includes it, selected via - # CONAN_DEFAULT_PROFILE (Conan reads [platform_tool_requires] from the - # host profile here; the build profile alone is not enough). - CIBW_BEFORE_ALL: >- - mkdir -p ~/.conan2/profiles && - printf 'include(default)\n\n[platform_tool_requires]\ncmake/%s\n' - "$(cmake --version | head -n1 | cut -d' ' -f3)" - > ~/.conan2/profiles/riscv64 - CIBW_ENVIRONMENT: >- - CONAN_DEFAULT_PROFILE=riscv64 - PYWEBP_COMPILE_TARGET=riscv64 - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,Pillow,cffi - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest --import-mode=importlib {package}/tests + name: webp-${{ env.WEBP_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -108,16 +107,9 @@ jobs: assert licences == {"LICENSE"}, licences EOF - - name: Store wheels - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: webp-${{ env.WEBP_VERSION }}-cp39-abi3-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish webp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-whylogs-sketching.yml b/.github/workflows/build-whylogs-sketching.yml index d1560cb4a9db..6d42b02c2f9f 100644 --- a/.github/workflows/build-whylogs-sketching.yml +++ b/.github/workflows/build-whylogs-sketching.yml @@ -56,48 +56,58 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build whylogs-sketching ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "whylogs-sketching" + version: "${{ matrix.version }}" + repository: "whylabs/whylogs-sketching" + ref: "c81f372d971bc461d5fe1c2967aa9d609af2f23a" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/whylogs-sketching/${{ matrix.version }}/00*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # vector_of_kll_test.py calls np.row_stack, which numpy 2.5 removed. + cibw-before-test: "pip install pytest \"numpy<2.5\" --only-binary numpy" + # tests/ has __init__.py, and the checkout root's own python/ source tree + # would shadow the installed wheel if pytest ran from the checkout (gotcha 25); + # stage only python/tests into an empty cwd. + cibw-test-sources: "python/tests" + cibw-test-command: "python -m pytest python/tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: WHYLOGS_SKETCHING_VERSION: ${{ matrix.version }} - steps: - - name: Checkout whylabs/whylogs-sketching ${{ env.WHYLOGS_SKETCHING_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: whylabs/whylogs-sketching - ref: ${{ env.WHYLOGS_SKETCHING_REF }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - # vector_of_kll_sketches's own operator= assigns to its const k_/d_ members, - # which GCC 13 (this image's compiler) rejects; not riscv64-specific (gotcha 23 shape). - - name: Patch whylogs-sketching source - run: git apply python-wheels/patches/whylogs-sketching/${{ env.WHYLOGS_SKETCHING_VERSION }}/00*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # vector_of_kll_test.py calls np.row_stack, which numpy 2.5 removed. - CIBW_BEFORE_TEST: pip install pytest "numpy<2.5" --only-binary numpy - # tests/ has __init__.py, and the checkout root's own python/ source tree - # would shadow the installed wheel if pytest ran from the checkout (gotcha 25); - # stage only python/tests into an empty cwd. - CIBW_TEST_SOURCES: python/tests - CIBW_TEST_COMMAND: python -m pytest python/tests + name: whylogs-sketching-${{ env.WHYLOGS_SKETCHING_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -112,15 +122,9 @@ jobs: assert {"LICENSE", "NOTICE"} <= licences, licences EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: whylogs-sketching-${{ env.WHYLOGS_SKETCHING_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish whylogs-sketching ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-wntr.yml b/.github/workflows/build-wntr.yml index dc0c9672e4b2..ee3a57180ec5 100644 --- a/.github/workflows/build-wntr.yml +++ b/.github/workflows/build-wntr.yml @@ -51,6 +51,101 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build wntr ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "wntr" + version: "${{ matrix.version }}" + repository: "USEPA/WNTR" + ref: "${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + timeout-minutes: 240 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/wntr/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + # Our registry's cp310 numpy riscv64 wheels stop at 2.2.2, below the + # pyproject.toml build requirement numpy>=2.2.6; let pip build numpy from + # sdist for cp310 only, keeping the faster prebuilt wheel everywhere else. + cibw-environment-linux: "BUILD_WNTR_EXTENSIONS='true' PIP_ONLY_BINARY=${{ matrix.python == 'cp310' && 'scipy,pandas,matplotlib,contourpy,kiwisolver,pillow,shapely,pyproj,pyogrio,rasterio,rtree,pyzmq,rpds-py' || 'numpy,scipy,pandas,matplotlib,contourpy,kiwisolver,pillow,shapely,pyproj,pyogrio,rasterio,rtree,pyzmq,rpds-py' }}" + # Upstream commits x86_64-only EPANET binaries under libepanet/linux-x64; this + # compiles the same sources they were built from into libepanet/linux-riscv64. + cibw-before-all: |- + set -e + dest={project}/wntr/epanet/libepanet/linux-riscv64 + mkdir -p $dest /tmp/epanet && cd /tmp/epanet + + curl -fsSL --retry 5 https://github.com/OpenWaterAnalytics/EPANET/archive/refs/tags/v2.1.tar.gz | tar xz + # gotcha 226/525: GCC14 treats missing-prototype as an error under + # strict -std=c99, and mkstemp() needs _DEFAULT_SOURCE to be visible; + # reproduce the Makefile's own CFLAGS and add the macro (command-line + # CFLAGS= replaces the Makefile's, it doesn't append to it; CPPFLAGS, + # which supplies -I../../include, is untouched here). + make -C EPANET-2.1/build/Linux libepanet2.so LDFLAGS="-L . -lm" CFLAGS="-g -O3 -fPIC -std=c99 -D_DEFAULT_SOURCE" + cp EPANET-2.1/build/Linux/libepanet2.so $dest/libepanet20.so + + curl -fsSL --retry 5 https://github.com/OpenWaterAnalytics/EPANET/archive/refs/tags/v2.2.tar.gz | tar xz + # gotcha 207: v2.2 declares cmake_minimum_required(2.8.8), which CMake 4 rejects. + cmake -S EPANET-2.2 -B epanet22-build -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + cmake --build epanet22-build --target epanet2 + cp epanet22-build/lib/libepanet2.so $dest/libepanet22.so + cp EPANET-2.2/LICENSE {project}/LICENSE.EPANET + + curl -fsSL --retry 5 https://github.com/USEPA/EPANETMSX/archive/85a303dca05859389eced63fabd5ea145c096333.tar.gz | tar xz + curl -fsSL --retry 5 https://github.com/USEPA/EPANET2.2/archive/1e2fc3d909c0df654ead95e6e98c3307ce1375b1.tar.gz | tar xz --wildcards '*/SRC_engines/*' + rm -rf EPANETMSX-85a303dca05859389eced63fabd5ea145c096333/EPANET2.2 + mv EPANET2.2-1e2fc3d909c0df654ead95e6e98c3307ce1375b1 EPANETMSX-85a303dca05859389eced63fabd5ea145c096333/EPANET2.2 + # gotcha 226/525: src/solver/msxout.c includes only under + # `#if ... __APPLE__`, so on Linux calloc()/free() have no prototype, which + # GCC14 rejects (implicit-function-declaration) even at its default gnu17; + # force-include the header (CMAKE_C_FLAGS is otherwise empty here). + cmake -S EPANETMSX-85a303dca05859389eced63fabd5ea145c096333 -B msx-build -DCMAKE_BUILD_TYPE=Release '-DCMAKE_INSTALL_RPATH=$ORIGIN' '-DCMAKE_C_FLAGS=-include stdlib.h' + cmake --build msx-build + cmake --install msx-build --prefix /tmp/epanet/msx-install + cp msx-install/lib/libepanet2.so msx-install/lib/libepanetmsx.so $dest/ + cp EPANETMSX-85a303dca05859389eced63fabd5ea145c096333/license.txt {project}/LICENSE.EPANETMSX + # rasterio/shapely/pyproj have no riscv64 wheel on our registry below cp312, + # and the 'optional' tests guard their imports; test only 'test' on cp310/cp311. + cibw-test-extras: "${{ (matrix.python == 'cp310' || matrix.python == 'cp311') && 'test' || 'optional,test' }}" + # plotly, utm and folium are all pure-Python, so pull them in directly on + # cp310/cp311 rather than losing the tests that need them along with the + # rest of 'optional'. folium was missed in the prior round: real cp310/cp311 + # job logs (run 43082661452) show test_plot_interactive_network1, + # test_plot_leaflet_network1 and test_plot_leaflet_network_popup still + # failing with "ImportError: folium is required" even after plotly/utm + # were added - those three only need folium itself, not geopandas/shapely. + cibw-test-requires: "${{ (matrix.python == 'cp310' || matrix.python == 'cp311') && 'plotly utm folium' || '' }}" + cibw-test-sources: "pyproject.toml wntr/tests examples" + # wntr/tests/conftest.py os.chdir()s to a temp dir at import time, which + # invalidates these --ignore paths once pyproject.toml's `--doctest-modules` + # addopt forces pytest to also re-resolve them against the new cwd; make + # them absolute so they still match after the chdir. test_plot_valve_layer_gpd + # and test_plot_valve_layer_with_attribute need geopandas/shapely themselves, + # which stay unavailable on cp310/cp311; deselect those two. The real + # cp310/cp311 job log (run 43632351590) also shows test_plot_interactive_network1 + # failing independent of any missing dependency: "ValueError: Invalid property + # specified for object of type plotly.graph_objs.scatter.marker.ColorBar: + # 'titleside'" - the installed plotly release dropped/renamed that colorbar + # property, an upstream test/plotly-version incompatibility unrelated to + # riscv64; deselect it alongside the other two known-incompatible tests. + cibw-test-command: "pytest wntr/tests/ --ignore=\"$PWD/wntr/tests/test_demos.py\" --ignore=\"$PWD/wntr/tests/test_examples.py\" ${{ (matrix.python == 'cp310' || matrix.python == 'cp311') && '--deselect wntr/tests/test_graphics.py::TestGraphics::test_plot_valve_layer_gpd --deselect wntr/tests/test_graphics.py::TestGraphics::test_plot_valve_layer_with_attribute --deselect wntr/tests/test_graphics.py::TestGraphics::test_plot_interactive_network1' || '' }}" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 240 strategy: @@ -59,100 +154,12 @@ jobs: include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: WNTR_VERSION: ${{ matrix.version }} - steps: - - name: Checkout WNTR ${{ env.WNTR_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: USEPA/WNTR - ref: ${{ env.WNTR_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Apply patches - run: git apply python-wheels/patches/wntr/${{ env.WNTR_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Our registry's cp310 numpy riscv64 wheels stop at 2.2.2, below the - # pyproject.toml build requirement numpy>=2.2.6; let pip build numpy from - # sdist for cp310 only, keeping the faster prebuilt wheel everywhere else. - CIBW_ENVIRONMENT: >- - BUILD_WNTR_EXTENSIONS='true' - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=${{ matrix.python == 'cp310' && 'scipy,pandas,matplotlib,contourpy,kiwisolver,pillow,shapely,pyproj,pyogrio,rasterio,rtree,pyzmq,rpds-py' || 'numpy,scipy,pandas,matplotlib,contourpy,kiwisolver,pillow,shapely,pyproj,pyogrio,rasterio,rtree,pyzmq,rpds-py' }} - # Upstream commits x86_64-only EPANET binaries under libepanet/linux-x64; this - # compiles the same sources they were built from into libepanet/linux-riscv64. - CIBW_BEFORE_ALL: | - set -e - dest={project}/wntr/epanet/libepanet/linux-riscv64 - mkdir -p $dest /tmp/epanet && cd /tmp/epanet - - curl -fsSL --retry 5 https://github.com/OpenWaterAnalytics/EPANET/archive/refs/tags/v2.1.tar.gz | tar xz - # gotcha 226/525: GCC14 treats missing-prototype as an error under - # strict -std=c99, and mkstemp() needs _DEFAULT_SOURCE to be visible; - # reproduce the Makefile's own CFLAGS and add the macro (command-line - # CFLAGS= replaces the Makefile's, it doesn't append to it; CPPFLAGS, - # which supplies -I../../include, is untouched here). - make -C EPANET-2.1/build/Linux libepanet2.so LDFLAGS="-L . -lm" CFLAGS="-g -O3 -fPIC -std=c99 -D_DEFAULT_SOURCE" - cp EPANET-2.1/build/Linux/libepanet2.so $dest/libepanet20.so - - curl -fsSL --retry 5 https://github.com/OpenWaterAnalytics/EPANET/archive/refs/tags/v2.2.tar.gz | tar xz - # gotcha 207: v2.2 declares cmake_minimum_required(2.8.8), which CMake 4 rejects. - cmake -S EPANET-2.2 -B epanet22-build -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - cmake --build epanet22-build --target epanet2 - cp epanet22-build/lib/libepanet2.so $dest/libepanet22.so - cp EPANET-2.2/LICENSE {project}/LICENSE.EPANET - - curl -fsSL --retry 5 https://github.com/USEPA/EPANETMSX/archive/85a303dca05859389eced63fabd5ea145c096333.tar.gz | tar xz - curl -fsSL --retry 5 https://github.com/USEPA/EPANET2.2/archive/1e2fc3d909c0df654ead95e6e98c3307ce1375b1.tar.gz | tar xz --wildcards '*/SRC_engines/*' - rm -rf EPANETMSX-85a303dca05859389eced63fabd5ea145c096333/EPANET2.2 - mv EPANET2.2-1e2fc3d909c0df654ead95e6e98c3307ce1375b1 EPANETMSX-85a303dca05859389eced63fabd5ea145c096333/EPANET2.2 - # gotcha 226/525: src/solver/msxout.c includes only under - # `#if ... __APPLE__`, so on Linux calloc()/free() have no prototype, which - # GCC14 rejects (implicit-function-declaration) even at its default gnu17; - # force-include the header (CMAKE_C_FLAGS is otherwise empty here). - cmake -S EPANETMSX-85a303dca05859389eced63fabd5ea145c096333 -B msx-build -DCMAKE_BUILD_TYPE=Release '-DCMAKE_INSTALL_RPATH=$ORIGIN' '-DCMAKE_C_FLAGS=-include stdlib.h' - cmake --build msx-build - cmake --install msx-build --prefix /tmp/epanet/msx-install - cp msx-install/lib/libepanet2.so msx-install/lib/libepanetmsx.so $dest/ - cp EPANETMSX-85a303dca05859389eced63fabd5ea145c096333/license.txt {project}/LICENSE.EPANETMSX - # rasterio/shapely/pyproj have no riscv64 wheel on our registry below cp312, - # and the 'optional' tests guard their imports; test only 'test' on cp310/cp311. - CIBW_TEST_EXTRAS: >- - ${{ (matrix.python == 'cp310' || matrix.python == 'cp311') && 'test' || 'optional,test' }} - # plotly, utm and folium are all pure-Python, so pull them in directly on - # cp310/cp311 rather than losing the tests that need them along with the - # rest of 'optional'. folium was missed in the prior round: real cp310/cp311 - # job logs (run 43082661452) show test_plot_interactive_network1, - # test_plot_leaflet_network1 and test_plot_leaflet_network_popup still - # failing with "ImportError: folium is required" even after plotly/utm - # were added - those three only need folium itself, not geopandas/shapely. - CIBW_TEST_REQUIRES: ${{ (matrix.python == 'cp310' || matrix.python == 'cp311') && 'plotly utm folium' || '' }} - CIBW_TEST_SOURCES: pyproject.toml wntr/tests examples - # wntr/tests/conftest.py os.chdir()s to a temp dir at import time, which - # invalidates these --ignore paths once pyproject.toml's `--doctest-modules` - # addopt forces pytest to also re-resolve them against the new cwd; make - # them absolute so they still match after the chdir. test_plot_valve_layer_gpd - # and test_plot_valve_layer_with_attribute need geopandas/shapely themselves, - # which stay unavailable on cp310/cp311; deselect those two. The real - # cp310/cp311 job log (run 43632351590) also shows test_plot_interactive_network1 - # failing independent of any missing dependency: "ValueError: Invalid property - # specified for object of type plotly.graph_objs.scatter.marker.ColorBar: - # 'titleside'" - the installed plotly release dropped/renamed that colorbar - # property, an upstream test/plotly-version incompatibility unrelated to - # riscv64; deselect it alongside the other two known-incompatible tests. - CIBW_TEST_COMMAND: pytest wntr/tests/ --ignore="$PWD/wntr/tests/test_demos.py" --ignore="$PWD/wntr/tests/test_examples.py" ${{ (matrix.python == 'cp310' || matrix.python == 'cp311') && '--deselect wntr/tests/test_graphics.py::TestGraphics::test_plot_valve_layer_gpd --deselect wntr/tests/test_graphics.py::TestGraphics::test_plot_valve_layer_with_attribute --deselect wntr/tests/test_graphics.py::TestGraphics::test_plot_interactive_network1' || '' }} + name: wntr-${{ env.WNTR_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Verify the wheel ships the extensions, riscv64 EPANET libraries and licences run: | @@ -168,12 +175,6 @@ jobs: print(sys.argv[1], "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: wntr-${{ env.WNTR_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -208,7 +209,7 @@ jobs: publish: name: Publish wntr ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-wordcloud.yml b/.github/workflows/build-wordcloud.yml index 7e5eab67131a..85939e68c689 100644 --- a/.github/workflows/build-wordcloud.yml +++ b/.github/workflows/build-wordcloud.yml @@ -61,10 +61,7 @@ jobs: # contourpy/kiwisolver deps) are runtime-only. Only our registry has # riscv64 wheels for any of them, so only-binary keeps pip from # resolving a newer PyPI sdist-only release and compiling it instead. - cibw-environment: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,pillow,matplotlib,contourpy,kiwisolver - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_WORDCLOUD=${{ matrix.version }} + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,pillow,matplotlib,contourpy,kiwisolver SETUPTOOLS_SCM_PRETEND_VERSION_FOR_WORDCLOUD=${{ matrix.version }}" cibw-test-requires: pytest # setup.cfg's [tool:pytest] addopts is coverage-only (--cov ...); drop it # rather than pull in pytest-cov (gotcha 176). diff --git a/.github/workflows/build-xatlas.yml b/.github/workflows/build-xatlas.yml index 31ad93dd227e..6f94ea56962f 100644 --- a/.github/workflows/build-xatlas.yml +++ b/.github/workflows/build-xatlas.yml @@ -49,45 +49,51 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build xatlas ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "xatlas" + version: "${{ matrix.version }}" + repository: "mworchel/xatlas-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + checkout-submodules: "true" + pre-build: |- + cp extern/xatlas/LICENSE LICENSE.xatlas + cp extern/pybind11/LICENSE LICENSE.pybind11 + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + # numpy and scipy have no riscv64 wheels on public PyPI; keep pip + # on our registry's copies for the test extras. + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: XATLAS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout xatlas-python v${{ env.XATLAS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: mworchel/xatlas-python - ref: v${{ env.XATLAS_VERSION }} - submodules: true - persist-credentials: false - - # extern/xatlas (jpcy/xatlas) and extern/pybind11 are compiled into the - # wheel, but upstream's own wheel ships only its own LICENSE. Stage - # theirs at the root for scikit-build-core's default - # wheel.license-files glob to pick up. - - name: Stage the vendored dependencies' licences - run: | - cp extern/xatlas/LICENSE LICENSE.xatlas - cp extern/pybind11/LICENSE LICENSE.pybind11 - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - # numpy and scipy have no riscv64 wheels on public PyPI; keep pip - # on our registry's copies for the test extras. - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,scipy + name: xatlas-${{ env.XATLAS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check wheel contents run: | @@ -102,15 +108,9 @@ jobs: print(path, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: xatlas-${{ env.XATLAS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish xatlas ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-xattr.yml b/.github/workflows/build-xattr.yml index dfb1e3adc353..9576c3df0def 100644 --- a/.github/workflows/build-xattr.yml +++ b/.github/workflows/build-xattr.yml @@ -59,7 +59,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build-frontend: build # cffi, needed to build and to import the extension, has no riscv64 wheel on PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ timeout-minutes: 90 publish: diff --git a/.github/workflows/build-xgboost-cpu.yml b/.github/workflows/build-xgboost-cpu.yml index 3faf6c48484f..1c53e22f5c34 100644 --- a/.github/workflows/build-xgboost-cpu.yml +++ b/.github/workflows/build-xgboost-cpu.yml @@ -58,56 +58,58 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build xgboost-cpu ${{ matrix.version }} py3-none-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "xgboost-cpu" + version: "${{ matrix.version }}" + repository: "dmlc/xgboost" + ref: "v${{ matrix.version }}" + artifact-tag: "py3-none-manylinux_riscv64" + timeout-minutes: 180 + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply "python-wheels/patches/xgboost-cpu/${XGBOOST_VERSION#v}"/0001-*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-package-dir: "python-package" + # wheel.py-api = "py3", so one build serves every interpreter. + cibw-build: "cp312-manylinux_riscv64" + # Renames the package to xgboost-cpu and drops the nvidia-nccl-cu13 + # dependency, same as upstream's own build-python-wheels-cpu.sh. + cibw-before-build: "python3 -m pip install packaging && python3 {project}/ops/script/pypi_variants.py --use-suffix=cpu --require-nccl-dep=na" + cibw-test-requires: "pytest hypothesis scikit-learn pandas" + cibw-test-environment: "PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn" + # Mirrors upstream's own reduced arm64 suite (ops/pipeline/test-python-wheel.sh + # --suite cpu-arm64); test_model_compatibility.py is dropped since it downloads + # a model archive from xgboost's own S3 bucket. + cibw-test-command: "pytest -v -s -rxXs --durations=0 {project}/tests/python/test_basic.py {project}/tests/python/test_basic_models.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 180 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: XGBOOST_VERSION: ${{ matrix.version }} - steps: - - name: Checkout xgboost ${{ env.XGBOOST_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: dmlc/xgboost - ref: v${{ env.XGBOOST_VERSION }} - submodules: 'true' - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - # gotcha 166: libgomp's dynamic/guided work-share schedules fault on the - # riscv64 runners; ParallelFor() is XGBoost's one choke point for both. - - name: Patch xgboost source - run: git apply "python-wheels/patches/xgboost-cpu/${XGBOOST_VERSION#v}"/0001-*.patch - - - name: Build wheel - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - package-dir: python-package - output-dir: wheelhouse/ - # wheel.py-api = "py3", so one build serves every interpreter. - only: cp312-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # Renames the package to xgboost-cpu and drops the nvidia-nccl-cu13 - # dependency, same as upstream's own build-python-wheels-cpu.sh. - CIBW_BEFORE_BUILD: >- - python3 -m pip install packaging && - python3 {project}/ops/script/pypi_variants.py --use-suffix=cpu --require-nccl-dep=na - CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - CIBW_TEST_REQUIRES: pytest hypothesis scikit-learn pandas - CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,scipy,pandas,scikit-learn - # Mirrors upstream's own reduced arm64 suite (ops/pipeline/test-python-wheel.sh - # --suite cpu-arm64); test_model_compatibility.py is dropped since it downloads - # a model archive from xgboost's own S3 bucket. - CIBW_TEST_COMMAND: >- - pytest -v -s -rxXs --durations=0 - {project}/tests/python/test_basic.py - {project}/tests/python/test_basic_models.py + name: xgboost-cpu-${{ env.XGBOOST_VERSION }}-py3-none-manylinux_riscv64 + path: wheelhouse - name: Check the wheel carries libxgboost and a vendored libgomp run: | @@ -121,12 +123,6 @@ jobs: print("\n".join(n for n in names if ".so" in n)) EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: xgboost-cpu-${{ env.XGBOOST_VERSION }}-py3-none-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - gpl_sources: needs: [setup] if: needs.setup.outputs.versions != '[]' @@ -156,7 +152,7 @@ jobs: publish: name: Publish xgboost-cpu ${{ matrix.version }} - needs: [setup, build_wheels, gpl_sources] + needs: [setup, build_wheels, gpl_sources, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-xrootd.yml b/.github/workflows/build-xrootd.yml index 8b2d1af0b7da..e3091b132938 100644 --- a/.github/workflows/build-xrootd.yml +++ b/.github/workflows/build-xrootd.yml @@ -48,124 +48,131 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build xrootd ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "xrootd" + version: "${{ matrix.version }}" + repository: "xrootd/xrootd" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 120 + pre-build: |- + echo -n '${{ matrix.version }}' > VERSION + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + + cat > collect-licenses.sh <<'COLLECT_EOF' + #!/bin/bash + # SPDX-FileCopyrightText: 2026 The RISE Project + # SPDX-License-Identifier: MIT + # + # Stage, at the project root, the licence of every shared library + # auditwheel vendors out of the build image alongside the XRootD + # client libraries (OpenSSL, Kerberos, libuuid and their closure). + # setuptools' default LICENSE* glob copies them into the wheel. + set -euo pipefail + + project="${1:?usage: collect-licenses.sh }" + + # ldd is transitive, so these roots cover their whole closure; ldd + # does not list the roots themselves, so resolve those too. libcrypt + # is not pulled in by any -devel package above: XrdUtils' own CMake + # probes for crypt() directly and links libc-adjacent libxcrypt, + # which the base image already ships. + mapfile -t libs < <( + { + for root in libssl.so libcrypto.so libkrb5.so libuuid.so libcrypt.so; do + path="/usr/lib64/${root}" + [ -e "${path}" ] || continue + ldd "${path}" | tr ' ' '\n' | grep '^/' + readlink -f "${path}" + done + } | sort -u + ) + + # `rpm -qf` reports unowned files on stdout, so keep only bare package names. + # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist + # (confirmed against the upstream x86_64 wheel's auditwheel-vendored set) + # and are never vendored into the wheel; zlib-ng-compat also ships no + # licence file via any rpm metadata path, so it would break the loop below. + mapfile -t pkgs < <( + rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | + grep -E '^[A-Za-z0-9._+-]+$' | sort -u | + grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' + ) + + for pkg in "${pkgs[@]}"; do + mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) + + # Some subpackages leave the licence to a sibling of the same source RPM. + if [ -z "${files[0]:-}" ]; then + srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") + mapfile -t files < <( + rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | + awk -v s="$srpm" '$1 == s { print $2 }' | + xargs -r rpm -q --licensefiles 2>/dev/null | sort -u + ) + fi + + # Others mark it %doc rather than %license, and the image installs no docs. + if [ -z "${files[0]:-}" ]; then + dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null + mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') + fi + + for f in "${files[@]}"; do + [ -f "$f" ] || continue + cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" + done + compgen -G "$project/LICENSE.$pkg.*" >/dev/null || + { echo "no licence file found for $pkg" >&2; exit 1; } + done + + ls -1 "$project"/LICENSE.* | sed "s|$project/||" + COLLECT_EOF + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-before-all-linux: "dnf install -y krb5-devel libuuid-devel openssl-devel && bash {project}/collect-licenses.sh {project}" + cibw-environment-linux: "CMAKE_ARGS=-DCMAKE_BUILD_TYPE=Release" + # Upstream's own manylinux job test step (python.yml): import the + # extension and the pure-Python client, then build a FileSystem + # object (no network I/O, so no server needed). + cibw-test-command: |- + python -m pip show xrootd && + python -c "import XRootD; print(XRootD)" && + python -c "import pyxrootd; print(pyxrootd)" && + python -c "from XRootD import client; help(client)" && + python -c "from XRootD import client; print(client.FileSystem('root://localhost'))" + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 120 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: XROOTD_VERSION: ${{ matrix.version }} - steps: - - name: Checkout xrootd v${{ env.XROOTD_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: xrootd/xrootd - ref: v${{ env.XROOTD_VERSION }} - persist-credentials: false - - # The tag's VERSION file is an unexpanded `git-archive` export-subst - # placeholder (`$Format:%(describe)$`); setup.py and CMake both fall - # back to `git describe`, which a shallow single-ref checkout can't - # answer. Writing the real version here is the officially supported - # override (cmake/XRootDVersion.cmake reads this file first). - - name: Set version from tag - run: echo -n '${{ env.XROOTD_VERSION }}' > VERSION - - - name: Stage the licence-collection script - run: | - cat > collect-licenses.sh <<'COLLECT_EOF' - #!/bin/bash - # SPDX-FileCopyrightText: 2026 The RISE Project - # SPDX-License-Identifier: MIT - # - # Stage, at the project root, the licence of every shared library - # auditwheel vendors out of the build image alongside the XRootD - # client libraries (OpenSSL, Kerberos, libuuid and their closure). - # setuptools' default LICENSE* glob copies them into the wheel. - set -euo pipefail - - project="${1:?usage: collect-licenses.sh }" - - # ldd is transitive, so these roots cover their whole closure; ldd - # does not list the roots themselves, so resolve those too. libcrypt - # is not pulled in by any -devel package above: XrdUtils' own CMake - # probes for crypt() directly and links libc-adjacent libxcrypt, - # which the base image already ships. - mapfile -t libs < <( - { - for root in libssl.so libcrypto.so libkrb5.so libuuid.so libcrypt.so; do - path="/usr/lib64/${root}" - [ -e "${path}" ] || continue - ldd "${path}" | tr ' ' '\n' | grep '^/' - readlink -f "${path}" - done - } | sort -u - ) - - # `rpm -qf` reports unowned files on stdout, so keep only bare package names. - # glibc, the gcc runtime and zlib are on auditwheel's manylinux allowlist - # (confirmed against the upstream x86_64 wheel's auditwheel-vendored set) - # and are never vendored into the wheel; zlib-ng-compat also ships no - # licence file via any rpm metadata path, so it would break the loop below. - mapfile -t pkgs < <( - rpm -qf --qf '%{NAME}\n' "${libs[@]}" 2>/dev/null | - grep -E '^[A-Za-z0-9._+-]+$' | sort -u | - grep -vE '^(glibc|libgcc|libstdc\+\+|gcc|zlib-ng-compat)$' - ) - - for pkg in "${pkgs[@]}"; do - mapfile -t files < <(rpm -q --licensefiles "$pkg" 2>/dev/null || true) - - # Some subpackages leave the licence to a sibling of the same source RPM. - if [ -z "${files[0]:-}" ]; then - srpm=$(rpm -q --qf '%{SOURCERPM}\n' "$pkg") - mapfile -t files < <( - rpm -qa --qf '%{SOURCERPM} %{NAME}\n' | - awk -v s="$srpm" '$1 == s { print $2 }' | - xargs -r rpm -q --licensefiles 2>/dev/null | sort -u - ) - fi - - # Others mark it %doc rather than %license, and the image installs no docs. - if [ -z "${files[0]:-}" ]; then - dnf -y --disablerepo=extras reinstall --setopt=tsflags= "$pkg" >/dev/null - mapfile -t files < <(rpm -qd "$pkg" | grep -iE '/(LICEN[CS]E|COPYING|NOTICE)') - fi - - for f in "${files[@]}"; do - [ -f "$f" ] || continue - cp "$f" "$project/LICENSE.${pkg}.$(basename "$f")" - done - compgen -G "$project/LICENSE.$pkg.*" >/dev/null || - { echo "no licence file found for $pkg" >&2; exit 1; } - done - - ls -1 "$project"/LICENSE.* | sed "s|$project/||" - COLLECT_EOF - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BEFORE_ALL_LINUX: >- - dnf install -y krb5-devel libuuid-devel openssl-devel && - bash {project}/collect-licenses.sh {project} - CIBW_ENVIRONMENT: CMAKE_ARGS=-DCMAKE_BUILD_TYPE=Release - # Upstream's own manylinux job test step (python.yml): import the - # extension and the pure-Python client, then build a FileSystem - # object (no network I/O, so no server needed). - CIBW_TEST_COMMAND: | - python -m pip show xrootd && - python -c "import XRootD; print(XRootD)" && - python -c "import pyxrootd; print(pyxrootd)" && - python -c "from XRootD import client; help(client)" && - python -c "from XRootD import client; print(client.FileSystem('root://localhost'))" + name: xrootd-${{ env.XROOTD_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension and licences run: | @@ -183,15 +190,9 @@ jobs: assert expected_pkgs <= have_pkgs, expected_pkgs - have_pkgs EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: xrootd-${{ env.XROOTD_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish xrootd ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-xtcocotools.yml b/.github/workflows/build-xtcocotools.yml index de37967fc40c..88311a57e8d4 100644 --- a/.github/workflows/build-xtcocotools.yml +++ b/.github/workflows/build-xtcocotools.yml @@ -51,53 +51,56 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build xtcocotools ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - runs-on: ubuntu-24.04-riscv strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "xtcocotools" + version: "${{ matrix.version }}" + repository: "jin-s13/xtcocoapi" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/xtcocotools/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-environment-linux: "PIP_ONLY_BINARY=numpy,matplotlib,contourpy,kiwisolver,pillow" + # setup.py has no build-system table and imports numpy at top level; + # upstream installs requirements.txt into the build env first. + cibw-before-build: "pip install -r {project}/requirements.txt wheel" + cibw-build-frontend: "pip; args: --no-build-isolation" + # Upstream has no test suite; its demos are the only runnable checks. + cibw-test-command: "cd {project}/demos && python demo_coco.py && python demo_coco_wholebody.py && python demo_crowdpose.py && python -c \"import numpy as np; from xtcocotools import mask; m = np.asfortranarray(np.tri(8, dtype=np.uint8)[:, :, None]); assert (mask.decode(mask.encode(m)) == m).all(); r = mask.encode(m); assert mask.area(r)[0] == 36; assert (mask.toBbox(r) == [[0, 0, 8, 8]]).all(); assert mask.iou(r, r, [0])[0, 0] == 1\"" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: XTCOCOTOOLS_VERSION: ${{ matrix.version }} - steps: - - name: Checkout xtcocoapi ${{ env.XTCOCOTOOLS_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: jin-s13/xtcocoapi - ref: v${{ env.XTCOCOTOOLS_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch xtcocoapi source - run: git apply python-wheels/patches/xtcocotools/${{ env.XTCOCOTOOLS_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: >- - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,matplotlib,contourpy,kiwisolver,pillow - # setup.py has no build-system table and imports numpy at top level; - # upstream installs requirements.txt into the build env first. - CIBW_BEFORE_BUILD: pip install -r {project}/requirements.txt wheel - CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" - # Upstream has no test suite; its demos are the only runnable checks. - CIBW_TEST_COMMAND: >- - cd {project}/demos && - python demo_coco.py && - python demo_coco_wholebody.py && - python demo_crowdpose.py && - python -c "import numpy as np; from xtcocotools import mask; m = np.asfortranarray(np.tri(8, dtype=np.uint8)[:, :, None]); assert (mask.decode(mask.encode(m)) == m).all(); r = mask.encode(m); assert mask.area(r)[0] == 36; assert (mask.toBbox(r) == [[0, 0, 8, 8]]).all(); assert mask.iou(r, r, [0])[0, 0] == 1" + name: xtcocotools-${{ env.XTCOCOTOOLS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Verify the wheel ships the compiled extension and licence run: | @@ -109,15 +112,9 @@ jobs: print(sys.argv[1], "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: xtcocotools-${{ env.XTCOCOTOOLS_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish xtcocotools ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-yappi.yml b/.github/workflows/build-yappi.yml index 46e83683258f..a92a2631c2f1 100644 --- a/.github/workflows/build-yappi.yml +++ b/.github/workflows/build-yappi.yml @@ -61,7 +61,6 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # musllinux is dropped: gevent, the test dependency, has no musl riscv64 wheel. cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ # Upstream builds its wheels untested and runs this suite separately. cibw-test-extras: test cibw-test-sources: tests run_tests.py diff --git a/.github/workflows/build-yara-python.yml b/.github/workflows/build-yara-python.yml index 1708b8a34458..83bade0864d9 100644 --- a/.github/workflows/build-yara-python.yml +++ b/.github/workflows/build-yara-python.yml @@ -52,53 +52,63 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build yara-python ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "yara-python" + version: "${{ matrix.version }}" + repository: "VirusTotal/yara-python" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + checkout-submodules: "true" + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/yara-python/${{ matrix.version }}/00*.patch + + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + # Rocky 10 and Alpine both carry a current openssl-dev(el); skip upstream's + # from-source OpenSSL 1.1.1w build, which the images don't need. + cibw-before-all-linux: |- + if command -v dnf > /dev/null; then + dnf install -y openssl-devel + elif command -v apk > /dev/null; then + apk add openssl-dev + fi + cibw-build-frontend: "build; args: --config-setting=--enable-openssl" + cibw-test-command: "python {package}/tests.py" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 60 strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.setup.outputs.matrix) }} - env: YARA_PYTHON_VERSION: ${{ matrix.version }} - steps: - - name: Checkout yara-python v${{ env.YARA_PYTHON_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: VirusTotal/yara-python - ref: v${{ env.YARA_PYTHON_VERSION }} - submodules: true - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - path: python-wheels - persist-credentials: false - - # The extension compiles the vendored yara/ submodule straight into the .so and - # dynamically links libcrypto for the hash module, but ships only its own LICENSE. - - name: Patch yara-python source - run: | - git apply python-wheels/patches/yara-python/${{ env.YARA_PYTHON_VERSION }}/00*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - env: - CIBW_ARCHS: riscv64 - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - # Rocky 10 and Alpine both carry a current openssl-dev(el); skip upstream's - # from-source OpenSSL 1.1.1w build, which the images don't need. - CIBW_BEFORE_ALL_LINUX: | - if command -v dnf > /dev/null; then - dnf install -y openssl-devel - elif command -v apk > /dev/null; then - apk add openssl-dev - fi - CIBW_BUILD_FRONTEND: "build; args: --config-setting=--enable-openssl" - CIBW_TEST_COMMAND: python {package}/tests.py + name: yara-python-${{ env.YARA_PYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the compiled extension made it into the wheel run: | @@ -110,15 +120,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: yara-python-${{ env.YARA_PYTHON_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish yara-python ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-zeroconf.yml b/.github/workflows/build-zeroconf.yml index 743442e81117..46fd29b2c99c 100644 --- a/.github/workflows/build-zeroconf.yml +++ b/.github/workflows/build-zeroconf.yml @@ -61,7 +61,7 @@ jobs: # Upstream passes REQUIRE_CYTHON as a plain job env var, which never # reaches the Linux build container; build_ext.py otherwise falls back # to a pure-Python wheel under a riscv64 tag. - cibw-environment: REQUIRE_CYTHON=1 + cibw-environment-linux: REQUIRE_CYTHON=1 cibw-test-sources: tests cibw-test-requires: 'pytest>=9.1.1,<10 pytest-asyncio>=1.4.0,<1.5.0 pytest-codspeed>=5.0.3,<6.0.0' cibw-test-command: >- diff --git a/.github/workflows/build-zipcodes.yml b/.github/workflows/build-zipcodes.yml index cd0984c38cfe..80274e10de1c 100644 --- a/.github/workflows/build-zipcodes.yml +++ b/.github/workflows/build-zipcodes.yml @@ -53,46 +53,46 @@ jobs: matrix: version: ${{ fromJSON(needs.setup.outputs.versions) }} name: Build zipcodes ${{ matrix.version }} cp39-abi3-manylinux_riscv64 + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "zipcodes" + version: "${{ matrix.version }}" + repository: "seanpianka/zipcodes" + ref: "v${{ matrix.version }}" + artifact-tag: "cp39-abi3-manylinux_riscv64" + timeout-minutes: 90 + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + # pyo3's abi3-py39 feature is on unconditionally, so one abi3 wheel + # serves every interpreter it claims; upstream publishes no + # free-threaded (cp314t) wheel, so there is no second job here. + # Built on cp39 -- the oldest interpreter the abi3 tag claims -- + # and re-tested on the newer ones via find_compatible_wheel. + cibw-build: "cp39-manylinux_riscv64 cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64" + # zipcodes ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + cibw-before-all-linux: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" + cibw-environment-linux: "PATH=\"$PATH:$HOME/.cargo/bin\"" + cibw-test-requires: "pytest" + cibw-test-sources: "tests" + cibw-test-command: "python -c \"import zipcodes._zipcodes as m; assert m.__file__.endswith('.abi3.so'), m.__file__\" && python -m pytest -v tests" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 - + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} env: ZIPCODES_VERSION: ${{ matrix.version }} - steps: - - name: Checkout zipcodes v${{ env.ZIPCODES_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: seanpianka/zipcodes - ref: v${{ env.ZIPCODES_VERSION }} - persist-credentials: false - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - output-dir: wheelhouse/ - env: - # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. - # pyo3's abi3-py39 feature is on unconditionally, so one abi3 wheel - # serves every interpreter it claims; upstream publishes no - # free-threaded (cp314t) wheel, so there is no second job here. - # Built on cp39 -- the oldest interpreter the abi3 tag claims -- - # and re-tested on the newer ones via find_compatible_wheel. - CIBW_BUILD: >- - cp39-manylinux_riscv64 cp310-manylinux_riscv64 - cp311-manylinux_riscv64 cp312-manylinux_riscv64 - cp313-manylinux_riscv64 cp314-manylinux_riscv64 - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # zipcodes ships no [tool.cibuildwheel], so the Rust toolchain its - # maturin backend needs is installed in-container here. - CIBW_BEFORE_ALL_LINUX: >- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_SOURCES: tests - CIBW_TEST_COMMAND: >- - python -c "import zipcodes._zipcodes as m; assert m.__file__.endswith('.abi3.so'), m.__file__" && - python -m pytest -v tests + name: zipcodes-${{ env.ZIPCODES_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse - name: Check the extension and licence made it into the wheel run: | @@ -105,15 +105,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: zipcodes-${{ env.ZIPCODES_VERSION }}-cp39-abi3-manylinux_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish zipcodes ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-zipline-reloaded.yml b/.github/workflows/build-zipline-reloaded.yml index d669507ef8f1..1c9695de94d8 100644 --- a/.github/workflows/build-zipline-reloaded.yml +++ b/.github/workflows/build-zipline-reloaded.yml @@ -78,11 +78,7 @@ jobs: # GITHUB_ACTIONS=true repeats upstream's [tool.cibuildwheel] environment, # which CIBW_ENVIRONMENT replaces (gotcha 107); tests/test_testing.py keys # its xfail on it. - cibw-environment: >- - GITHUB_ACTIONS=true - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ZIPLINE_RELOADED=${{ matrix.version }} - PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - PIP_ONLY_BINARY=numpy,scipy,pandas,tables,pillow,h5py + cibw-environment-linux: "GITHUB_ACTIONS=true SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ZIPLINE_RELOADED=${{ matrix.version }} PIP_ONLY_BINARY=numpy,scipy,pandas,tables,pillow,h5py" # 3.1.1's tests predate numpy 2.4 and empyrical-reloaded 0.7. numpy 2.4 # expired the 1.25 deprecation of ndim>0 array -> Python scalar # conversion (now TypeError "only 0-dimensional arrays can be diff --git a/.github/workflows/build-zodbpickle.yml b/.github/workflows/build-zodbpickle.yml index 725c8ab22bd9..53a091cea621 100644 --- a/.github/workflows/build-zodbpickle.yml +++ b/.github/workflows/build-zodbpickle.yml @@ -59,7 +59,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # zope.testrunner pulls in zope.interface, which has no riscv64 wheel # on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test # Upstream's two test steps (with and without the C extension). cibw-test-command: >- diff --git a/.github/workflows/build-zope-container.yml b/.github/workflows/build-zope-container.yml index 5ddc753adf13..d2f6b6d542aa 100644 --- a/.github/workflows/build-zope-container.yml +++ b/.github/workflows/build-zope-container.yml @@ -59,7 +59,6 @@ jobs: cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # zope.interface and the rest of the zope.* / ZODB dependency chain # have no riscv64 wheel on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test cibw-test-environment: ZOPE_INTERFACE_STRICT_IRO=1 # Upstream's two test steps. setup.py swallows extension build failures diff --git a/.github/workflows/build-zope-index.yml b/.github/workflows/build-zope-index.yml index acffdbd45613..040e828af7e3 100644 --- a/.github/workflows/build-zope-index.yml +++ b/.github/workflows/build-zope-index.yml @@ -58,7 +58,6 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # BTrees, persistent and zope.interface have no riscv64 wheel on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test cibw-test-environment: ZOPE_INTERFACE_STRICT_IRO=1 # Upstream's two test steps. setup.py swallows extension build failures diff --git a/.github/workflows/build-zope-proxy.yml b/.github/workflows/build-zope-proxy.yml index 8311d5c5758e..59af4613481a 100644 --- a/.github/workflows/build-zope-proxy.yml +++ b/.github/workflows/build-zope-proxy.yml @@ -57,7 +57,6 @@ jobs: ref: ${{ matrix.version }} artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-environment: ZOPE_INTERFACE_STRICT_IRO=1 # Upstream's two test steps. setup.py swallows extension build failures # (optional_build_ext), so PURE_PYTHON=0 - which makes the C import diff --git a/.github/workflows/build-zope-security.yml b/.github/workflows/build-zope-security.yml index 1057367b9d4a..372832d07c78 100644 --- a/.github/workflows/build-zope-security.yml +++ b/.github/workflows/build-zope-security.yml @@ -58,7 +58,6 @@ jobs: artifact-tag: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 cibw-build: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 # cffi and zope.interface have no riscv64 wheel on public PyPI. - cibw-environment: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ cibw-test-extras: test cibw-test-environment: ZOPE_INTERFACE_STRICT_IRO=1 # PURE_PYTHON=0 proves setup.py did not swallow an extension build failure. diff --git a/.github/workflows/build-zopfli.yml b/.github/workflows/build-zopfli.yml index 16015a73f72a..e3afe3d377ad 100644 --- a/.github/workflows/build-zopfli.yml +++ b/.github/workflows/build-zopfli.yml @@ -65,7 +65,7 @@ jobs: cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 # setuptools_scm can't see the tag from the shallow checkout. - cibw-environment: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ZOPFLI=${{ matrix.version }} + cibw-environment-linux: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_ZOPFLI=${{ matrix.version }} cibw-test-extras: test cibw-test-command: pytest {package}/tests -v timeout-minutes: 90 diff --git a/.github/workflows/build-zttp.yml b/.github/workflows/build-zttp.yml index 7233aca6d1b5..40a55847d349 100644 --- a/.github/workflows/build-zttp.yml +++ b/.github/workflows/build-zttp.yml @@ -50,6 +50,44 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build zttp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.setup.outputs.matrix) }} + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "zttp" + version: "${{ matrix.version }}" + repository: "Kludex/zttp" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/zttp/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" + cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION=${{ matrix.version }}" + # Upstream's build[uv] frontend needs a host uv the runner has none of. + cibw-build-frontend: "build" + # Upstream's wheel test is an import smoke; run its pytest suite (main.yml) instead. + cibw-test-requires: "pytest inline-snapshot" + cibw-test-sources: "tests docs pyproject.toml" + cibw-test-command: "python -m pytest -v" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: @@ -58,38 +96,12 @@ jobs: include: ${{ fromJSON(needs.setup.outputs.matrix) }} env: ZTTP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout zttp v${{ env.ZTTP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repository: Kludex/zttp - ref: v${{ env.ZTTP_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch zttp source - run: git apply python-wheels/patches/zttp/${{ env.ZTTP_VERSION }}/*.patch - - - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 - with: - output-dir: wheelhouse/ - only: ${{ matrix.python }}-${{ matrix.platform }}_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} - CIBW_ENVIRONMENT: SETUPTOOLS_SCM_PRETEND_VERSION=${{ env.ZTTP_VERSION }} - # Upstream's build[uv] frontend needs a host uv the runner has none of. - CIBW_BUILD_FRONTEND: build - # Upstream's wheel test is an import smoke; run its pytest suite (main.yml) instead. - CIBW_TEST_REQUIRES: pytest inline-snapshot - CIBW_TEST_SOURCES: tests docs pyproject.toml - CIBW_TEST_COMMAND: python -m pytest -v + name: zttp-${{ env.ZTTP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 + path: wheelhouse - name: Check the wheel is compiled and carries the release version run: | @@ -102,15 +114,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: zttp-${{ env.ZTTP_VERSION }}-${{ matrix.python }}-${{ matrix.platform }}_riscv64 - path: wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish zttp ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/build-zuvloop.yml b/.github/workflows/build-zuvloop.yml index 11c4bb85b49b..f0385102fedc 100644 --- a/.github/workflows/build-zuvloop.yml +++ b/.github/workflows/build-zuvloop.yml @@ -49,6 +49,46 @@ jobs: needs: [setup] if: needs.setup.outputs.versions != '[]' name: Build zuvloop ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: ["cp314", "cp314t", "cp315", "cp315t"] + include: + # hypothesis ships no cp314t riscv64 wheel and its sdist needs a Rust + # toolchain riscv64 lacks; pin its last pure-Python release there. + - python: cp314t + hypothesis: "hypothesis<6.156" + + uses: $/.github/workflows/_build-cibuildwheel.yml + with: + package: "zuvloop" + version: "${{ matrix.version }}" + repository: "Kludex/zuvloop" + ref: "v${{ matrix.version }}" + artifact-tag: "${{ matrix.python }}-manylinux_riscv64" + timeout-minutes: 90 + pre-build: |- + rm -rf "python-wheels" + git init -q "python-wheels" + git -C "python-wheels" remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git -C "python-wheels" fetch -q --no-tags --depth=1 origin "${{ github.sha }}" + git -C "python-wheels" checkout -q --detach FETCH_HEAD + + git apply python-wheels/patches/zuvloop/${{ matrix.version }}/*.patch + while IFS='=' read -r pw_key pw_value; do + [[ $pw_key =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]] || continue + printf -v "$pw_key" '%s' "$pw_value" + export "$pw_key" + done < "$GITHUB_ENV" + cibw-build: "${{ matrix.python }}-manylinux_riscv64" + # The applied patch dirties the tree, so hatch-vcs would stamp the next .dev0. + cibw-environment-linux: "SETUPTOOLS_SCM_PRETEND_VERSION=${{ matrix.version }}" + cibw-test-requires: "aiohttp anyio httptools ${{ matrix.hypothesis || 'hypothesis' }} opentelemetry-sdk pytest pytest-timeout uvicorn" + + verify_wheels: + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' runs-on: ubuntu-24.04-riscv timeout-minutes: 90 strategy: @@ -61,36 +101,14 @@ jobs: # toolchain riscv64 lacks; pin its last pure-Python release there. - python: cp314t hypothesis: "hypothesis<6.156" - env: ZUVLOOP_VERSION: ${{ matrix.version }} - steps: - - name: Checkout zuvloop v${{ env.ZUVLOOP_VERSION }} - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: Kludex/zuvloop - ref: v${{ env.ZUVLOOP_VERSION }} - persist-credentials: false - - - name: Checkout python-wheels - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - path: python-wheels - persist-credentials: false - - - name: Patch zuvloop source - run: git apply python-wheels/patches/zuvloop/${{ env.ZUVLOOP_VERSION }}/*.patch - - - name: Build wheels - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + - name: Download wheels + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - only: ${{ matrix.python }}-manylinux_riscv64 - env: - CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - # The applied patch dirties the tree, so hatch-vcs would stamp the next .dev0. - CIBW_ENVIRONMENT: SETUPTOOLS_SCM_PRETEND_VERSION=${{ env.ZUVLOOP_VERSION }} - CIBW_TEST_REQUIRES: aiohttp anyio httptools ${{ matrix.hypothesis || 'hypothesis' }} opentelemetry-sdk pytest pytest-timeout uvicorn + name: zuvloop-${{ env.ZUVLOOP_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse - name: Check the wheel is compiled and carries the release version run: | @@ -103,15 +121,9 @@ jobs: print(whl, "ok") EOF - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: zuvloop-${{ env.ZUVLOOP_VERSION }}-${{ matrix.python }}-manylinux_riscv64 - path: ./wheelhouse/*.whl - if-no-files-found: error - publish: name: Publish zuvloop ${{ matrix.version }} - needs: [setup, build_wheels] + needs: [setup, build_wheels, verify_wheels] if: needs.setup.outputs.versions != '[]' strategy: fail-fast: false diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 54280de00d5d..6f865708f3e1 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -169,14 +169,17 @@ jobs: ) def input_name(key): + if key == "CIBW_ENVIRONMENT": + return "cibw-environment-linux" return "cibw-" + key.removeprefix("CIBW_").lower().replace("_", "-") errors = [] for key in sorted(used_environment): expected = input_name(key) + configured_key = "CIBW_ENVIRONMENT_LINUX" if key == "CIBW_ENVIRONMENT" else key if expected not in inputs: errors.append(f"{key} has no {expected} workflow_call input") - if key not in configured_environment: + if configured_key not in configured_environment: errors.append(f"{key} is not mapped into the configuration step") if key not in exported_environment: errors.append(f"{key} is not exported for the cibuildwheel action")