Skip to content

Commit 419f082

Browse files
committed
Add setup.py
This installs the emsdk script as a proper Python entry point
1 parent e34773a commit 419f082

20 files changed

+39
-3
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*.pyc
22
__pycache__
3+
emsdk.egg-info
4+
dist
5+
build
36

47
# Support for --embedded configs
58
/.emscripten

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
recursive-include emsdk

emsdk

100755100644
+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ if [ -z "$EMSDK_PYTHON" ]; then
4444
EMSDK_PYTHON=python
4545
fi
4646

47-
exec "$EMSDK_PYTHON" "$0.py" "$@"
47+
exec "$EMSDK_PYTHON" "emsdkpy/$0.py" "$@"

emsdkpy/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .emsdk import main # noqa
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

emsdk.py renamed to emsdkpy/emsdk.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2833,7 +2833,9 @@ def expand_sdk_name(name, activating):
28332833
return name
28342834

28352835

2836-
def main(args):
2836+
def main():
2837+
args = sys.argv[1:]
2838+
28372839
if not args:
28382840
errlog("Missing command; Type 'emsdk help' to get a list of commands.")
28392841
return 1
@@ -3268,4 +3270,4 @@ def print_tools(t):
32683270

32693271

32703272
if __name__ == '__main__':
3271-
sys.exit(main(sys.argv[1:]))
3273+
sys.exit(main())
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

setup.cfg

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[metadata]
2+
name = emsdk
3+
version = 3.1.9
4+
description = Emscripten SDK
5+
long_description = file: README.md
6+
long_description_content_type = text/markdown
7+
license_file = LICENSE
8+
author = Emscripten authors
9+
url = https://github.com/emscripten-core/emsdk
10+
platforms = Windows, Linux, Mac OS X
11+
keywords = emscripten, sdk
12+
13+
[bdist_wheel]
14+
universal = 1
15+
16+
[options]
17+
include_package_data = True
18+
packages = find:
19+
python_requires = >=3.7
20+
21+
[options.entry_points]
22+
console_scripts =
23+
emsdk = emsdkpy.emsdk:main
24+
25+
[options.package_data]
26+
emsdkpy = *.txt, *.bat, *.csh, *.fish, *.ps1, *.sh, *.json

setup.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import setuptools
2+
3+
setuptools.setup()

0 commit comments

Comments
 (0)