Skip to content

Commit 26df3a5

Browse files
committed
Support uploading to PyPi.
1 parent 64168e8 commit 26df3a5

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
__pycache__
22
build
3+
dist
4+
quickjs.egg-info

Makefile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1+
PYTHON = python3.6
12

23
test: install
3-
python3 -m unittest
4+
$(PYTHON) -m unittest
45

56
install: build
6-
python3 setup.py install --user
7+
$(PYTHON) setup.py install --user
78

89
build: Makefile module.c third-party/quickjs.c third-party/quickjs.h
9-
python3 setup.py build
10+
$(PYTHON) setup.py build
1011

1112
format:
12-
python3 -m yapf -i -r --style .style.yapf .
13+
$(PYTHON) -m yapf -i -r --style .style.yapf .
1314
clang-format-7 -i module.c
1415

16+
distribute: test
17+
rm -rf dist/
18+
$(PYTHON) setup.py sdist
19+
20+
upload-test: distribute
21+
$(PYTHON) -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
22+
23+
upload: distribute
24+
$(PYTHON) -m twine upload dist/* quickjs.egg-info/
25+
1526
clean:
16-
rm -rf build/
27+
rm -rf build/ dist/

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import setuptools
12
from distutils.core import setup, Extension
23

34
_quickjs = Extension('_quickjs',
@@ -8,7 +9,7 @@
89
])
910

1011
setup(name='quickjs',
11-
version='1.0',
12+
version='1.0.2',
1213
description='Wrapping the quickjs C library.',
1314
packages=["quickjs"],
1415
ext_modules=[_quickjs])

test_quickjs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ def test_json(self):
157157

158158
class FunctionTest(unittest.TestCase):
159159
def test_adder(self):
160-
f = quickjs.Function("adder", """
160+
f = quickjs.Function(
161+
"adder", """
161162
function adder(x, y) {
162163
return x + y;
163164
}

0 commit comments

Comments
 (0)