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

pep425tags no longer available - #370

Closed
alexsavulescu opened this issue Aug 18, 2020 · 5 comments
Closed

pep425tags no longer available - #370

alexsavulescu opened this issue Aug 18, 2020 · 5 comments

Comments

@alexsavulescu
Copy link

Hello,

We've been relying on pep425tags to set MACOSX_DEPLOYMENT_TARGET:

    from wheel import pep425tags
    py_osx_framework = pep425tags.extract_macosx_min_system_version(sys.executable)
    if py_osx_framework is None:
        py_osx_framework=[10, 9]
    if py_osx_framework[1] > 9:
        log.warn("[ WARNING ] You are building a wheel with a Python built "
              "for a recent MACOS version (from brew?). Your wheel won't be portable.\n"
              "          Consider using an official Python build from python.org")
    macos_target = "%d.%d" % tuple(py_osx_framework[:2])
    log.info("Setting MACOSX_DEPLOYMENT_TARGET=%s", macos_target)
    os.environ['MACOSX_DEPLOYMENT_TARGET'] = macos_target

Since that is not available anymore, what would be the official way of achieving the above?

Thank you

@pfmoore
Copy link
Member

pfmoore commented Aug 18, 2020

If you're looking for a library API, you should be using the packaging library - that has a tags module.

https://packaging.pypa.io/en/latest/tags/

@mattip
Copy link
Contributor

mattip commented Aug 18, 2020

Does this work? import sysconfig; sysconfig.get_var('MACOSX_DEPLOYMENT_TARGET')

@agronholm
Copy link
Contributor

This function was never part of any public API. The Wheel README plainly states that there is none:

It should be noted that wheel is not intended to be used as a library, and
as such there is no stable, public API.

This will change with v1.0 but I don't think that function will be part of the API even then. I would like to see it migrate to the packaging.tags module or similar though.

@alexsavulescu
Copy link
Author

Thank you for the insight @agronholm, very clear.

@pfmoore, @mattip thanks for your help, will check those out.

@tristan957
Copy link

For anyone looking for docs page mentioned earlier: https://packaging.pypa.io/en/latest/tags.html

AnthonyBarbier pushed a commit to graphcore/poptorch that referenced this issue Jul 25, 2022
Summary:
Newer versions don't have the pep425tags module, so we need the old
version. See pypa/wheel#370.

Ref T59136.

Reviewers: #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, #pytorch, anthonyb

Reviewed By: #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, #pytorch, anthonyb

Subscribers: anthonyb

Maniphest Tasks: T59136

Differential Revision: https://phabricator.sourcevertex.net/D63797
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants