conda-forge / xcape-feedstock

A conda-smithy repository for xcape.
BSD 3-Clause "New" or "Revised" License
0 stars 3 forks source link

package is empty; python files missing #3

Closed rabernat closed 4 years ago

rabernat commented 4 years ago

The package I install from conda-forge appears to be, for lack of a better word, empty. If I look in the directory where it was installed, I see the following

$ ls  /Users/rpa/opt/miniconda3/envs/xcape_env/lib/python3.7/site-packages/xcape
Bunkers_model_lev.cpython-37m-darwin.so         SREH_model_lev.cpython-37m-darwin.so
Bunkers_model_lev.cpython-37m-darwin.so.dSYM        SREH_model_lev.cpython-37m-darwin.so.dSYM
Bunkers_pressure_lev.cpython-37m-darwin.so      SREH_pressure_lev.cpython-37m-darwin.so
Bunkers_pressure_lev.cpython-37m-darwin.so.dSYM     SREH_pressure_lev.cpython-37m-darwin.so.dSYM
CAPE_CODE_model_lev.cpython-37m-darwin.so       stdheight_2D_model_lev.cpython-37m-darwin.so
CAPE_CODE_model_lev.cpython-37m-darwin.so.dSYM      stdheight_2D_model_lev.cpython-37m-darwin.so.dSYM
CAPE_CODE_pressure_lev.cpython-37m-darwin.so        stdheight_2D_pressure_lev.cpython-37m-darwin.so
CAPE_CODE_pressure_lev.cpython-37m-darwin.so.dSYM   stdheight_2D_pressure_lev.cpython-37m-darwin.so.dSYM

There is no __init__.py, and in fact there are no pyhton files at all. Just a few compiled modules. As a result, I can't import or use the modules from the package, i.e.

>>> import xcape
>>> xcape                                                                                                                                         
<module 'xcape' (namespace)>
>>> import xcape.core
ImportError: cannot import name 'core' from 'xcape' (unknown location)

Something is wrong with this build, but I can't figure out what. I guess setup.py is not running properly?

Help would be much appreciated.


Environment (conda list):

