Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
4d4a7f53
Commit
4d4a7f53
authored
11 years ago
by
Damien George
Browse files
Options
Downloads
Plain Diff
Merge branch 'pip-micropy' of github.com:pfalcon/micropython into pfalcon-pip-micropy
parents
a12be917
802d5057
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/pip-micropython
+61
-0
61 additions, 0 deletions
tools/pip-micropython
with
61 additions
and
0 deletions
tools/pip-micropython
0 → 100755
+
61
−
0
View file @
4d4a7f53
#!/bin/sh
#
# This tool can be used to install a new package into MicroPython
# library location (for unix port, default behavior), or produce
# complete library snapshot to be deployed on a device for baremetal
# ports (if PIP_MICROPY_DEST environment var is set).
#
if
[
-n
"
$PIP_MICROPY_DEST
"
]
;
then
dest
=
"
$PIP_MICROPY_DEST
"
echo
"Destination snapshot directory:
$dest
"
elif
[
-n
"
$MICROPYPATH
"
]
;
then
libdest
=
$(
echo
"
$MICROPYPATH
"
|
awk
-F
:
' {print $1}'
)
echo
"Destination library directory:
$libdest
"
else
echo
"Warning: MICROPYPATH is not set, assuming default value"
libdest
=
~/.micropython/lib
echo
"Destination library directory:
$libdest
"
fi
# Due to bugs in pip, installation should happen with active virtualenv
# The issue (at least with pip 1.0 which is still what's shipped with many
# distros) is that even if --ignore-installed is used, package is not
# installed if it's already installed for main python distribution.
if
[
!
-d
/tmp/pip-micropy-venv
]
;
then
virtualenv
--no-site-packages
/tmp/pip-micropy-venv
fi
.
/tmp/pip-micropy-venv/bin/activate
# We need to specify --record to override this switch as passed by pip
# pip will try to parse this file (at the location in specifies), and try to
# access files as specified in it. But paths there will be relative to --root
# we pass, so it won't find files and crash. However, if it won't find the
# file, it will just issue a warning and continue.
if
[
-n
"
$dest
"
]
;
then
pip
install
"
$@
"
\
--install-option
=
"--install-base=."
\
--install-option
=
"--install-purelib=lib"
\
--install-option
=
"--install-platlib=lib"
\
--install-option
=
"--install-scripts=."
\
--install-option
=
"--install-headers=headers"
\
--install-option
=
"--install-data=lib"
\
--install-option
=
"--record=/tmp/setuptools-record.txt"
\
--install-option
=
"--no-compile"
\
--install-option
=
"--root=
$dest
"
else
# Here we assume that base dir is lib dir, and install scripts a level
# higher. For default value of ~/micropython/lib/ , this should give
# reasonable behavior, though better would make it overridable (or
# go bold and use ~/bin ?)
pip
install
"
$@
"
\
--install-option
=
"--install-base=."
\
--install-option
=
"--install-purelib=."
\
--install-option
=
"--install-platlib=."
\
--install-option
=
"--install-scripts=.."
\
--install-option
=
"--install-headers=../headers"
\
--install-option
=
"--install-data=."
\
--install-option
=
"--record=/tmp/setuptools-record.txt"
\
--install-option
=
"--no-compile"
\
--install-option
=
"--root=
$libdest
"
fi
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