summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_py_compile.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-31904: Correct error string in test_file_not_exists() for VxWorks (GH-25965)pxinwr2021-05-081-1/+1
| | | The error string on VxWorks is "no such file or directory" for FileNotFoundError. That is, the 1st letter of the error string has lower case.
* bpo-40275: Use new test.support helper submodules in tests (GH-21764)Hai Shi2020-08-071-1/+1
|
* bpo-38731: Add --quiet option to py_compile CLI (GH-17134)Gregory Schevchenko2020-07-251-1/+70
|
* bpo-40275: Use new test.support helper submodules in tests (GH-21317)Hai Shi2020-07-061-1/+1
|
* bpo-40275: Use new test.support helper submodules in tests (GH-21314)Hai Shi2020-07-061-2/+3
|
* bpo-39041: Add GitHub Actions support (GH-17594)Steve Dower2019-12-161-1/+1
|
* bpo-22640: Add silent mode to py_compile.compile() (GH-12976)Joannah Nanjekye2019-05-281-0/+9
|
* bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH ↵Elvis Pranskevichus2018-10-101-6/+60
| | | | | | | | | | | | | | | | | | | | (GH-9607) Unconditional forcing of ``CHECKED_HASH`` invalidation was introduced in 3.7.0 in bpo-29708. The change is bad, as it unconditionally overrides *invalidation_mode*, even if it was passed as an explicit argument to ``py_compile.compile()`` or ``compileall``. An environment variable should *never* override an explicit argument to a library function. That change leads to multiple test failures if the ``SOURCE_DATE_EPOCH`` environment variable is set. This changes ``py_compile.compile()`` to only look at ``SOURCE_DATE_EPOCH`` if no explicit *invalidation_mode* was specified. I also made various relevant tests run with explicit control over the value of ``SOURCE_DATE_EPOCH``. While looking at this, I noticed that ``zipimport`` does not work with hash-based .pycs _at all_, though I left the fixes for subsequent commits.
* bpo-29708: Setting SOURCE_DATE_EPOCH forces hash-based .pyc files (GH-5200)Bernhard M. Wiedemann2018-01-241-0/+12
| | | To support reproducible builds, the setting of of SOURCE_DATE_EPOCH triggers the py_compile module -- and by extension, compileall -- to forcibly compile with hash-based .pyc files. This eliminates the possibility of timestamp-based .pyc files which vary between builds.
* closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson2017-12-091-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Python now supports checking bytecode cache up-to-dateness with a hash of the source contents rather than volatile source metadata. See the PEP for details. While a fairly straightforward idea, quite a lot of code had to be modified due to the pervasiveness of pyc implementation details in the codebase. Changes in this commit include: - The core changes to importlib to understand how to read, validate, and regenerate hash-based pycs. - Support for generating hash-based pycs in py_compile and compileall. - Modifications to our siphash implementation to support passing a custom key. We then expose it to importlib through _imp. - Updates to all places in the interpreter, standard library, and tests that manually generate or parse pyc files to grok the new format. - Support in the interpreter command line code for long options like --check-hash-based-pycs. - Tests and documentation for all of the above.
* Use support.change_cwd() in tests.Serhiy Storchaka2015-09-061-5/+3
|\
| * Use support.change_cwd() in tests.Serhiy Storchaka2015-09-061-5/+3
| |
* | Issue #23822: Fix test_py_compile to not fail under -O.Brett Cannon2015-04-131-0/+1
| |
* | Issue #23731: Implement PEP 488.Brett Cannon2015-04-131-0/+4
|/ | | | | | The concept of .pyo files no longer exists. Now .pyc files have an optional `opt-` tag which specifies if any extra optimizations beyond the peepholer were applied.
* Fix the test to use an os.sep agnostic test. Hopefully this will fix theBarry Warsaw2014-12-021-2/+6
| | | | Windows buildbots. Found by Jeremy Kloth.
* Make this change a little more robust for up-merging.Barry Warsaw2014-12-011-1/+2
|
* - Issue #22966: Fix __pycache__ pyc file name clobber when pyc_compile isBarry Warsaw2014-12-011-0/+16
| | | | | asked to compile a source file containing multiple dots in the source file name.
* Remove unused imports.Berker Peksag2014-09-011-2/+2
|
* Issue #19447: Suppress output of py_compile.compile().Berker Peksag2014-09-011-1/+2
|
* Issue #19447: Use importlib.util.cache_from_source() instead of ``bad_coding ↵Berker Peksag2014-08-221-1/+2
| | | | | | + 'c'``. Thanks to Arfrever Frehtes Taifersar Arahesis.
* Issue #19447: Add a test case to py_compile.compile() to make sureBerker Peksag2014-08-221-0/+4
| | | | | | it don't raise an exception if doraise is False. Patch by Bohuslav "Slavek" Kabrda.
* Issue 19384: Fix test_py_compile for root user, patch by Claudiu Popa.Christian Heimes2013-10-251-0/+3
|
* Issue #17177: Stop using imp with py_compileBrett Cannon2013-06-151-2/+2
|
* make test more robust under WindowsBrett Cannon2013-06-151-1/+1
|
* Issue #17222: Raise FileExistsError when py_compile.compile wouldBrett Cannon2013-06-141-0/+20
| | | | overwrite a symlink or non-regular file with a regular file.
* Issue #17244: Windows doesn't let you set permissions on directories.Brett Cannon2013-04-241-0/+2
|
* add a newlineBrett Cannon2013-04-141-1/+1
|
* Issue #17244: Don't mask exceptions raised during the creation ofBrett Cannon2013-04-141-3/+14
| | | | | | bytecode files in py_compile. Thanks to Arfrever Frehtes Taifersar Arahesis for the bug report.
* Issue #12618: py_compile cannot create files in current directoryMeador Inge2011-11-281-0/+9
| | | | Initial patch by Sjoerd de Vries.
* Issue #12618: fix py_compile unit tests to handle different drives on WindowsMeador Inge2011-11-261-0/+10
|
* Issue #12618: create unit tests for the py_compile moduleMeador Inge2011-11-261-0/+42