fujiisoup / py3nj

Wigner's 3J, 6J, 9J symbols for python
https://py3nj.readthedocs.io/
Apache License 2.0
18 stars 5 forks source link

Publish ci #30

Closed fujiisoup closed 1 year ago

fujiisoup commented 1 year ago

Adding a CI to publish wheels to PyPI, according to the comment https://github.com/fujiisoup/py3nj/pull/27#issuecomment-1694585707

fujiisoup commented 1 year ago

It is still failing, saying

+ python -m pip wheel 'D:\a\py3nj\py3nj' '--wheel-dir=C:\Users\runneradmin\AppData\Local\Temp\cibw-run-2eznju6f\cp38-win32\built_wheel' --no-deps
  Processing d:\a\py3nj\py3nj
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'error'
    error: subprocess-exited-with-error

    × Preparing metadata (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [12 lines of output]
        + meson setup D:\a\py3nj\py3nj D:\a\py3nj\py3nj\.mesonpy-p5usx21z\build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=D:\a\py3nj\py3nj\.mesonpy-p5usx21z\build\meson-python-native-file.ini
        The Meson build system
        Version: 1.2.1
        Source dir: D:\a\py3nj\py3nj
        Build dir: D:\a\py3nj\py3nj\.mesonpy-p5usx21z\build
        Build type: native build
        Project name: py3nj
        Project version: 0.2.2

        ..\..\meson.build:1:0: ERROR: Executables created by fortran compiler gfortran are not runnable.

        A full log can be found at D:\a\py3nj\py3nj\.mesonpy-p5usx21z\build\meson-logs\meson-log.txt
        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: metadata-generation-failed

  × Encountered error while generating package metadata.
  ╰─> See above for output.

  note: This is an issue with the package mentioned above, not pip.
  hint: See above for details.
  Error: Command ['python', '-m', 'pip', 'wheel', 'D:\\a\\py3nj\\py3nj', '--wheel-dir=C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-2eznju6f\\cp38-win32\\built_wheel', '--no-deps'] failed with code 1. None

Looks like it fails in compilation / installation.

kalekundert commented 1 year ago

I think the issue is that the wheels need to be built in the same environment that the tests are run in, i.e. with ninja and a working fortran compiler installed.

I made a branch (kalekundert/py3nj:cibuildwheel) that refactors the build environment setup steps into their own action, so that they can easily be used in both the test and publish workflows. That avoids the above error, but runs into two more errors:

fujiisoup commented 1 year ago

Taken over by #31