Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLD: fix bleeding-edge build script #4898

Merged
merged 5 commits into from May 11, 2024

Conversation

yut23
Copy link
Member

@yut23 yut23 commented May 7, 2024

PR Summary

Updates the bleeding-edge CI workflow script to run only pip and adds the numpy API macros to the clib defines.

Fixes #4896.

PR Checklist

  • New features are documented, with docstrings and narrative docs
  • Adds a test for any bugs fixed. Adds tests for new features.

@yut23
Copy link
Member Author

yut23 commented May 7, 2024

I'm not sure if python setup.py build_ext is necessary anymore, since the build also works fine if I remove the setup.py calls entirely.

@neutrinoceros
Copy link
Member

Thanks a lot for following up on this so promptly !

I'm not sure if python setup.py build_ext is necessary anymore, since the build also works fine if I remove the setup.py calls entirely.

You're right, the script is currently mixing up 2 ways to build yt, and pip install already does build + install so setup.py invokes are redundant (and apparently broken) !

There's also a pre-commit lint error (though I don't get why it's poping now).

@yut23
Copy link
Member Author

yut23 commented May 7, 2024

Is python setup.py develop still a supported install method? The docs mention it here: https://yt-project.org/docs/dev/visualizing/unstructured_mesh_rendering.html. If it is, then we should probably do something like python-hyper/brotlicffi#92 instead, as develop only runs build_ext, not build_clib.

@yut23
Copy link
Member Author

yut23 commented May 7, 2024

yt update also uses setup.py, see update_git() and rebuild_modules() in yt/funcs.py:

yt/yt/funcs.py

Lines 474 to 481 in 8d58839

print("Here's a set of sample commands:")
print("")
print(f" $ cd {path}")
print(" $ git stash")
print(" $ git checkout main")
print(" $ git pull")
print(" $ git stash pop")
print(f" $ {sys.executable} setup.py develop")

yt/yt/funcs.py

Lines 515 to 522 in 8d58839

def rebuild_modules(path, f):
f.write("Rebuilding modules\n\n")
p = subprocess.Popen(
[sys.executable, "setup.py", "build_ext", "-i"],
cwd=path,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)

@neutrinoceros
Copy link
Member

nice catch. I don't know that we exercise setup.py develop anywhere else and I don't know if it still works as intended. pip install unfortunately does a bit more than what rebuild_modules is supposed to do so I think we should stick to setup.py commands in this function and include the clibs build step your first proposed there.
FTR I'm not sure anyone still relies on the yt command line to manage a git repo (or that anyone should), so I would advocate for deprecating them, but that's out of scope for the present PR.

@neutrinoceros neutrinoceros added build related to the build process tests: running tests Issues with the test setup bug labels May 7, 2024
@neutrinoceros neutrinoceros added this to the 4.4.0 milestone May 7, 2024
@neutrinoceros
Copy link
Member

"Mergeable bot" appears to be stuck. As I don't control it, I'm going to try to close/reopen, hoping this wakes it up.

@neutrinoceros neutrinoceros reopened this May 8, 2024
@neutrinoceros neutrinoceros added bug and removed bug labels May 11, 2024
@neutrinoceros neutrinoceros merged commit 0a865a3 into yt-project:main May 11, 2024
26 checks passed
@matthewturk
Copy link
Member

Ah, this seems to be related to where I was running into issues. I believe my current development workflow is broken, as I utilize build_ext -i constantly and have multiple checkouts I switch between. I find it annoying that it's not working, but unless I am able to identify a solution I won't belabor the point here and I'll just try to update my usage.

@neutrinoceros
Copy link
Member

It still works if you run build_clib first.

@matthewturk
Copy link
Member

matthewturk commented May 16, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build related to the build process tests: running tests Issues with the test setup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BLD: non-isolated builds are broken
3 participants