{"id":20940401,"url":"https://github.com/fedora-python/compileall2","last_synced_at":"2025-05-13T22:32:19.181Z","repository":{"id":55901550,"uuid":"176296865","full_name":"fedora-python/compileall2","owner":"fedora-python","description":"Enhanced Python `compileall` module","archived":false,"fork":false,"pushed_at":"2024-03-21T15:54:46.000Z","size":72,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-20T00:48:31.756Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fedora-python.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-18T13:53:47.000Z","updated_at":"2024-11-22T20:15:41.000Z","dependencies_parsed_at":"2024-11-18T23:10:15.612Z","dependency_job_id":"5fb079b8-7c55-4a39-b7e4-5b26c3688202","html_url":"https://github.com/fedora-python/compileall2","commit_stats":{"total_commits":68,"total_committers":3,"mean_commits":"22.666666666666668","dds":0.1029411764705882,"last_synced_commit":"a2bd55e643556da849e70c7c36f0dd68ca815a15"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-python%2Fcompileall2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-python%2Fcompileall2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-python%2Fcompileall2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-python%2Fcompileall2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fedora-python","download_url":"https://codeload.github.com/fedora-python/compileall2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036821,"owners_count":22003659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T23:10:12.196Z","updated_at":"2025-05-13T22:32:17.866Z","avatar_url":"https://github.com/fedora-python.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# compileall2 Python module\n\nCopy of `compileall` module from CPython source code with some new features, namely:\n\n* compatibility with Python \u003e= 3.6 \u0026 PyPy 3\n\nThe following features were first implemented in this project and then included\ninto the standard libraty of CPython.\n\n* default recursion limit is now \"unlimited\" (actually limited by `sys.getrecursionlimit()`)\n\n* `-s` and `-p` command line options for manipulation of the path baked into\n  a compiled `*.pyc` file.\n\n* the `-o` command line option can be specified multiple times to compile for \n  multiple optimization levels in one run\n\n* the `-e` command line option for ignoring symlinks pointing outside a specific directory\n\n* the `--hardlink-dupes` command line option which creates hardlinks between\n  `.pyc` files with the same content\n\n## Installation\n\n* From [PyPI](https://pypi.org/project/compileall2/) via `pip install compileall2`\n\n* In Fedora Linux, compileall2.py is a part of python-srpm-macros RPM package.\n\n## Usage\n\n`compileall2` can be executed as a Python module or directly.\n\nExample usage:\n\n```shell\n# Create some script (this one raises an exception to show tracebacks)\n$ echo \"1 / 0\" \u003e test.py\n\n# Compile it\n$ compileall2 test.py\nCompiling 'test.py'...\n\n# Try to execute compiled version directly\n$ python __pycache__/test.cpython-37.pyc \nTraceback (most recent call last):\n  File \"test.py\", line 1, in \u003cmodule\u003e\n    1 / 0\nZeroDivisionError: division by zero\n\n# Recompile it with changes path which will be visible in error message\n$ compileall2 -f -p /foo/bar test.py\nCompiling 'test.py'...\n$ python __pycache__/test.cpython-37.pyc\nTraceback (most recent call last):\n  File \"/foo/bar/test.py\", line 1, in \u003cmodule\u003e\nZeroDivisionError: division by zero\n\n# Same thing as above but executed as a Python module\n$ python -m compileall2 -f -p /bar/baz test.py\nCompiling 'test.py'...\n$ python __pycache__/test.cpython-37.pyc\nTraceback (most recent call last):\n  File \"/bar/baz/test.py\", line 1, in \u003cmodule\u003e\nZeroDivisionError: division by zero\n```\n\n## Testing\n\nYou can test it locally with tox or unittest directly:\n\n```shell\n$ python3 -m unittest test_compileall2.py\n..............sss....ss.......................sss....ss.....................ss.............................----------------------------------------------------------------------\nRan 107 tests in 3.714s\n\nOK (skipped=12)\n```\n\nbut running in a container might be better because the superuser has privileges to write to `sys.path` which lowers the number of skipped tests.\n\n## License\n\n[PSF license v2](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedora-python%2Fcompileall2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedora-python%2Fcompileall2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedora-python%2Fcompileall2/lists"}