Skip to content

Commit a8b8af1

Browse files
committed
fix ci install (tests failing now as they locally)
1 parent 625c864 commit a8b8af1

File tree

13 files changed

+678
-1070
lines changed

13 files changed

+678
-1070
lines changed

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ addons:
1515
before_install:
1616
- sudo apt update
1717
# javascript dependencies
18-
- sudo apt install nodejs
18+
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
19+
- nvm install 10.16.3
20+
- nvm use 10.16.3
21+
- npm --version
1922
# install chromebrowser
2023
- wget -N http://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip -P ~/
2124
- unzip ~/chromedriver_linux64.zip -d ~/
@@ -26,7 +29,9 @@ before_install:
2629
install:
2730
# Install IDOM along with test requirements
2831
- pip install -r requirements.txt
32+
- python setup.py build
2933
- pip install -e .[all]
34+
- ls src/idom/client
3035

3136
script:
3237
- bash scripts/test.sh

MANIFEST.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
graft src/idom/client/
2-
prune src/idom/client/node_modules
1+
graft src/idom/client/core_modules
2+
graft src/idom/client/web_modules
3+
include src/idom/client/index.html
34

45
include src/idom/py.typed
56
include LICENSE

requirements/dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ jupyterlab
22
pre-commit
33
notebook
44
twine
5+
wheel

requirements/extras.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# extra=sanic
1+
# extra=stable,sanic
22
sanic <19.12.0
33
sanic-cors >=0.9.9, <1.0
44

requirements/test.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pytest==5.2.2
22
pytest-asyncio
33
pytest-cov
4-
pytest-rerunfailures
54
mypy>=0.750
65
black
76
flake8

scripts/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/bin/bash
2+
set -e
3+
24
cd src/idom/client
35
rm -rf node_modules
46
rm -rf web_modules
7+
rm -rf etc_modules
58
npm install
69
npm run snowpack
710
cd ../../../

scripts/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -e
33

4-
pytest src/tests --headless --cov=idom --cov-fail-under=82 --reruns 1
4+
pytest src/tests --headless --cov=idom --cov-fail-under=82 -vv
55
black --verbose --check src/py
66
flake8 src/
77
mypy src/idom

setup.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,20 @@
5050
requirements.append(line)
5151
package["install_requires"] = requirements
5252

53-
_current_extra_section = None
53+
_current_extras = []
5454
extra_requirements = {"all": []} # type: ignore
5555
extra_requirements_path = os.path.join(here, "requirements", "extras.txt")
5656
with open(extra_requirements_path, "r") as f:
5757
for line in map(str.strip, f):
5858
if line.startswith("#") and line[1:].strip().startswith("extra="):
59-
_current_extra_section = line.split("=", 1)[1]
60-
if _current_extra_section == "all":
59+
_current_extras = [e.strip() for e in line.split("=", 1)[1].split(",")]
60+
if "all" in _current_extras:
6161
raise ValueError("%r uses the reserved extra name 'all'")
62-
extra_requirements[_current_extra_section] = []
63-
elif _current_extra_section is not None:
64-
extra_requirements[_current_extra_section].append(line)
62+
for e in _current_extras:
63+
extra_requirements[e] = []
64+
elif _current_extras:
65+
for e in _current_extras:
66+
extra_requirements[e].append(line)
6567
extra_requirements["all"].append(line)
6668
elif line:
6769
msg = "No '# extra=<name>' header before requirements in %r"

src/docs/source/install.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ In order to work with IDOM's source code you'll need to install:
4040

4141
- git_
4242

43-
- Yarn_
43+
- npm_
4444

4545
You'll begin by copy the source from GitHub onto your computer using Git:
4646

@@ -53,23 +53,23 @@ At this point you should be able to run this install command to:
5353

5454
- Install an editable version of the Python code
5555

56-
- Transpile the Javascript and copy it to ``src/py/idom/static``
56+
- Download, build, and install Javascript dependencies
5757

5858
- Install some pre-commit hooks for Git
5959

6060
.. code-block:: bash
6161
6262
pip install -e . -r requirements.txt && pre-commit install
6363
64-
If you modify a Javascript library you'll need to re-run this command:
64+
Since we're using native ES modules for our Javascript, you should usually be able to
65+
refresh your browser page to see your latest changes to the client. However if you
66+
modify any dependencies you can run standard ``npm`` commands to install them or
67+
simply run the following to re-evaluate the ``package.json``:
6568

6669
.. code-block:: bash
6770
6871
pip install -e .
6972
70-
This will transpile the Javascript again and copy it to the
71-
``src/py/idom/static`` folder.
72-
7373
7474
Running The Test
7575
----------------
@@ -97,13 +97,13 @@ run:
9797

9898
.. code-block:: bash
9999
100-
pytest src/py/tests
100+
pytest src/tests
101101
102102
If you prefer to run the tests using a headless browser:
103103

104104
.. code-block:: bash
105105
106-
pytest src/py/tests --headless
106+
pytest src/tests --headless
107107
108108
.. Links
109109
.. =====
@@ -112,8 +112,8 @@ If you prefer to run the tests using a headless browser:
112112
.. _ChromeDriver: https://chromedriver.chromium.org/downloads
113113
.. _git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
114114
.. _Git Bash: https://gitforwindows.org/
115+
.. _npm: https://www.npmjs.com/get-npm
115116
.. _PyPI: https://pypi.org/project/idom
116117
.. _pip: https://pypi.org/project/pip/
117118
.. _PyTest: pytest <https://docs.pytest.org
118119
.. _Selenium: https://www.seleniumhq.org/
119-
.. _Yarn: https://yarnpkg.com/lang/en/docs/install

src/idom/client/etc_modules/chart.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)