Because //github.com/scikit-optimize/scikit-optimize/issues/931 is fixed.
Bas Nijholt authored on 17/09/2020 23:51:22... | ... |
@@ -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 |
} |
... | ... |
@@ -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 |
} |
... | ... |
@@ -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", |
... | ... |
@@ -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", |
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... | ... |
@@ -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", |
... | ... |
@@ -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, |
In 890f84c00e059c15c427d1269f3e8df7abb83c74 I wrote that a 'concurrent.futures.ProcessPoolExecutor' doesn't work on Windows.
However, it seems like it just works now.
... | ... |
@@ -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", |
... | ... |
@@ -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", |
... | ... |
@@ -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 |
|
... | ... |
@@ -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 |
|
... | ... |
@@ -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/", |
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.
... | ... |
@@ -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": [ |
... | ... |
@@ -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, |
... | ... |
@@ -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, |
We use sortedcontainers 2.0 API.
Joseph Weston authored on 11/12/2018 15:49:40... | ... |
@@ -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=[ |
... | ... |
@@ -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') |
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.
... | ... |
@@ -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', |
... | ... |
@@ -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', |
... | ... |
@@ -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 |
) |
Remove usage of deprecated 'imp' module in favour of 'importlib'.
Also remove the package name from as many places as possible.
... | ... |
@@ -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 |
|
... | ... |
@@ -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', |
Without this subpackages are not packaged when using 'sdist'.
Joseph Weston authored on 20/02/2018 16:11:52... | ... |
@@ -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), |
We want a single source of truth for versioning; we choose
git tags.
... | ... |
@@ -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 |
) |
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
... | ... |
@@ -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 |
} |
... | ... |
@@ -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', |
Also move all non-essential requirements to 'extras_require'.
Joseph Weston authored on 16/02/2018 20:49:15... | ... |
@@ -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', |
... | ... |
@@ -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', |
... | ... |
@@ -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 |
) |
... | ... |
@@ -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', |
... | ... |
@@ -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 |
|
... | ... |
@@ -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', |
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
... | ... |
@@ -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( |
... | ... |
@@ -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', |
... | ... |
@@ -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 |
) |
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 |
+) |