Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
9312bd1e
Commit
9312bd1e
authored
Oct 26, 2018
by
Michael Droettboom
Committed by
GitHub
Oct 26, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #212 from rth/package-joblib
Package joblib
parents
db4e1d02
bad48f6b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
2 deletions
+91
-2
.circleci/config.yml
.circleci/config.yml
+2
-2
packages/joblib/meta.yaml
packages/joblib/meta.yaml
+15
-0
packages/joblib/patches/ctypes-import.patch
packages/joblib/patches/ctypes-import.patch
+21
-0
packages/joblib/patches/use-setuptools.patch
packages/joblib/patches/use-setuptools.patch
+12
-0
test/packages/test_joblib.py
test/packages/test_joblib.py
+41
-0
No files found.
.circleci/config.yml
View file @
9312bd1e
...
...
@@ -18,7 +18,7 @@ jobs:
-
restore_cache
:
keys
:
-
v1-emsdk-{{ checksum "emsdk/Makefile" }}-v
8
-
-
v1-emsdk-{{ checksum "emsdk/Makefile" }}-v
11
-
-
run
:
name
:
build
...
...
@@ -36,7 +36,7 @@ jobs:
paths
:
-
./emsdk/emsdk
-
~/.ccache
key
:
v1-emsdk-{{ checksum "emsdk/Makefile" }}-v
8
-{{ .BuildNum }}
key
:
v1-emsdk-{{ checksum "emsdk/Makefile" }}-v
11
-{{ .BuildNum }}
-
persist_to_workspace
:
root
:
.
...
...
packages/joblib/meta.yaml
0 → 100644
View file @
9312bd1e
package
:
name
:
joblib
version
:
"
0.11"
source
:
url
:
https://pypi.io/packages/source/j/joblib/joblib-0.11.tar.gz
sha256
:
7b8fd56df36d9731a83729395ccb85a3b401f62a96255deb1a77220c00ed4085
patches
:
-
patches/use-setuptools.patch
-
patches/ctypes-import.patch
test
:
imports
:
-
joblib
packages/joblib/patches/ctypes-import.patch
0 → 100644
View file @
9312bd1e
diff --git a/joblib/backports.py b/joblib/backports.py
index 7dd3df1..a49ef78 100644
--- a/joblib/backports.py
+++ b/joblib/backports.py
@@ -3,7 +3,6 @@
Backports of fixes for joblib dependencies
"""
import os
import time
-import ctypes
import sys
from distutils.version import LooseVersion
@@ -34,6 +33,8 @@
except ImportError:
if os.name == 'nt':
error_access_denied = 5
+ import ctypes
+
try:
from os import replace
except ImportError:
packages/joblib/patches/use-setuptools.patch
0 → 100644
View file @
9312bd1e
diff --git a/setup.py b/setup.py
index 134db18..f705b28 100755
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-from distutils.core import setup
+from setuptools import setup
import sys
import joblib
test/packages/test_joblib.py
0 → 100644
View file @
9312bd1e
import
pytest
def
test_joblib_numpy_pickle
(
selenium
,
request
):
if
selenium
.
browser
==
'chrome'
:
request
.
applymarker
(
pytest
.
mark
.
xfail
(
run
=
False
,
reason
=
'chrome not supported'
))
selenium
.
load_package
([
'numpy'
,
'joblib'
])
selenium
.
run
(
"""
import joblib
import numpy as np
from numpy.testing import assert_array_equal
X = np.ones(10)
file_path = "./X.pkl"
joblib.dump(X, file_path)
X2 = joblib.load(file_path)
assert_array_equal(X, X2)"""
)
def
test_joblib_parallel
(
selenium
):
selenium
.
load_package
([
'numpy'
,
'joblib'
])
selenium
.
clean_logs
()
selenium
.
run
(
"""
from math import sqrt
from joblib import Parallel, delayed
# check that the default multiprocessing backend
# gracefully reduces to n_jobs=1
res = Parallel(n_jobs=2)(delayed(sqrt)(i ** 2)
for i in range(10))
assert res == [sqrt(i ** 2) for i in range(10)]
# check threading backend
Parallel(n_jobs=2, backend='threading')(
delayed(sqrt)(i ** 2) for i in range(10))
"""
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment