Skip to content

Set compile invalidation method #5551

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

Closed
Siecje opened this issue Jun 28, 2018 · 3 comments
Closed

Set compile invalidation method #5551

Siecje opened this issue Jun 28, 2018 · 3 comments
Labels
auto-locked Outdated issues that have been locked by automation type: feature request Request for a new feature

Comments

@Siecje
Copy link

Siecje commented Jun 28, 2018

What's the problem this feature will solve?

I'm trying to have pip create "hash-based"[0] .pyc files when you install a distribution package.

0: https://docs.python.org/3.7/reference/import.html#cached-bytecode-invalidation

Describe the solution you'd like

pip could accept a --invalidation-mode argument which matches the same argument for python -m compileall[1] and sets the cache method.

1: https://docs.python.org/3.7/library/compileall.html#cmdoption-compileall-invalidation-mode

Currently I am installing distribution packages with pip and then setting the timestamp in the .pyc file to a known value. This does not use the new "hash-based" cache files.

Alternative Solutions

I could re-compile the Python files with the preferred mode.

Additional context

https://www.python.org/dev/peps/pep-0552/

@Siecje
Copy link
Author

Siecje commented Jul 9, 2018

--compile could also accept options

@pradyunsg pradyunsg added the type: feature request Request for a new feature label Jul 9, 2018
@pradyunsg
Copy link
Member

Closing as a duplicate of #5648 since that has a better description. :)

@lock
Copy link

lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

2 participants