Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
shallow-appify
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ingo Meyer
shallow-appify
Commits
5e1a2dca
Commit
5e1a2dca
authored
7 years ago
by
Ingo Meyer
Browse files
Options
Downloads
Patches
Plain Diff
Python files are precompiled
parent
80facd74
Branches
feature-precompile_python_files
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/python.py
+13
-0
13 additions, 0 deletions
src/plugins/python.py
with
13 additions
and
0 deletions
src/plugins/python.py
+
13
−
0
View file @
5e1a2dca
...
...
@@ -118,6 +118,10 @@ class LibPatchingError(Exception):
pass
class
PrecompileError
(
Exception
):
pass
class
ExtensionModuleError
(
Exception
):
pass
...
...
@@ -336,6 +340,14 @@ def setup_startup(app_path, executable_path, app_executable_path, executable_roo
create_missing_library_links
()
def
precompile_python_files
():
with
open
(
os
.
devnull
,
'
w
'
)
as
dummy
:
try
:
subprocess
.
check_call
([
'
python
'
,
'
-m
'
,
'
compileall
'
,
macos_path
],
stdout
=
dummy
,
stderr
=
dummy
)
except
subprocess
.
CalledProcessError
:
raise
PrecompileError
(
'
Python modules could not be precompiled.
'
)
def
build_extension_modules
(
env_path
):
def
get_makefile_path
():
if
executable_root_path
is
not
None
and
\
...
...
@@ -368,6 +380,7 @@ def setup_startup(app_path, executable_path, app_executable_path, executable_roo
make_conda_portable
(
env_path
)
if
_conda_gr_included
:
fix_conda_gr
(
env_path
)
precompile_python_files
()
if
_extension_makefile
is
not
None
:
build_extension_modules
(
env_path
)
env_startup_script
=
PY_PRE_STARTUP_CONDA_SETUP
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment