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

Use the MACOSX_DEPLOYMENT_TARGET env variable #441

Merged
merged 1 commit into from Jul 27, 2019

Conversation

@certik
Copy link
Contributor

commented Jul 26, 2019

If the variable is defined, use it. Othewise use the value from distutils.

Copy link
Contributor

left a comment

Thanks for the PR 👍

After addressing few nitpicks, it will be good for integration.

In the mean time, could you also:

skbuild/constants.py Outdated Show resolved Hide resolved
skbuild/constants.py Show resolved Hide resolved
@certik

This comment has been minimized.

Copy link
Contributor Author

commented Jul 26, 2019

I updated the CHANGES. Would you mind helping me with the Documentation? Where do you think this should be mentioned?

Also, how would you suggest to test this? It's not quite clear to me from the test you mentioned.

@jcfr

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2019

Would you mind helping me with the Documentation? Where do you think this should be mentioned?

In the Customizing Deployment Target and Architecture, I could do the following:

Customizing Deployment Target and Architecture
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. versionadded:: 0.11.0

Deployment target can be customized by setting the MACOSX_DEPLOYMENT_TARGET
environment variable.


.. versionadded:: 0.7.0

Deployment target and architecture can be customized by associating the 
[...]

Also, how would you suggest to test this? It's not quite clear to me from the test you mentioned.

This could be done changing:

@pytest.mark.parametrize("cli_setup_args,keyword_cmake_args,cli_cmake_args,expected_cmake_osx_deployment_target",

to

@pytest.mark.parametrize("osx_deployment_target_env_var, cli_setup_args,keyword_cmake_args,cli_cmake_args,expected_cmake_osx_deployment_target",

osx_deployment_target_env_var should be set to None in all existing case, and a new case setting the env var to a specific value should be added.

CHANGES.rst Outdated Show resolved Hide resolved
@certik certik force-pushed the certik:osx branch from 296084b to 6b475dd Jul 26, 2019
@certik

This comment has been minimized.

Copy link
Contributor Author

commented Jul 26, 2019

This is mostly implemented. There are two issues:

  • The test fails, but I don't know what the best way to fix it is. I currently set the environment variable in the test, perhaps it does not work somehow.

  • There is also an issue that I couldn't figure out how to make the code flake8 compliant, so I disabled flake8 testing for now in 8fc4042 (that commit should be reverted).

@jcfr if you know how to finish this, feel free to push into my branch. I think it's pretty close, and somebody more familiar with scikit-build might be able to finish it quickly.

@certik

This comment has been minimized.

Copy link
Contributor Author

commented Jul 26, 2019

The issue is with the test. It is made to execute on all platforms, but the _default_skbuild_plat_name does not pick up the sys.platform == 'darwin', and so it will not read the MACOSX_DEPLOYMENT_TARGET env var, and so the test will fail on Linux.

@certik

This comment has been minimized.

Copy link
Contributor Author

commented Jul 26, 2019

The _default_skbuild_plat_name() function is being executed before the test in tests/test_issue342_cmake_osx_args_in_setup.py even has a chance to run. And so the function _default_skbuild_plat_name cannot be tested like you proposed I think.

Is there another way you would like to test it?

@certik

This comment has been minimized.

Copy link
Contributor Author

commented Jul 26, 2019

Tests should pass. @jcfr this is ready for review. The commits should probably be squashed.

…v variable

If the MACOSX_DEPLOYMENT_TARGET environment variable is defined, use
it, as it will be the most accurate. Otherwise use the value returned
by platform.mac_ver() provided by the platform module available in
the Python standard library.
@jcfr jcfr force-pushed the certik:osx branch from 6c5fab8 to 1b3e37f Jul 27, 2019
@jcfr jcfr merged commit bdc9ec9 into scikit-build:master Jul 27, 2019
7 checks passed
7 checks passed
ci/circleci: python27 Your tests passed on CircleCI!
Details
ci/circleci: python35 Your tests passed on CircleCI!
Details
ci/circleci: python36 Your tests passed on CircleCI!
Details
ci/circleci: python37 Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
scikit-build.scikit-build #20190727.1 succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.