One function
initpkg in pytest-dev/apipkg
The author described this change as “fix typos and auto-obtain version from pkg_ressources”. It counts as a record because the check below fails on the code as it stood at 4d840c3b3 and passes on a10f27e46, with nothing else changed between the two runs.
Projectpytest-dev/apipkg
Fix saved2015-02-15
Sharing licenceMIT · LICENSE
Change size+3 −1
What the code was meant to do, written into the code itself as a docstring
initialize given package from the export definitions.
The change
| 8 | 8 | d['__file__'] = f | |
| 9 | 9 | if hasattr(oldmod, '__version__'): | |
| 10 | 10 | d['__version__'] = oldmod.__version__ | |
| 11 | + | elif distribution_version(pkgname) is not None: | |
| 12 | + | d['__version__'] = distribution_version(pkgname) | |
| 11 | 13 | if hasattr(oldmod, '__loader__'): | |
| 12 | 14 | d['__loader__'] = oldmod.__loader__ | |
| 13 | 15 | if hasattr(oldmod, '__path__'): | |
| ⋯ | |||
| 19 | 21 | oldmod.__dict__.update(d) | |
| 20 | 22 | mod = ApiModule(pkgname, exportdefs, implprefix=pkgname, attr=d) | |
| 21 | 23 | sys.modules[pkgname] = mod | |
| 22 | - | # eaerload in bypthon to avoid their monkeypatching breaking packages | |
| 24 | + | # eagerload in bypthon to avoid their monkeypatching breaking packages | |
| 23 | 25 | if 'bpython' in sys.modules or eager: | |
| 24 | 26 | for module in sys.modules.values(): | |
| 25 | 27 | if isinstance(module, ApiModule): | |
The check that tells the two apart
fail→pass·test_apipkg.py::test_autoset_version_attribute_from_distribution
Check file test_apipkg.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it4d840c3b33c1dbc79849879bb969eee1bd6c12b9
Broken version dated2015-02-15
Moduleapipkg
Units changedinitpkg
Fingerprint47d8fc9447534e16
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.