[issue40732] New realpath breaks setuptools_scm

2020-05-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Good news is it looks like the issue with setuptools_scm can be address in a 
relatively straightforward manner 
(https://github.com/pypa/setuptools_scm/issues/436#issuecomment-632899446).

I think that means the answers to the above questions are:

- Downstream users do not need to avoid the use of realpath.
- When using realpath, make sure to do it consistently, especially before 
invoking relpath.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40732] New realpath breaks setuptools_scm

2020-05-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

To make matters more complicated, `git rev-parse --show-toplevel` also returns 
the realpath:

```
# git rev-parse --show-toplevel
//vmware-host/Shared Folders/home/code/main/path
```

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40732] New realpath breaks setuptools_scm

2020-05-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

It's because on Unix:

```
>>> os.path.relpath('/Users/jaraco/code/main/path/.flake8', '')
'.flake8'
```

But on Windows, relpath raises an error for the comparable call:

```
>>> os.path.relpath('vmware-host\\shared 
>>> folders\\home\\code\\main\\path\\.flake8', '')
ValueError: path is on mount 'vmware-host\\shared folders', start on mount 
'C:'
```

So it seems it may not be a bug in Python, but merely a consequence of Python 
3.8 honoring symlinks in realpath, and exposing the unfortunate weakness of 
resolving relative real paths when root volumes aren't in a shared namespace.

Does Python have any advice for downstream users running into this or similar 
issues? If they want cross-platform compatibility, must they avoid use of 
realpath? Do you have any tips specific to what setuptools_scm is doing?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40732] New realpath breaks setuptools_scm

2020-05-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

It seems the underlying reason the behavior fails is the (intended) difference 
resolving the empty path to a realpath when a symlink points to another volume. 
The failing routine invokes realpath early 
(https://github.com/pypa/setuptools_scm/blob/d7c122e14c9eaca96574dec0ea530ad7204965a9/src/setuptools_scm/file_finder.py#L19).

```
path master # pwd
C:\Users\jaraco\code\main\path
path master # py -3.7 -c "import os; print(os.path.realpath(''))"
C:\Users\jaraco\code\main\path
path master # py -3.8 -c "import os; print(os.path.realpath(''))"
\\vmware-host\Shared Folders\home\code\main\path
```

But that doesn't explain why this issue would not have been triggered on 
non-Windows systems.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40732] New realpath breaks setuptools_scm

2020-05-22 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40732] New realpath breaks setuptools_scm

2020-05-22 Thread Jason R. Coombs


New submission from Jason R. Coombs :

I've encountered an apparent regression on Python 3.8 on Windows when the 
current working directory is in a symlink to another volume and one runs 
`setup.py develop` on a project using setuptools_scm 
(https://github.com/pypa/setuptools_scm/issues/436).

I suspect the issue stems from changes in issue9949 and is likely a 
manifestation of the issues articulated by Eryk in issue9949#msg350138.

--
components: Windows
keywords: 3.8regression
messages: 369629
nosy: jaraco, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: New realpath breaks setuptools_scm
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com