Build six using usual build system (#1010)

This commit is contained in:
Dexter Chua 2021-01-02 16:59:28 +08:00 committed by GitHub
parent 2dfeba4c05
commit 869044ba2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 29 additions and 56 deletions

1
.gitignore vendored
View File

@ -26,7 +26,6 @@ ccache
/emsdk/emsdk
*.egg-info/
packages/six/six-1.11.0
packages/lz4/lz4-1.8.3
packages/CLAPACK/CLAPACK-WA
packages/CLAPACK/clapack.tgz

View File

@ -40,9 +40,6 @@ LDFLAGS=\
-s "BINARYEN_TRAP_MODE='clamp'" \
-s LZ4=1
SIX_ROOT=packages/six/six-1.11.0/build/lib
SIX_LIBS=$(SIX_ROOT)/six.py
JEDI_ROOT=packages/jedi/jedi-0.17.2/jedi
JEDI_LIBS=$(JEDI_ROOT)/__init__.py
@ -133,7 +130,6 @@ clean:
rm -fr src/*.bc
rm -fr node_modules
make -C packages clean
make -C packages/six clean
make -C packages/jedi clean
make -C packages/parso clean
make -C packages/libxslt clean
@ -168,7 +164,6 @@ $(UGLIFYJS) $(LESSC): emsdk/emsdk/.complete
root/.built: \
$(CPYTHONLIB) \
$(SIX_LIBS) \
$(JEDI_LIBS) \
$(PARSO_LIBS) \
src/sitecustomize.py \
@ -179,7 +174,6 @@ root/.built: \
mkdir -p root/lib
cp -r $(CPYTHONLIB) root/lib
mkdir -p $(SITEPACKAGES)
cp $(SIX_LIBS) $(SITEPACKAGES)
cp -r $(JEDI_ROOT) $(SITEPACKAGES)
cp -r $(PARSO_ROOT) $(SITEPACKAGES)
cp src/sitecustomize.py $(SITEPACKAGES)
@ -224,12 +218,6 @@ $(CPYTHONLIB): emsdk/emsdk/.complete $(PYODIDE_EMCC) $(PYODIDE_CXX)
date +"[%F %T] done building cpython..."
$(SIX_LIBS): $(CPYTHONLIB)
date +"[%F %T] Building six..."
make -C packages/six
date +"[%F %T] done building six."
$(JEDI_LIBS): $(CPYTHONLIB)
date +"[%F %T] Building jedi..."
make -C packages/jedi

View File

@ -16,6 +16,8 @@
As part of the change, Module.checkABI is no longer present.
[#991](https://github.com/iodide-project/pyodide/pull/991)
- six is no longer vendored in the main pyodide package, and needs to be loaded
explicitly [#1010](https://github.com/iodide-project/pyodide/pull/1010)
### Added
- `micropip` now supports installing wheels from relative urls. [#872](https://github.com/iodide-project/pyodide/pull/872)

View File

@ -4,6 +4,9 @@ package:
source:
sha256: 0ef97238856430dcf9228e07f316aefc17e8939fc8507e18c6501b761ef1a42a
url: https://files.pythonhosted.org/packages/c4/d4/c2b5232ecfc0783c697a81c13efc53a4fe285d4e2c00e0d8aed90495fade/attrs-20.1.0.tar.gz
requirements:
run:
- six
test:
imports:
- attr

View File

@ -6,6 +6,7 @@ requirements:
- setuptools
- webencodings
- packaging
- six
source:
sha256: 3c4c520fdb9db59ef139915a5db79f8b51bc2a7257ea0389f30c846883430a4b
url: https://files.pythonhosted.org/packages/a9/ac/dc881fca3ac66d6f2c4c3ac46633af4e9c05ed5a0aa2e7e36dc096687dd7/bleach-3.1.5.tar.gz

View File

@ -9,3 +9,7 @@ source:
test:
imports:
- cycler
requirements:
run:
- six

View File

@ -4,6 +4,7 @@ package:
requirements:
run:
- webencodings
- six
source:
sha256: b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f
url: https://files.pythonhosted.org/packages/ac/b6/b55c3f49042f1df3dcd422b7f224f939892ee94f22abcf503a9b7339eaf2/html5lib-1.1.tar.gz

View File

@ -8,6 +8,7 @@ source:
requirements:
run:
- pyparsing
- six
test:
imports:

View File

@ -10,6 +10,7 @@ source:
requirements:
run:
- numpy
- six
test:
imports:

View File

@ -17,6 +17,7 @@ requirements:
- pluggy
- py
- setuptools
- six
test:
imports:

View File

@ -6,6 +6,9 @@ source:
- patches/dummy-thread-lock.patch
sha256: 73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c
url: https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz
requirements:
run:
- six
test:
imports:
- dateutil

View File

@ -13,3 +13,7 @@ source:
test:
imports:
- pysat
requirements:
run:
- six

View File

@ -1,38 +0,0 @@
PYODIDE_ROOT=$(abspath ../..)
include ../../Makefile.envs
SIXVERSION=1.11.0
ROOT=$(abspath .)
SRC=$(ROOT)/six-$(SIXVERSION)
BUILD=$(SRC)/build/lib/six
TARBALL=$(ROOT)/downloads/six-$(SIXVERSION).tgz
URL=https://files.pythonhosted.org/packages/16/d8/bc6316cf98419719bd59c91742194c111b6f2e85abac88e496adefaf7afe/six-1.11.0.tar.gz
all: $(BUILD)/__init__.py
clean:
-rm -fr downloads
-rm -fr $(SRC)
$(TARBALL):
[ -d $(ROOT)/downloads ] || mkdir $(ROOT)/downloads
wget -q -O $@ $(URL)
md5sum --quiet --check checksums || (rm $@; false)
$(SRC)/setup.py: $(TARBALL)
tar -C . -xf $(TARBALL)
touch $(SRC)/setup.py
$(BUILD)/__init__.py: $(SRC)/setup.py
( \
cd $(SRC) ; \
$(HOSTPYTHON) setup.py build ; \
touch build/lib/six.py \
)

View File

@ -1,2 +0,0 @@
Six is a special case package, since it's so commonly used, we want to include
it in the main Python package.

View File

@ -1 +0,0 @@
d12789f9baf7e9fb2524c0c64f1773f8 downloads/six-1.11.0.tgz

6
packages/six/meta.yaml Normal file
View File

@ -0,0 +1,6 @@
package:
name: six
version: 1.15.0
source:
sha256: 30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259
url: https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz

View File

@ -47,6 +47,7 @@ def test_build_dependencies(n_jobs, monkeypatch):
"libxml",
"zlib",
"libiconv",
"six",
}
assert build_list.index("distlib") < build_list.index("micropip")
assert build_list.index("soupsieve") < build_list.index("beautifulsoup4")

View File

@ -15,14 +15,13 @@ def test_find_imports():
res = find_imports(
dedent(
"""
import six
import numpy as np
from scipy import sparse
import matplotlib.pyplot as plt
"""
)
)
assert set(res) == {"numpy", "scipy", "six", "matplotlib"}
assert set(res) == {"numpy", "scipy", "matplotlib"}
def test_adjust_ast():