17
17
18
18
"""The setup script."""
19
19
20
+ import sys
20
21
from setuptools import setup , find_packages
21
22
from setuptools .command .bdist_egg import bdist_egg as BdistEggCommand
22
23
from distutils .command .build import build as BuildCommand
43
44
# TODO: Put package test requirements here
44
45
]
45
46
47
+ needs_pytest = {'pytest' , 'test' , 'ptr' }.intersection (sys .argv )
48
+ if needs_pytest :
49
+ setup_requirements += ['pytest-runner' ]
50
+
46
51
COMMON_OPTIONS = dict (
47
52
version = '0.1.1' ,
48
53
description = "Grumpy Runtime & Transpiler" ,
70
75
)
71
76
72
77
73
- GRUMPY_TOOLS_OPTIONS = dict (
74
- name = 'grumpy-tools' ,
75
- package_dir = {'' :'grumpy-tools-src' },
76
- packages = find_packages (
77
- 'grumpy-tools-src' ,
78
- exclude = ["*.tests" , "*.tests.*" , "tests.*" , "tests" ],
79
- ),
80
- include_package_data = False ,
81
- entry_points = {
82
- 'console_scripts' : [
83
- 'grumpy=grumpy_tools.cli:main' ,
84
- ],
85
- },
86
- )
87
- GRUMPY_TOOLS_OPTIONS .update (COMMON_OPTIONS )
88
-
89
-
90
78
def _run_make (self , * args , ** kwargs ):
91
79
subprocess .check_call (["cd grumpy-runtime-src && make --debug" ], shell = True )
92
80
@@ -106,9 +94,7 @@ def run(self, *args, **kwargs):
106
94
GRUMPY_RUNTIME_OPTIONS = dict (
107
95
name = 'grumpy-runtime' ,
108
96
requires = ['grumpy_tools' ],
109
- package_dir = {'' :'grumpy-runtime-src' },
110
97
packages = find_packages (
111
- 'grumpy-runtime-src' ,
112
98
exclude = ["*.tests" , "*.tests.*" , "tests.*" , "tests" ],
113
99
),
114
100
include_package_data = True ,
@@ -120,9 +106,4 @@ def run(self, *args, **kwargs):
120
106
)
121
107
GRUMPY_RUNTIME_OPTIONS .update (COMMON_OPTIONS )
122
108
123
-
124
- ## Just the "tools"
125
- setup (** GRUMPY_TOOLS_OPTIONS )
126
-
127
- # ## Just the "runtime"
128
109
setup (** GRUMPY_RUNTIME_OPTIONS )
0 commit comments