Skip to content

Commit

Permalink
Add setup.py
Browse files Browse the repository at this point in the history
This installs the emsdk script as a proper Python entry point
  • Loading branch information
martinRenou committed Apr 29, 2022
1 parent e34773a commit 419f082
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
*.pyc
__pycache__
emsdk.egg-info
dist
build

# Support for --embedded configs
/.emscripten
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include emsdk
2 changes: 1 addition & 1 deletion emsdk
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ if [ -z "$EMSDK_PYTHON" ]; then
EMSDK_PYTHON=python
fi

exec "$EMSDK_PYTHON" "$0.py" "$@"
exec "$EMSDK_PYTHON" "emsdkpy/$0.py" "$@"
1 change: 1 addition & 0 deletions emsdkpy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .emsdk import main # noqa
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions emsdk.py → emsdkpy/emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2833,7 +2833,9 @@ def expand_sdk_name(name, activating):
return name


def main(args):
def main():
args = sys.argv[1:]

if not args:
errlog("Missing command; Type 'emsdk help' to get a list of commands.")
return 1
Expand Down Expand Up @@ -3268,4 +3270,4 @@ def print_tools(t):


if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
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.
26 changes: 26 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[metadata]
name = emsdk
version = 3.1.9
description = Emscripten SDK
long_description = file: README.md
long_description_content_type = text/markdown
license_file = LICENSE
author = Emscripten authors
url = https://github.com/emscripten-core/emsdk
platforms = Windows, Linux, Mac OS X
keywords = emscripten, sdk

[bdist_wheel]
universal = 1

[options]
include_package_data = True
packages = find:
python_requires = >=3.7

[options.entry_points]
console_scripts =
emsdk = emsdkpy.emsdk:main

[options.package_data]
emsdkpy = *.txt, *.bat, *.csh, *.fish, *.ps1, *.sh, *.json
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import setuptools

setuptools.setup()

0 comments on commit 419f082

Please sign in to comment.