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

Adjectives.txt missing from wheel #200

Closed
andrewcooke opened this issue Dec 21, 2020 · 15 comments · Fixed by #201
Closed

Adjectives.txt missing from wheel #200

andrewcooke opened this issue Dec 21, 2020 · 15 comments · Fixed by #201
Assignees

Comments

@andrewcooke
Copy link

andrewcooke commented Dec 21, 2020

Hi,

I just built a docker image using the latest Jupyter and when I try to open a notebook see the error

   File "/usr/local/lib/python3.8/site-packages/nbformat/corpus/words.py", line 15, in acceptable_adjectives
   with open(os.path.join(os.path.dirname(__file__), 'adjectives.txt'), 'r') as adjectives_file:
   FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/site-packages/nbformat/corpus/adjectives.txt'

Looking at nbformat-5.0.9b0-py3-none-any.whl from PyPi (https://files.pythonhosted.org/packages/20/4a/bef9724bf4682c42f729d753a1c9ff5b9db97f64d155e5b3cd1a9bd21a60/nbformat-5.0.9b0-py3-none-any.whl) that file is indeed missing:

> unzip -l nbformat-5.0.9b0-py3-none-any.whl
Archive:  nbformat-5.0.9b0-py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
     4962  2020-12-20 23:09   nbformat/__init__.py
      342  2020-12-20 23:09   nbformat/_compat.py
      122  2020-12-20 23:09   nbformat/_version.py
     2074  2020-12-20 23:09   nbformat/converter.py
     5353  2020-12-20 23:09   nbformat/current.py
     2547  2020-12-20 23:09   nbformat/json_compat.py
     1709  2020-12-20 23:09   nbformat/notebooknode.py
     2088  2020-12-20 23:09   nbformat/reader.py
      421  2020-12-20 23:09   nbformat/sentinel.py
    20454  2020-12-20 23:09   nbformat/sign.py
    11191  2020-12-20 23:09   nbformat/validator.py
        0  2020-12-20 23:09   nbformat/corpus/__init__.py
      608  2020-12-20 23:09   nbformat/corpus/words.py
        0  2020-12-20 23:09   nbformat/corpus/tests/__init__.py
...

(It is present in the tarball, and setup.py looks fine to me).

Sorry if I am doing something dumb, but this looks like a bug? Particularly since this was released yesterday?

Cheers,
Andrew

Edit: I should add, sorry, that my docker image has:

 cat _version.py 
# Make sure to update package.json, too!
version_info = (5, 0, 9, 'beta0')
__version__ = '.'.join(map(str, version_info))
@andrewcooke andrewcooke changed the title Adjerctives.txt missing from wheel Adjectives.txt missing from wheel Dec 21, 2020
@andrewcooke
Copy link
Author

If anyone else is having the same problem the work-around is, in the project that requires jupyter, to use

nbformat==5.0.8

in the setup.py install_requires. That fixes the issue.

@goanpeca
Copy link
Contributor

Hi @andrewcooke thanks for the report!

I will prepare a 5.0.9b1 !

@goanpeca goanpeca self-assigned this Dec 21, 2020
@goanpeca
Copy link
Contributor

Question @andrewcooke are you installing this dependency with --pre ?

Being a beta it should not be pulled by default py pip.

@andrewcooke
Copy link
Author

I don't understand why I was getting a beta package. Is there anything wrong with https://github.com/andrewcooke/choochoo/blob/v0.38.1/py/setup.py ? The image is built using https://github.com/andrewcooke/choochoo/blob/v0.38.1/dkr/make-choochoo-dockerfile.sh

I think I have had problems with other beta packages in the past, too.

@andrewcooke
Copy link
Author

Looking at the requirements.txt that is used during building, one odd thing that sticks out is

ipywidgets==8.0.0a0

But I have no idea why that is there.

@andrewcooke
Copy link
Author

Hmmm. I think my build process is broken. I seem to be using requirements from pip freeze of my development code rather than something consistent. Thanks for asking about this. I will make it cleaner.

@andrewcooke
Copy link
Author

Just to confirm that when I fix my build process I don't get this dependency. So I am probably the only person ever to have seen it...

@goanpeca
Copy link
Contributor

Yeah, I just tried locally on a clean env, and unless I do pip install nbformat --pre I still get 5.0.8 version, so it may be something funny going on with Pip.

@goanpeca
Copy link
Contributor

goanpeca commented Dec 21, 2020

Ok cool, sorry I missed the previous message. Indeed I saw the freeze and that looked interesting 🙃.

Glad to hear you got thing sorted out. Feel free to close the issue :)

Cheers!

@MSeal
Copy link
Contributor

MSeal commented Dec 21, 2020

Some builds purposefully have --pre on to catch upcoming incompatibilities, so likely this isn't isolated to just you.

The weird part is that when I generate the wheel locally from the release tag it has the specified txt files included. And the tar.gz has the corpus txt files present. Only the uploaded wheel doesn't have the txt files. And the uploaded tar.gz has the files. I'm having difficulty figuring out why the automated build didn't include the file.

@goanpeca
Copy link
Contributor

goanpeca commented Dec 21, 2020

I have a fix for this @MSeal, pushing a PR.

@MSeal
Copy link
Contributor

MSeal commented Dec 21, 2020

Ok, btw I am able to reproduce if I upgrade wheel to wheel-0.36.2 -- downgrading to wheel-0.34.2 and it correctly includes the files.

@goanpeca
Copy link
Contributor

I tried locally with include_package_data = True, on setup.py and seems to work ?

@MSeal
Copy link
Contributor

MSeal commented Dec 21, 2020

Yeah I can confirm that in 0.36.2 it needs that field. That's really weird that it started requiring that field -- wheels haven't required that if package_data is present since python 3 came out. Maybe python 3.9 had a different opinion and support for that version was recently added. I can't find any issues pointing out why this changed but oh well -- it seems to fix it.

@andrewcooke
Copy link
Author

OK, so I'm closing this as suggested above. I think I fixed my side and it seems you've fixed your side. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants