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

prevent No such file or directory: 'README.md' on install #102

Merged
merged 1 commit into from May 27, 2020

Conversation

jquast
Copy link
Contributor

@jquast jquast commented Oct 8, 2018

This should prevent the following error,

$ pip --version
pip 18.1 from /Users/jq/.pyenv/versions/3.6.5/envs/jupyter/lib/python3.6/site-packages/pip (python 3.6)
$ pip install colout
Collecting colout
  Downloading https://files.pythonhosted.org/packages/3d/ba/3ef31c0df3ace69271cc8b1af6b529f24de66ff42c0d99a8d18aa980a307/colout-0.5.tar.gz (47kB)
    100% |████████████████████████████████| 51kB 970kB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/0x/y8s2qlk558596kyqdhv3nwv40000gn/T/pip-install-gixoekff/colout/setup.py", line 25, in <module>
        long_description=open('README.md').read(),
    FileNotFoundError: [Errno 2] No such file or directory: 'README.md'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/0x/y8s2qlk558596kyqdhv3nwv40000gn/T/pip-install-gixoekff/colout/

I tested this locally, by clone of this repository, change to folder parent of the repository,
install from relative folder, ./colout, where README.md is not found:

$ pip install --upgrade --force-reinstall ./colout/

Without patch, fails, with patch, succeeds.

This should prevent the following error,

```
$ pip --version
pip 18.1 from /Users/jq/.pyenv/versions/3.6.5/envs/jupyter/lib/python3.6/site-packages/pip (python 3.6)
$ pip install colout
Collecting colout
  Downloading https://files.pythonhosted.org/packages/3d/ba/3ef31c0df3ace69271cc8b1af6b529f24de66ff42c0d99a8d18aa980a307/colout-0.5.tar.gz (47kB)
    100% |████████████████████████████████| 51kB 970kB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/0x/y8s2qlk558596kyqdhv3nwv40000gn/T/pip-install-gixoekff/colout/setup.py", line 25, in <module>
        long_description=open('README.md').read(),
    FileNotFoundError: [Errno 2] No such file or directory: 'README.md'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/0x/y8s2qlk558596kyqdhv3nwv40000gn/T/pip-install-gixoekff/colout/
```
@tartley
Copy link

tartley commented Oct 25, 2018

This patch might be necessary, but I think it is insufficient.

Although your change finds the README.md file in a cloned repo, an additional problem is that the sdist which is currently uploaded to PyPI does not contain any README.md file at all.

So the README.md needs adding to the MANIFEST.in, so that it gets included in the sdist. Then a new sdist upload to PyPI made. Then perhaps your change is needed to find that README.md when pip comes to install the sdist.

@tartley
Copy link

tartley commented Oct 25, 2018

It occurs to me that we can test all this out by uploading to PyPI using another project name (or by using the "test version" PyPI, which I've never used?). Then when it works, all we need is for @nojhan to make a new PyPI release. I'll try it out. Maybe tonight?

@tartley
Copy link

tartley commented Oct 25, 2018

I sent an email to nojan about it.

  1. I'll try the above experiments until I find something that definitely works
  2. If nojan is able to release that to PyPI, that's good.
  3. If they are not (life happens) then we could perhaps make an alternate release to PyPI using a different project name. colout-fix ? Suggestions welcome.

@tartley
Copy link

tartley commented Oct 25, 2018

All of this reminds me of the movement I've been reading about lately, to layout python projects with the source in a 'src' directory (which was formerly heresy) and then running your test against a pip install -e . version of your package. Then your tests fail if the pip install is faulty.

@tartley
Copy link

tartley commented Oct 25, 2018

I tried some experiments. I believe this PR is not necessary. (I got a pip install to work without it)
Details back on the issue: #101 (comment)

stdedos added a commit to stdedos/colout that referenced this pull request Oct 26, 2018
Closes #2

Conflicts:
	setup.py (PR #1 aka nojhan#102)

Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
@nojhan nojhan merged commit f7b4b1d into nojhan:master May 27, 2020
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 this pull request may close these issues.

None yet

4 participants