Browse code

remove scikit-learn dep and pin scikit-optimize>=0.8.1

Because //github.com/scikit-optimize/scikit-optimize/issues/931 is fixed.

Bas Nijholt authored on 17/09/2020 23:51:22
Showing 1 changed files
... ...
@@ -56,8 +56,7 @@ extras_require = {
56 56
         "distributed",
57 57
         "ipyparallel>=6.2.5",  # because of https://github.com/ipython/ipyparallel/issues/404
58 58
         "loky",
59
-        "scikit-optimize",
60
-        "scikit-learn<=0.23.1",  # because of https://github.com/scikit-optimize/scikit-optimize/issues/931, remove dep when fixed
59
+        "scikit-optimize>=0.8.1",  # because of https://github.com/scikit-optimize/scikit-optimize/issues/931
61 60
         "wexpect" if os.name == "nt" else "pexpect",
62 61
     ],
63 62
 }
Browse code

temporarily pin scikit-learn<=0.23.1, see https://github.com/scikit-optimize/scikit-optimize/issues/931

Bas Nijholt authored on 07/08/2020 13:02:02
Showing 1 changed files
... ...
@@ -57,6 +57,7 @@ extras_require = {
57 57
         "ipyparallel>=6.2.5",  # because of https://github.com/ipython/ipyparallel/issues/404
58 58
         "loky",
59 59
         "scikit-optimize",
60
+        "scikit-learn<=0.23.1",  # because of https://github.com/scikit-optimize/scikit-optimize/issues/931, remove dep when fixed
60 61
         "wexpect" if os.name == "nt" else "pexpect",
61 62
     ],
62 63
 }
Browse code

only test cloudpickle and dill if installed

Bas Nijholt authored on 10/04/2020 16:22:24
Showing 1 changed files
... ...
@@ -43,8 +43,6 @@ extras_require = {
43 43
         "plotly",
44 44
     ],
