Skip to content

Commit

Permalink
Lazily import compileall (#226)
Browse files Browse the repository at this point in the history
* Lazily import compileall

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
ofek and pre-commit-ci[bot] authored Jul 13, 2024
1 parent 501bdc2 commit fbea70c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ check if there is an existing issue already filed for the same, in the project's
GitHub [issue tracker]. If not, please file a new issue.

If you want to help out by fixing bugs, choose an open issue in the [issue
tracker] to work on and claim it by posting a comment saying "I would like to
work on this.". Feel free to ask any doubts in the issue thread.
tracker] to work on and claim it by posting a comment saying "I would like to work
on this.". Feel free to ask any doubts in the issue thread.

While working on implementing the feature, please go ahead and file a pull
request. Filing a pull request early allows for getting feedback as early as
Expand Down
3 changes: 2 additions & 1 deletion src/installer/destinations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Handles all file writing and post-installation processing."""

import compileall
import io
import os
from pathlib import Path
Expand Down Expand Up @@ -243,6 +242,8 @@ def _compile_bytecode(self, scheme: Scheme, record: RecordEntry) -> None:
if scheme not in ("purelib", "platlib"):
return

import compileall

target_path = self._path_with_destdir(scheme, record.path)
dir_path_to_embed = os.path.dirname( # Without destdir
os.path.join(self.scheme_dict[scheme], record.path)
Expand Down

0 comments on commit fbea70c

Please sign in to comment.