Skip to content
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

Changes to make work with conda skeleton pypi jupyter-book #315

Merged
merged 1 commit into from Sep 12, 2019
Merged

Changes to make work with conda skeleton pypi jupyter-book #315

merged 1 commit into from Sep 12, 2019

Conversation

krinsman
Copy link
Contributor

@krinsman krinsman commented Sep 9, 2019

I tried to install this package using conda skeleton (see also) but ran into the error:

Traceback
Traceback (most recent call last):
  File "setup.py", line 17, in <module>
    with open('requirements.txt', 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
$PYTHONPATH = /var/folders/2b/mmgzz0qx6rvc_hgds3b0snjc0000gr/T/tmpwf3pkgfjconda_skeleton_jupyter-book-0.5.2.tar.gz/jupyter-book-0.5.2

Leaving build/test directories:
  Work:
 /opt/conda/miniconda3/conda-bld/skeleton_1568068075277/work 
  Test:
 /opt/conda/miniconda3/conda-bld/skeleton_1568068075277/test_tmp 
Leaving build/test environments:
  Test:
source activate  /opt/conda/miniconda3/conda-bld/skeleton_1568068075277/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol 
  Build:
source activate  /opt/conda/miniconda3/conda-bld/skeleton_1568068075277/_build_env 


Error: command failed: /opt/conda/miniconda3/conda-bld/skeleton_1568068075277/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/bin/python setup.py install

It seems like (and I'm not really sure) that conda build isn't able to run setup.py because requirements.txt isn't included with the source distribution uploaded to PyPI. So I added a MANIFEST.in and an extra include_package_data line in the call to setup. But admittedly I'm not sure whether this is sufficient to fix the error, nor am I sure how to test locally whether this would fix the error (since it seems like conda skeleton must pull the package remotely from PyPI).

Anyway since there isn't yet a conda-forge conda package for this project (which is understandable, because it takes a really long time for PR's to staged-recipes to get looked at/reviewed, and even longer for them to get approved), ensuring that the PyPI distribution is properly configured to work with conda skeleton pypi seems like it would be a helpful intermediate step for users.

@choldgraf
Copy link
Member

choldgraf commented Sep 11, 2019

Hmmm - this is a good question. I must admit I don't have much experience w/ conda skeleton, but perhaps there's a way to accomplish this without the MANIFEST file? Maybe @ocefpaf could advise since he's a conda-forge guru? :-)

@ocefpaf
Copy link

ocefpaf commented Sep 12, 2019

Can you pip install it the from source dist available on PyPI without the requirements.txt? The wheels are fine b/c they were built from a GitHub source, so they had the requirements.txt when they were created. However, the sdist on PyPI is incomplete without that file.

You cam either add a MANIFEST.in listing the files used in setup.py, or declare the dependencies directly on setup.py (or any other new packaging standard). This is not a skeleton problem but a problem with an incomplete source distribution.

@choldgraf
Copy link
Member

@ocefpaf it is definitely possible that this is an incomplete packaging problem, I am still pretty ignorant about packaging :-)

@krinsman if it's possible for us to accomplish the same thing but only using setup.py, I'd prefer that. It sounds from the comment above that this is possible? However if you don't have the time to investigate, we can merge this and follow up later. Let me know!

@ocefpaf
Copy link

ocefpaf commented Sep 12, 2019

The pattern that @krinsman used here is quite common if you want to have a single place for the requirements where setup.py, pip-CIs, and conda-CIs installs. However, I see people preferring the pyproject.toml or setup.cfg for dependencies too lately. TL;DR it is up to you.

@ocefpaf it is definitely possible that this is an incomplete packaging problem, I am still pretty ignorant about packaging :-)

Try pip install --no-binary :all: jupyter-book and you'll notice that the sdist is not OK without that file. The wheels only installation hinders that problem.

@choldgraf
Copy link
Member

thanks @ocefpaf - that's helpful! In that case, let's give this a merge and hopefully that fixes the installation issues. Thanks @krinsman for the improvement!

@choldgraf choldgraf merged commit d96a7ac into executablebooks:master Sep 12, 2019
@krinsman krinsman deleted the conda_package branch September 24, 2019 19:15
@choldgraf choldgraf added the 🏷️ maintenance Generic under-the-hood improvements to code and docs label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ maintenance Generic under-the-hood improvements to code and docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants