-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Python package sos-notebook. #7665
Changes from 12 commits
e0a88eb
5783369
351f3b5
fbe0a80
37affe9
e389f42
dc1bb83
d0b292e
5e29676
e7cbed6
493cbec
cd71a55
36fb3a2
44652e9
0946379
fe325bf
b77ff46
27e99d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
x=1 | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,65 @@ | ||||||
{% set name = "sos-notebook" %} | ||||||
{% set version = "0.19.1" %} | ||||||
|
||||||
package: | ||||||
name: "{{ name|lower }}" | ||||||
version: "{{ version }}" | ||||||
|
||||||
source: | ||||||
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz | ||||||
sha256: 9f3ae4371f2a9cf493c77190010e73270ddc658904618937889ce14c0ecebb09 | ||||||
|
||||||
build: | ||||||
noarch: python | ||||||
number: 0 | ||||||
script: | ||||||
- {{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv | ||||||
- {{ PYTHON }} -m sos_notebook.install --sys-prefix | ||||||
|
||||||
requirements: | ||||||
host: | ||||||
- ipython | ||||||
- notebook >=5.0.0 | ||||||
- pip | ||||||
- python >=3.6 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this can't be
Suggested change
(same applies in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having looked more closely it looks like this could be |
||||||
run: | ||||||
- ipykernel | ||||||
- ipython | ||||||
- markdown | ||||||
- matplotlib | ||||||
- nbconvert >=5.1.1 | ||||||
- nbformat | ||||||
- notebook >=5.0.0 | ||||||
- pandas | ||||||
- python >=3.6 | ||||||
- setuptools | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then should I move it to https://github.com/vatlab/sos-notebook/blob/master/setup.py#L11 |
||||||
- sos >=0.19.2 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, fiddling this for a long time... because
before running
It is a shame that conda-forge does not allow dependency from conda-forge. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Huh? This is not true There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I described,
outside of
or
in the configuration file. I apologize for my "shame" word but it was frustrating to spend a few hours debugging this simple problem. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least the error message could be more informative such as "package xxx cannot be found in channels xxxx". |
||||||
- tabulate | ||||||
|
||||||
test: | ||||||
requires: | ||||||
- nose | ||||||
imports: | ||||||
- sos_notebook | ||||||
commands: | ||||||
- jupyter kernelspec list | grep -w $PREFIX/share/jupyter/kernels/sos # [unix] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not work under mac here. It seems that
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @isuruf I would also appreciate your guidance here. Did There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it doesn't split the command into two. It's just that when the commands are echoed they are shown like that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Figured out the problem, the build and test steps use different environments with different python. @jdblischak Please change
to
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @BoPeng I don't understand your concern. This test passes on macOS, which you can see at the line below: https://travis-ci.org/conda-forge/staged-recipes/builds/513186637#L1626 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It failed locally on my mac. I think the problem was that I have locally installed kernels and multiple jupyter commands so There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm....that still doesn't seem right. Even though you have local kernels installed, the sos kernel should still be installed in the conda environment, and thus the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The jupyter command used in the test might be from local environment. The change can be useful because it makes a bit easier to test the recipe locally, even if the wrong jupyter or python was used. Not a big deal though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The jupyter command used in the test might be from local environment. The change can be useful because it makes a bit easier to test the recipe locally, even if the wrong jupyter or python was used. Not a big deal though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That shouldn't happen. In a conda environment, the first
If the wrong jupyter or python is being used, it is good that the test fails since this indicates something is wrong with the isolation of the conda environment. |
||||||
- jupyter kernelspec list | findstr \share\jupyter\kernels\sos # [win] | ||||||
- jupyter run --kernel=sos ex.py | ||||||
files: | ||||||
- ex.py | ||||||
|
||||||
about: | ||||||
home: https://github.com/vatlab/SOS | ||||||
license: BSD | ||||||
license_family: BSD | ||||||
license_file: LICENSE | ||||||
summary: "Script of Scripts (SoS): an interactive, cross-platform, and | ||||||
cross-language workflow system for reproducible data analysis" | ||||||
doc_url: https://vatlab.github.io/sos-docs/ | ||||||
dev_url: https://github.com/vatlab/sos-notebook | ||||||
|
||||||
extra: | ||||||
recipe-maintainers: | ||||||
- BoPeng | ||||||
- gaow | ||||||
- jdblischak |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Test that sos kernel is installed | ||
|
||
import jupyter_client | ||
|
||
try: | ||
jupyter_client.kernelspec.get_kernel_spec('sos') | ||
except jupyter_client.kernelspec.NoSuchKernel: | ||
print('sos kernel was not installed') | ||
print('The following kernels are installed:') | ||
print('jupyter_client.kernelspec.find_kernel_specs()') | ||
print(jupyter_client.kernelspec.find_kernel_specs()) | ||
|
||
# Test that sos kernel is functional | ||
|
||
import unittest | ||
|
||
from ipykernel.tests.utils import execute, wait_for_idle, assemble_output | ||
from sos_notebook.test_utils import sos_kernel | ||
|
||
class TestSoSKernel(unittest.TestCase): | ||
def testKernel(self): | ||
with sos_kernel() as kc: | ||
execute(kc=kc, code='a = 1\nprint(a)') | ||
stdout, stderr = assemble_output(kc.iopub_channel) | ||
self.assertEqual(stderr, '') | ||
self.assertEqual(stdout.strip(), '1') | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, delete the
build.sh
andbld.bat
. After that please add in yourbuild
sectionOtherwise, this recipe cannot be
noarch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcelotrevisani Thanks! I just pushed this change.