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

fix: Ensure importlib_metadata runtime dependency installed with Python < 3.10 #474

Conversation

jcfr
Copy link
Contributor

@jcfr jcfr commented Mar 26, 2024

Fixes a regression introduced in 5f068d5 ("chore(build): move to scikitbuild-core (#455)", 2024-03-01)

…on < 3.10

Fixes a regression introduced in 5f068d5 ("chore(build): move to
scikitbuild-core (scikit-build#455)", 2024-03-01)

Reported-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Reported-by: Shizhi Tang <rd0x01@gmail.com>
Co-authored-by: Fabio Luporini <fabio@devitocodes.com>
@jcfr
Copy link
Contributor Author

jcfr commented Mar 26, 2024

cc: @mayeut @henryiii

@jcfr
Copy link
Contributor Author

jcfr commented Mar 26, 2024

Thanks @agriyakhetarpal, @braindevices, @mloubout and @roastduck for the issue reports and pull requests 🙏

@jcfr
Copy link
Contributor Author

jcfr commented Mar 26, 2024

Once the fix has been reviewed, approved and integrated, suggested path forward:

  • Yank CMake 3.29.0
  • Release 3.29.0.1

@mudit2812
Copy link

mudit2812 commented Mar 26, 2024

importlib_metadata is only needed for python 3.7. Versions 3.8 or greater can use importlib.metadata, which ships with python afaik

@mloubout
Copy link

Still needs to fix from #473 for correct version checking

@agriyakhetarpal
Copy link

agriyakhetarpal commented Mar 26, 2024

@mudit2812 and @mloubout, Python 3.7 support was recently dropped with 3.29.0. Do we even need the conditional import for importlib_metadata at all, then? We can just use importlib.metadata and that should work? i.e., I don't think adding importlib_metadata as a required dependency is required at all, now – it would be better to drop the conditional import from src/cmake/__init__.py.

@mloubout
Copy link

Didn't see Python 3.8 was the minimum version now, should be able to completely drop importlib_metadata then as you pointed out.

pyproject.toml Outdated Show resolved Hide resolved
@agriyakhetarpal
Copy link

docs/conf.py seems to have been using the correct Python version check, as reported by @mloubout:

if sys.version_info < (3, 8):
import importlib_metadata as metadata
else:
from importlib import metadata

@henryiii
Copy link
Contributor

Python 3.7 is the minimum version, not 3.8. We just dropped 2.7 and 3.6.

@agriyakhetarpal
Copy link

Oops, thanks! Updated my review to mark that change

@henryiii
Copy link
Contributor

You are correct about this working in 3.8+ though, I just checked. There are bugs in importlib.metadata before 3.10.2, but this shouldn't hit those.

@henryiii
Copy link
Contributor

@jcfr I don't have permission to yank cmake 3.29.0, let's go ahead and do that, since it's breaking people and people probably aren't requiring it yet after a few hours, and if they did, it would still work (due to yanks resolving if they can't resolve to a non-yanked version). CI will take ~20-30 mins here, then the release will take ~3 hours.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii henryiii force-pushed the ensure-importlib_metadata-installed-in-python-less-3.10 branch from 2fbb98c to e8abbbc Compare March 26, 2024 16:02
@jcfr
Copy link
Contributor Author

jcfr commented Mar 26, 2024

re: yanked

image

@jcfr
Copy link
Contributor Author

jcfr commented Mar 26, 2024

Thanks @henryiii for further tweaking the patch 🙏 and @mloubout for testing.

🚀 ✅

@jcfr jcfr enabled auto-merge (rebase) March 26, 2024 16:09
Copy link

@mloubout mloubout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for the quick resolution 🔥

@jcfr jcfr merged commit 8ea3e18 into scikit-build:main Mar 26, 2024
23 checks passed
@jcfr jcfr deleted the ensure-importlib_metadata-installed-in-python-less-3.10 branch March 26, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants