-
-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
139 additions
and
55 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.0.3" | ||
__version__ = "0.0.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from setuptools.command import easy_install | ||
import sys | ||
import os | ||
import tokenize | ||
|
||
|
||
def install(setup_py, prefix): | ||
__file__ = setup_py | ||
bin_dir = "Scripts" if os.name == "nt" else "bin" | ||
install_dir = os.path.join(prefix, "lib") | ||
scripts_dir = os.path.join(prefix, bin_dir) | ||
|
||
with getattr(tokenize, "open", open)(setup_py) as f: | ||
code = f.read().replace("\\r\\n", "\n") | ||
sys.argv[1:] = [ | ||
"develop", | ||
f"--install-dir={install_dir}", | ||
"--no-deps", | ||
f"--prefix={prefix}", | ||
f"--script-dir={scripts_dir}", | ||
f"--site-dirs={install_dir}", | ||
] | ||
# Patches the script writer to inject library path | ||
easy_install.ScriptWriter.template = easy_install.ScriptWriter.template.replace( | ||
"import sys", | ||
"import sys\nsys.path.insert(0, {!r})".format(install_dir.replace("\\", "/")), | ||
) | ||
exec(compile(code, __file__, "exec")) | ||
|
||
|
||
if __name__ == "__main__": | ||
setup_py, prefix = sys.argv[1:3] | ||
install(setup_py, prefix) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.