Skip to content

Commit 51f5922

Browse files
committed
Update setup script
1 parent 4547ca7 commit 51f5922

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.github/workflows/python-pytest-without-torch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Python pytest
4+
name: Python pytest without torch
55

66
on:
77
push:

setup.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from setuptools import setup, Extension, find_packages
1111

1212
my_name = 'ylearn'
13+
excludes_on_windows = ['torch', ]
1314

1415

1516
def read_requirements(file_path='requirements.txt'):
@@ -20,8 +21,12 @@ def read_requirements(file_path='requirements.txt'):
2021
lines = f.readlines()
2122

2223
lines = [x.strip('\n').strip(' ') for x in lines]
23-
lines = list(filter(lambda x: len(x) > 0 and not x.startswith('#'), lines))
24+
lines = filter(lambda x: len(x) > 0 and not x.startswith('#'), lines)
2425

26+
is_os_windows = sys.platform.find('win') == 0
27+
if is_os_windows:
28+
lines = filter(lambda x: x not in excludes_on_windows, lines)
29+
lines = list(lines)
2530
return lines
2631

2732

@@ -54,7 +59,6 @@ def execfile(fname, globs, locs=None):
5459
version_ns = {}
5560
execfile(P.join(HERE, my_name, '_version.py'), version_ns)
5661
version = version_ns['__version__']
57-
print("__version__=" + version)
5862

5963
np_include = numpy.get_include()
6064
pyx_files = glob(f"{my_name}/**/*.pyx", recursive=True)
@@ -72,9 +76,13 @@ def execfile(fname, globs, locs=None):
7276
raise FileNotFoundError(f'Not found c file for {pf}, '
7377
f'run "python setup.py build_ext --inplace" to generate c files.')
7478
pyx_modules = []
79+
80+
print('cmdline:', ' '.join(sys.argv))
81+
print(f'{my_name}.__version__:' + version)
82+
print('np_version:', numpy.__version__)
83+
print('np_include:', np_include)
7584
print('pyx extensions:', pyx_modules)
7685
print('cpp extensions:', c_modules)
77-
print('np_include', np_include)
7886

7987
c_modules = list(map(lambda f: Extension(f.replace(os.sep, '.'), [f'{f}.cpp'], include_dirs=[np_include]), c_modules))
8088
if pyx_modules:

ylearn/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.1.1'
1+
__version__ = '0.1.1.0a2'

0 commit comments

Comments
 (0)