Skip to content

try pyproject.toml then flit.ini#221

Merged
takluyver merged 3 commits intopypa:masterfrom
jwkvam:fix-installfrom
Oct 23, 2018
Merged

try pyproject.toml then flit.ini#221
takluyver merged 3 commits intopypa:masterfrom
jwkvam:fix-installfrom

Conversation

@jwkvam
Copy link
Copy Markdown
Contributor

@jwkvam jwkvam commented Oct 13, 2018

Fixes #215

Do not have any unit tests, but appears to work through my manual testing.

Errors will look something like this:

Traceback (most recent call last):
  File "/Users/jacques/miniconda/lib/python3.6/site-packages/flit/installfrom.py", line 117, in install_local
    deps='production').install()
  File "/Users/jacques/miniconda/lib/python3.6/site-packages/flit/install.py", line 106, in __init__
    self.ini_info = inifile.read_pkg_ini(ini_path)
  File "/Users/jacques/miniconda/lib/python3.6/site-packages/flit/inifile.py", line 56, in read_pkg_ini
    cp = _read_pkg_ini(path)
  File "/Users/jacques/miniconda/lib/python3.6/site-packages/flit/inifile.py", line 156, in _read_pkg_ini
    with path.open(encoding='utf-8') as f:
  File "/Users/jacques/miniconda/lib/python3.6/pathlib.py", line 1181, in open
    opener=self._opener)
  File "/Users/jacques/miniconda/lib/python3.6/pathlib.py", line 1035, in _opener
    return self._accessor.open(self, flags, mode)
  File "/Users/jacques/miniconda/lib/python3.6/pathlib.py", line 387, in wrapped
    return strfunc(str(pathobj), *args)
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/gd/p_8rmvg56j39gd6lnkb7_51h0000gn/T/tmph97psynz/pyGAM-master/flitx.ini'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/jacques/miniconda/bin/flit", line 4, in <module>
    main()
  File "/Users/jacques/miniconda/lib/python3.6/site-packages/flit/__init__.py", line 127, in main
    sys.exit(installfrom(args.location, user=args.user, python=args.python))
  File "/Users/jacques/miniconda/lib/python3.6/site-packages/flit/installfrom.py", line 130, in installfrom
    return install_local(fetch(*parse_address(address)), user=user, python=python)
  File "/Users/jacques/miniconda/lib/python3.6/site-packages/flit/installfrom.py", line 121, in install_local
    raise FileNotFoundError('Neither {} found'.format(' nor '.join(ininames))) from exc
FileNotFoundError: Neither pyproject.toml nor flitx.ini found

@takluyver
Copy link
Copy Markdown
Member

Thanks, but I think it would be better to check explicitly (p / ini_name).is_file() - this avoids accidentally catching anything else that might raise a FileNotFoundError while installing the package.

@jwkvam
Copy link
Copy Markdown
Contributor Author

jwkvam commented Oct 22, 2018

@takluyver thanks for the suggestion, let me know what you think about the update.

@takluyver
Copy link
Copy Markdown
Member

Looks good, thanks!

@takluyver takluyver merged commit e4d5833 into pypa:master Oct 23, 2018
@jwkvam jwkvam deleted the fix-installfrom branch October 23, 2018 16:40
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.

2 participants