``` $ conda list # packages in environment at /Users/rpa/opt/miniconda3/envs/xcape_env: # # Name Version Build Channel appnope 0.1.0 py37hc8dfbb8_1001 conda-forge attrs 19.3.0 py_0 conda-forge backcall 0.1.0 py_0 conda-forge binutils-meta 1.0.4 0 conda-forge bleach 3.1.4 pyh9f0ad1d_0 conda-forge bokeh 2.0.1 py37hc8dfbb8_0 conda-forge brotlipy 0.7.0 py37h9bfed18_1000 conda-forge ca-certificates 2020.4.5.1 hecc5488_0 conda-forge cctools 927.0.2 h5ba7a2e_4 conda-forge certifi 2020.4.5.1 py37hc8dfbb8_0 conda-forge cffi 1.14.0 py37h356ff06_0 conda-forge chardet 3.0.4 py37hc8dfbb8_1006 conda-forge click 7.1.1 pyh8c360ce_0 conda-forge cloudpickle 1.3.0 py_0 conda-forge cryptography 2.8 py37he655712_2 conda-forge cytoolz 0.10.1 py37h0b31af3_0 conda-forge dask 2.14.0 py_0 conda-forge dask-core 2.14.0 py_0 conda-forge decorator 4.4.2 py_0 conda-forge defusedxml 0.6.0 py_0 conda-forge distributed 2.14.0 py37hc8dfbb8_0 conda-forge entrypoints 0.3 py37hc8dfbb8_1001 conda-forge fortran-compiler 1.0.4 he991be0_0 conda-forge freetype 2.10.1 h8da9a1a_0 conda-forge fsspec 0.7.2 py_0 conda-forge gfortran_impl_osx-64 7.3.0 hf4212f2_2 conda-forge gfortran_osx-64 7.3.0 h22b1bf0_2 conda-forge gmp 6.2.0 h4a8c4bd_2 conda-forge heapdict 1.0.1 py_0 conda-forge idna 2.9 py_1 conda-forge importlib-metadata 1.6.0 py37hc8dfbb8_0 conda-forge importlib_metadata 1.6.0 0 conda-forge ipykernel 5.2.0 py37h43977f1_1 conda-forge ipython 7.13.0 py37hc8dfbb8_2 conda-forge ipython_genutils 0.2.0 py_1 conda-forge isl 0.19 0 conda-forge jedi 0.17.0 py37hc8dfbb8_0 conda-forge jinja2 2.11.2 pyh9f0ad1d_0 conda-forge jpeg 9c h1de35cc_1001 conda-forge json5 0.9.0 py_0 conda-forge jsonschema 3.2.0 py37hc8dfbb8_1 conda-forge jupyter_client 6.1.3 py_0 conda-forge jupyter_core 4.6.3 py37hc8dfbb8_1 conda-forge jupyterlab 2.1.0 py_0 conda-forge jupyterlab_server 1.1.1 py_0 conda-forge ld64 450.3 h3c32e8a_4 conda-forge libblas 3.8.0 16_openblas conda-forge libcblas 3.8.0 16_openblas conda-forge libcxx 9.0.1 1 conda-forge libffi 3.2.1 h4a8c4bd_1007 conda-forge libgfortran 4.0.0 2 conda-forge libiconv 1.15 h0b31af3_1006 conda-forge liblapack 3.8.0 16_openblas conda-forge libllvm9 9.0.1 h7475705_1 conda-forge libopenblas 0.3.9 h3d69b6c_0 conda-forge libpng 1.6.37 hbbe82c9_1 conda-forge libsodium 1.0.17 h01d97ff_0 conda-forge libtiff 4.1.0 h2ae36a8_6 conda-forge libwebp-base 1.1.0 h0b31af3_3 conda-forge llvm-openmp 10.0.0 h28b9765_0 conda-forge locket 0.2.0 py_2 conda-forge lz4-c 1.9.2 h4a8c4bd_0 conda-forge markupsafe 1.1.1 py37h9bfed18_1 conda-forge mistune 0.8.4 py37h9bfed18_1001 conda-forge mpc 1.1.0 h4160ff4_1007 conda-forge mpfr 4.0.2 h65ac59c_1 conda-forge msgpack-python 1.0.0 py37ha1cc60f_1 conda-forge nbconvert 5.6.1 py37hc8dfbb8_1 conda-forge nbformat 5.0.6 py_0 conda-forge ncurses 6.1 h0a44026_1002 conda-forge notebook 6.0.3 py37_0 conda-forge numpy 1.18.1 py37h7687784_1 conda-forge olefile 0.46 py_0 conda-forge openssl 1.1.1f h0b31af3_0 conda-forge packaging 20.1 py_0 conda-forge pandas 1.0.3 py37h94625e5_1 conda-forge pandoc 2.9.2.1 0 conda-forge pandocfilters 1.4.2 py_1 conda-forge parso 0.7.0 pyh9f0ad1d_0 conda-forge partd 1.1.0 py_0 conda-forge pexpect 4.8.0 py37hc8dfbb8_1 conda-forge pickleshare 0.7.5 py37hc8dfbb8_1001 conda-forge pillow 7.1.1 py37hfd78ece_0 conda-forge pip 20.0.2 py_2 conda-forge prometheus_client 0.7.1 py_0 conda-forge prompt-toolkit 3.0.5 py_0 conda-forge psutil 5.7.0 py37h9bfed18_1 conda-forge ptyprocess 0.6.0 py_1001 conda-forge pycparser 2.20 py_0 conda-forge pygments 2.6.1 py_0 conda-forge pyopenssl 19.1.0 py_1 conda-forge pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pyrsistent 0.16.0 py37h9bfed18_0 conda-forge pysocks 1.7.1 py37hc8dfbb8_1 conda-forge python 3.7.6 h90870a6_5_cpython conda-forge python-dateutil 2.8.1 py_0 conda-forge python_abi 3.7 1_cp37m conda-forge pytz 2019.3 py_0 conda-forge pyyaml 5.3.1 py37h9bfed18_0 conda-forge pyzmq 19.0.0 py37haec44b1_1 conda-forge readline 8.0 hcfe32e1_0 conda-forge requests 2.23.0 pyh8c360ce_2 conda-forge send2trash 1.5.0 py_0 conda-forge setuptools 46.1.3 py37hc8dfbb8_0 conda-forge six 1.14.0 py_1 conda-forge sortedcontainers 2.1.0 py_0 conda-forge sqlite 3.30.1 h93121df_0 conda-forge tapi 1000.10.8 ha1b3eb9_4 conda-forge tblib 1.6.0 py_0 conda-forge terminado 0.8.3 py37hc8dfbb8_1 conda-forge testpath 0.4.4 py_0 conda-forge tk 8.6.10 hbbe82c9_0 conda-forge toolz 0.10.0 py_0 conda-forge tornado 6.0.4 py37h9bfed18_1 conda-forge traitlets 4.3.3 py37hc8dfbb8_1 conda-forge typing_extensions 3.7.4.1 py37hc8dfbb8_3 conda-forge urllib3 1.25.9 py_0 conda-forge wcwidth 0.1.9 pyh9f0ad1d_0 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.34.2 py_1 conda-forge xarray 0.15.1 py_0 conda-forge xcape 0.1 pypi_0 pypi xz 5.2.5 h0b31af3_0 conda-forge yaml 0.2.4 h0b31af3_0 conda-forge zeromq 4.3.2 h6de7cb9_2 conda-forge zict 2.0.0 py_0 conda-forge zipp 3.1.0 py_0 conda-forge zlib 1.2.11 h0b31af3_1006 conda-forge zstd 1.4.4 h4b3e974_3 conda-forge ```


Details about conda and system ( conda info ):

``` $ conda info active environment : xcape_env active env location : /Users/rpa/opt/miniconda3/envs/xcape_env shell level : 6 user config file : /Users/rpa/.condarc populated config files : /Users/rpa/.condarc conda version : 4.8.2 conda-build version : not installed python version : 3.7.4.final.0 virtual packages : __osx=10.12.6 base environment : /Users/rpa/opt/miniconda3 (writable) channel URLs : https://conda.anaconda.org/conda-forge/osx-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/osx-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/osx-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /Users/rpa/opt/miniconda3/pkgs /Users/rpa/.conda/pkgs envs directories : /Users/rpa/opt/miniconda3/envs /Users/rpa/.conda/envs platform : osx-64 user-agent : conda/4.8.2 requests/2.22.0 CPython/3.7.4 Darwin/16.7.0 OSX/10.12.6 UID:GID : 501:20 netrc file : None offline mode : False ```
dopplershift commented 4 years ago

It's not a conda-forge issue. If you just do pip install . from the xcape repo, it produces the same layout. Probably best to continue with an issue over there?

rabernat commented 4 years ago

Thanks for the suggestion @dopplershift! What you say sounds plausible. Whenever I install locally, I run pip install -e .. That's also what we do in the xcape tests. I never anticipated that pip install . would work any differently.

To test this myself, I just did

conda create -n xcape_env numpy xarray dask-core fortran-compiler python=3.7
pip install .

And I reproduced the problematic install.

rabernat commented 4 years ago

Over in #4, @ocefpaf seems to have found a fix that does not involve touching our setup.py. But it seems like we should be able to pip install . on the package, independently of conda-forge. Trying to figure out the best approach to fix.

rabernat commented 4 years ago

And as usual @ocefpaf is 100 steps ahead of me: https://github.com/xgcm/xcape/pull/22

dopplershift commented 4 years ago

Yeah, we moved MetPy to use a src/ layout and making sure we do pip install . in our tests to make sure we're testing as our users would install.

For the record, pip install -e . is little more than a symlink to your python code (and a build of your extension code in-place). Great for development, not so great for testing.

ocefpaf commented 4 years ago

The alternative is either the src layout or not running the tests from the root directory. Both would catch that. I also do like to add some tarball tests, like check-manifest and twine checks, I'll add those to the PR.

rabernat commented 4 years ago

I made some of these changes over in https://github.com/xgcm/xcape/pull/23 and issued a new release (0.1.1). Thanks for all your suggestions.

ocefpaf commented 4 years ago

I guess we can close this one now. Please re-open if I'm wrong.