File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848 - name : Build wheel
4949 run : |
5050 cd python/
51- pip install build setuptools wheel
52- python -m build --wheel
51+ pip install setuptools wheel
52+ pip wheel . --no-deps -w dist/
5353 ls dist/
5454 - name : Run unit tests
5555 run : |
Original file line number Diff line number Diff line change 5353
5454 upload_windows_wheels :
5555 needs : build_windows_wheels
56- runs-on : ubuntu-22.04
56+ runs-on : ubuntu-latest
5757 if : ${{ github.repository_owner == 'NeuroJSON' && needs.build_windows_wheels.outputs.perform_pypi_upload == 1 && github.event_name != 'pull_request'}}
5858 permissions :
5959 id-token : write
Original file line number Diff line number Diff line change 4545
4646def ensure_csrc ():
4747 """Copy C sources from parent directory into csrc/ if needed."""
48- if os .path .isdir (os .path .join (csrc_dir , "src" )):
48+ csrc_src = os .path .join (csrc_dir , "src" )
49+ if os .path .isdir (csrc_src ) and os .path .isfile (os .path .join (csrc_src , "zmatlib.c" )):
4950 return # already populated
5051
5152 if not os .path .isdir (parent_srcdir ):
52- return # no parent sources available (pure sdist build)
53+ return # no parent sources available (pure sdist build, csrc should be in tree )
5354
5455 parent = os .path .join (here , ".." )
5556 for src_rel , dst_rel in COPY_ITEMS :
@@ -67,7 +68,21 @@ def ensure_csrc():
6768
6869
6970# copy sources into csrc/ so all paths are within setup.py's directory
71+ # must change to setup.py's directory first so relative paths work
72+ _orig_cwd = os .getcwd ()
73+ os .chdir (here )
7074ensure_csrc ()
75+ os .chdir (_orig_cwd )
76+
77+ # verify csrc exists
78+ csrc_src = os .path .join (csrc_dir , "src" )
79+ if not os .path .isdir (csrc_src ):
80+ import warnings
81+
82+ warnings .warn (
83+ "csrc/src/ not found - C sources may be missing. "
84+ "Build from a full git checkout or a complete sdist."
85+ )
7186
7287# all paths are relative to here, inside csrc/
7388srcdir = os .path .join ("csrc" , "src" )
You can’t perform that action at this time.
0 commit comments