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

Compile sysconfig's data #742

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jakirkham
Copy link
Member

@jakirkham jakirkham commented Nov 14, 2024

It appears sysconfig's data doesn't get compiled until install time, which results in a file modification after installation. This can throw up red flags in certain install environments and when using conda doctor. To address this, import sysconfig and run sysconfig.get_config_vars(), which loads the data file as a dict. This should compile the data file.

Also pprint the data for additional debug information/validation.


Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

Fixes #741

It appears `sysconfig`'s data doesn't get compiled until install time,
which results in a file modification after installation. This can throw
up red flags in certain install environments and when using `conda
doctor`. To address this, `import sysconfig` and run
`sysconfig.get_config_vars()`, which loads the data file as a `dict`.
This should compile the data file.

Also `pprint` the data for additional debug information/validation.
@conda-forge-admin
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

python -c "import compileall,os;compileall.compile_dir(os.environ['PREFIX'])"
python -c "import pprint, sysconfig; pprint(sysconfig.get_config_vars())"
Copy link
Member Author

@jakirkham jakirkham Nov 14, 2024

Choose a reason for hiding this comment

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

As there is a fair bit of logic above to handle the generation of sysconfig data (and possibly additional considerations for cross-compilation), there may be a better approach than this. Open to suggestions

Comment on lines +188 to +190
:: Ensure `sysconfig`'s data is also compiled
%PREFIX%\python.exe -c "import pprint, sysconfig; pprint(sysconfig.get_config_vars())"
if %errorlevel% neq 1 exit /b 1
Copy link
Member Author

Choose a reason for hiding this comment

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

Windows doesn't seem to have the same complexities as the UNIX builds. So think this is probably sufficient here

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

Successfully merging this pull request may close these issues.

Conda Doctor Altered Files: Python, in a new install, can't resolve.
2 participants