45 45
     "testing": [
46
-        "cloudpickle",
47
-        "dill",
48 46
         "flaky",
49 47
         "pytest",
50 48
         "pytest-cov",
... ...
@@ -53,6 +51,8 @@ extras_require = {
53 51
         "pre_commit",
54 52
     ],
55 53
     "other": [
54
+        "cloudpickle",
55
+        "dill",
56 56
         "distributed",
57 57
         "ipyparallel>=6.2.5",  # because of https://github.com/ipython/ipyparallel/issues/404
58 58
         "loky",
Browse code

test serialization with pickle, cloudpickle, and dill

Bas Nijholt authored on 10/04/2020 15:18:14
Showing 1 changed files
... ...
@@ -44,6 +44,7 @@ extras_require = {
44 44
     ],
45 45
     "testing": [
46 46
         "cloudpickle",
47
+        "dill",
47 48
         "flaky",
48 49
         "pytest",
49 50
         "pytest-cov",
Browse code

add cloudpickle to testing dependencies

Bas Nijholt authored on 10/04/2020 14:26:30
Showing 1 changed files
... ...
@@ -43,6 +43,7 @@ extras_require = {
43 43
         "plotly",
44 44
     ],
45 45
     "testing": [
46
+        "cloudpickle",
46 47
         "flaky",
47 48
         "pytest",
48 49
         "pytest-cov",
... ...
@@ -51,8 +52,8 @@ extras_require = {
51 52
         "pre_commit",
52 53
     ],
53 54
     "other": [
54
-        "ipyparallel>=6.2.5",  # because of https://github.com/ipython/ipyparallel/issues/404
55 55
         "distributed",
56
+        "ipyparallel>=6.2.5",  # because of https://github.com/ipython/ipyparallel/issues/404
56 57
         "loky",
57 58
         "scikit-optimize",
58 59
         "wexpect" if os.name == "nt" else "pexpect",
Browse code

minimally require ipyparallel 6.2.5

This means that we won't run into https://github.com/joblib/loky/issues/240

Bas Nijholt authored on 20/04/2020 11:00:31
Showing 1 changed files
... ...
@@ -51,7 +51,7 @@ extras_require = {
51 51
         "pre_commit",
52 52
     ],
53 53
     "other": [
54
-        "ipyparallel",
54
+        "ipyparallel>=6.2.5",  # because of https://github.com/ipython/ipyparallel/issues/404
55 55
         "distributed",
56 56
         "loky",
57 57
         "scikit-optimize",
Browse code

add Loky to (optional) dependencies

Joseph Weston authored on 09/04/2020 18:29:39 • Bas Nijholt committed on 09/04/2020 23:24:26
Showing 1 changed files
... ...
@@ -53,6 +53,7 @@ extras_require = {
53 53
     "other": [
54 54
         "ipyparallel",
55 55
         "distributed",
56
+        "loky",
56 57
         "scikit-optimize",
57 58
         "wexpect" if os.name == "nt" else "pexpect",
58 59
     ],
Browse code

add flaky to tests that sometimes fail

Bas Nijholt authored on 17/12/2019 21:06:25
Showing 1 changed files
... ...
@@ -43,6 +43,7 @@ extras_require = {
43 43
         "plotly",
44 44
     ],
45 45
     "testing": [
46
+        "flaky",
46 47
         "pytest",
47 48
         "pytest-cov",
48 49
         "pytest-randomly",
Browse code

use wexpect instead of pexpect on Windows

Bas Nijholt authored on 17/12/2019 18:28:31
Showing 1 changed files
... ...
@@ -1,5 +1,6 @@
1 1
 #!/usr/bin/env python3
2 2
 
3
+import os
3 4
 import sys
4 5
 
5 6
 from setuptools import find_packages, setup
... ...
@@ -48,10 +49,14 @@ extras_require = {
48 49
         "pytest-timeout",
49 50
         "pre_commit",
50 51
     ],
51
-    "other": ["pexpect", "ipyparallel", "distributed", "scikit-optimize"],
52
+    "other": [
53
+        "ipyparallel",
54
+        "distributed",
55
+        "scikit-optimize",
56
+        "wexpect" if os.name == "nt" else "pexpect",
57
+    ],
52 58
 }
53 59
 
54
-
55 60
 setup(
56 61
     name="adaptive",
57 62
     description="Parallel active learning of mathematical functions",
Browse code

add Python 3.8 classifier to setup.py

Bas Nijholt authored on 17/12/2019 17:48:39
Showing 1 changed files
... ...
@@ -66,6 +66,7 @@ setup(
66 66
         "Intended Audience :: Science/Research",
67 67
         "Programming Language :: Python :: 3.6",
68 68
         "Programming Language :: Python :: 3.7",
69
+        "Programming Language :: Python :: 3.8",
69 70
     ],
70 71
     packages=find_packages("."),
71 72
     install_requires=install_requires,
Browse code

use a concurrent.ProcessPoolExecutor on Windows too

In 890f84c00e059c15c427d1269f3e8df7abb83c74 I wrote that a 'concurrent.futures.ProcessPoolExecutor' doesn't work on Windows.
However, it seems like it just works now.

Bas Nijholt authored on 17/12/2019 17:39:26
Showing 1 changed files
... ...
@@ -1,6 +1,5 @@
1 1
 #!/usr/bin/env python3
2 2
 
3
-import os
4 3
 import sys
5 4
 
6 5
 from setuptools import find_packages, setup
... ...
@@ -31,10 +30,6 @@ install_requires = [
31 30
     "atomicwrites",
32 31
 ]
33 32
 
34
-if os.name == "nt":  # on Windows
35
-    # distributed provides the default executor on Windows
36
-    install_requires.append("distributed")
37
-
38 33
 extras_require = {
39 34
     "notebook": [
40 35
         "ipython",
Browse code

fix black error

Joseph Weston authored on 17/12/2019 13:58:50
Showing 1 changed files
... ...
@@ -31,7 +31,7 @@ install_requires = [
31 31
     "atomicwrites",
32 32
 ]
33 33
 
34
-if os.name == 'nt':  # on Windows
34
+if os.name == "nt":  # on Windows
35 35
     # distributed provides the default executor on Windows
36 36
     install_requires.append("distributed")
37 37
 
Browse code

always install "distributed" on Windows

Bas Nijholt authored on 17/12/2019 12:59:17
Showing 1 changed files
... ...
@@ -1,5 +1,6 @@
1 1
 #!/usr/bin/env python3
2 2
 
3
+import os
3 4
 import sys
4 5
 
5 6
 from setuptools import find_packages, setup
... ...
@@ -30,6 +31,10 @@ install_requires = [
30 31
     "atomicwrites",
31 32
 ]
32 33
 
34
+if os.name == 'nt':  # on Windows
35
+    # distributed provides the default executor on Windows
36
+    install_requires.append("distributed")
37
+
33 38
 extras_require = {
34 39
     "notebook": [
35 40
         "ipython",
Browse code

move pexpect to 'other' install requires

Bas Nijholt authored on 17/12/2019 11:26:29
Showing 1 changed files
... ...
@@ -42,14 +42,13 @@ extras_require = {
42 42
         "plotly",
43 43
     ],
44 44
     "testing": [
45
-        "pexpect",
46 45
         "pytest",
47 46
         "pytest-cov",
48 47
         "pytest-randomly",
49 48
         "pytest-timeout",
50 49
         "pre_commit",
51 50
     ],
52
-    "other": ["ipyparallel", "distributed", "scikit-optimize"],
51
+    "other": ["pexpect", "ipyparallel", "distributed", "scikit-optimize"],
53 52
 }
54 53
 
55 54
 
Browse code

move requirements to setup.py

Bas Nijholt authored on 16/12/2019 19:11:06
Showing 1 changed files
... ...
@@ -40,7 +40,16 @@ extras_require = {
40 40
         "bokeh",
41 41
         "matplotlib",
42 42
         "plotly",
43
-    ]
43
+    ],
44
+    "testing": [
45
+        "pexpect",
46
+        "pytest",
47
+        "pytest-cov",
48
+        "pytest-randomly",
49
+        "pytest-timeout",
50
+        "pre_commit",
51
+    ],
52
+    "other": ["ipyparallel", "distributed", "scikit-optimize"],
44 53
 }
45 54
 
46 55
 
Browse code

correct short description in setup.py (#239)

Joseph Weston authored on 12/12/2019 16:00:16 • Bas Nijholt committed on 12/12/2019 16:00:16
Showing 1 changed files
... ...
@@ -46,7 +46,7 @@ extras_require = {
46 46
 
47 47
 setup(
48 48
     name="adaptive",
49
-    description="Adaptive parallel sampling of mathematical functions",
49
+    description="Parallel active learning of mathematical functions",
50 50
     version=version,
51 51
     python_requires=">=3.6",
52 52
     url="https://adaptive.readthedocs.io/",
Browse code

run pre-commit run --all

Bas Nijholt authored on 11/12/2019 14:00:39
Showing 1 changed files
... ...
@@ -1,5 +1,4 @@
1 1
 #!/usr/bin/env python3
2
-# -*- coding: utf-8 -*-
3 2
 
4 3
 import sys
5 4
 
Browse code

ensure atomic writes when saving a file

Right now, if a program crashes in the middle of saving, you lose
all your data.

Right now, if a program crashes in the middle of saving, you lose
all your data. This ensures that the old file is first moved, then
the new file is saved, and only then the old file is removed.

Bas Nijholt authored on 21/06/2019 00:04:07
Showing 1 changed files
... ...
@@ -24,7 +24,12 @@ def get_version_and_cmdclass(package_name):
24 24
 version, cmdclass = get_version_and_cmdclass("adaptive")
25 25
 
26 26
 
27
-install_requires = ["scipy", "sortedcollections >= 1.1", "sortedcontainers >= 2.0"]
27
+install_requires = [
28
+    "scipy",
29
+    "sortedcollections >= 1.1",
30
+    "sortedcontainers >= 2.0",
31
+    "atomicwrites",
32
+]
28 33
 
29 34
 extras_require = {
30 35
     "notebook": [
Browse code

fix all flake8 issues and run pre-commit filters

Bas Nijholt authored on 08/05/2019 02:26:15
Showing 1 changed files
... ...
@@ -6,7 +6,7 @@ import sys
6 6
 from setuptools import find_packages, setup
7 7
 
8 8
 if sys.version_info < (3, 6):
9
-    print('adaptive requires Python 3.6 or above.')
9
+    print("adaptive requires Python 3.6 or above.")
10 10
     sys.exit(1)
11 11
 
12 12
 
... ...
@@ -14,52 +14,48 @@ if sys.version_info < (3, 6):
14 14
 def get_version_and_cmdclass(package_name):
15 15
     import os
16 16
     from importlib.util import module_from_spec, spec_from_file_location
17
-    spec = spec_from_file_location('version',
18
-                                   os.path.join(package_name, '_version.py'))
17
+
18
+    spec = spec_from_file_location("version", os.path.join(package_name, "_version.py"))
19 19
     module = module_from_spec(spec)
20 20
     spec.loader.exec_module(module)
21 21
     return module.__version__, module.cmdclass
22 22
 
23 23
 
24
-version, cmdclass = get_version_and_cmdclass('adaptive')
24
+version, cmdclass = get_version_and_cmdclass("adaptive")
25 25
 
26 26
 
27
-install_requires = [
28
-    'scipy',
29
-    'sortedcollections >= 1.1',
30
-    'sortedcontainers >= 2.0',
31
-]
27
+install_requires = ["scipy", "sortedcollections >= 1.1", "sortedcontainers >= 2.0"]
32 28
 
33 29
 extras_require = {
34
-    'notebook': [
35
-        'ipython',
36
-        'ipykernel>=4.8.0',  # because https://github.com/ipython/ipykernel/issues/274 and https://github.com/ipython/ipykernel/issues/263
37
-        'jupyter_client>=5.2.2',  # because https://github.com/jupyter/jupyter_client/pull/314
38
-        'holoviews>=1.9.1',
39
-        'ipywidgets',
40
-        'bokeh',
41
-        'matplotlib',
42
-        'plotly',
43
-    ],
30
+    "notebook": [
31
+        "ipython",
32
+        "ipykernel>=4.8.0",  # because https://github.com/ipython/ipykernel/issues/274 and https://github.com/ipython/ipykernel/issues/263
33
+        "jupyter_client>=5.2.2",  # because https://github.com/jupyter/jupyter_client/pull/314
34
+        "holoviews>=1.9.1",
35
+        "ipywidgets",
36
+        "bokeh",
37
+        "matplotlib",
38
+        "plotly",
39
+    ]
44 40
 }
45 41
 
46 42
 
47 43
 setup(
48
-    name='adaptive',
49
-    description='Adaptive parallel sampling of mathematical functions',
44
+    name="adaptive",
45
+    description="Adaptive parallel sampling of mathematical functions",
50 46
     version=version,
51
-    python_requires='>=3.6',
52
-    url='https://adaptive.readthedocs.io/',
53
-    author='Adaptive authors',
54
-    license='BSD',
47
+    python_requires=">=3.6",
48
+    url="https://adaptive.readthedocs.io/",
49
+    author="Adaptive authors",
50
+    license="BSD",
55 51
     classifiers=[
56
-        'Development Status :: 4 - Beta',
57
-        'License :: OSI Approved :: BSD License',
58
-        'Intended Audience :: Science/Research',
59
-        'Programming Language :: Python :: 3.6',
60
-        'Programming Language :: Python :: 3.7',
52
+        "Development Status :: 4 - Beta",
53
+        "License :: OSI Approved :: BSD License",
54
+        "Intended Audience :: Science/Research",
55
+        "Programming Language :: Python :: 3.6",
56
+        "Programming Language :: Python :: 3.7",
61 57
     ],
62
-    packages=find_packages('.'),
58
+    packages=find_packages("."),
63 59
     install_requires=install_requires,
64 60
     extras_require=extras_require,
65 61
     cmdclass=cmdclass,
Browse code

fix import order and style

Bas Nijholt authored on 07/05/2019 23:42:40
Showing 1 changed files
... ...
@@ -1,9 +1,9 @@
1 1
 #!/usr/bin/env python3
2 2
 # -*- coding: utf-8 -*-
3 3
 
4
-from setuptools import setup, find_packages
5 4
 import sys
6 5
 
6
+from setuptools import find_packages, setup
7 7
 
8 8
 if sys.version_info < (3, 6):
9 9
     print('adaptive requires Python 3.6 or above.')
Browse code

use setup(..., python_requires='>=3.6'), closes #179

Bas Nijholt authored on 03/04/2019 22:14:10
Showing 1 changed files
... ...
@@ -48,6 +48,7 @@ setup(
48 48
     name='adaptive',
49 49
     description='Adaptive parallel sampling of mathematical functions',
50 50
     version=version,
51
+    python_requires='>=3.6',
51 52
     url='https://adaptive.readthedocs.io/',
52 53
     author='Adaptive authors',
53 54
     license='BSD',
Browse code

add Python 3.7 to the setup.py classifiers

Bas Nijholt authored on 29/01/2019 16:15:36
Showing 1 changed files
... ...
@@ -56,6 +56,7 @@ setup(
56 56
         'License :: OSI Approved :: BSD License',
57 57
         'Intended Audience :: Science/Research',
58 58
         'Programming Language :: Python :: 3.6',
59
+        'Programming Language :: Python :: 3.7',
59 60
     ],
60 61
     packages=find_packages('.'),
61 62
     install_requires=install_requires,
Browse code

remove _deepcopy_fix and depend on sortedcollections >= 1.1

Bas Nijholt authored on 21/01/2019 15:15:05
Showing 1 changed files
... ...
@@ -26,7 +26,7 @@ version, cmdclass = get_version_and_cmdclass('adaptive')
26 26
 
27 27
 install_requires = [
28 28
     'scipy',
29
-    'sortedcollections',
29
+    'sortedcollections >= 1.1',
30 30
     'sortedcontainers >= 2.0',
31 31
 ]
32 32
 
Browse code

Merge branch 'stable-0.7'

Joseph Weston authored on 17/12/2018 15:45:33
Showing 0 changed files
Browse code

update dependency versions

We use sortedcontainers 2.0 API.

Joseph Weston authored on 11/12/2018 15:49:40
Showing 1 changed files
... ...
@@ -27,7 +27,7 @@ version, cmdclass = get_version_and_cmdclass('adaptive')
27 27
 install_requires = [
28 28
     'scipy',
29 29
     'sortedcollections',
30
-    'sortedcontainers',
30
+    'sortedcontainers >= 2.0',
31 31
 ]
32 32
 
33 33
 extras_require = {
Browse code

change url in setup.py to the documentation

Bas Nijholt authored on 07/12/2018 17:22:33
Showing 1 changed files
... ...
@@ -48,7 +48,7 @@ setup(
48 48
     name='adaptive',
49 49
     description='Adaptive parallel sampling of mathematical functions',
50 50
     version=version,
51
-    url='https://gitlab.kwant-project.org/qt/adaptive',
51
+    url='https://adaptive.readthedocs.io/',
52 52
     author='Adaptive authors',
53 53
     license='BSD',
54 54
     classifiers=[
Browse code

Resolve "(Learner1D) improve time complexity"

Jorn Hoofwijk authored on 07/12/2018 11:42:53 • Bas Nijholt committed on 07/12/2018 11:42:53
Showing 1 changed files
... ...
@@ -26,6 +26,7 @@ version, cmdclass = get_version_and_cmdclass('adaptive')
26 26
 
27 27
 install_requires = [
28 28
     'scipy',
29
+    'sortedcollections',
29 30
     'sortedcontainers',
30 31
 ]
31 32
 
Browse code

improve 'notebook_extension' and add 'plotly' as a dependency

Bas Nijholt authored on 20/10/2018 13:04:45
Showing 1 changed files
... ...
@@ -38,6 +38,7 @@ extras_require = {
38 38
         'ipywidgets',
39 39
         'bokeh',
40 40
         'matplotlib',
41
+        'plotly',
41 42
     ],
42 43
 }
43 44
 
Browse code

update to the latest miniver

Bas Nijholt authored on 15/10/2018 14:03:58
Showing 1 changed files
... ...
@@ -10,15 +10,15 @@ if sys.version_info < (3, 6):
10 10
     sys.exit(1)
11 11
 
12 12
 
13
-# Loads version.py module without importing the whole package.
13
+# Loads _version.py module without importing the whole package.
14 14
 def get_version_and_cmdclass(package_name):
15 15
     import os
16 16
     from importlib.util import module_from_spec, spec_from_file_location
17 17
     spec = spec_from_file_location('version',
18
-                                   os.path.join(package_name, 'version.py'))
18
+                                   os.path.join(package_name, '_version.py'))
19 19
     module = module_from_spec(spec)
20 20
     spec.loader.exec_module(module)
21
-    return module.version, module.cmdclass
21
+    return module.__version__, module.cmdclass
22 22
 
23 23
 
24 24
 version, cmdclass = get_version_and_cmdclass('adaptive')
Browse code

further reduce boilerplate in setup.py

Revert to a style in 'version.py' that uses module globals
to report information to the outside world. Doing this means
less "plumbing" when using the module.

Joseph Weston authored on 21/02/2018 16:04:32
Showing 1 changed files
... ...
@@ -1,7 +1,6 @@
1 1
 #!/usr/bin/env python3
2 2
 # -*- coding: utf-8 -*-
3 3
 
4
-import os
5 4
 from setuptools import setup, find_packages
6 5
 import sys
7 6
 
... ...
@@ -11,19 +10,19 @@ if sys.version_info < (3, 6):
11 10
     sys.exit(1)
12 11
 
13 12
 
14
-# Load version.py module without importing 'adaptive'
15
-def load_version_module(package_name):
13
+# Loads version.py module without importing the whole package.
14
+def get_version_and_cmdclass(package_name):
15
+    import os
16 16
     from importlib.util import module_from_spec, spec_from_file_location
17 17
     spec = spec_from_file_location('version',
18
-                                   '{}/version.py'.format(package_name))
18
+                                   os.path.join(package_name, 'version.py'))
19 19
     module = module_from_spec(spec)
20 20
     spec.loader.exec_module(module)
21
-    return module
21
+    return module.version, module.cmdclass
22 22
 
23 23
 
24
-version_module = load_version_module('adaptive')
25
-version = version_module.get_version()
26
-cmdclass = version_module.cmdclass(version, 'adaptive')
24
+version, cmdclass = get_version_and_cmdclass('adaptive')
25
+
27 26
 
28 27
 install_requires = [
29 28
     'scipy',
Browse code

get version in setup.py using version.get_version()

Bas Nijholt authored on 21/02/2018 14:37:34
Showing 1 changed files
... ...
@@ -21,8 +21,9 @@ def load_version_module(package_name):
21 21
     return module
22 22
 
23 23
 
24
-version = load_version_module('adaptive')
25
-cmdclass = version.cmdclass(version.version, 'adaptive')
24
+version_module = load_version_module('adaptive')
25
+version = version_module.get_version()
26
+cmdclass = version_module.cmdclass(version, 'adaptive')
26 27
 
27 28
 install_requires = [
28 29
     'scipy',
... ...
@@ -45,7 +46,7 @@ extras_require = {
45 46
 setup(
46 47
     name='adaptive',
47 48
     description='Adaptive parallel sampling of mathematical functions',
48
-    version=version.version,
49
+    version=version,
49 50
     url='https://gitlab.kwant-project.org/qt/adaptive',
50 51
     author='Adaptive authors',
51 52
     license='BSD',
Browse code

move version related functions and classes from setup.py to version.py

Bas Nijholt authored on 21/02/2018 13:56:08
Showing 1 changed files
... ...
@@ -2,12 +2,8 @@
2 2
 # -*- coding: utf-8 -*-
3 3
 
4 4
 import os
5
-import sys
6
-import importlib
7
-from importlib.util import module_from_spec, spec_from_file_location
8 5
 from setuptools import setup, find_packages
9
-from setuptools.command.sdist import sdist as sdist_orig
10
-from distutils.command.build import build as build_orig
6
+import sys
11 7
 
12 8
 
13 9
 if sys.version_info < (3, 6):
... ...
@@ -15,44 +11,18 @@ if sys.version_info < (3, 6):
15 11
     sys.exit(1)
16 12
 
17 13
 
18
-package_name = 'adaptive'
19
-
20 14
 # Load version.py module without importing 'adaptive'
21
-def load_version_module():
15
+def load_version_module(package_name):
16
+    from importlib.util import module_from_spec, spec_from_file_location
22 17
     spec = spec_from_file_location('version',
23 18
                                    '{}/version.py'.format(package_name))
24 19
     module = module_from_spec(spec)
25 20
     spec.loader.exec_module(module)
26 21
     return module
27 22
 
28
-version = load_version_module()
29
-
30
-
31
-def write_version(fname):
32
-    # This could be a hard link, so try to delete it first.  Is there any way
33
-    # to do this atomically together with opening?
34
-    try:
35
-        os.remove(fname)
36
-    except OSError:
37
-        pass
38
-    with open(fname, 'w') as f:
39
-        f.write("# This file has been created by setup.py.\n"
40
-                "version = '{}'\n".format(version.version))
41
-
42
-
43
-class build(build_orig):
44
-    def run(self):
45
-        super().run()
46
-        write_version(os.path.join(self.build_lib, package_name,
47
-                                   version.STATIC_VERSION_FILE))
48
-
49
-
50
-class sdist(sdist_orig):
51
-    def make_release_tree(self, base_dir, files):
52
-        super().make_release_tree(base_dir, files)
53
-        write_version(os.path.join(base_dir, package_name,
54
-                                   version.STATIC_VERSION_FILE))
55 23
 
24
+version = load_version_module('adaptive')
25
+cmdclass = version.cmdclass(version.version, 'adaptive')
56 26
 
57 27
 install_requires = [
58 28
     'scipy',
... ...
@@ -88,5 +58,5 @@ setup(
88 58
     packages=find_packages('.'),
89 59
     install_requires=install_requires,
90 60
     extras_require=extras_require,
91
-    cmdclass=dict(sdist=sdist, build=build),
61
+    cmdclass=cmdclass,
92 62
 )
Browse code

modify filenames and version-module import from setup.py

Remove usage of deprecated 'imp' module in favour of 'importlib'.
Also remove the package name from as many places as possible.

Joseph Weston authored on 21/02/2018 10:06:07
Showing 1 changed files
... ...
@@ -3,7 +3,8 @@
3 3
 
4 4
 import os
5 5
 import sys
6
-import imp
6
+import importlib
7
+from importlib.util import module_from_spec, spec_from_file_location
7 8
 from setuptools import setup, find_packages
8 9
 from setuptools.command.sdist import sdist as sdist_orig
9 10
 from distutils.command.build import build as build_orig
... ...
@@ -14,10 +15,17 @@ if sys.version_info < (3, 6):
14 15
     sys.exit(1)
15 16
 
16 17
 
17
-# Load _version.py module without importing 'adaptive'
18
-_dont_write_bytecode = sys.dont_write_bytecode
19
-version = imp.load_source('version', 'adaptive/_version.py')
20
-sys.dont_write_bytecode = _dont_write_bytecode
18
+package_name = 'adaptive'
19
+
20
+# Load version.py module without importing 'adaptive'
21
+def load_version_module():
22
+    spec = spec_from_file_location('version',
23
+                                   '{}/version.py'.format(package_name))
24
+    module = module_from_spec(spec)
25
+    spec.loader.exec_module(module)
26
+    return module
27
+
28
+version = load_version_module()
21 29
 
22 30
 
23 31
 def write_version(fname):
... ...
@@ -35,15 +43,14 @@ def write_version(fname):
35 43
 class build(build_orig):
36 44
     def run(self):
37 45
         super().run()
38
-        write_version(os.path.join(self.build_lib, 'adaptive',
46
+        write_version(os.path.join(self.build_lib, package_name,
39 47
                                    version.STATIC_VERSION_FILE))
40 48
 
41 49
 
42 50
 class sdist(sdist_orig):
43
-
44 51
     def make_release_tree(self, base_dir, files):
45 52
         super().make_release_tree(base_dir, files)
46
-        write_version(os.path.join(base_dir, 'adaptive',
53
+        write_version(os.path.join(base_dir, package_name,
47 54
                                    version.STATIC_VERSION_FILE))
48 55
 
49 56
 
Browse code

update the development status to beta

Bas Nijholt authored on 20/02/2018 17:10:03
Showing 1 changed files
... ...
@@ -73,7 +73,7 @@ setup(
73 73
     author='Adaptive authors',
74 74
     license='BSD',
75 75
     classifiers=[
76
-        'Development Status :: 3 - Alpha',
76
+        'Development Status :: 4 - Beta',
77 77
         'License :: OSI Approved :: BSD License',
78 78
         'Intended Audience :: Science/Research',
79 79
         'Programming Language :: Python :: 3.6',
Browse code

add bokeh and matplotlib to the optional notebook requirements

Bas Nijholt authored on 20/02/2018 17:04:39
Showing 1 changed files
... ...
@@ -59,6 +59,8 @@ extras_require = {
59 59
         'jupyter_client>=5.2.2',  # because https://github.com/jupyter/jupyter_client/pull/314
60 60
         'holoviews>=1.9.1',
61 61
         'ipywidgets',
62
+        'bokeh',
63
+        'matplotlib',
62 64
     ],
63 65
 }
64 66
 
Browse code

correctly list all packages in setup.py

Without this subpackages are not packaged when using 'sdist'.

Joseph Weston authored on 20/02/2018 16:11:52
Showing 1 changed files
... ...
@@ -4,7 +4,7 @@
4 4
 import os
5 5
 import sys
6 6
 import imp
7
-from setuptools import setup
7
+from setuptools import setup, find_packages
8 8
 from setuptools.command.sdist import sdist as sdist_orig
9 9
 from distutils.command.build import build as build_orig
10 10
 
... ...
@@ -76,7 +76,7 @@ setup(
76 76
         'Intended Audience :: Science/Research',
77 77
         'Programming Language :: Python :: 3.6',
78 78
     ],
79
-    packages=['adaptive'],
79
+    packages=find_packages('.'),
80 80
     install_requires=install_requires,
81 81
     extras_require=extras_require,
82 82
     cmdclass=dict(sdist=sdist, build=build),
Browse code

add functionality to get version from git

We want a single source of truth for versioning; we choose
git tags.

Joseph Weston authored on 20/02/2018 14:51:52
Showing 1 changed files
... ...
@@ -1,14 +1,52 @@
1 1
 #!/usr/bin/env python3
2 2
 # -*- coding: utf-8 -*-
3 3
 
4
+import os
4 5
 import sys
6
+import imp
5 7
 from setuptools import setup
8
+from setuptools.command.sdist import sdist as sdist_orig
9
+from distutils.command.build import build as build_orig
6 10
 
7 11
 
8 12
 if sys.version_info < (3, 6):
9 13
     print('adaptive requires Python 3.6 or above.')
10 14
     sys.exit(1)
11 15
 
16
+
17
+# Load _version.py module without importing 'adaptive'
18
+_dont_write_bytecode = sys.dont_write_bytecode
19
+version = imp.load_source('version', 'adaptive/_version.py')
20
+sys.dont_write_bytecode = _dont_write_bytecode
21
+
22
+
23
+def write_version(fname):
24
+    # This could be a hard link, so try to delete it first.  Is there any way
25
+    # to do this atomically together with opening?
26
+    try:
27
+        os.remove(fname)
28
+    except OSError:
29
+        pass
30
+    with open(fname, 'w') as f:
31
+        f.write("# This file has been created by setup.py.\n"
32
+                "version = '{}'\n".format(version.version))
33
+
34
+
35
+class build(build_orig):
36
+    def run(self):
37
+        super().run()
38
+        write_version(os.path.join(self.build_lib, 'adaptive',
39
+                                   version.STATIC_VERSION_FILE))
40
+
41
+
42
+class sdist(sdist_orig):
43
+
44
+    def make_release_tree(self, base_dir, files):
45
+        super().make_release_tree(base_dir, files)
46
+        write_version(os.path.join(base_dir, 'adaptive',
47
+                                   version.STATIC_VERSION_FILE))
48
+
49
+
12 50
 install_requires = [
13 51
     'scipy',
14 52
     'sortedcontainers',
... ...
@@ -28,7 +66,7 @@ extras_require = {
28 66
 setup(
29 67
     name='adaptive',
30 68
     description='Adaptive parallel sampling of mathematical functions',
31
-    version='0.1a',
69
+    version=version.version,
32 70
     url='https://gitlab.kwant-project.org/qt/adaptive',
33 71
     author='Adaptive authors',
34 72
     license='BSD',
... ...
@@ -41,4 +79,5 @@ setup(
41 79
     packages=['adaptive'],
42 80
     install_requires=install_requires,
43 81
     extras_require=extras_require,
82
+    cmdclass=dict(sdist=sdist, build=build),
44 83
 )
Browse code

remove ipyparallel and distributed as dependencies

We provide compatibility to these libraries, but they are not
dependencies. If the user just wants to use all the cores on their
machine, 'concurrent.futures' is good enough. If they want to use
a cluster, they will have to learn to set up ipyparallel or distributed
themselves *anyway*, so we don't save users any effort by adding the
packages as dependencies

Joseph Weston authored on 19/02/2018 19:30:29
Showing 1 changed files
... ...
@@ -20,8 +20,6 @@ extras_require = {
20 20
         'ipykernel>=4.8.0',  # because https://github.com/ipython/ipykernel/issues/274 and https://github.com/ipython/ipykernel/issues/263
21 21
         'jupyter_client>=5.2.2',  # because https://github.com/jupyter/jupyter_client/pull/314
22 22
         'holoviews>=1.9.1',
23
-        'ipyparallel',
24
-        'distributed',
25 23
         'ipywidgets',
26 24
     ],
27 25
 }
Browse code

update README.md and add AUTHORS.md

Joseph Weston authored on 19/02/2018 19:30:08
Showing 1 changed files
... ...
@@ -15,7 +15,7 @@ install_requires = [
15 15
 ]
16 16
 
17 17
 extras_require = {
18
-    'recommended': [
18
+    'notebook': [
19 19
         'ipython',
20 20
         'ipykernel>=4.8.0',  # because https://github.com/ipython/ipykernel/issues/274 and https://github.com/ipython/ipykernel/issues/263
21 21
         'jupyter_client>=5.2.2',  # because https://github.com/jupyter/jupyter_client/pull/314
... ...
@@ -29,7 +29,7 @@ extras_require = {
29 29
 
30 30
 setup(
31 31
     name='adaptive',
32
-    description='Adaptively sample mathematical functions',
32
+    description='Adaptive parallel sampling of mathematical functions',
33 33
     version='0.1a',
34 34
     url='https://gitlab.kwant-project.org/qt/adaptive',
35 35
     author='Adaptive authors',
Browse code

move all notebook-related code to notebook_integration

Also move all non-essential requirements to 'extras_require'.

Joseph Weston authored on 16/02/2018 20:49:15
Showing 1 changed files
... ...
@@ -11,14 +11,14 @@ if sys.version_info < (3, 6):
11 11
 
12 12
 install_requires = [
13 13
     'scipy',
14
-    'ipython',
15 14
     'sortedcontainers',
16
-    'ipykernel>=4.8.0',  # because https://github.com/ipython/ipykernel/issues/274 and https://github.com/ipython/ipykernel/issues/263
17
-    'jupyter_client>=5.2.2',  # because https://github.com/jupyter/jupyter_client/pull/314
18 15
 ]
19 16
 
20 17
 extras_require = {
21 18
     'recommended': [
19
+        'ipython',
20
+        'ipykernel>=4.8.0',  # because https://github.com/ipython/ipykernel/issues/274 and https://github.com/ipython/ipykernel/issues/263
21
+        'jupyter_client>=5.2.2',  # because https://github.com/jupyter/jupyter_client/pull/314
22 22
         'holoviews>=1.9.1',
23 23
         'ipyparallel',
24 24
         'distributed',
... ...
@@ -26,6 +26,7 @@ extras_require = {
26 26
     ],
27 27
 }
28 28
 
29
+
29 30
 setup(
30 31
     name='adaptive',
31 32
     description='Adaptively sample mathematical functions',
Browse code

bump required Python to version 3.6

Bas Nijholt authored on 16/02/2018 17:49:31 • Joseph Weston committed on 16/02/2018 18:14:20
Showing 1 changed files
... ...
@@ -1,9 +1,14 @@
1 1
 #!/usr/bin/env python3
2 2
 # -*- coding: utf-8 -*-
3 3
 
4
+import sys
4 5
 from setuptools import setup
5 6
 
6 7
 
8
+if sys.version_info < (3, 6):
9
+    print('adaptive requires Python 3.6 or above.')
10
+    sys.exit(1)
11
+
7 12
 install_requires = [
8 13
     'scipy',
9 14
     'ipython',
... ...
@@ -19,6 +24,7 @@ extras_require = {
19 24
         'distributed',
20 25
         'ipywidgets',
21 26
     ],
27
+}
22 28
 
23 29
 setup(
24 30
     name='adaptive',
Browse code

remove superfluous package specification

Joseph Weston authored on 16/02/2018 16:53:19
Showing 1 changed files
... ...
@@ -33,8 +33,7 @@ setup(
33 33
         'Intended Audience :: Science/Research',
34 34
         'Programming Language :: Python :: 3.6',
35 35
     ],
36
-    packages=['adaptive',
37
-              'adaptive.learner'],
36
+    packages=['adaptive'],
38 37
     install_requires=install_requires,
39 38
     extras_require=extras_require,
40 39
 )
Browse code

add methods to the async runner for displaying its current status

Joseph Weston authored on 15/02/2018 17:40:52
Showing 1 changed files
... ...
@@ -12,9 +12,13 @@ install_requires = [
12 12
     'jupyter_client>=5.2.2',  # because https://github.com/jupyter/jupyter_client/pull/314
13 13
 ]
14 14
 
15
-extras_require = {'recommended': ['holoviews>=1.9.1',
16
-                                  'ipyparallel',
17
-                                  'distributed']}
15
+extras_require = {
16
+    'recommended': [
17
+        'holoviews>=1.9.1',
18
+        'ipyparallel',
19
+        'distributed',
20
+        'ipywidgets',
21
+    ],
18 22
 
19 23
 setup(
20 24
     name='adaptive',
Browse code

only require holoviews>=1.9.1 because we are no longer using TriMesh

Bas Nijholt authored on 16/02/2018 15:12:29
Showing 1 changed files
... ...
@@ -12,7 +12,7 @@ install_requires = [
12 12
     'jupyter_client>=5.2.2',  # because https://github.com/jupyter/jupyter_client/pull/314
13 13
 ]
14 14
 
15
-extras_require = {'recommended': ['holoviews>=1.10',
15
+extras_require = {'recommended': ['holoviews>=1.9.1',
16 16
                                   'ipyparallel',
17 17
                                   'distributed']}
18 18
 
Browse code

require holoviews 1.10

Bas Nijholt authored on 16/12/2017 17:10:41
Showing 1 changed files
... ...
@@ -12,7 +12,9 @@ install_requires = [
12 12
     'jupyter_client>=5.2.2',  # because https://github.com/jupyter/jupyter_client/pull/314
13 13
 ]
14 14
 
15
-extras_require = {'recommended': ['holoviews>=1.9.1', 'ipyparallel', 'distributed']}
15
+extras_require = {'recommended': ['holoviews>=1.10',
16
+                                  'ipyparallel',
17
+                                  'distributed']}
16 18
 
17 19
 setup(
18 20
     name='adaptive',
Browse code

pin ipykernel and jupyter_client to get relevant bug fixes

See the following issues / MR:
- https://github.com/ipython/ipykernel/issues/274
- https://github.com/ipython/ipykernel/issues/263
- https://github.com/jupyter/jupyter_client/pull/314

ttps://github.com/jupyter/jupyter_client/pull/314# Please enter the commit message for your changes. Lines starting

Bas Nijholt authored on 15/02/2018 11:40:30
Showing 1 changed files
... ...
@@ -4,7 +4,14 @@
4 4
 from setuptools import setup
5 5
 
6 6
 
7
-install_requires = ['scipy', 'ipython', 'sortedcontainers']
7
+install_requires = [
8
+    'scipy',
9
+    'ipython',
10
+    'sortedcontainers',
11
+    'ipykernel>=4.8.0',  # because https://github.com/ipython/ipykernel/issues/274 and https://github.com/ipython/ipykernel/issues/263
12
+    'jupyter_client>=5.2.2',  # because https://github.com/jupyter/jupyter_client/pull/314
13
+]
14
+
8 15
 extras_require = {'recommended': ['holoviews>=1.9.1', 'ipyparallel', 'distributed']}
9 16
 
10 17
 setup(
Browse code

update trove classifiers

Joseph Weston authored on 05/02/2018 12:32:53
Showing 1 changed files
... ...
@@ -11,15 +11,13 @@ setup(
11 11
     name='adaptive',
12 12
     description='Adaptively sample mathematical functions',
13 13
     version='0.1a',
14
-
15 14
     url='https://gitlab.kwant-project.org/qt/adaptive',
16 15
     author='Adaptive authors',
17 16
     license='BSD',
18 17
     classifiers=[
19 18
         'Development Status :: 3 - Alpha',
20
-        'License :: OSI Approved :: BSD License'
19
+        'License :: OSI Approved :: BSD License',
21 20
         'Intended Audience :: Science/Research',
22
-        'Topic :: Software Development :: Build Tools',
23 21
         'Programming Language :: Python :: 3.6',
24 22
     ],
25 23
     packages=['adaptive',
Browse code

remove requirements.txt and define extras_require in setup.py

Bas Nijholt authored on 09/12/2017 02:02:31
Showing 1 changed files
... ...
@@ -4,8 +4,8 @@
4 4
 from setuptools import setup
5 5
 
6 6
 
7
-with open('requirements.txt') as f:
8
-    requirements = f.readlines()
7
+install_requires = ['scipy', 'ipython', 'sortedcontainers']
8
+extras_require = {'recommended': ['holoviews>=1.9.1', 'ipyparallel', 'distributed']}
9 9
 
10 10
 setup(
11 11
     name='adaptive',
... ...
@@ -24,5 +24,6 @@ setup(
24 24
     ],
25 25
     packages=['adaptive',
26 26
               'adaptive.learner'],
27
-    install_requires=requirements,
27
+    install_requires=install_requires,
28
+    extras_require=extras_require,
28 29
 )
Browse code

add shebang to setup.py

Bas Nijholt authored on 31/10/2017 13:04:07
Showing 1 changed files
... ...
@@ -1,3 +1,4 @@
1
+#!/usr/bin/env python3
1 2
 # -*- coding: utf-8 -*-
2 3
 
3 4
 from setuptools import setup
Browse code

fix setup.py

Bas Nijholt authored on 31/10/2017 12:54:17
Showing 1 changed files
... ...
@@ -21,6 +21,7 @@ setup(
21 21
         'Topic :: Software Development :: Build Tools',
22 22
         'Programming Language :: Python :: 3.6',
23 23
     ],
24
-    packages=['adaptive'],
24
+    packages=['adaptive',
25
+              'adaptive.learner'],
25 26
     install_requires=requirements,
26 27
 )
Browse code

add setup.py and requirements file

Joseph Weston authored on 29/08/2017 11:48:58
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,26 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+from setuptools import setup
4
+
5
+
6
+with open('requirements.txt') as f:
7
+    requirements = f.readlines()
8
+
9
+setup(
10
+    name='adaptive',
11
+    description='Adaptively sample mathematical functions',
12
+    version='0.1a',
13
+
14
+    url='https://gitlab.kwant-project.org/qt/adaptive',
15
+    author='Adaptive authors',
16
+    license='BSD',
17
+    classifiers=[
18
+        'Development Status :: 3 - Alpha',
19
+        'License :: OSI Approved :: BSD License'
20
+        'Intended Audience :: Science/Research',
21
+        'Topic :: Software Development :: Build Tools',
22
+        'Programming Language :: Python :: 3.6',
23
+    ],
24
+    packages=['adaptive'],
25
+    install_requires=requirements,
26
+)