Skip to content

Commit 0b03548

Browse files
committed
arraykit -> src
1 parent 68bcb11 commit 0b03548

File tree

7 files changed

+30
-22
lines changed

7 files changed

+30
-22
lines changed

performance/main.py renamed to performance/__main__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,4 +298,3 @@ def main():
298298

299299
if __name__ == '__main__':
300300
main()
301-

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ def get_long_description() -> str:
4040
],
4141
keywords='numpy array',
4242
packages=['arraykit'],
43+
package_dir={'arraykit': 'src'},
4344
package_data={'arraykit': ['__init__.pyi', 'py.typed']},
4445
include_package_data=True,
4546
ext_modules=[
4647
Extension(
4748
name='arraykit._arraykit', # build into module
48-
sources=['arraykit/_arraykit.c'],
49+
sources=['src/_arraykit.c'],
4950
include_dirs=[np.get_include()],
50-
define_macros=[("AK_VERSION", AK_VERSION)],
51+
define_macros=[('AK_VERSION', AK_VERSION)],
5152
),
5253
],
5354
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tasks.py

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,48 @@
11
import sys
2-
import os
3-
import typing as tp
42

53
import invoke
64

5+
6+
ARTIFACTS = (
7+
'*.egg-info',
8+
'.hypothesis',
9+
'build',
10+
'dist',
11+
'src/*.so'
12+
)
13+
14+
715
@invoke.task
816
def clean(context):
917
'''Clean doc and build artifacts
1018
'''
11-
context.run(f"{sys.executable} setup.py develop --uninstall", echo=True)
19+
cmd = f'{sys.executable} -m pip uninstall --yes arraykit'
20+
context.run(cmd, echo=True, pty=True)
1221

13-
for artifact in ("*.egg-info", "build", "dist", ".hypothesis"):
14-
context.run(f"rm -rf {artifact}", echo=True)
22+
for artifact in sorted(ARTIFACTS):
23+
context.run(f'rm -rf {artifact}', echo=True, pty=True)
1524

16-
for artifact in ("arraykit/*.so",):
17-
context.run(f"rm -rf {artifact}", echo=True)
1825

19-
# context.run("black .", echo=True)@task(clean)
20-
21-
@invoke.task
26+
@invoke.task(clean)
2227
def build(context):
23-
context.run(f"pip install -r requirements.txt", echo=True)
24-
context.run(f"{sys.executable} setup.py develop", echo=True)
28+
context.run('pip install -r requirements.txt', echo=True, pty=True)
29+
context.run(f'{sys.executable} -m pip install .', echo=True, pty=True)
2530

26-
@invoke.task(pre=(clean, build))
31+
32+
@invoke.task(build)
2733
def test(context):
2834
cmd = 'pytest -s --color no --disable-pytest-warnings --tb=native'
29-
context.run(cmd)
35+
context.run(cmd, echo=True, pty=True)
36+
3037

31-
@invoke.task(pre=(clean, build))
38+
@invoke.task(build)
3239
def performance(context):
33-
context.run(f"{sys.executable} performance/main.py", echo=True)
40+
context.run(f'{sys.executable} -m performance', echo=True, pty=True)
41+
3442

35-
@invoke.task(pre=(clean, build))
43+
@invoke.task
3644
def lint(context):
3745
'''Run pylint static analysis.
3846
'''
39-
context.run('pylint -f colorized test performance')
40-
47+
cmd = 'pylint -f colorized *.py performance src test'
48+
context.run(cmd, echo=True, pty=True)

0 commit comments

Comments
 (0)